diff --git a/src/Att.cpp b/src/Att.cpp index 7255c95c3..1efc606c1 100644 --- a/src/Att.cpp +++ b/src/Att.cpp @@ -259,7 +259,6 @@ bool Att::validNameValue ( std::string combined; join (combined, ", ", matches); - error += combined; throw error + combined; } diff --git a/src/Context.cpp b/src/Context.cpp index c3578f9f6..705f95e7d 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -463,11 +463,12 @@ std::cout << "# parse post-termination description '" << *arg << "'" if (descCandidate != "" && noVerticalSpace (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 + // TODO task.validate () ? - constructFilter (); + // Read-only command (reports, status, info ...) use filters. Write commands + // (add, done ...) do not. + if (cmd.isReadOnlyCommand ()) + autoFilter (); // If no command was specified, and there were no command line arguments // then invoke the default command. @@ -490,7 +491,7 @@ std::cout << "# parse post-termination description '" << *arg << "'" //////////////////////////////////////////////////////////////////////////////// // Add all the attributes in the task to the filter. All except uuid. -void Context::constructFilter () +void Context::autoFilter () { foreach (att, task) { diff --git a/src/Context.h b/src/Context.h index 0ad6511f7..dce8b7a03 100644 --- a/src/Context.h +++ b/src/Context.h @@ -58,7 +58,7 @@ public: private: void loadCorrectConfigFile (); void parse (); - void constructFilter (); + void autoFilter (); public: Config config;