IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 14, 2010, 5:11:02 PM (16 years ago)
Author:
Paul Price
Message:

Add pretend option to pubtool -definerun.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pubtool.c

    r28319 r28320  
    165165
    166166    PXOPT_LOOKUP_BOOL(rerun, config->args, "-rerun", false);
     167    PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
     168    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     169    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    167170
    168171    psString query = pxDataGet("pubtool_definerun.sql"); // Query to run
     
    174177
    175178    if (!rerun) {
    176         psStringAppend(&query, "WHERE publishRun.client_id IS NULL");
     179        psStringAppend(&query, "\nWHERE publishRun.client_id IS NULL");
     180    }
     181
     182    if (limit) {
     183        psString limitString = psDBGenerateLimitSQL(limit);
     184        psStringAppend(&query, "\n%s", limitString);
     185        psFree(limitString);
    177186    }
    178187
     
    213222    if (!psArrayLength(output)) {
    214223        psTrace("pubtool", PS_LOG_INFO, "No rows found");
     224        psFree(output);
     225        return true;
     226    }
     227
     228    if (pretend) {
     229        if (!ippdbPrintMetadatas(stdout, output, "publishRun", !simple)) {
     230            psError(psErrorCodeLast(), false, "Failed to print array");
     231            psFree(output);
     232            return false;
     233        }
    215234        psFree(output);
    216235        return true;
Note: See TracChangeset for help on using the changeset viewer.