mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdContinue: Handles case where there is no previous interval to restart
This commit is contained in:
parent
100d567b79
commit
eb06efc92a
1 changed files with 17 additions and 11 deletions
|
@ -35,7 +35,8 @@ int CmdContinue (
|
|||
Database& database)
|
||||
{
|
||||
auto latest = getLatestInterval (database);
|
||||
|
||||
if (! latest.empty ())
|
||||
{
|
||||
if (latest.isStarted () &&
|
||||
latest.isEnded ())
|
||||
{
|
||||
|
@ -53,6 +54,11 @@ int CmdContinue (
|
|||
{
|
||||
std::cout << "There is already active tracking.\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "There is no previous tracking to continue.\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue