Rather than complain and quit if -V is missing when -O <protocols> is used, do the...
authorChris Maynard <Christopher.Maynard@GTECH.COM>
Wed, 28 Sep 2011 14:50:07 +0000 (14:50 -0000)
committerChris Maynard <Christopher.Maynard@GTECH.COM>
Wed, 28 Sep 2011 14:50:07 +0000 (14:50 -0000)
svn path=/trunk/; revision=39175

doc/tshark.pod
tshark.c

index a520729416d4eb709349e5f602fbbb0abdf59ee7..8724f2c9438582bb34f33a53eacc890d1c99b39a 100644 (file)
@@ -90,10 +90,10 @@ pane in B<Wireshark>), although if it's writing packets as it captures
 them, rather than writing packets from a saved capture file, it won't
 show the "frame number" field.  If the B<-V> option is specified, it
 writes instead a view of the details of the packet, showing all the
-fields of all protocols in the packet.  If the B<-O> option is
-specified in combination with B<-V>, it will only show the full
-protocols specified.  Use the output of "tshark -G protocols" to
-find the abbreviations of the protocols you can specify.
+fields of all protocols in the packet.  If the B<-O> option is specified,
+it will only show the full protocols specified.  Use the output of
+"B<tshark -G protocols>" to find the abbreviations of the protocols you can
+specify.
 
 If you want to write the decoded form of packets to a file, run
 B<TShark> without the B<-w> option, and redirect its standard output to
@@ -538,6 +538,13 @@ form I<prefname>B<:>I<value>, where I<prefname> is the name of the
 preference (which is the same name that would appear in the preference
 file), and I<value> is the value to which it should be set.
 
+=item -O  E<lt>protocolsE<gt>
+
+Similar to the B<-V> option, but causes B<TShark> to only show a detailed view
+of the comma-separated list of I<protocols> specified, rather than a detailed
+view of all protocols.  Use the output of "B<tshark -G protocols>" to find the
+abbreviations of the protocols you can specify.
+
 =item -p
 
 I<Don't> put the interface into promiscuous mode.  Note that the
index 2f4ecb4fb9cd316002faedda5c47e6345d0bfa67..1697fd8f737c63717c94235d4c426cb1893ded0e 100644 (file)
--- a/tshark.c
+++ b/tshark.c
@@ -1235,9 +1235,6 @@ main(int argc, char *argv[])
         break;
       }
       break;
-    case 'O':        /* Only output these protocols */
-      output_only = g_strdup(optarg);
-      break;
     case 'q':        /* Quiet */
       quiet = TRUE;
       break;
@@ -1328,6 +1325,9 @@ main(int argc, char *argv[])
       return 0;
       break;
     }
+    case 'O':        /* Only output these protocols */
+      output_only = g_strdup(optarg);
+      /* FALLTHROUGH */
     case 'V':        /* Verbose */
       verbose = TRUE;
       /*  The user asked for a verbose output, so let's ensure they get it,