mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-26 15:47:19 +02:00
Enhancements - validation
- Implemented Cmd::isReadOnlyCommand. - Implemented Cmd::isWriteCommand. - Added unit tests for above.
This commit is contained in:
parent
bc8aba26a9
commit
0b14efbb76
7 changed files with 217 additions and 322 deletions
|
@ -361,7 +361,8 @@ std::cout << "[1;31m# parse sequence '" << *arg << "'[0m" << std::endl;
|
|||
|
||||
// Tags to include begin with '+'.
|
||||
else if (arg->length () > 1 &&
|
||||
(*arg)[0] == '+')
|
||||
(*arg)[0] == '+' &&
|
||||
validTag (*arg))
|
||||
{
|
||||
std::cout << "[1;31m# parse tag addition '" << *arg << "'[0m" << std::endl;
|
||||
if (foundSequence)
|
||||
|
@ -372,7 +373,8 @@ std::cout << "[1;31m# parse tag addition '" << *arg << "'[0m" << std::endl;
|
|||
|
||||
// Tags to remove begin with '-'.
|
||||
else if (arg->length () > 1 &&
|
||||
(*arg)[0] == '-')
|
||||
(*arg)[0] == '-' &&
|
||||
validTag (*arg))
|
||||
{
|
||||
std::cout << "[1;31m# parse tag removal '" << *arg << "'[0m" << std::endl;
|
||||
if (foundSequence)
|
||||
|
@ -445,6 +447,10 @@ std::cout << "[1;31m# parse post-termination description '" << *arg << "'[0m"
|
|||
if (validDescription (descCandidate))
|
||||
task.set ("description", descCandidate);
|
||||
|
||||
// TODO task.validate ()
|
||||
// TODO if readOnlyCommand (cmd.command) then any attributes are allowed
|
||||
// TODO if writeCommand (cmd.command) then only modifiable attributes are allowed
|
||||
|
||||
constructFilter ();
|
||||
|
||||
// If no command was specified, and there were no command line arguments
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue