IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 11, 2022, 4:58:07 PM (5 years ago)
Author:
eugene
Message:

option to start list -join at a later point, change default in getargs

Location:
branches/eam_branches/ipp-20211108/Ohana/src/opihi/cmd.basic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20211108/Ohana/src/opihi/cmd.basic/getargs.c

    r41978 r41985  
    5353  if (!argmatch) {
    5454    if (varName) {
     55      // default for a boolean is FALSE
     56      // default for a value is to keep an existing value
    5557      if (mode == MODE_BOOL) {
    5658        set_str_variable (varName, "0"); // NOTE: if a local variable with the same name exists, that will be used
    57       } else {
    58         set_str_variable (varName, ""); // NOTE: if a local variable with the same name exists, that will be used
    5959      }
    6060    }
  • branches/eam_branches/ipp-20211108/Ohana/src/opihi/cmd.basic/list.c

    r41341 r41985  
    119119  // return an error if -add is given with no other args
    120120  if ((argc > 2) && (!strcmp (argv[2], "-join"))) {
     121    int start = 0;
     122    if ((N = get_argument (argc, argv, "-start"))) {
     123      remove_argument (N, &argc, argv);
     124      start = atoi (argv[N]);
     125      remove_argument (N, &argc, argv);
     126    }
     127
    121128    if (argc != 4) {
    122129      gprint (GP_ERR, "USAGE: list (root) -join (variable)\n");
     
    137144    memset (output, 0, MAX_LINE_LENGTH);
    138145
    139     for (i = 0; i < nList; i++) {
     146    for (i = start; i < nList; i++) {
    140147      snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);
    141148      char *word = get_variable (line);
Note: See TracChangeset for help on using the changeset viewer.