mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI2: Fixed bug recognizing command names
- If a command is found via canonicalization, but that command is also an exact match for an attribute, then it is not a command.
This commit is contained in:
parent
fd35190ab0
commit
02b91a94fc
1 changed files with 9 additions and 1 deletions
10
src/CLI2.cpp
10
src/CLI2.cpp
|
@ -798,8 +798,16 @@ bool CLI2::findCommand ()
|
|||
{
|
||||
for (auto& a : _args)
|
||||
{
|
||||
std::string raw = a.attribute ("raw");
|
||||
std::string canonical;
|
||||
if (canonicalize (canonical, "cmd", a.attribute ("raw")))
|
||||
|
||||
// If the arg canonicalized to a 'cmd', but is also not an exact match
|
||||
// for an 'attribute', proceed. Example:
|
||||
// task project=foo list
|
||||
// ^cmd ^cmd
|
||||
// ^attribute
|
||||
if (canonicalize (canonical, "cmd", raw) &&
|
||||
! exactMatch ("attribute", raw))
|
||||
{
|
||||
a.attribute ("canonical", canonical);
|
||||
a.tag ("CMD");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue