CLI2: Removed old implementation from ::prepareFilter
This commit is contained in:
70
src/CLI2.cpp
70
src/CLI2.cpp
@@ -628,76 +628,6 @@ void CLI2::prepareFilter (bool applyContext)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
for (auto& a : _args)
|
|
||||||
{
|
|
||||||
std::string raw = a.attribute ("raw");
|
|
||||||
|
|
||||||
if (! terminated && raw == "--")
|
|
||||||
{
|
|
||||||
a.tag ("ORIGINAL");
|
|
||||||
a.tag ("TERMINATOR");
|
|
||||||
terminated = true;
|
|
||||||
changes = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if (terminated)
|
|
||||||
{
|
|
||||||
a.tag ("ORIGINAL");
|
|
||||||
a.tag ("TERMINATED");
|
|
||||||
a.tag ("WORD");
|
|
||||||
changes = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (raw.find (' ') != std::string::npos)
|
|
||||||
{
|
|
||||||
a.tag ("QUOTED");
|
|
||||||
changes = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string canonical;
|
|
||||||
if (! terminated &&
|
|
||||||
! foundCommand &&
|
|
||||||
canonicalize (canonical, "cmd", raw))
|
|
||||||
{
|
|
||||||
readOnly = ! exactMatch ("writecmd", canonical);
|
|
||||||
|
|
||||||
a.tag ("CMD");
|
|
||||||
a.tag (readOnly ? "READCMD" : "WRITECMD");
|
|
||||||
a.attribute ("canonical", canonical);
|
|
||||||
foundCommand = true;
|
|
||||||
changes = true;
|
|
||||||
}
|
|
||||||
else if (a.hasTag ("TERMINATOR") ||
|
|
||||||
a.hasTag ("BINARY") ||
|
|
||||||
a.hasTag ("CONFIG") ||
|
|
||||||
a.hasTag ("RC"))
|
|
||||||
{
|
|
||||||
// NOP
|
|
||||||
}
|
|
||||||
else if (foundCommand && ! readOnly)
|
|
||||||
{
|
|
||||||
a.tag ("MODIFICATION");
|
|
||||||
|
|
||||||
// If the argument contains a space, it was quoted. Record that.
|
|
||||||
if (! Lexer::isOneWord (raw))
|
|
||||||
a.tag ("QUOTED");
|
|
||||||
|
|
||||||
changes = true;
|
|
||||||
}
|
|
||||||
else if (!foundCommand || (foundCommand && readOnly))
|
|
||||||
{
|
|
||||||
a.tag ("FILTER");
|
|
||||||
|
|
||||||
// If the argument contains a space, it was quoted. Record that.
|
|
||||||
if (! Lexer::isOneWord (raw))
|
|
||||||
a.tag ("QUOTED");
|
|
||||||
|
|
||||||
changes = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (changes &&
|
if (changes &&
|
||||||
context.config.getInteger ("debug.parser") >= 3)
|
context.config.getInteger ("debug.parser") >= 3)
|
||||||
context.debug (dump ("CLI2::prepareFilter categorize"));
|
context.debug (dump ("CLI2::prepareFilter categorize"));
|
||||||
|
|||||||
Reference in New Issue
Block a user