mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Extract function CLI::getDuration ()
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
0c1d7291e2
commit
e8511c5efd
5 changed files with 22 additions and 32 deletions
|
@ -49,16 +49,7 @@ int CmdLengthen (
|
|||
throw std::string ("IDs must be specified. See 'timew help lengthen'.");
|
||||
}
|
||||
|
||||
std::string delta;
|
||||
|
||||
for (auto& arg : cli._args)
|
||||
{
|
||||
if (arg.hasTag ("FILTER") &&
|
||||
arg._lextype == Lexer::Type::duration)
|
||||
{
|
||||
delta = arg.attribute ("raw");
|
||||
}
|
||||
}
|
||||
Duration dur = cli.getDuration ();
|
||||
|
||||
journal.startTransaction ();
|
||||
|
||||
|
@ -75,7 +66,6 @@ int CmdLengthen (
|
|||
|
||||
database.deleteInterval (interval);
|
||||
|
||||
Duration dur (delta);
|
||||
interval.end += dur.toTime_t ();
|
||||
validate (cli, rules, database, interval);
|
||||
database.addInterval (interval, verbose);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue