* Dispatch the command. */
| 203 | * Dispatch the command. |
| 204 | */ |
| 205 | int handleCommand(Bundle* bundle) |
| 206 | { |
| 207 | //printf("--- command %d (verbose=%d force=%d):\n", |
| 208 | // bundle->getCommand(), bundle->getVerbose(), bundle->getForce()); |
| 209 | //for (int i = 0; i < bundle->getFileSpecCount(); i++) |
| 210 | // printf(" %d: '%s'\n", i, bundle->getFileSpecEntry(i)); |
| 211 | |
| 212 | switch (bundle->getCommand()) { |
| 213 | case kCommandVersion: return doVersion(bundle); |
| 214 | case kCommandList: return doList(bundle); |
| 215 | case kCommandDump: return doDump(bundle); |
| 216 | case kCommandAdd: return doAdd(bundle); |
| 217 | case kCommandRemove: return doRemove(bundle); |
| 218 | case kCommandPackage: return doPackage(bundle); |
| 219 | case kCommandCrunch: return doCrunch(bundle); |
| 220 | case kCommandSingleCrunch: return doSingleCrunch(bundle); |
| 221 | default: |
| 222 | fprintf(stderr, "%s: requested command not yet supported\n", gProgName); |
| 223 | return 1; |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | /* |
| 228 | * Parse args. |
no test coverage detected