mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdStart: Converted to CLI
This commit is contained in:
parent
5f2774c723
commit
eeb848d809
3 changed files with 6 additions and 5 deletions
|
@ -32,7 +32,7 @@
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdStart (
|
||||
const std::vector <std::string>& args,
|
||||
CLI& cli,
|
||||
Rules& rules,
|
||||
Database& database,
|
||||
Log& log)
|
||||
|
@ -60,8 +60,9 @@ int CmdStart (
|
|||
now.start (Datetime ());
|
||||
|
||||
// Apply tags.
|
||||
for (auto& tag : std::vector <std::string> (args.begin () + 2, args.end ()))
|
||||
now.tag (tag);
|
||||
auto words = cli.getWords ();
|
||||
for (auto& word : words)
|
||||
now.tag (word);
|
||||
|
||||
// Update database.
|
||||
database.addInterval (now);
|
||||
|
|
|
@ -49,7 +49,7 @@ int CmdHelp (CLI&, Log&);
|
|||
int CmdLog (CLI&, Log&);
|
||||
int CmdImport ( );
|
||||
int CmdReport (CLI&, Rules&, Database&, Extensions&, Log&);
|
||||
int CmdStart (const std::vector <std::string>&, Rules&, Database&, Log&);
|
||||
int CmdStart (CLI&, Rules&, Database&, Log&);
|
||||
int CmdStop (const std::vector <std::string>&, Rules&, Database&, Log&);
|
||||
int CmdTags ( Rules&, Database&, Log&);
|
||||
int CmdTrack ( );
|
||||
|
|
|
@ -224,7 +224,7 @@ int dispatchCommand (
|
|||
else if (command == "import") status = CmdImport ( );
|
||||
else if (command == "log") status = CmdLog (cli, log);
|
||||
else if (command == "report") status = CmdReport (cli, rules, database, extensions, log);
|
||||
else if (command == "start") status = CmdStart (args, rules, database, log);
|
||||
else if (command == "start") status = CmdStart (cli, rules, database, log);
|
||||
else if (command == "stop") status = CmdStop (args, rules, database, log);
|
||||
else if (command == "tags") status = CmdTags ( rules, database, log);
|
||||
else if (command == "track") status = CmdTrack ( );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue