msh-console/main.cpp

28 lines
701 B
C++

#include <cstdlib>
#include <iostream>
#include "shell.h"
#include "command.h"
#include "cmds.h"
using namespace std;
using namespace Cmds;
static void setup(Shell *);
int main(int argc, char **argv)
{
string c = "msh-console-test";
string ps = "[msh-console-test]:";
Shell mshConsoleTest(c, ps, &setup);
//add builtin commands
mshConsoleTest.addCmd(new Command("cd", &cdExecute));
mshConsoleTest.addCmd(new Command("exit", &exitExecute));
mshConsoleTest.addCmd(new Command("help", &helpExecute));
mshConsoleTest.launch();
return EXIT_SUCCESS;
}
void setup(Shell *s){
cout << "Now entering in test shell...\n" << endl;
s->executeCmd("stty -ctlecho");
}