builtin about box, bump version number.

This commit is contained in:
Kelvin Sherlock 2016-02-11 21:50:25 -05:00
parent ca4fafb62c
commit 0d0367ca08
4 changed files with 50 additions and 1 deletions

View File

@ -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());
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;
}

View File

@ -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_unexport(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 &);

View File

@ -93,6 +93,7 @@ namespace {
}
std::unordered_map<std::string, int (*)(Environment &, const std::vector<std::string> &, const fdmask &)> builtins = {
{"aboutbox", builtin_aboutbox},
{"directory", builtin_directory},
{"echo", builtin_echo},
{"export", builtin_export},

View File

@ -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);
read_file(p1, root() / "Startup");
e.startup(false);