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".
This commit is contained in:
Paul Beckingham 2009-06-16 12:05:04 -04:00
parent 97d732e5f7
commit 027b343e49
3 changed files with 7 additions and 7 deletions

View file

@ -259,7 +259,6 @@ bool Att::validNameValue (
std::string combined; std::string combined;
join (combined, ", ", matches); join (combined, ", ", matches);
error += combined;
throw error + combined; throw error + combined;
} }

View file

@ -463,11 +463,12 @@ std::cout << "# parse post-termination description '" << *arg << "'"
if (descCandidate != "" && noVerticalSpace (descCandidate)) if (descCandidate != "" && noVerticalSpace (descCandidate))
task.set ("description", descCandidate); task.set ("description", descCandidate);
// TODO task.validate () // 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 (); // 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 // If no command was specified, and there were no command line arguments
// then invoke the default command. // 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. // Add all the attributes in the task to the filter. All except uuid.
void Context::constructFilter () void Context::autoFilter ()
{ {
foreach (att, task) foreach (att, task)
{ {

View file

@ -58,7 +58,7 @@ public:
private: private:
void loadCorrectConfigFile (); void loadCorrectConfigFile ();
void parse (); void parse ();
void constructFilter (); void autoFilter ();
public: public:
Config config; Config config;