tshark: Use -G help instead of -G ?

Not all platforms handle ? or -? *predictably* at the command line.
As long as "?" isn't replaced with a file name, it works, but if it
gets replaced by a file name...

Bug: 13984
Change-Id: I4496bb27fdef121967e7baf7b7f4a1bb0a44b00a
Reviewed-on: https://code.wireshark.org/review/24125
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2017-10-27 21:07:05 -04:00
parent 7c9ec1d13c
commit 7ddfee9aea
1 changed files with 8 additions and 2 deletions

View File

@ -466,7 +466,7 @@ print_usage(FILE *output)
fprintf(output, " -K <keytab> keytab file to use for kerberos decryption\n");
fprintf(output, " -G [report] dump one of several available reports and exit\n");
fprintf(output, " default report=\"fields\"\n");
fprintf(output, " use \"-G ?\" for more help\n");
fprintf(output, " use \"-G help\" for more help\n");
#ifdef __linux__
fprintf(output, "\n");
fprintf(output, "WARNING: dumpcap will enable kernel BPF JIT compiler if available.\n");
@ -1005,12 +1005,18 @@ main(int argc, char *argv[])
proto_registrar_dump_protocols();
else if (strcmp(argv[2], "values") == 0)
proto_registrar_dump_values();
else if (strcmp(argv[2], "help") == 0)
glossary_option_help();
/* These are supported only for backwards compatibility and may or may not work
* for a given user in a given directory on a given operating system with a given
* command-line interpreter.
*/
else if (strcmp(argv[2], "?") == 0)
glossary_option_help();
else if (strcmp(argv[2], "-?") == 0)
glossary_option_help();
else {
cmdarg_err("Invalid \"%s\" option for -G flag, enter -G ? for more help.", argv[2]);
cmdarg_err("Invalid \"%s\" option for -G flag, enter -G help for more help.", argv[2]);
exit_status = INVALID_OPTION;
goto clean_exit;
}