mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2025-08-15 14:27:40 +00:00
builtin about box, bump version number.
This commit is contained in:
47
builtins.cpp
47
builtins.cpp
@@ -606,3 +606,50 @@ int builtin_which(Environment &env, const std::vector<std::string> &tokens, cons
|
|||||||
fprintf(stderr, "### Which - Command \"%s\" was not found.\n", target.c_str());
|
fprintf(stderr, "### Which - Command \"%s\" was not found.\n", target.c_str());
|
||||||
return 2; // not found.
|
return 2; // not found.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int builtin_aboutbox(Environment &env, const std::vector<std::string> &tokens, const fdmask &fds) {
|
||||||
|
// the most important command of all!
|
||||||
|
|
||||||
|
if (tokens.size() == 2 && tokens[1] == "--moof") {
|
||||||
|
|
||||||
|
fputs(
|
||||||
|
"\n"
|
||||||
|
" ## \n"
|
||||||
|
" ## ## #### \n"
|
||||||
|
" ## #### ## \n"
|
||||||
|
" ## ## \n"
|
||||||
|
" ## ## ## ## \n"
|
||||||
|
" ## ## #### \n"
|
||||||
|
" ## ## ## ## \n"
|
||||||
|
" ######## #### ## ## \n"
|
||||||
|
" ## #################### ## \n"
|
||||||
|
" ## ############## ## \n"
|
||||||
|
" #### ############ ## \n"
|
||||||
|
" ###### ###### ## \n"
|
||||||
|
" ###### ## \n"
|
||||||
|
" #### ## \n"
|
||||||
|
" ## ## \n"
|
||||||
|
" ## ################ ## \n"
|
||||||
|
" ## ## ## ## \n"
|
||||||
|
" ## ## ## ## \n"
|
||||||
|
" ## ## ## ## \n"
|
||||||
|
" ## ## ## ## \n"
|
||||||
|
" ## ## ## ## \n"
|
||||||
|
" ###### ###### \n"
|
||||||
|
"\n"
|
||||||
|
,stdout);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fputs(
|
||||||
|
"+--------------------------------------+\n"
|
||||||
|
"| MPW Shell 0.1 - February 2016 |\n"
|
||||||
|
"| |\n"
|
||||||
|
"| |\n"
|
||||||
|
"| (c) 2016 Kelvin W Sherlock |\n"
|
||||||
|
"+--------------------------------------+\n"
|
||||||
|
,stdout);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -17,6 +17,7 @@ int builtin_unset(Environment &e, const std::vector<std::string> &, const fdmask
|
|||||||
int builtin_export(Environment &e, const std::vector<std::string> &, const fdmask &);
|
int builtin_export(Environment &e, const std::vector<std::string> &, const fdmask &);
|
||||||
int builtin_unexport(Environment &e, const std::vector<std::string> &, const fdmask &);
|
int builtin_unexport(Environment &e, const std::vector<std::string> &, const fdmask &);
|
||||||
int builtin_which(Environment &e, const std::vector<std::string> &, const fdmask &);
|
int builtin_which(Environment &e, const std::vector<std::string> &, const fdmask &);
|
||||||
|
int builtin_aboutbox(Environment &e, const std::vector<std::string> &, const fdmask &);
|
||||||
|
|
||||||
int builtin_evaluate(Environment &e, std::vector<token> &&, const fdmask &);
|
int builtin_evaluate(Environment &e, std::vector<token> &&, const fdmask &);
|
||||||
|
|
||||||
|
@@ -93,6 +93,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::unordered_map<std::string, int (*)(Environment &, const std::vector<std::string> &, const fdmask &)> builtins = {
|
std::unordered_map<std::string, int (*)(Environment &, const std::vector<std::string> &, const fdmask &)> builtins = {
|
||||||
|
{"aboutbox", builtin_aboutbox},
|
||||||
{"directory", builtin_directory},
|
{"directory", builtin_directory},
|
||||||
{"echo", builtin_echo},
|
{"echo", builtin_echo},
|
||||||
{"export", builtin_export},
|
{"export", builtin_export},
|
||||||
|
@@ -476,7 +476,7 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!cflag) fprintf(stdout, "MPW Shell 0.0\n");
|
if (!cflag) fprintf(stdout, "MPW Shell 0.1\n");
|
||||||
e.startup(true);
|
e.startup(true);
|
||||||
read_file(p1, root() / "Startup");
|
read_file(p1, root() / "Startup");
|
||||||
e.startup(false);
|
e.startup(false);
|
||||||
|
Reference in New Issue
Block a user