MCPcopy Create free account
hub / github.com/GothenburgBitFactory/timewarrior / CmdModify

Function CmdModify

src/commands/CmdModify.cpp:31–58  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

29
30////////////////////////////////////////////////////////////////////////////////
31int CmdModify (
32 CLI& cli,
33 Rules& rules,
34 Database& database,
35 Journal& journal)
36{
37 const auto subCommand = cli.findSubCommand (std::set<std::string> {"start", "end", "range"});
38
39 if (subCommand.empty())
40 {
41 throw std::string ("Must specify start|end|range command to modify. See 'timew help modify'.");
42 }
43
44 if (subCommand == "start")
45 {
46 return CmdModifyStart (cli, rules, database, journal);
47 }
48 if (subCommand == "end")
49 {
50 return CmdModifyEnd (cli, rules, database, journal);
51 }
52 if (subCommand == "range")
53 {
54 return CmdModifyRange (cli, rules, database, journal);
55 }
56
57 throw format ("Command 'modify' has no subcommand '{1}' defined!", subCommand);
58}
59
60////////////////////////////////////////////////////////////////////////////////

Callers 1

dispatchCommandFunction · 0.85

Calls 5

CmdModifyStartFunction · 0.85
CmdModifyEndFunction · 0.85
CmdModifyRangeFunction · 0.85
findSubCommandMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected