mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI2: Obey the terminator and skip Lexing
This commit is contained in:
parent
299ecad49f
commit
1824a542f6
1 changed files with 19 additions and 6 deletions
13
src/CLI2.cpp
13
src/CLI2.cpp
|
@ -340,7 +340,19 @@ void CLI2::lexArguments ()
|
||||||
{
|
{
|
||||||
// Note: Starts interating at index 1, because ::handleArg0 has already
|
// Note: Starts interating at index 1, because ::handleArg0 has already
|
||||||
// processed it.
|
// processed it.
|
||||||
|
bool terminated = false;
|
||||||
for (unsigned int i = 1; i < _original_args.size (); ++i)
|
for (unsigned int i = 1; i < _original_args.size (); ++i)
|
||||||
|
{
|
||||||
|
if (_original_args[i] == "--")
|
||||||
|
{
|
||||||
|
terminated = true;
|
||||||
|
_args.push_back (A2 (_original_args[i], Lexer::Type::separator));
|
||||||
|
}
|
||||||
|
else if (terminated)
|
||||||
|
{
|
||||||
|
_args.push_back (A2 (_original_args[i], Lexer::Type::word));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
std::string lexeme;
|
std::string lexeme;
|
||||||
Lexer::Type type;
|
Lexer::Type type;
|
||||||
|
@ -350,6 +362,7 @@ void CLI2::lexArguments ()
|
||||||
while (lex.token (lexeme, type))
|
while (lex.token (lexeme, type))
|
||||||
_args.push_back (A2 (lexeme, type));
|
_args.push_back (A2 (lexeme, type));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (context.config.getInteger ("debug.parser") >= 3)
|
if (context.config.getInteger ("debug.parser") >= 3)
|
||||||
context.debug (dump ("CLI2::analyze lexArguments"));
|
context.debug (dump ("CLI2::analyze lexArguments"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue