mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 11:27:19 +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.
|
// 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 &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue