mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
A3t
- Removed obsolete ::findAliases method.
This commit is contained in:
parent
a353cbaf91
commit
3c701c8d5b
4 changed files with 3 additions and 50 deletions
47
src/A3t.cpp
47
src/A3t.cpp
|
@ -502,53 +502,6 @@ void A3t::inject_defaults ()
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// An alias must be a distinct word on the command line.
|
||||
void A3t::findAliases ()
|
||||
{
|
||||
bool something;
|
||||
int safety_valve = safetyValveDefault;
|
||||
|
||||
do
|
||||
{
|
||||
something = false;
|
||||
|
||||
std::string command;
|
||||
std::vector <Tree*>::iterator i;
|
||||
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
||||
{
|
||||
// Parser override operator.
|
||||
if ((*i)->attribute ("raw") == "--")
|
||||
break;
|
||||
|
||||
// Skip known args.
|
||||
if (! (*i)->hasTag ("?"))
|
||||
continue;
|
||||
|
||||
std::string raw = (*i)->attribute ("raw");
|
||||
std::map <std::string, std::string>::iterator match = context.aliases.find (raw);
|
||||
if (match != context.aliases.end ())
|
||||
{
|
||||
something = true;
|
||||
|
||||
std::vector <std::string> words;
|
||||
splitq (words, context.aliases[raw], ' ');
|
||||
|
||||
std::vector <std::string>::iterator word;
|
||||
for (word = words.begin (); word != words.end (); ++word)
|
||||
{
|
||||
// TODO Insert branch (words) in place of (*i).
|
||||
std::cout << "# alias word '" << *word << "'\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while (something && --safety_valve > 0);
|
||||
|
||||
if (safety_valve <= 0)
|
||||
context.debug (format ("Nested alias limit of {1} reached.", safetyValveDefault));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void A3t::capture_first (const std::string& arg)
|
||||
{
|
||||
|
|
|
@ -49,7 +49,6 @@ public:
|
|||
void findCommand ();
|
||||
void findIdSequence ();
|
||||
void findUUIDList ();
|
||||
void findAliases ();
|
||||
|
||||
void get_overrides (std::string&, File&);
|
||||
void get_data_location (Path&);
|
||||
|
|
|
@ -152,7 +152,6 @@ int Context::initialize (int argc, const char** argv)
|
|||
// Handle Aliases.
|
||||
loadAliases ();
|
||||
a3.resolve_aliases ();
|
||||
a3t.findAliases ();
|
||||
aliases2.load ();
|
||||
aliases2.resolve (a3t.tree ());
|
||||
|
||||
|
|
|
@ -40,7 +40,9 @@ int main (int argc, const char** argv)
|
|||
a3t.append_stdin ();
|
||||
a3t.findFileOverride ();
|
||||
a3t.findConfigOverride ();
|
||||
a3t.findAliases ();
|
||||
|
||||
Alias alias;
|
||||
alias.resolve (a3t.tree ());
|
||||
|
||||
// Reports.
|
||||
a3t.entity ("report", "list");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue