mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Arguments
- Corrected mishandling of sequence in both read-only and write command filters.
This commit is contained in:
parent
1cb4d19c3c
commit
9b2e61f9b3
1 changed files with 25 additions and 26 deletions
|
@ -1368,7 +1368,8 @@ Arguments Arguments::extract_read_only_filter ()
|
||||||
arg->_third == "pattern" ||
|
arg->_third == "pattern" ||
|
||||||
arg->_third == "attr" ||
|
arg->_third == "attr" ||
|
||||||
arg->_third == "attmod" ||
|
arg->_third == "attmod" ||
|
||||||
arg->_third == "seq" ||
|
arg->_third == "id" ||
|
||||||
|
arg->_third == "uuid" ||
|
||||||
arg->_third == "op" ||
|
arg->_third == "op" ||
|
||||||
arg->_third == "exp" ||
|
arg->_third == "exp" ||
|
||||||
arg->_third == "word")
|
arg->_third == "word")
|
||||||
|
@ -1382,8 +1383,11 @@ Arguments Arguments::extract_read_only_filter ()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// substitution
|
// substitution
|
||||||
throw std::string ("A substitution '") + arg->_first + "' is not allowed "
|
throw std::string ("A ")
|
||||||
"in a read-only command filter.";
|
+ arg->_third
|
||||||
|
+ " '"
|
||||||
|
+ arg->_first
|
||||||
|
+ "' is not allowed in a read-only filter.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1412,7 +1416,8 @@ Arguments Arguments::extract_write_filter ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Included regardless of position.
|
// Included regardless of position.
|
||||||
else if (arg->_third == "seq")
|
else if (arg->_third == "id" ||
|
||||||
|
arg->_third == "uuid")
|
||||||
{
|
{
|
||||||
filter.push_back (*arg);
|
filter.push_back (*arg);
|
||||||
}
|
}
|
||||||
|
@ -1462,6 +1467,12 @@ Arguments Arguments::extract_modifications ()
|
||||||
seen_command = true;
|
seen_command = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sequence excluded regardless of location.
|
||||||
|
else if (arg->_third == "id" ||
|
||||||
|
arg->_third == "uuid")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
else if (seen_command)
|
else if (seen_command)
|
||||||
{
|
{
|
||||||
// Excluded.
|
// Excluded.
|
||||||
|
@ -1496,6 +1507,7 @@ Arguments Arguments::extract_modifications ()
|
||||||
+ arg->_first
|
+ arg->_first
|
||||||
+ "' is not allowed when modifiying a task.";
|
+ "' is not allowed when modifiying a task.";
|
||||||
|
|
||||||
|
// TODO Really?
|
||||||
else if (arg->_third == "exp")
|
else if (arg->_third == "exp")
|
||||||
throw std::string ("An expression '")
|
throw std::string ("An expression '")
|
||||||
+ arg->_first
|
+ arg->_first
|
||||||
|
@ -1535,7 +1547,9 @@ Arguments Arguments::extract_simple_words ()
|
||||||
// Included.
|
// Included.
|
||||||
else if (arg->_third == "tag" ||
|
else if (arg->_third == "tag" ||
|
||||||
arg->_third == "pattern" ||
|
arg->_third == "pattern" ||
|
||||||
arg->_third == "seq" ||
|
arg->_third == "substitution" ||
|
||||||
|
arg->_third == "id" ||
|
||||||
|
arg->_third == "uuid" ||
|
||||||
arg->_third == "op" ||
|
arg->_third == "op" ||
|
||||||
arg->_third == "exp" ||
|
arg->_third == "exp" ||
|
||||||
arg->_third == "word")
|
arg->_third == "word")
|
||||||
|
@ -1546,25 +1560,10 @@ Arguments Arguments::extract_simple_words ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error.
|
// Error.
|
||||||
else
|
|
||||||
{
|
|
||||||
if (arg->_third == "tag")
|
|
||||||
throw std::string ("A tag '") + arg->_first + "' is not allowed "
|
|
||||||
"with this command.";
|
|
||||||
|
|
||||||
else if (arg->_third == "pattern")
|
|
||||||
throw std::string ("A pattern '") + arg->_first + "' is not allowed "
|
|
||||||
"with this command.";
|
|
||||||
|
|
||||||
else if (arg->_third == "substitution")
|
|
||||||
throw std::string ("A substitution '") + arg->_first + "' is not allowed "
|
|
||||||
"with this command.";
|
|
||||||
|
|
||||||
else
|
else
|
||||||
throw std::string ("Argument '") + arg->_first + "' is not allowed "
|
throw std::string ("Argument '") + arg->_first + "' is not allowed "
|
||||||
"with this command.";
|
"with this command.";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue