mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Merge branch '2.0.0' of tasktools.org:task into 2.0.0
This commit is contained in:
commit
63e3f5711e
2 changed files with 57 additions and 0 deletions
|
@ -1502,6 +1502,62 @@ Arguments Arguments::extract_modifications ()
|
||||||
return modifications;
|
return modifications;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
Arguments Arguments::extract_simple_words ()
|
||||||
|
{
|
||||||
|
Arguments filter;
|
||||||
|
|
||||||
|
std::vector <Triple>::iterator arg;
|
||||||
|
for (arg = this->begin (); arg != this->end (); ++arg)
|
||||||
|
{
|
||||||
|
// Excluded.
|
||||||
|
if (arg->_third == "program" ||
|
||||||
|
arg->_third == "command" ||
|
||||||
|
arg->_third == "rc" ||
|
||||||
|
arg->_third == "override" ||
|
||||||
|
arg->_third == "attr" ||
|
||||||
|
arg->_third == "attmod")
|
||||||
|
{
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Included.
|
||||||
|
else if (arg->_third == "tag" ||
|
||||||
|
arg->_third == "pattern" ||
|
||||||
|
arg->_third == "seq" ||
|
||||||
|
arg->_third == "op" ||
|
||||||
|
arg->_third == "exp" ||
|
||||||
|
arg->_third == "word")
|
||||||
|
{
|
||||||
|
// "limit" is special - it is recognized but not included in filters.
|
||||||
|
if (arg->_first.find ("limit:") == std::string::npos)
|
||||||
|
filter.push_back (*arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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
|
||||||
|
throw std::string ("Argument '") + arg->_first + "' is not allowed "
|
||||||
|
"with this command.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool Arguments::valid_modifier (const std::string& modifier)
|
bool Arguments::valid_modifier (const std::string& modifier)
|
||||||
{
|
{
|
||||||
|
|
|
@ -132,6 +132,7 @@ public:
|
||||||
Arguments extract_read_only_filter ();
|
Arguments extract_read_only_filter ();
|
||||||
Arguments extract_write_filter ();
|
Arguments extract_write_filter ();
|
||||||
Arguments extract_modifications ();
|
Arguments extract_modifications ();
|
||||||
|
Arguments extract_simple_words ();
|
||||||
|
|
||||||
static bool valid_modifier (const std::string&);
|
static bool valid_modifier (const std::string&);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue