diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-09-10 22:47:02 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-09-10 22:47:02 +0000 |
commit | 8e90f07c710e30d5949e2258a46f338482ac3e55 (patch) | |
tree | 320ef58fef7f6bcfc6d6b00c4bdc343667acb060 /tethereal.c | |
parent | b16cec7ef22e477406bf1366e192d6aa30a11516 (diff) | |
download | wireshark-8e90f07c710e30d5949e2258a46f338482ac3e55.tar.gz |
Hoist the code for handling "-G" into a common module.
svn path=/trunk/; revision=11956
Diffstat (limited to 'tethereal.c')
-rw-r--r-- | tethereal.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/tethereal.c b/tethereal.c index 00ca36df98..eefb2778d0 100644 --- a/tethereal.c +++ b/tethereal.c @@ -88,6 +88,7 @@ #include "print.h" #include <epan/addr_resolv.h> #include "util.h" +#include "clopts_common.h" #include "version_info.h" #ifdef HAVE_LIBPCAP #include "pcap-util.h" @@ -873,26 +874,7 @@ main(int argc, char *argv[]) We do this here to mirror what happens in the GTK+ version, although it's not necessary here. */ - 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, "tethereal: Invalid \"%s\" option for -G flag\n", - argv[2]); - exit(1); - } - } - exit(0); - } + handle_dashG_option(argc, argv, "tethereal"); /* Set the C-language locale to the native environment. */ setlocale(LC_ALL, ""); |