IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 28, 2010, 12:48:11 PM (16 years ago)
Author:
eugene
Message:

fix some usage errors for reindex

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/Ohana/src/opihi/cmd.data/reindex.c

    r29540 r30194  
    55int reindex (int argc, char **argv) {
    66 
    7   int  i, Npts, Nmax, valid;
     7  int  i, Npts, Nmax;
    88  Vector *ivec, *ovec, *xvec;
    99
     
    1111  Npts = 0;
    1212
    13   valid = TRUE;
    14   valid &= (argc >= 6);
    15   valid &= !strcmp(argv[2], "=");
    16   valid &= !strcmp(argv[4], "using");
    17   if (!valid) {
    18     gprint (GP_ERR, "USAGE: reindex (out) = (in) using (index)\n");
    19     gprint (GP_ERR, "  creates a new vectors (out) from (in) based on sequence in (index)\n");
    20     return (FALSE);
    21   }
     13  if (argc != 6) goto usage;
     14  if (strcmp(argv[2], "=")) goto usage;
     15  if (strcmp(argv[4], "using")) goto usage;
    2216
    2317  if ((ovec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto error;
     
    6357  DeleteVector (ovec);
    6458  return (FALSE);
     59
     60usage:
     61    gprint (GP_ERR, "USAGE: reindex (out) = (in) using (index)\n");
     62    gprint (GP_ERR, "  creates a new vectors (out) from (in) based on sequence in (index)\n");
     63    return (FALSE);
    6564}
    6665
Note: See TracChangeset for help on using the changeset viewer.