Changeset 40534
- Timestamp:
- Sep 26, 2018, 12:19:35 PM (8 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
chiptool.c (modified) (3 diffs)
-
chiptoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r37410 r40534 279 279 PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false); 280 280 281 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 282 281 283 // default 282 284 PXOPT_LOOKUP_BOOL(unique, config->args, "-unique", false); … … 284 286 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 285 287 288 PXOPT_LOOKUP_BOOL(randomOrder, config->args, "-random", false); 289 286 290 // find the exp_id of all the exposures that we want to queue up. 287 291 psString query = pxDataGet("chiptool_find_rawexp.sql"); … … 304 308 } 305 309 310 // treat limit == 0 as "no limit" 311 if (randomOrder) { 312 psStringAppend(&query, " %s", "ORDER BY RAND()"); 313 } 314 315 // treat limit == 0 as "no limit" 316 if (limit) { 317 psString limitString = psDBGenerateLimitSQL(limit); 318 psStringAppend(&query, " %s", limitString); 319 psFree(limitString); 320 } 321 306 322 if (!p_psDBRunQueryF(config->dbh, query, labelHook ? labelHook : "")) { 307 323 psError(PS_ERR_UNKNOWN, false, "database error"); -
trunk/ippTools/src/chiptoolConfig.c
r35789 r40534 64 64 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-pretend", 0, "do not actually modify the database", false); 65 65 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 66 psMetadataAddU64(definebyqueryArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 67 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-random", 0, "randomly sort the output", false); 66 68 67 69 // -definecopy
Note:
See TracChangeset
for help on using the changeset viewer.
