Introduce default range parameter when requesting filter from CLI

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2020-06-03 17:38:41 +02:00
parent 7e11fde992
commit 6117ce1a84
4 changed files with 21 additions and 24 deletions

View file

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