IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 19, 2009, 10:44:27 AM (16 years ago)
Author:
bills
Message:

change -listtarget to -listtargets because I keep typing it wrong.
in -updateinterest accept -dest_name as a search parameters

File:
1 edited

Legend:

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

    r26192 r26193  
    5252static bool definetargetMode(pxConfig *config);
    5353static bool updatetargetMode(pxConfig *config);
    54 static bool listtargetMode(pxConfig *config);
     54static bool listtargetsMode(pxConfig *config);
    5555
    5656static bool definedestinationMode(pxConfig *config);
     
    100100        MODECASE(DISTTOOL_MODE_DEFINETARGET, definetargetMode);
    101101        MODECASE(DISTTOOL_MODE_UPDATETARGET, updatetargetMode);
    102         MODECASE(DISTTOOL_MODE_LISTTARGET, listtargetMode);
     102        MODECASE(DISTTOOL_MODE_LISTTARGETS, listtargetsMode);
    103103        MODECASE(DISTTOOL_MODE_DEFINEDESTINATION, definedestinationMode);
    104104        MODECASE(DISTTOOL_MODE_UPDATEDESTINATION, updatedestinationMode);
     
    13111311}
    13121312
    1313 static bool listtargetMode(pxConfig *config)
     1313static bool listtargetsMode(pxConfig *config)
    13141314{
    13151315    PS_ASSERT_PTR_NON_NULL(config, false);
     
    16111611    PXOPT_COPY_S64(config->args, where, "-dest_id",   "dest_id", "==");
    16121612    PXOPT_COPY_S64(config->args, where, "-target_id", "target_id", "==");
     1613    PXOPT_COPY_STR(config->args, where, "-dest_name", "rcDestination.name", "LIKE");
    16131614    PXOPT_COPY_STR(config->args, where, "-filter", "filter", "LIKE");
    16141615
     
    16191620        return false;
    16201621    }
    1621     psString query = NULL;
    1622     psStringAppend(&query, "UPDATE rcInterest join distTarget using(target_id) SET rcInterest.state = '%s'", state);
     1622    psString query = pxDataGet("disttool_updateinterest.sql");
    16231623
    16241624    if (psListLength(where->list)) {
     
    16341634    psFree(where);
    16351635
    1636     if (!p_psDBRunQuery(config->dbh, query)) {
     1636    if (!p_psDBRunQueryF(config->dbh, query, state)) {
    16371637        psError(PS_ERR_UNKNOWN, false, "database error");
    16381638        psFree(query);
Note: See TracChangeset for help on using the changeset viewer.