mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Commands
- Implemented the ability to iterate over installed Command objects, to augment the '_commands' command. - Renamed verbosity tokens, to de-pluralize them.
This commit is contained in:
parent
14bea5e1b4
commit
902ed48243
8 changed files with 49 additions and 52 deletions
|
@ -119,9 +119,9 @@ void Context::initialize2 (int argc, char** argv)
|
|||
// TODO Load relevant rc file.
|
||||
|
||||
// Instantiate built-in command objects.
|
||||
commands.push_back (Command::factory ("exec"));
|
||||
commands.push_back (Command::factory ("install"));
|
||||
commands.push_back (Command::factory ("_logo"));
|
||||
commands["exec"] = Command::factory ("exec");
|
||||
commands["install"] = Command::factory ("install");
|
||||
commands["logo"] = Command::factory ("_logo");
|
||||
|
||||
// TODO Instantiate extension command objects.
|
||||
// TODO Instantiate default command object.
|
||||
|
@ -248,15 +248,15 @@ int Context::dispatch2 (std::string &out)
|
|||
|
||||
updateXtermTitle ();
|
||||
|
||||
std::vector <Command*>::iterator c;
|
||||
std::map <std::string, Command*>::iterator c;
|
||||
for (c = commands.begin (); c != commands.end (); ++c)
|
||||
{
|
||||
if ((*c)->implements (commandLine))
|
||||
if (c->second->implements (commandLine))
|
||||
{
|
||||
if (! (*c)->read_only ())
|
||||
if (! c->second->read_only ())
|
||||
tdb.gc ();
|
||||
|
||||
return (*c)->execute (commandLine, out);
|
||||
return c->second->execute (commandLine, out);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue