IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 2, 2010, 4:01:44 PM (16 years ago)
Author:
eugene
Message:

added list -copy option; added mextract, avextract features to support all existing fields; filled out the --help fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.basic/list.c

    r25965 r27587  
    7474    set_int_variable (line, nWords);
    7575
     76    return (TRUE);
     77  }
     78
     79  // return an error if -copy is given with no other args
     80  if ((argc > 2) && (!strcmp (argv[2], "-copy"))) {
     81    char *value;
     82    if (argc == 3) {
     83      gprint (GP_ERR, "USAGE: list (newlist) -copy (oldlist) ...\n");
     84      return (FALSE);
     85    }
     86   
     87    sprintf (line, "%s:n", argv[3]);
     88    N = get_int_variable (line, &found);
     89    sprintf (line, "%s:n", argv[1]);
     90    set_int_variable (line, N);
     91    for (i = 0; i < N; i++) {
     92      sprintf (line, "%s:%d", argv[3], i);
     93      value = get_variable (line);
     94      sprintf (line, "%s:%d", argv[1], i);
     95      set_str_variable (line, value);
     96    }
    7697    return (TRUE);
    7798  }
Note: See TracChangeset for help on using the changeset viewer.