- Tags QUOTED args.
- Documented the list of args that do not get Lexed.
This commit is contained in:
Paul Beckingham 2014-10-30 07:05:16 -04:00
parent d7f869accc
commit 195edcaa47

View file

@ -480,18 +480,18 @@ const std::string CLI::dump () const
// Either the arg is appended to _original_args intact, or the lexemes are. // Either the arg is appended to _original_args intact, or the lexemes are.
void CLI::addArg (const std::string& arg) void CLI::addArg (const std::string& arg)
{ {
// Do not lex RC overrides, IDs, UUIDs, patterns, substitutions. // Do not lex these constructs.
if (isTerminator (arg) || if (isTerminator (arg) || // --
isRCOverride (arg) || isRCOverride (arg) || // rc:<file>
isConfigOverride (arg) || isConfigOverride (arg) || // rc.<attr>:<value>
isTag (arg) || isTag (arg) || // [+-]<tag>
isUUIDList (arg) || isUUIDList (arg) || // <uuid>,[uuid ...]
isUUID (arg) || isUUID (arg) || // <uuid>
isIDSequence (arg) || isIDSequence (arg) || // <id>[-<id>][,<id>[-<id>] ...]
isID (arg) || isID (arg) || // <id>
isPattern (arg) || isPattern (arg) || // /<pattern</
isSubstitution (arg) || isSubstitution (arg) || // /<from>/<to>/[g]
isAttribute (arg)) isAttribute (arg)) // <name>[.[~]<modfifier>]:<value>
{ {
_original_args.push_back (arg); _original_args.push_back (arg);
} }
@ -647,6 +647,9 @@ void CLI::categorize ()
a->tag ("WORD"); a->tag ("WORD");
} }
if (raw.find (' ') != std::string::npos)
a->tag ("QUOTED");
std::string canonical; std::string canonical;
if (! terminated && if (! terminated &&
! foundCommand && ! foundCommand &&