mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CLI
- Tags QUOTED args. - Documented the list of args that do not get Lexed.
This commit is contained in:
parent
d7f869accc
commit
195edcaa47
1 changed files with 15 additions and 12 deletions
27
src/CLI.cpp
27
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:<file>
|
||||
isConfigOverride (arg) || // rc.<attr>:<value>
|
||||
isTag (arg) || // [+-]<tag>
|
||||
isUUIDList (arg) || // <uuid>,[uuid ...]
|
||||
isUUID (arg) || // <uuid>
|
||||
isIDSequence (arg) || // <id>[-<id>][,<id>[-<id>] ...]
|
||||
isID (arg) || // <id>
|
||||
isPattern (arg) || // /<pattern</
|
||||
isSubstitution (arg) || // /<from>/<to>/[g]
|
||||
isAttribute (arg)) // <name>[.[~]<modfifier>]:<value>
|
||||
{
|
||||
_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 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue