[ovs-dev] [PATCH 3/5] dpctl: Prefer "--more" to indicate verbosity for "ct-stats-show".

Justin Pettit jpettit at ovn.org
Thu Jun 14 19:00:45 UTC 2018


The "ct-stats-show" used the keyword "verbose" to indicate verbosity,
but the more standard way in OVS is to use "-m" or "--more".  This
commit continues to support the keyword method, but adds support for
"-m" and "--more" and documents their use.

Signed-off-by: Justin Pettit <jpettit at ovn.org>
---
 lib/dpctl.c   | 6 ++++--
 lib/dpctl.man | 6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/dpctl.c b/lib/dpctl.c
index f522785a5f97..00f6f9cbead8 100644
--- a/lib/dpctl.c
+++ b/lib/dpctl.c
@@ -1377,16 +1377,18 @@ dpctl_ct_stats_show(int argc, const char *argv[],
     struct ct_dpif_entry cte;
     uint16_t zone, *pzone = NULL;
     int tot_bkts;
-    bool verbose = false;
     int lastargc = 0;
 
     int proto_stats[CT_STATS_MAX];
     int tcp_conn_per_states[CT_DPIF_TCPS_MAX_NUM];
     int error;
 
+    bool verbose = dpctl_p->verbosity;
+
     while (argc > 1 && lastargc != argc) {
         lastargc = argc;
         if (!strncmp(argv[argc - 1], "verbose", 7)) {
+            /* Support "verbose" argument for backwards compatibility. */
             verbose = true;
             argc--;
         } else if (!strncmp(argv[argc - 1], "zone=", 5)) {
@@ -1958,7 +1960,7 @@ static const struct dpctl_command all_commands[] = {
     { "dump-conntrack", "[dp] [zone=N]", 0, 2, dpctl_dump_conntrack, DP_RO },
     { "flush-conntrack", "[dp] [zone=N] [ct-tuple]", 0, 3,
       dpctl_flush_conntrack, DP_RW },
-    { "ct-stats-show", "[dp] [zone=N] [verbose]",
+    { "ct-stats-show", "[dp] [zone=N]",
       0, 3, dpctl_ct_stats_show, DP_RO },
     { "ct-bkts", "[dp] [gt=N]", 0, 2, dpctl_ct_bkts, DP_RO },
     { "ct-set-maxconns", "[dp] maxconns", 1, 2, dpctl_ct_set_maxconns, DP_RW },
diff --git a/lib/dpctl.man b/lib/dpctl.man
index 3a1716fedb6c..51c401c31ae9 100644
--- a/lib/dpctl.man
+++ b/lib/dpctl.man
@@ -240,11 +240,11 @@ An example of an IPv6 TCP \fIct-tuple\fR:
 "ct_ipv6_src=fc00::1,ct_ipv6_dst=fc00::2,ct_nw_proto=6,ct_tp_src=1,ct_tp_dst=2"
 .
 .TP
-\*(DX\fBct\-stats\-show\fR [\fIdp\fR] [\fBzone=\fIzone\fR] [\fBverbose\fR]
+.DO "[\fB\-m\fR | \fB\-\-more\fR]" "\*(DX\fBct\-stats\-show\fR [\fIdp\fR] [\fBzone=\fIzone\fR]"
 Displays the number of connections grouped by protocol used by \fIdp\fR.
 If \fBzone=\fIzone\fR is specified, numbers refer to the connections in
-\fBzone\fR. The \fBverbose\fR option allows to group by connection state
-for each protocol.
+\fBzone\fR.  With \fB\-\-more\fR, groups by connection state for each
+protocol.
 .
 .TP
 \*(DX\fBct\-bkts\fR [\fIdp\fR] [\fBgt=\fIThreshold\fR]
-- 
2.7.4



More information about the dev mailing list