///////////////////////////////////////////////////////////////////////////
| 29 | |
| 30 | //////////////////////////////////////////////////////////////////////////////// |
| 31 | int 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 | //////////////////////////////////////////////////////////////////////////////// |
no test coverage detected