mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Add brackets to if-/for-statement
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
f00c4b9464
commit
0db5598aa6
3 changed files with 14 additions and 0 deletions
|
@ -52,7 +52,9 @@ int CmdCancel (
|
|||
journal.endTransaction ();
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
std::cout << "Canceled active time tracking.\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,9 @@ int CmdFill (
|
|||
std::set <int> ids = cli.getIds ();
|
||||
|
||||
if (ids.empty ())
|
||||
{
|
||||
throw std::string ("IDs must be specified. See 'timew help fill'.");
|
||||
}
|
||||
|
||||
// Load the data.
|
||||
// Note: There is no filter.
|
||||
|
|
|
@ -96,7 +96,9 @@ int CmdStop (
|
|||
database.addInterval (interval, verbose);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
std::cout << intervalSummarize (database, rules, interval);
|
||||
}
|
||||
}
|
||||
|
||||
// If tags are specified, but are not a full set of tags, remove them
|
||||
|
@ -105,10 +107,16 @@ int CmdStop (
|
|||
setIntersect (filter.tags (), latest.tags ()).size () != latest.tags ().size ())
|
||||
{
|
||||
for (auto& tag : filter.tags ())
|
||||
{
|
||||
if (modified.hasTag (tag))
|
||||
{
|
||||
modified.untag (tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw format ("The current interval does not have the '{1}' tag.", tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Open a new interval with remaining tags, if any.
|
||||
|
@ -120,7 +128,9 @@ int CmdStop (
|
|||
validate (cli, rules, database, modified);
|
||||
database.addInterval (modified, verbose);
|
||||
if (verbose)
|
||||
{
|
||||
std::cout << '\n' << intervalSummarize (database, rules, modified);
|
||||
}
|
||||
}
|
||||
|
||||
journal.endTransaction ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue