CmdContinue: Handles case where there is no previous interval to restart

This commit is contained in:
Paul Beckingham 2016-04-11 17:17:56 -04:00
parent 100d567b79
commit eb06efc92a

View file

@ -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;
}