2016-03-11 14:49:24 +00:00
|
|
|
#include <cstdlib>
|
2016-03-11 16:45:15 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include "shell.h"
|
|
|
|
#include "command.h"
|
|
|
|
#include "cmds.h"
|
2016-03-11 14:49:24 +00:00
|
|
|
using namespace std;
|
2016-03-11 16:45:15 +00:00
|
|
|
using namespace Cmds;
|
|
|
|
|
|
|
|
static void setup(Shell *);
|
2016-03-11 14:49:24 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
2016-03-11 16:45:15 +00:00
|
|
|
string c = "msh-console-test";
|
|
|
|
string ps = "[msh-console-test]:";
|
|
|
|
Shell mshConsoleTest(c, ps, &setup);
|
2016-03-11 14:49:24 +00:00
|
|
|
|
2016-03-11 16:45:15 +00:00
|
|
|
//add builtin commands
|
|
|
|
mshConsoleTest.addCmd(new Command("cd", &cdExecute));
|
|
|
|
mshConsoleTest.addCmd(new Command("exit", &exitExecute));
|
|
|
|
mshConsoleTest.addCmd(new Command("help", &helpExecute));
|
2016-03-12 17:58:01 +00:00
|
|
|
mshConsoleTest.launch();
|
2016-03-11 16:45:15 +00:00
|
|
|
return EXIT_SUCCESS;
|
2016-03-11 14:49:24 +00:00
|
|
|
}
|
|
|
|
|
2016-03-11 16:45:15 +00:00
|
|
|
void setup(Shell *){
|
|
|
|
cout << "Now entering in test shell...\n" << endl;
|
|
|
|
}
|