mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
CLI2: Removed obsolete ::categorize method
This commit is contained in:
parent
3636de11c8
commit
4c55e7ef3d
2 changed files with 0 additions and 88 deletions
85
src/CLI2.cpp
85
src/CLI2.cpp
|
@ -1054,91 +1054,6 @@ bool CLI2::findCommand ()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// TODO This method should further categorize args into whether or not they are
|
|
||||||
// extracted by ::getWords.
|
|
||||||
void CLI2::categorize ()
|
|
||||||
{
|
|
||||||
bool changes = false;
|
|
||||||
bool foundCommand = false;
|
|
||||||
bool readOnly = false;
|
|
||||||
bool terminated = false;
|
|
||||||
|
|
||||||
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 &&
|
|
||||||
context.config.getInteger ("debug.parser") >= 3)
|
|
||||||
context.debug (dump ("CLI2::analyze categorize"));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Search for exact 'value' in _entities category.
|
// Search for exact 'value' in _entities category.
|
||||||
bool CLI2::exactMatch (
|
bool CLI2::exactMatch (
|
||||||
|
|
|
@ -113,9 +113,6 @@ private:
|
||||||
void aliasExpansion ();
|
void aliasExpansion ();
|
||||||
void findOverrides ();
|
void findOverrides ();
|
||||||
bool findCommand ();
|
bool findCommand ();
|
||||||
/*
|
|
||||||
void categorize ();
|
|
||||||
*/
|
|
||||||
bool exactMatch (const std::string&, const std::string&) const;
|
bool exactMatch (const std::string&, const std::string&) const;
|
||||||
/*
|
/*
|
||||||
void desugarFilterTags ();
|
void desugarFilterTags ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue