mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-29 19:13:26 +02:00
CmdContinue, CmdDefine: Removed log
This commit is contained in:
parent
d27ae7bd73
commit
1e65133efd
4 changed files with 12 additions and 17 deletions
|
@ -32,8 +32,7 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int CmdContinue (
|
int CmdContinue (
|
||||||
Rules& rules,
|
Rules& rules,
|
||||||
Database& database,
|
Database& database)
|
||||||
Log& log)
|
|
||||||
{
|
{
|
||||||
// Load the most recent interval.
|
// Load the most recent interval.
|
||||||
auto latest = database.getLatestInterval ();
|
auto latest = database.getLatestInterval ();
|
||||||
|
@ -48,16 +47,13 @@ int CmdContinue (
|
||||||
|
|
||||||
// Update database.
|
// Update database.
|
||||||
database.addInterval (latest);
|
database.addInterval (latest);
|
||||||
log.write ("debug", std::string ("Continued tracking: ") + latest.serialize ());
|
|
||||||
|
|
||||||
// User feedback.
|
// User feedback.
|
||||||
std::cout << intervalSummarize (rules, latest);
|
std::cout << intervalSummarize (rules, latest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string message = "There is already active tracking.";
|
std::cout << "There is already active tracking.\n";
|
||||||
std::cout << message << "\n";
|
|
||||||
log.write ("warning", message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -46,8 +46,7 @@
|
||||||
int CmdDefine (
|
int CmdDefine (
|
||||||
CLI& cli,
|
CLI& cli,
|
||||||
Rules& rules,
|
Rules& rules,
|
||||||
Database& database,
|
Database& database)
|
||||||
Log& log)
|
|
||||||
{
|
{
|
||||||
auto words = cli.getWords ();
|
auto words = cli.getWords ();
|
||||||
if (words.size () >= 1)
|
if (words.size () >= 1)
|
||||||
|
|
|
@ -33,11 +33,6 @@
|
||||||
#include <Extensions.h>
|
#include <Extensions.h>
|
||||||
#include <Log.h>
|
#include <Log.h>
|
||||||
|
|
||||||
int CmdClear ( );
|
|
||||||
int CmdConfig ( );
|
|
||||||
int CmdContinue ( Rules&, Database&, Log&);
|
|
||||||
int CmdDefault ( Rules&, Database& );
|
|
||||||
int CmdDefine (CLI&, Rules&, Database&, Log&);
|
|
||||||
int CmdDiagnostics ( Rules&, Database&, Extensions&, Log&);
|
int CmdDiagnostics ( Rules&, Database&, Extensions&, Log&);
|
||||||
int CmdExport (CLI&, Rules&, Database&, Log&);
|
int CmdExport (CLI&, Rules&, Database&, Log&);
|
||||||
int CmdExtensions ( Rules&, Extensions& );
|
int CmdExtensions ( Rules&, Extensions& );
|
||||||
|
@ -51,5 +46,10 @@ int CmdStop (CLI&, Rules&, Database&, Log&);
|
||||||
int CmdTags ( Rules&, Database&, Log&);
|
int CmdTags ( Rules&, Database&, Log&);
|
||||||
int CmdTrack (CLI&, Rules&, Database&, Log&);
|
int CmdTrack (CLI&, Rules&, Database&, Log&);
|
||||||
int CmdUndo ( );
|
int CmdUndo ( );
|
||||||
|
int CmdClear ( );
|
||||||
|
int CmdConfig ( );
|
||||||
|
int CmdContinue ( Rules&, Database& );
|
||||||
|
int CmdDefault ( Rules&, Database& );
|
||||||
|
int CmdDefine (CLI&, Rules&, Database& );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -206,10 +206,6 @@ int dispatchCommand (
|
||||||
{
|
{
|
||||||
// These signatures are æxpected to be all different, therefore no
|
// These signatures are æxpected to be all different, therefore no
|
||||||
// command to fn mapping.
|
// command to fn mapping.
|
||||||
if (command == "clear") status = CmdClear ( );
|
|
||||||
else if (command == "config") status = CmdConfig ( );
|
|
||||||
else if (command == "continue") status = CmdContinue ( rules, database, log);
|
|
||||||
else if (command == "define") status = CmdDefine (cli, rules, database, log);
|
|
||||||
else if (command == "diagnostics") status = CmdDiagnostics ( rules, database, extensions, log);
|
else if (command == "diagnostics") status = CmdDiagnostics ( rules, database, extensions, log);
|
||||||
else if (command == "export") status = CmdExport (cli, rules, database, log);
|
else if (command == "export") status = CmdExport (cli, rules, database, log);
|
||||||
else if (command == "extensions") status = CmdExtensions ( rules, extensions );
|
else if (command == "extensions") status = CmdExtensions ( rules, extensions );
|
||||||
|
@ -222,6 +218,10 @@ int dispatchCommand (
|
||||||
else if (command == "tags") status = CmdTags ( rules, database, log);
|
else if (command == "tags") status = CmdTags ( rules, database, log);
|
||||||
else if (command == "track") status = CmdTrack (cli, rules, database, log);
|
else if (command == "track") status = CmdTrack (cli, rules, database, log);
|
||||||
else if (command == "undo") status = CmdUndo ( );
|
else if (command == "undo") status = CmdUndo ( );
|
||||||
|
if (command == "clear") status = CmdClear ( );
|
||||||
|
else if (command == "config") status = CmdConfig ( );
|
||||||
|
else if (command == "continue") status = CmdContinue ( rules, database );
|
||||||
|
else if (command == "define") status = CmdDefine (cli, rules, database );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue