- Added logo command, for fun.
- Renamed commands to CmdXxxxx for clarity and commonality with columns.
This commit is contained in:
Paul Beckingham 2011-04-29 19:31:29 -04:00
parent 8bc7d5932b
commit dd1be996a6
6 changed files with 248 additions and 22 deletions

View file

@ -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;
}
////////////////////////////////////////////////////////////////////////////////