mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
CLI2: Some args must avoid lexing
- This now include rc:xxx and rc.xxx.
This commit is contained in:
parent
4820bde41e
commit
8cc75693a0
1 changed files with 12 additions and 0 deletions
12
src/CLI2.cpp
12
src/CLI2.cpp
|
@ -343,15 +343,27 @@ void CLI2::lexArguments ()
|
|||
bool terminated = false;
|
||||
for (unsigned int i = 1; i < _original_args.size (); ++i)
|
||||
{
|
||||
// The terminator itself is captured.
|
||||
if (_original_args[i] == "--")
|
||||
{
|
||||
terminated = true;
|
||||
_args.push_back (A2 (_original_args[i], Lexer::Type::separator));
|
||||
}
|
||||
|
||||
// Any arguments that are after the terminator are captured as words.
|
||||
else if (terminated)
|
||||
{
|
||||
_args.push_back (A2 (_original_args[i], Lexer::Type::word));
|
||||
}
|
||||
|
||||
// rc:<file> and rc.<name>[:=]<value> argumenst are captured whole.
|
||||
else if (_original_args[i].substr (0, 3) == "rc:" ||
|
||||
_original_args[i].substr (0, 3) == "rc.")
|
||||
{
|
||||
_args.push_back (A2 (_original_args[i], Lexer::Type::pair));
|
||||
}
|
||||
|
||||
// Everything else gets lexed.
|
||||
else
|
||||
{
|
||||
std::string lexeme;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue