From 2ef47f9ccb08352098067b8d60690fca56ada2d4 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 20 Sep 2000 08:28:54 +0000 Subject: [PATCH] Give Tethereal a "-l" flag, as tcpdump has, to make the standard output line-buffered. svn path=/trunk/; revision=2451 --- doc/tethereal.pod.template | 9 +++++++++ tethereal.c | 11 +++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/tethereal.pod.template b/doc/tethereal.pod.template index ffc8e8904c..baace15209 100644 --- a/doc/tethereal.pod.template +++ b/doc/tethereal.pod.template @@ -11,6 +11,7 @@ S<[ B<-f> filter expression ]> S<[ B<-F> file format ]> S<[ B<-h> ]> S<[ B<-i> interface ]> +S<[ B<-l> ]> S<[ B<-n> ]> S<[ B<-o> preference setting ] ...> S<[ B<-p> ]> @@ -125,6 +126,14 @@ there are any non-loopback interfaces, and choosing the first loopback interface if there are no non-loopback interfaces; if there are no interfaces, B reports an error and doesn't start the capture. +=item -l + +Make the standard output line buffered. This may be useful when piping +the output of B to another program, as it means that the +program to which the output is piped will see lines of output as soon as +B generates those lines, rather than seeing them only when +the standard output buffer containing those lines fills up. + =item -n Disables network object name resolution (such as hostname, TCP and UDP port diff --git a/tethereal.c b/tethereal.c index 611ed2bbe6..ae58baec1d 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.46 2000/09/15 05:32:19 guy Exp $ + * $Id: tethereal.c,v 1.47 2000/09/20 08:28:43 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -136,12 +136,12 @@ print_usage(void) fprintf(stderr, "This is GNU t%s %s, compiled with %s\n", PACKAGE, VERSION, comp_info_str); #ifdef HAVE_LIBPCAP - fprintf(stderr, "t%s [ -vVhp ] [ -c count ] [ -f ]\n", PACKAGE); + fprintf(stderr, "t%s [ -vVhlp ] [ -c count ] [ -f ]\n", PACKAGE); fprintf(stderr, "\t[ -F ] [ -i interface ] [ -n ]\n"); fprintf(stderr, "\t[ -o ] ... [ -r infile ] [ -R ]\n"); fprintf(stderr, "\t[ -s snaplen ] [ -t