diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-09-10 22:47:02 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-09-10 22:47:02 +0000 |
commit | 542f4dc1802158a828ad0a170ba0eff9ad20fbd5 (patch) | |
tree | 320ef58fef7f6bcfc6d6b00c4bdc343667acb060 /gtk | |
parent | 70a5a2b8a5563350ea9dd28e0ad11c544c84f2c6 (diff) |
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
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/main.c | 22 |
1 files changed, 2 insertions, 20 deletions
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 |