Code Reorganization
- Added the ability for a command to specify it's own pirmary keyword.
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user