MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / addModifications

Method addModifications

src/CLI2.cpp:503–525  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Process raw modification string. Insert modification arguments immediatelly after the command (i.e. 'add')

Source from the content-addressed store, hash-verified

501// Process raw modification string.
502// Insert modification arguments immediatelly after the command (i.e. 'add')
503void 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

Callers

nothing calls this directly

Calls 2

tokenMethod · 0.80
hasTagMethod · 0.45

Tested by

no test coverage detected