mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
Code Reorganization
- Added the ability for a command to specify it's own pirmary keyword.
This commit is contained in:
parent
f8b44b68d7
commit
f53d509930
9 changed files with 128 additions and 1 deletions
|
@ -31,6 +31,7 @@
|
|||
#include <CmdHelp.h>
|
||||
#include <CmdInstall.h>
|
||||
#include <CmdLogo.h>
|
||||
#include <CmdTip.h>
|
||||
#include <Context.h>
|
||||
|
||||
extern Context context;
|
||||
|
@ -42,6 +43,7 @@ Command* Command::factory (const std::string& name)
|
|||
if (name == "execute") command = new CmdExec ();
|
||||
else if (name == "help") command = new CmdHelp ();
|
||||
else if (name == "install") command = new CmdInstall ();
|
||||
else if (name == "tip") command = new CmdTip ();
|
||||
else if (name == "_logo") command = new CmdLogo ();
|
||||
else
|
||||
throw std::string ("Unrecognized command object '") + name + "'";
|
||||
|
@ -97,6 +99,12 @@ Command::~Command ()
|
|||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Command::keyword () const
|
||||
{
|
||||
return _keyword;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Command::usage () const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue