mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Introduce default range parameter when requesting filter from CLI
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
7e11fde992
commit
6117ce1a84
4 changed files with 21 additions and 24 deletions
|
@ -636,7 +636,7 @@ std::vector <std::string> CLI::getDomReferences () const
|
|||
// <duration> ["before"|"after" <date>]
|
||||
// <duration> "ago"
|
||||
//
|
||||
Interval CLI::getFilter () const
|
||||
Interval CLI::getFilter (const Range& default_range) const
|
||||
{
|
||||
// One instance, so we can directly compare.
|
||||
Datetime now;
|
||||
|
@ -708,8 +708,13 @@ Interval CLI::getFilter () const
|
|||
}
|
||||
}
|
||||
|
||||
if (args.empty ())
|
||||
{
|
||||
filter.setRange(default_range);
|
||||
}
|
||||
|
||||
// <date>
|
||||
if (args.size () == 1 &&
|
||||
else if (args.size () == 1 &&
|
||||
args[0] == "<date>")
|
||||
{
|
||||
filter.setRange ({Datetime (start), 0});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue