diff --git a/tfshark.c b/tfshark.c index 38b94199c9..2cbe7e7485 100644 --- a/tfshark.c +++ b/tfshark.c @@ -1300,12 +1300,12 @@ main(int argc, char *argv[]) by the preferences set callback) from being used as part of a tap filter. Instead, we just add the argument to a list of stat arguments. */ + if (strcmp("help", optarg) == 0) { + fprintf(stderr, "tfshark: The available statistics for the \"-z\" option are:\n"); + list_stat_cmd_args(); + return 0; + } if (!process_stat_cmd_arg(optarg)) { - if (strcmp("help", optarg)==0) { - fprintf(stderr, "tfshark: The available statistics for the \"-z\" option are:\n"); - list_stat_cmd_args(); - return 0; - } cmdarg_err("Invalid -z argument \"%s\"; it must be one of:", optarg); list_stat_cmd_args(); return 1; diff --git a/tshark.c b/tshark.c index c413218863..0cdbb901fb 100644 --- a/tshark.c +++ b/tshark.c @@ -1645,12 +1645,12 @@ main(int argc, char *argv[]) by the preferences set callback) from being used as part of a tap filter. Instead, we just add the argument to a list of stat arguments. */ + if (strcmp("help", optarg) == 0) { + fprintf(stderr, "tshark: The available statistics for the \"-z\" option are:\n"); + list_stat_cmd_args(); + return 0; + } if (!process_stat_cmd_arg(optarg)) { - if (strcmp("help", optarg)==0) { - fprintf(stderr, "tshark: The available statistics for the \"-z\" option are:\n"); - list_stat_cmd_args(); - return 0; - } cmdarg_err("Invalid -z argument \"%s\"; it must be one of:", optarg); list_stat_cmd_args(); return 1; diff --git a/ui/gtk/main.c b/ui/gtk/main.c index a78edc01b8..622bb6ee16 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -2759,6 +2759,11 @@ main(int argc, char *argv[]) by the preferences set callback) from being used as part of a tap filter. Instead, we just add the argument to a list of stat arguments. */ + if (strcmp("help", optarg) == 0) { + fprintf(stderr, "wireshark: The available statistics for the \"-z\" option are:\n"); + list_stat_cmd_args(); + exit(0); + } if (!process_stat_cmd_arg(optarg)) { cmdarg_err("Invalid -z argument."); cmdarg_err_cont(" -z argument must be one of :"); diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp index 24fc283510..7b244c1f3f 100644 --- a/ui/qt/main.cpp +++ b/ui/qt/main.cpp @@ -1081,6 +1081,11 @@ int main(int argc, char *argv[]) by the preferences set callback) from being used as part of a tap filter. Instead, we just add the argument to a list of stat arguments. */ + if (strcmp("help", optarg) == 0) { + fprintf(stderr, "wireshark: The available statistics for the \"-z\" option are:\n"); + list_stat_cmd_args(); + exit(0); + } if (!process_stat_cmd_arg(optarg)) { cmdarg_err("Invalid -z argument."); cmdarg_err_cont(" -z argument must be one of :");