/////////////////////////////////////////////////////////////////////////// Process raw modification string. Insert modification arguments immediatelly after the command (i.e. 'add')
| 501 | // Process raw modification string. |
| 502 | // Insert modification arguments immediatelly after the command (i.e. 'add') |
| 503 | void CLI2::addModifications(const std::string& arg) { |
| 504 | if (arg.length()) { |
| 505 | std::vector<std::string> mods; |
| 506 | |
| 507 | std::string lexeme; |
| 508 | Lexer::Type type; |
| 509 | Lexer lex(arg); |
| 510 | |
| 511 | while (lex.token(lexeme, type)) mods.push_back(lexeme); |
| 512 | |
| 513 | // Determine at which argument index does the task modification command |
| 514 | // reside |
| 515 | unsigned int cmdIndex = 0; |
| 516 | for (; cmdIndex < _args.size(); ++cmdIndex) { |
| 517 | // Command found, stop iterating. |
| 518 | if (_args[cmdIndex].hasTag("CMD")) break; |
| 519 | } |
| 520 | |
| 521 | // Insert modifications after the command. |
| 522 | add(mods, cmdIndex); |
| 523 | analyze(); |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | //////////////////////////////////////////////////////////////////////////////// |
| 528 | // There are situations where a context filter is applied. This method |