mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI
- Implemented ::isCommand.
This commit is contained in:
parent
78625d00ec
commit
290f248db8
2 changed files with 10 additions and 1 deletions
10
src/CLI.cpp
10
src/CLI.cpp
|
@ -511,12 +511,13 @@ const std::string CLI::dump (const std::string& title /* = "CLI Parser" */) cons
|
|||
// be lexed from those that need to be left alone.
|
||||
//
|
||||
// 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, bool first /* = false */)
|
||||
{
|
||||
// Do not lex these constructs.
|
||||
if (isTerminator (arg) || // --
|
||||
isRCOverride (arg) || // rc:<file>
|
||||
isConfigOverride (arg) || // rc.<attr>:<value>
|
||||
isCommand (arg) || // <cmd>
|
||||
isTag (arg) || // [+-]<tag>
|
||||
isUUIDList (arg) || // <uuid>,[uuid ...]
|
||||
isUUID (arg) || // <uuid>
|
||||
|
@ -1877,6 +1878,13 @@ bool CLI::isConfigOverride (const std::string& raw) const
|
|||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool CLI::isCommand (const std::string& raw) const
|
||||
{
|
||||
std::string canonical;
|
||||
return canonicalize (canonical, "cmd", raw);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool CLI::isTag (const std::string& raw) const
|
||||
{
|
||||
|
|
|
@ -102,6 +102,7 @@ private:
|
|||
bool isTerminator (const std::string&) const;
|
||||
bool isRCOverride (const std::string&) const;
|
||||
bool isConfigOverride (const std::string&) const;
|
||||
bool isCommand (const std::string&) const;
|
||||
bool isTag (const std::string&) const;
|
||||
bool isUUIDList (const std::string&) const;
|
||||
bool isUUID (const std::string&) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue