mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI2: Multiple 'limit:N' args are now properly handled
- The 'next' report has 'limit:page' in the filter, and when an additional arg was specified, only the first was obeyed. This means that it could not be effectively overriden.
This commit is contained in:
parent
aea4e8cb11
commit
11009fd3ff
1 changed files with 7 additions and 9 deletions
16
src/CLI2.cpp
16
src/CLI2.cpp
|
@ -511,7 +511,9 @@ void CLI2::lexArguments ()
|
||||||
void CLI2::demotion ()
|
void CLI2::demotion ()
|
||||||
{
|
{
|
||||||
bool changes = false;
|
bool changes = false;
|
||||||
|
std::vector <A2> replacement;
|
||||||
|
|
||||||
|
std::string canonical;
|
||||||
for (auto& a : _args)
|
for (auto& a : _args)
|
||||||
{
|
{
|
||||||
if (a._lextype == Lexer::Type::tag &&
|
if (a._lextype == Lexer::Type::tag &&
|
||||||
|
@ -525,22 +527,18 @@ void CLI2::demotion ()
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int count = 0;
|
else if (a._lextype == Lexer::Type::pair &&
|
||||||
for (auto& a : _args)
|
|
||||||
{
|
|
||||||
std::string canonical;
|
|
||||||
if (a._lextype == Lexer::Type::pair &&
|
|
||||||
canonicalize (canonical, "pseudo", a.attribute ("name")))
|
canonicalize (canonical, "pseudo", a.attribute ("name")))
|
||||||
{
|
{
|
||||||
context.config.set (canonical, a.attribute ("value"));
|
context.config.set (canonical, a.attribute ("value"));
|
||||||
changes = true;
|
changes = true;
|
||||||
_args.erase (_args.begin () + count);
|
|
||||||
break;
|
// Equivalent to erasing 'a'.
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
++count;
|
replacement.push_back (a);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changes &&
|
if (changes &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue