From 542f4dc1802158a828ad0a170ba0eff9ad20fbd5 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 10 Sep 2004 22:47:02 +0000 Subject: Hoist the code for handling "-G" into a common module. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11956 f5534014-38df-0310-8fa8-9805f1628bb7 --- gtk/main.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'gtk') diff --git a/gtk/main.c b/gtk/main.c index 0e40200738..0c30b5b59b 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -98,6 +98,7 @@ #include "../ui_util.h" /* beware: ui_util.h exists twice! */ #include "tap.h" #include "util.h" +#include "clopts_common.h" #include "version_info.h" #include "capture.h" #include "merge.h" @@ -1669,26 +1670,7 @@ main(int argc, char *argv[]) to specify the information to dump; arguments after that will not be used. */ - if (argc >= 2 && strcmp(argv[1], "-G") == 0) { - if (argc == 2) - proto_registrar_dump_fields(1); - else { - if (strcmp(argv[2], "fields") == 0) - proto_registrar_dump_fields(1); - else if (strcmp(argv[2], "fields2") == 0) - proto_registrar_dump_fields(2); - else if (strcmp(argv[2], "protocols") == 0) - proto_registrar_dump_protocols(); - else if (strcmp(argv[2], "values") == 0) - proto_registrar_dump_values(); - else { - fprintf(stderr, "ethereal: Invalid \"%s\" option for -G flag\n", - argv[2]); - exit(1); - } - } - exit(0); - } + handle_dashG_option(argc, argv, "ethereal"); /* multithread support currently doesn't seem to work in win32 gtk2.0.6 */ #if ! defined WIN32 && GTK_MAJOR_VERSION >= 2 && defined G_THREADS_ENABLED && defined USE_THREADS -- cgit v1.2.3