diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-05-31 08:41:32 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-05-31 08:41:32 +0000 |
commit | 0d1fb8c1080c0ce1ee258bfea8630944e883a1ca (patch) | |
tree | f23433c295ff73960aec57281a0ff7dca4c60c68 /tethereal.c | |
parent | 8a429808e7bb66fafccda23c5c0a11b8e1af0941 (diff) | |
download | wireshark-0d1fb8c1080c0ce1ee258bfea8630944e883a1ca.tar.gz wireshark-0d1fb8c1080c0ce1ee258bfea8630944e883a1ca.tar.bz2 wireshark-0d1fb8c1080c0ce1ee258bfea8630944e883a1ca.zip |
Make "-q" suppress packet printing when you're reading a capture file
and not writing to another capture file, for use with "-z" options.
Note that "-z proto" *doesn't* print statistics at the end - it modifies
the packet summary output.
Note that on at least some BSDs the "status" character is set to "off"
by default, so you have to set it explicitly in order to be able to ^T
an application such as Tethereal.
svn path=/trunk/; revision=11038
Diffstat (limited to 'tethereal.c')
-rw-r--r-- | tethereal.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tethereal.c b/tethereal.c index 12e3369ff5..c672e981a0 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.240 2004/05/31 07:52:27 guy Exp $ + * $Id: tethereal.c,v 1.241 2004/05/31 08:41:32 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1312,11 +1312,16 @@ main(int argc, char *argv[]) ld.output_to_pipe = FALSE; #endif if (cfile.save_file != NULL) { + /* We're writing to a capture file. */ if (strcmp(cfile.save_file, "-") == 0) { - /* stdout */ + /* Write to the standard output. */ g_free(cfile.save_file); cfile.save_file = g_strdup(""); #ifdef HAVE_LIBPCAP + /* XXX - should we check whether it's a pipe? It's arguably + silly to do "-w - >output_file" rather than "-w output_file", + but by not checking we might be violating the Principle Of + Least Astonishment. */ ld.output_to_pipe = TRUE; #endif } @@ -1343,8 +1348,10 @@ main(int argc, char *argv[]) } #endif } else { - /* We're not writing to a file, so we should print packet information. */ - print_packet_info = TRUE; + /* We're not writing to a file, so we should print packet information + unless "-q" was specified. */ + if (!quiet) + print_packet_info = TRUE; } #ifndef HAVE_LIBPCAP |