Skip to content

Commit 0d0367c

Browse files
committed
builtin about box, bump version number.
1 parent ca4fafb commit 0d0367c

File tree

4 files changed

+50
-1
lines changed

4 files changed

+50
-1
lines changed

builtins.cpp

+47
Original file line numberDiff line numberDiff line change
@@ -606,3 +606,50 @@ int builtin_which(Environment &env, const std::vector<std::string> &tokens, cons
606606
fprintf(stderr, "### Which - Command \"%s\" was not found.\n", target.c_str());
607607
return 2; // not found.
608608
}
609+
610+
int builtin_aboutbox(Environment &env, const std::vector<std::string> &tokens, const fdmask &fds) {
611+
// the most important command of all!
612+
613+
if (tokens.size() == 2 && tokens[1] == "--moof") {
614+
615+
fputs(
616+
"\n"
617+
" ## \n"
618+
" ## ## #### \n"
619+
" ## #### ## \n"
620+
" ## ## \n"
621+
" ## ## ## ## \n"
622+
" ## ## #### \n"
623+
" ## ## ## ## \n"
624+
" ######## #### ## ## \n"
625+
" ## #################### ## \n"
626+
" ## ############## ## \n"
627+
" #### ############ ## \n"
628+
" ###### ###### ## \n"
629+
" ###### ## \n"
630+
" #### ## \n"
631+
" ## ## \n"
632+
" ## ################ ## \n"
633+
" ## ## ## ## \n"
634+
" ## ## ## ## \n"
635+
" ## ## ## ## \n"
636+
" ## ## ## ## \n"
637+
" ## ## ## ## \n"
638+
" ###### ###### \n"
639+
"\n"
640+
,stdout);
641+
642+
return 0;
643+
}
644+
645+
646+
fputs(
647+
"+--------------------------------------+\n"
648+
"| MPW Shell 0.1 - February 2016 |\n"
649+
"| |\n"
650+
"| |\n"
651+
"| (c) 2016 Kelvin W Sherlock |\n"
652+
"+--------------------------------------+\n"
653+
,stdout);
654+
return 0;
655+
}

builtins.h

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ int builtin_unset(Environment &e, const std::vector<std::string> &, const fdmask
1717
int builtin_export(Environment &e, const std::vector<std::string> &, const fdmask &);
1818
int builtin_unexport(Environment &e, const std::vector<std::string> &, const fdmask &);
1919
int builtin_which(Environment &e, const std::vector<std::string> &, const fdmask &);
20+
int builtin_aboutbox(Environment &e, const std::vector<std::string> &, const fdmask &);
2021

2122
int builtin_evaluate(Environment &e, std::vector<token> &&, const fdmask &);
2223

command.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ namespace {
9393
}
9494

9595
std::unordered_map<std::string, int (*)(Environment &, const std::vector<std::string> &, const fdmask &)> builtins = {
96+
{"aboutbox", builtin_aboutbox},
9697
{"directory", builtin_directory},
9798
{"echo", builtin_echo},
9899
{"export", builtin_export},

mpw-shell.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ int main(int argc, char **argv) {
476476
}
477477
};
478478

479-
if (!cflag) fprintf(stdout, "MPW Shell 0.0\n");
479+
if (!cflag) fprintf(stdout, "MPW Shell 0.1\n");
480480
e.startup(true);
481481
read_file(p1, root() / "Startup");
482482
e.startup(false);

0 commit comments

Comments
 (0)