IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42413


Ignore:
Timestamp:
Mar 15, 2023, 11:01:42 AM (3 years ago)
Author:
eugene
Message:

fix the -simple usage to produce single-line outputs

Location:
branches/eam_branches/ipp-20230313/ippTools/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313/ippTools/src/disttool.c

    r37130 r42413  
    765765    }
    766766
    767     if (simple) {/* no option? */}
    768 
    769767    if (pretend) {
    770         if (!ippdbPrintMetadatas(stdout, output, "distRunsToUpdate", true)) {
     768        if (!ippdbPrintMetadatas(stdout, output, "distRunsToUpdate", !simple)) {
    771769            psError(PS_ERR_UNKNOWN, false, "failed to print array");
    772770            psFree(output);
     
    16521650    PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
    16531651    PXOPT_LOOKUP_STR(comment, config->args, "-comment", false, false);
     1652    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    16541653
    16551654    distTargetRow *row = distTargetRowAlloc(
     
    16761675    row->target_id = psDBLastInsertID(config->dbh);
    16771676
    1678     if (!distTargetPrintObject(stdout, row, true)) {
     1677    if (!distTargetPrintObject(stdout, row, !simple)) {
    16791678            psError(PS_ERR_UNKNOWN, false, "failed to print object");
    16801679            psFree(row);
     
    18151814    PXOPT_LOOKUP_STR(last_fileset, config->args, "-last_fileset", false, false);
    18161815    PXOPT_LOOKUP_STR(state, config->args,        "-set_state", false, false);
     1816    PXOPT_LOOKUP_BOOL(simple, config->args,      "-simple", false);
    18171817
    18181818    // XXX: should we insure that these names do not contatin any whitespace?
     
    18421842    row->dest_id = psDBLastInsertID(config->dbh);
    18431843
    1844     if (!rcDestinationPrintObject(stdout, row, true)) {
     1844    if (!rcDestinationPrintObject(stdout, row, !simple)) {
    18451845        psError(PS_ERR_UNKNOWN, false, "failed to print object");
    18461846        psFree(row);
  • branches/eam_branches/ipp-20230313/ippTools/src/disttoolConfig.c

    r37130 r42413  
    275275    psMetadataAddStr(definedestinationArgs, PS_LIST_TAIL, "-last_fileset",0, "define last_fileset", NULL);
    276276    psMetadataAddStr(definedestinationArgs, PS_LIST_TAIL, "-set_state",   0, "define state", NULL);
     277    psMetadataAddBool(definedestinationArgs, PS_LIST_TAIL, "-simple",  0, "use the simple output format", false);
    277278
    278279    // -updatedestination
     
    292293    psMetadataAddStr(definetargetArgs, PS_LIST_TAIL, "-set_state", 0, "define state", NULL);
    293294    psMetadataAddStr(definetargetArgs, PS_LIST_TAIL, "-comment",   0, "define comment", NULL);
     295    psMetadataAddBool(definetargetArgs, PS_LIST_TAIL, "-simple",  0, "use the simple output format", false);
    294296
    295297    // -updatetarget
Note: See TracChangeset for help on using the changeset viewer.