add -g option (shortcut for --code=debug)

This commit is contained in:
Bill Currie 2001-11-14 23:17:20 +00:00
parent ed331517b3
commit cf37275def

View file

@ -62,6 +62,7 @@ static struct option const long_options[] = {
{"source", required_argument, 0, 's'}, {"source", required_argument, 0, 's'},
{"quiet", no_argument, 0, 'q'}, {"quiet", no_argument, 0, 'q'},
{"verbose", no_argument, 0, 'v'}, {"verbose", no_argument, 0, 'v'},
{NULL, no_argument, 0, 'g'},
{"code", required_argument, 0, 'C'}, {"code", required_argument, 0, 'C'},
{"warn", required_argument, 0, 'W'}, {"warn", required_argument, 0, 'W'},
{"help", no_argument, 0, 'h'}, {"help", no_argument, 0, 'h'},
@ -678,6 +679,7 @@ usage (int status)
" -s, --source DIR Look for progs.src in DIR instead of \".\"\n" " -s, --source DIR Look for progs.src in DIR instead of \".\"\n"
" -q, --quiet Inhibit usual output\n" " -q, --quiet Inhibit usual output\n"
" -v, --verbose Display more output than usual\n" " -v, --verbose Display more output than usual\n"
" -g, Generate debuggin info\n"
" -C, --code OPTION,... Set code generation options\n" " -C, --code OPTION,... Set code generation options\n"
" -W, --warn OPTION,... Set warning options\n" " -W, --warn OPTION,... Set warning options\n"
" -h, --help Display this help and exit\n" " -h, --help Display this help and exit\n"
@ -716,6 +718,7 @@ DecodeArgs (int argc, char **argv)
"s:" // source dir "s:" // source dir
"q" // quiet "q" // quiet
"v" // verbose "v" // verbose
"g" // debug
"C:" // code options "C:" // code options
"W:" // warning options "W:" // warning options
"h" // help "h" // help
@ -743,6 +746,9 @@ DecodeArgs (int argc, char **argv)
case 'v': // verbose case 'v': // verbose
options.verbosity += 1; options.verbosity += 1;
break; break;
case 'g': // debug
options.code.debug = 1;
break;
case 'C': { // code options case 'C': { // code options
char *opts = strdup (optarg); char *opts = strdup (optarg);
char *temp = strtok (opts, ","); char *temp = strtok (opts, ",");