IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 28, 2022, 12:15:17 PM (4 years ago)
Author:
eugene
Message:

add getargs function; add option to list -join to start on later word

File:
1 edited

Legend:

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

    r41341 r42081  
    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.