fix argparse --help

Also stop special-casing `printf` as if it were a syntactical keyword
with respect to handling `printf --help`. It should use the same pattern
as every other builtin command.
This commit is contained in:
Kurtis Rader
2017-07-19 11:44:53 -07:00
parent f78ab085b5
commit 9e08609f85
3 changed files with 25 additions and 13 deletions

View File

@@ -397,6 +397,8 @@ static int parse_cmd_opts(argparse_cmd_opts_t &opts, int *optind, //!OCLINT(hig
}
}
if (opts.print_help) return STATUS_CMD_OK;
if (argc == w.woptind || wcscmp(L"--", argv[w.woptind - 1]) == 0) {
// The user didn't specify any option specs.
streams.err.append_format(_(L"%ls: No option specs were provided\n"), cmd);