Code Reorganization

- Added the ability for a command to specify it's own pirmary keyword.
This commit is contained in:
Paul Beckingham 2011-05-23 20:23:53 -04:00
parent f8b44b68d7
commit f53d509930
9 changed files with 128 additions and 1 deletions

View file

@ -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
{