2016-03-11 14:49:24 +00:00
|
|
|
/**
|
|
|
|
builtin commands
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "cmds.h"
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int Cmds::cdExecute(const vector<string>* 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<string>*){
|
|
|
|
std::exit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int Cmds::helpExecute(const vector<string>*){
|
2016-03-11 15:13:04 +00:00
|
|
|
cout << "Msh info" << endl;
|
2016-03-11 14:49:24 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|