From 027b343e495d6fb7f2f54f79d963e1b14f8cba1f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 16 Jun 2009 12:05:04 -0400 Subject: [PATCH] Bug Fixes - autofilter - Auto filter now only creates a filter for read-only commands. - Fixed bug whereby ambiguities were reported twice: "could be one of a, b, a, b". --- src/Att.cpp | 1 - src/Context.cpp | 11 ++++++----- src/Context.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) 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;