diff --git a/HISTORY b/HISTORY index f0f39ba..dd05d92 100755 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,6 @@ +Mar. 29 2016 +Added a help option to the shell + Mar. 16 2016 Fixed an execution issue after a lambda Fixed a cannot RETURN bug from a FOR loop in a sub routine diff --git a/output/my_basic.exe b/output/my_basic.exe index 12a0e8d..668e158 100755 Binary files a/output/my_basic.exe and b/output/my_basic.exe differ diff --git a/shell/main.c b/shell/main.c index da8d83d..966adac 100755 --- a/shell/main.c +++ b/shell/main.c @@ -862,6 +862,7 @@ static void _show_help(void) { _printf(" %s -e \"expr\" - Evaluate an expression directly\n", _BIN_FILE_NAME); _printf("\n"); _printf("Options:\n"); + _printf(" -h - Show help information\n"); #if _USE_MEM_POOL _printf(" -p n - Set memory pool threashold size, n is size in bytes\n"); #endif /* _USE_MEM_POOL */ @@ -1028,6 +1029,7 @@ static bool_t _process_parameters(int argc, char* argv[]) { int i = 1; char* prog = 0; bool_t eval = false; + bool_t help = false; char* memp = 0; char* diri = 0; @@ -1037,6 +1039,8 @@ static bool_t _process_parameters(int argc, char* argv[]) { eval = true; _CHECK_ARG(argc, i, "-e: Expression expected.\n"); prog = argv[++i]; + } else if(!memcmp(argv[i] + 1, "h", 1)) { + help = true; #if _USE_MEM_POOL } else if(!memcmp(argv[i] + 1, "p", 1)) { _CHECK_ARG(argc, i, "-p: Memory pool threashold size expected.\n"); @@ -1069,6 +1073,8 @@ static bool_t _process_parameters(int argc, char* argv[]) { _evaluate_expression(prog); else if(prog) _run_file(prog); + else if(help) + _show_help(); else return false;