From 195edcaa4787ccb348ed26a49fcd01f60bdeca5e Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 30 Oct 2014 07:05:16 -0400 Subject: [PATCH] CLI - Tags QUOTED args. - Documented the list of args that do not get Lexed. --- src/CLI.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/CLI.cpp b/src/CLI.cpp index cf694ab0a..f041475cf 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -480,18 +480,18 @@ const std::string CLI::dump () const // Either the arg is appended to _original_args intact, or the lexemes are. void CLI::addArg (const std::string& arg) { - // Do not lex RC overrides, IDs, UUIDs, patterns, substitutions. - if (isTerminator (arg) || - isRCOverride (arg) || - isConfigOverride (arg) || - isTag (arg) || - isUUIDList (arg) || - isUUID (arg) || - isIDSequence (arg) || - isID (arg) || - isPattern (arg) || - isSubstitution (arg) || - isAttribute (arg)) + // Do not lex these constructs. + if (isTerminator (arg) || // -- + isRCOverride (arg) || // rc: + isConfigOverride (arg) || // rc.: + isTag (arg) || // [+-] + isUUIDList (arg) || // ,[uuid ...] + isUUID (arg) || // + isIDSequence (arg) || // [-][,[-] ...] + isID (arg) || // + isPattern (arg) || // ///[g] + isAttribute (arg)) // [.[~]]: { _original_args.push_back (arg); } @@ -647,6 +647,9 @@ void CLI::categorize () a->tag ("WORD"); } + if (raw.find (' ') != std::string::npos) + a->tag ("QUOTED"); + std::string canonical; if (! terminated && ! foundCommand &&