mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
Commands
- Implemented stubbed Context::initialize2. - Implemented combined command line. - Migrated some code from Context::initialize to ::initialize2. - Integrated ::initialize2 into the startup sequence. - Implemented Context::dispatch2. - Integrated ::dispatch2 into the run sequence. - Implemented Context::updateXtermTitle. - Added debug messages to new Command objects. - Implemented CmdLogo, which implements the _logo command, for fun. - Removed unnecessary base class overrides from Cmd* objects.
This commit is contained in:
parent
02c2023dc4
commit
557440db0c
13 changed files with 215 additions and 141 deletions
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <Command.h>
|
||||
#include <CmdExec.h>
|
||||
#include <CmdInstall.h>
|
||||
#include <CmdLogo.h>
|
||||
#include <Context.h>
|
||||
|
@ -37,10 +38,13 @@ extern Context context;
|
|||
Command* Command::factory (const std::string& name)
|
||||
{
|
||||
Command* command;
|
||||
if (name == "install") command = new CmdInstall ();
|
||||
if (name == "exec") command = new CmdExec ();
|
||||
else if (name == "install") command = new CmdInstall ();
|
||||
else if (name == "_logo") command = new CmdLogo ();
|
||||
else
|
||||
throw std::string ("Unrecognized command '") + name + "'";
|
||||
throw std::string ("Unrecognized command object '") + name + "'";
|
||||
|
||||
// TODO Initialize command object.
|
||||
|
||||
return command;
|
||||
}
|
||||
|
@ -71,12 +75,6 @@ Command& Command::operator= (const Command& other)
|
|||
return *this;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Command::read_only () const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Command::operator== (const Command& other) const
|
||||
{
|
||||
|
@ -97,3 +95,10 @@ Command::~Command ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Command::read_only () const
|
||||
{
|
||||
std::cout << "# Command::read_only\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue