From f2233623ea2978359cfa25606950eae6ddf42c7b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 5 Jun 2003 04:47:58 +0000 Subject: From Lionel Ains: "-d" flag for decode-as support in Tethereal. Add a new routine to iterate through all dissector tables, calling a routine for each table, to support having the "-d" code list all dissector tables. Get rid of "dissector_handle_get_dissector_name()"; it was put in there for "-d", but turns out not to be necessary for that. Clean up the usage message a bit (using the convention, adhered to by at least some UNIX utilities, of listing all the flags with no arguments in a single lump, and then listing the ones with arguments individually, and also putting "-v" and "-h" in a separate lump, as Ethereal does). svn path=/trunk/; revision=7788 --- tethereal.c | 289 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 277 insertions(+), 12 deletions(-) (limited to 'tethereal.c') diff --git a/tethereal.c b/tethereal.c index 7a2a0a471e..8dd1dda6f1 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.185 2003/05/16 00:48:26 guy Exp $ + * $Id: tethereal.c,v 1.186 2003/06/05 04:47:57 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -102,6 +102,11 @@ #include "capture-wpcap.h" #endif +/* + * This is the template for the decode as option; it is shared between the + * various functions that output the usage for this parameter. + */ +static const gchar decode_as_arg_template[] = "==,"; static guint32 firstsec, firstusec; static guint32 prevsec, prevusec; static GString *comp_info_str, *runtime_info_str; @@ -222,19 +227,21 @@ print_usage(gboolean print_ver) comp_info_str->str, runtime_info_str->str); } #ifdef HAVE_LIBPCAP - fprintf(stderr, "\nt%s [ -DvVhqSlp ] [ -a ] ...\n", + fprintf(stderr, "\nt%s [ -vh ] [ -DlnpqSVx ] [ -a ] ...\n", PACKAGE); fprintf(stderr, "\t[ -b [:] ] [ -c ]\n"); - fprintf(stderr, "\t[ -f ] [ -F ]\n"); - fprintf(stderr, "\t[ -i ] [ -n ] [ -N ]\n"); - fprintf(stderr, "\t[ -o ] ... [ -r ] [ -R ]\n"); - fprintf(stderr, "\t[ -s ] [ -t