On 3 Sep 2025, at 16:26, Aaron Conole via dev wrote:

> There is some confusion about which options can be passed to ovs-tcpdump
> when gathering data.  The interpretation sometimes is that ovs-tcpdump
> only accepts a specific small set of options and discards other options.
> This leads to questions such as, "How can I use '-C' or set the snaplen
> with ovs-tcpdump like tcpdump allows?"  To correct this, print the
> dump_cmd help after the ovs-tcpdump options.
>
> As part of this rework, we delay printing the usage data until after
> all arguments are processed, which allows setting the dumpcmd as well
> for the --help option.
>
> Signed-off-by: Aaron Conole <[email protected]>

Hi Aaron,

I think the patch in general is good, however, the output might end up being 
more confusing. For example:

The following are the 'tcpdump' options:
tcpdump version 4.99.5
libpcap version 1.10.5 (with TPACKET_V3)
OpenSSL 3.2.4 11 Feb 2025
64-bit build, 64-bit time_t
Usage: tcpdump [-AbdDefhHIJKlLnNOpqStuUvxX#] [ -B size ] [ -c count ] [--count]
        [ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]
        [ -i interface ] [ --immediate-mode ] [ -j tstamptype ]
        [ -M secret ] [ --number ] [ --print ] [ -Q in|out|inout ]
        [ -r file ] [ -s snaplen ] [ -T type ] [ --version ]
        [ -V file ] [ -w file ] [ -W filecount ] [ -y datalinktype ]
        [ --time-stamp-precision precision ] [ --micro ] [ --nano ]
        [ -z postrotate-command ] [ -Z user ] [ expression ]


Here, the version info and other metadata appear before the actual usage 
instructions.
Should we perhaps start dumping from “Usage” onwards? Though I’m not sure this 
will work reliably for all tcpdump versions.

Thoughts?

//Eelco

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to