mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdDefault: Returns 1 when there is no active tracking
This commit is contained in:
parent
87698fe474
commit
eff59b6124
1 changed files with 14 additions and 7 deletions
|
@ -30,20 +30,27 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Returns 0 if tracking is active, 1 if not.
|
||||||
int CmdDefault (Rules& rules, Database& database)
|
int CmdDefault (Rules& rules, Database& database)
|
||||||
{
|
{
|
||||||
if (rules.getBoolean ("verbose"))
|
int status = 0;
|
||||||
{
|
|
||||||
// Load the most recent interval, summarize and display.
|
|
||||||
auto interval = getLatestInterval (database);
|
|
||||||
|
|
||||||
if (interval.isStarted () && ! interval.isEnded ())
|
// Load the most recent interval, summarize and display.
|
||||||
|
auto interval = getLatestInterval (database);
|
||||||
|
if (interval.isStarted () && ! interval.isEnded ())
|
||||||
|
{
|
||||||
|
if (rules.getBoolean ("verbose"))
|
||||||
std::cout << intervalSummarize (rules, interval);
|
std::cout << intervalSummarize (rules, interval);
|
||||||
else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (rules.getBoolean ("verbose"))
|
||||||
std::cout << "There is no active time tracking.\n";
|
std::cout << "There is no active time tracking.\n";
|
||||||
|
|
||||||
|
status = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue