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

Method dispatch

src/Context.cpp:855–892  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Dispatch to the command found by the CLI parser.

Source from the content-addressed store, hash-verified

853////////////////////////////////////////////////////////////////////////////////
854// Dispatch to the command found by the CLI parser.
855int Context::dispatch(std::string& out) {
856 // Autocomplete args against keywords.
857 std::string command = cli2.getCommand();
858 if (command != "") {
859 updateXtermTitle();
860 updateVerbosity();
861
862 Command* c = commands[command];
863 assert(c);
864
865 // The command know whether they need a GC or recurrence update.
866 if (c->needs_gc()) {
867 tdb2.gc();
868 }
869
870 // This is something that is only needed for write commands with no other
871 // filter processing.
872 if (c->accepts_modifications() && !c->accepts_filter()) {
873 cli2.prepareFilter();
874 }
875
876 // With rc.debug.parser == 2, there are more tree dumps than you might want,
877 // but we need the rc.debug.parser == 1 case covered also, with the final
878 // tree.
879 if (config.getBoolean("debug") && config.getInteger("debug.parser") == 1)
880 debug(cli2.dump("Parse Tree (before command-specifіc processing)"));
881
882 if (c->needs_recur_update() && Context::getContext().config.getBoolean("gc")) {
883 handleUntil();
884 handleRecurrence();
885 }
886
887 return c->execute(out);
888 }
889
890 assert(commands["help"]);
891 return commands["help"]->execute(out);
892}
893
894////////////////////////////////////////////////////////////////////////////////
895int Context::getWidth() {

Callers

nothing calls this directly

Calls 11

handleUntilFunction · 0.85
handleRecurrenceFunction · 0.85
getCommandMethod · 0.80
needs_gcMethod · 0.80
gcMethod · 0.80
accepts_modificationsMethod · 0.80
accepts_filterMethod · 0.80
prepareFilterMethod · 0.80
needs_recur_updateMethod · 0.80
dumpMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected