diff options
Diffstat (limited to 'src/option.cc')
| -rw-r--r-- | src/option.cc | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/option.cc b/src/option.cc index 552d83f..2cae4ef 100644 --- a/src/option.cc +++ b/src/option.cc @@ -5,6 +5,7 @@ #include "global.h" #include "util/io.h" +#include "util/prompt.h" using namespace std; @@ -27,6 +28,37 @@ void v(string s) } LOG << "-v: invalid value" << endl; } - + +void p(string s) +{ + if (s == "" || s == "true" || s == "1") + { + ov4::emit_prompt = true; + LOG << "emit_prompt = true" << endl; + return; + } + if (s == "false" || s == "0") + { + ov4::emit_prompt = false; + LOG << "emit_prompt = flase" << endl; + return; + } + LOG << "-p: invalid value" << endl; +} + + +/* + * usage - print a help message + */ +void h([[maybe_unused]] string s) +{ + cout << "\ +Usage: ccshell [-hvp] \n\ + -h print this message \n\ + -v(=<bool>) print additional diagnostic information \n\ + -p(=<bool>) do not emit a command prompt \ +" << endl; + exit(1); } +} |
