mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
Commands
- Added logo command, for fun. - Renamed commands to CmdXxxxx for clarity and commonality with columns.
This commit is contained in:
parent
8bc7d5932b
commit
dd1be996a6
6 changed files with 248 additions and 22 deletions
|
@ -27,7 +27,8 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <Command.h>
|
||||
#include <Install.h>
|
||||
#include <CmdInstall.h>
|
||||
#include <CmdLogo.h>
|
||||
#include <Context.h>
|
||||
|
||||
extern Context context;
|
||||
|
@ -35,10 +36,13 @@ extern Context context;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
Command* Command::factory (const std::string& name)
|
||||
{
|
||||
if (name == "install") return new Install ();
|
||||
Command* command;
|
||||
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 '") + name + "'";
|
||||
return NULL;
|
||||
return command;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue