| 276 | /* Main job command implementation */ |
| 277 | |
| 278 | static df::job_item *getJobItem(color_ostream &out, df::job *job, std::string idx) |
| 279 | { |
| 280 | if (!job) |
| 281 | return NULL; |
| 282 | |
| 283 | int v = atoi(idx.c_str()); |
| 284 | if (v < 1 || size_t(v) > job->job_items.elements.size()) { |
| 285 | out.printerr("Invalid item index.\n"); |
| 286 | return NULL; |
| 287 | } |
| 288 | |
| 289 | return job->job_items.elements[v-1]; |
| 290 | } |
| 291 | |
| 292 | static command_result job_cmd(color_ostream &out, vector <string> & parameters) |
| 293 | { |