mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdContinue: Errors result in non-zero exit code
This commit is contained in:
parent
9472b7586a
commit
feb219f733
1 changed files with 12 additions and 16 deletions
|
@ -36,10 +36,12 @@ int CmdContinue (
|
||||||
Database& database)
|
Database& database)
|
||||||
{
|
{
|
||||||
auto latest = getLatestInterval (database);
|
auto latest = getLatestInterval (database);
|
||||||
if (! latest.empty ())
|
if (latest.empty ())
|
||||||
{
|
throw std::string ("There is no previous tracking to continue.");
|
||||||
if (! latest.range.is_open ())
|
|
||||||
{
|
if (latest.range.is_open ())
|
||||||
|
throw std::string ("There is already active tracking.");
|
||||||
|
|
||||||
// Open an identical interval and update hte DB.
|
// Open an identical interval and update hte DB.
|
||||||
latest.range.open ();
|
latest.range.open ();
|
||||||
validate (cli, rules, database, latest);
|
validate (cli, rules, database, latest);
|
||||||
|
@ -47,12 +49,6 @@ int CmdContinue (
|
||||||
|
|
||||||
if (rules.getBoolean ("verbose"))
|
if (rules.getBoolean ("verbose"))
|
||||||
std::cout << intervalSummarize (database, rules, latest);
|
std::cout << intervalSummarize (database, rules, latest);
|
||||||
}
|
|
||||||
else
|
|
||||||
std::cout << "There is already active tracking.\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
std::cout << "There is no previous tracking to continue.\n";
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue