src/dird/snapshot.c
static void snapshot_scan_cmdline(UAContext *ua, int start, SNAPSHOT_DBR *snapdbr)
{
   for (int j=start; j<ua->argc; j++) {
      if (strcasecmp(ua->argk[j], NT_("device")) == 0 && ua->argv[j]) {
         snapdbr->Device = bstrdup(ua->argv[j]);
         snapdbr->need_to_free = true;

      } else if (strcasecmp(ua->argk[j], NT_("jobid")) == 0 && ua->argv[j]) {
         snapdbr->JobId = str_to_int64(ua->argv[j]);

      } else if (strcasecmp(ua->argk[j], NT_("type")) == 0 && ua->argv[j]) {
         bstrncpy(snapdbr->Type, ua->argv[j], sizeof(snapdbr->Type));

      } else if (strcasecmp(ua->argk[j], NT_("client")) == 0 && ua->argv[j]) {
         bstrncpy(snapdbr->Client, ua->argv[j], sizeof(snapdbr->Client));

      } else if (strcasecmp(ua->argk[j], NT_("snapshotid")) == 0 && ua->argv[j]) {
         snapdbr->SnapshotId = str_to_int64(ua->argv[j]);

      } else if (strcasecmp(ua->argk[j], NT_("snapshot")) == 0 && ua->argv[j]) {
         bstrncpy(snapdbr->Name, ua->argv[j], sizeof(snapdbr->Name));

      } else if (strcasecmp(ua->argk[j], NT_("volume")) == 0 && ua->argv[j]) {
         snapdbr->Volume = bstrdup(ua->argv[j]);
         snapdbr->need_to_free = true;

      } else if (strcasecmp(ua->argk[j], NT_("createdate")) == 0 && ua->argv[j]) {
         bstrncpy(snapdbr->CreateDate, ua->argv[j], sizeof(snapdbr->CreateDate));
         snapdbr->CreateTDate = str_to_utime(ua->argv[j]);

      } else if (strcasecmp(ua->argk[j], NT_("createtdate")) == 0 && ua->argv[j]) {
         snapdbr->CreateTDate = str_to_uint64(ua->argv[j]);
         bstrutime(snapdbr->CreateDate, sizeof(snapdbr->CreateDate), snapdbr->CreateTDate);

      } else if (strcasecmp(ua->argk[j], NT_("name")) == 0 && ua->argv[j]) {
         bstrncpy(snapdbr->Name, ua->argv[j], sizeof(snapdbr->Name));

      } else if (strcasecmp(ua->argk[j], NT_("size")) == 0 && ua->argv[j]) {
         snapdbr->Size = str_to_uint64(ua->argv[j]);

      } else if (strcasecmp(ua->argk[j], NT_("status")) == 0 && ua->argv[j]) {
         snapdbr->status = str_to_uint64(ua->argv[j]);

      } else if (strcasecmp(ua->argk[j], NT_("error")) == 0 && ua->argv[j]) {
         snapdbr->errmsg = bstrdup(ua->argv[j]);
         unbash_spaces(snapdbr->errmsg);
         snapdbr->need_to_free = true;

      } else {
         continue;
      }
   }
}
/* Scan command line for common snapshot arguments */
Scan command line for common snapshot arguments
Scan command line for common snapshot arguments
static void snapshot_scan_cmdline(UAContext *ua, int start, SNAPSHOT_DBR *snapdbr)
{
   for (int j=start; j<ua->argc; j++) {
      if (strcasecmp(ua->argk[j], NT_("device")) == 0 && ua->argv[j]) {
         snapdbr->Device = bstrdup(ua->argv[j]);
         snapdbr->need_to_free = true;
      } else if (strcasecmp(ua->argk[j], NT_("jobid")) == 0 && ua->argv[j]) {
         snapdbr->JobId = str_to_int64(ua->argv[j]);
      } else if (strcasecmp(ua->argk[j], NT_("type")) == 0 && ua->argv[j]) {
         bstrncpy(snapdbr->Type, ua->argv[j], sizeof(snapdbr->Type));
      } else if (strcasecmp(ua->argk[j], NT_("client")) == 0 && ua->argv[j]) {
         bstrncpy(snapdbr->Client, ua->argv[j], sizeof(snapdbr->Client));
      } else if (strcasecmp(ua->argk[j], NT_("snapshotid")) == 0 && ua->argv[j]) {
         snapdbr->SnapshotId = str_to_int64(ua->argv[j]);
      } else if (strcasecmp(ua->argk[j], NT_("snapshot")) == 0 && ua->argv[j]) {
         bstrncpy(snapdbr->Name, ua->argv[j], sizeof(snapdbr->Name));
      } else if (strcasecmp(ua->argk[j], NT_("volume")) == 0 && ua->argv[j]) {
         snapdbr->Volume = bstrdup(ua->argv[j]);
         snapdbr->need_to_free = true;
      } else if (strcasecmp(ua->argk[j], NT_("createdate")) == 0 && ua->argv[j]) {
         bstrncpy(snapdbr->CreateDate, ua->argv[j], sizeof(snapdbr->CreateDate));
         snapdbr->CreateTDate = str_to_utime(ua->argv[j]);
      } else if (strcasecmp(ua->argk[j], NT_("createtdate")) == 0 && ua->argv[j]) {
         snapdbr->CreateTDate = str_to_uint64(ua->argv[j]);
         bstrutime(snapdbr->CreateDate, sizeof(snapdbr->CreateDate), snapdbr->CreateTDate);
      } else if (strcasecmp(ua->argk[j], NT_("name")) == 0 && ua->argv[j]) {
         bstrncpy(snapdbr->Name, ua->argv[j], sizeof(snapdbr->Name));
      } else if (strcasecmp(ua->argk[j], NT_("size")) == 0 && ua->argv[j]) {
         snapdbr->Size = str_to_uint64(ua->argv[j]);
      } else if (strcasecmp(ua->argk[j], NT_("status")) == 0 && ua->argv[j]) {
         snapdbr->status = str_to_uint64(ua->argv[j]);
      } else if (strcasecmp(ua->argk[j], NT_("error")) == 0 && ua->argv[j]) {
         snapdbr->errmsg = bstrdup(ua->argv[j]);
         unbash_spaces(snapdbr->errmsg);
         snapdbr->need_to_free = true;
      } else {
         continue;
      }
   }
}
static void snapshot_scan_cmdline ( UAContext * ua , int start , SNAPSHOT_DBR * snapdbr ) { for ( int j = start ; j < ua -> argc ; j ++ ) { if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { snapdbr -> Device = bstrdup ( ua -> argv [ j ] ) ; snapdbr -> need_to_free = true ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { snapdbr -> JobId = str_to_int64 ( ua -> argv [ j ] ) ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { bstrncpy ( snapdbr -> Type , ua -> argv [ j ] , sizeof ( snapdbr -> Type ) ) ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { bstrncpy ( snapdbr -> Client , ua -> argv [ j ] , sizeof ( snapdbr -> Client ) ) ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { snapdbr -> SnapshotId = str_to_int64 ( ua -> argv [ j ] ) ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { bstrncpy ( snapdbr -> Name , ua -> argv [ j ] , sizeof ( snapdbr -> Name ) ) ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { snapdbr -> Volume = bstrdup ( ua -> argv [ j ] ) ; snapdbr -> need_to_free = true ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { bstrncpy ( snapdbr -> CreateDate , ua -> argv [ j ] , sizeof ( snapdbr -> CreateDate ) ) ; snapdbr -> CreateTDate = str_to_utime ( ua -> argv [ j ] ) ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { snapdbr -> CreateTDate = str_to_uint64 ( ua -> argv [ j ] ) ; bstrutime ( snapdbr -> CreateDate , sizeof ( snapdbr -> CreateDate ) , snapdbr -> CreateTDate ) ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { bstrncpy ( snapdbr -> Name , ua -> argv [ j ] , sizeof ( snapdbr -> Name ) ) ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { snapdbr -> Size = str_to_uint64 ( ua -> argv [ j ] ) ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { snapdbr -> status = str_to_uint64 ( ua -> argv [ j ] ) ; } else if ( strcasecmp ( ua -> argk [ j ] , NT_ ( " " ) ) == 0 && ua -> argv [ j ] ) { snapdbr -> errmsg = bstrdup ( ua -> argv [ j ] ) ; unbash_spaces ( snapdbr -> errmsg ) ; snapdbr -> need_to_free = true ; } else { continue ; } } }
Scan command line for common snapshot arguments
Scan command line for common snapshot arguments