/** builtin commands */ #include "cmds.h" using namespace std; int Cmds::cdExecute(const vector* args){ if (args->operator[](1) == "\0") { cerr << "msh: expected argument to \"cd\"\n"; } else { if (chdir(args->operator[](1).c_str()) != 0) { cerr << "msh"; } } return 1; } int Cmds::exitExecute(const vector*){ std::exit(0); } int Cmds::helpExecute(const vector*){ int i; cout << "Claudio Maggioni's msh\n" << endl << "Type program names and arguments, and hit enter.\n" << endl; return 1; }