mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
CLI2: ::lexArguments now uses ::readWord to expand escapes
This commit is contained in:
parent
b86c079ed5
commit
21be6862db
1 changed files with 19 additions and 4 deletions
15
src/CLI2.cpp
15
src/CLI2.cpp
|
@ -436,6 +436,20 @@ void CLI2::lexArguments ()
|
|||
_args.push_back (a);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string::size_type cursor = 0;
|
||||
std::string word;
|
||||
if (Lexer::readWord ("'" + _original_args[i] + "'", "'", cursor, word))
|
||||
{
|
||||
A2 unknown (word, Lexer::Type::word);
|
||||
if (lex.wasQuoted (_original_args[i]))
|
||||
unknown.tag ("QUOTED");
|
||||
|
||||
_args.push_back (unknown);
|
||||
}
|
||||
|
||||
// This branch may have no use-case.
|
||||
else
|
||||
{
|
||||
A2 unknown (_original_args[i], Lexer::Type::word);
|
||||
if (lex.wasQuoted (_original_args[i]))
|
||||
|
@ -444,6 +458,7 @@ void CLI2::lexArguments ()
|
|||
_args.push_back (unknown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (context.config.getInteger ("debug.parser") >= 3)
|
||||
context.debug (dump ("CLI2::analyze lexArguments"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue