mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-27 12:16:25 +02:00
init: Propagated args, rules, database and log to CmdStart
This commit is contained in:
parent
fc3b90f475
commit
fbe6584447
3 changed files with 42 additions and 37 deletions
|
@ -25,10 +25,15 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <commands.h>
|
||||
#include <iostream>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdStart ()
|
||||
int CmdStart (
|
||||
const std::vector <std::string>& args,
|
||||
Rules& rules,
|
||||
Database& database,
|
||||
Log& log)
|
||||
{
|
||||
std::cout << "[start: begin a new tracking interval]\n";
|
||||
|
||||
|
|
|
@ -34,24 +34,24 @@
|
|||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
int CmdClear ();
|
||||
int CmdConfig ();
|
||||
int CmdContinue ();
|
||||
int CmdDefault ();
|
||||
int CmdDefine (Rules&);
|
||||
int CmdDiagnostics (Rules&, Database&, Extensions&, Log&);
|
||||
int CmdExport ();
|
||||
int CmdExtensions (Rules&, Extensions&);
|
||||
int CmdGaps ();
|
||||
int CmdHelpUsage ();
|
||||
int CmdClear ( );
|
||||
int CmdConfig ( );
|
||||
int CmdContinue ( );
|
||||
int CmdDefault ( );
|
||||
int CmdDefine ( Rules& );
|
||||
int CmdDiagnostics ( Rules&, Database&, Extensions&, Log&);
|
||||
int CmdExport ( );
|
||||
int CmdExtensions ( Rules&, Extensions& );
|
||||
int CmdGaps ( );
|
||||
int CmdHelpUsage ( );
|
||||
int CmdHelp (const std::vector <std::string>&, Log&);
|
||||
int CmdLog (const std::vector <std::string>&, Log&);
|
||||
int CmdImport ();
|
||||
int CmdReport ();
|
||||
int CmdStart ();
|
||||
int CmdStop ();
|
||||
int CmdTags ();
|
||||
int CmdTrack ();
|
||||
int CmdUndo ();
|
||||
int CmdImport ( );
|
||||
int CmdReport ( );
|
||||
int CmdStart (const std::vector <std::string>&, Rules&, Database&, Log&);
|
||||
int CmdStop ( );
|
||||
int CmdTags ( );
|
||||
int CmdTrack ( );
|
||||
int CmdUndo ( );
|
||||
|
||||
#endif
|
||||
|
|
30
src/init.cpp
30
src/init.cpp
|
@ -190,23 +190,23 @@ int dispatchCommand (
|
|||
{
|
||||
// These signatures are æxpected to be all different, therefore no
|
||||
// command to fn mapping.
|
||||
if (closeEnough (allCommands[0], args[1], 2)) status = CmdClear ();
|
||||
else if (closeEnough (allCommands[1], args[1], 2)) status = CmdConfig ();
|
||||
else if (closeEnough (allCommands[2], args[1], 2)) status = CmdContinue ();
|
||||
else if (closeEnough (allCommands[3], args[1], 2)) status = CmdDefine (rules);
|
||||
else if (closeEnough (allCommands[4], args[1], 2)) status = CmdDiagnostics (rules, database, extensions, log);
|
||||
else if (closeEnough (allCommands[5], args[1], 2)) status = CmdExport ();
|
||||
else if (closeEnough (allCommands[6], args[1], 2)) status = CmdExtensions (rules, extensions);
|
||||
else if (closeEnough (allCommands[7], args[1], 2)) status = CmdGaps ();
|
||||
if (closeEnough (allCommands[0], args[1], 2)) status = CmdClear ( );
|
||||
else if (closeEnough (allCommands[1], args[1], 2)) status = CmdConfig ( );
|
||||
else if (closeEnough (allCommands[2], args[1], 2)) status = CmdContinue ( );
|
||||
else if (closeEnough (allCommands[3], args[1], 2)) status = CmdDefine ( rules );
|
||||
else if (closeEnough (allCommands[4], args[1], 2)) status = CmdDiagnostics ( rules, database, extensions, log);
|
||||
else if (closeEnough (allCommands[5], args[1], 2)) status = CmdExport ( );
|
||||
else if (closeEnough (allCommands[6], args[1], 2)) status = CmdExtensions ( rules, extensions );
|
||||
else if (closeEnough (allCommands[7], args[1], 2)) status = CmdGaps ( );
|
||||
else if (closeEnough (allCommands[8], args[1], 2)) status = CmdHelp (args, log);
|
||||
else if (closeEnough (allCommands[9], args[1], 2)) status = CmdImport ();
|
||||
else if (closeEnough (allCommands[9], args[1], 2)) status = CmdImport ( );
|
||||
else if (closeEnough (allCommands[10], args[1], 2)) status = CmdLog (args, log);
|
||||
else if (closeEnough (allCommands[11], args[1], 2)) status = CmdReport ();
|
||||
else if (closeEnough (allCommands[12], args[1], 2)) status = CmdStart ();
|
||||
else if (closeEnough (allCommands[13], args[1], 2)) status = CmdStop ();
|
||||
else if (closeEnough (allCommands[14], args[1], 2)) status = CmdTags ();
|
||||
else if (closeEnough (allCommands[15], args[1], 2)) status = CmdTrack ();
|
||||
else if (closeEnough (allCommands[16], args[1], 2)) status = CmdUndo ();
|
||||
else if (closeEnough (allCommands[11], args[1], 2)) status = CmdReport ( );
|
||||
else if (closeEnough (allCommands[12], args[1], 2)) status = CmdStart (args, rules, database, log);
|
||||
else if (closeEnough (allCommands[13], args[1], 2)) status = CmdStop ( );
|
||||
else if (closeEnough (allCommands[14], args[1], 2)) status = CmdTags ( );
|
||||
else if (closeEnough (allCommands[15], args[1], 2)) status = CmdTrack ( );
|
||||
else if (closeEnough (allCommands[16], args[1], 2)) status = CmdUndo ( );
|
||||
}
|
||||
else if (matches.size () == 0)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue