Proposal: add an option to ovs-ofctl utility so as to obtain colorized output in tty, for easier reading. Currently, only the dump-flows command supports colors.
A new `--color` option has been added to ovs-ofctl so as to indicate whether color markers should be used or not. It can be set to `always` (force colors), `never` (no colors) or `auto` (use colors only if output is a tty). If provided without any value, it is the same as `auto`. If the option is not provided at all, colors are disabled by default. An example screenshot of colored output is available at the following address: https://github.com/6WIND/ovs/blob/colors/README-colors.md v2: instead of using only hardcoded colors, it is now possible to define custom colors by using the `OVS_COLORS` environment variable (on the ls or grep tools model). See patch 2/6 (“ovs-ofctl: declare / set up colors for command output”) for more details. This version also splits the two patches of v1 into several smaller patches so as to ease comprehension and review. Quentin Monnet (6): ovs-ofctl: add option for color output to dump-flows command ovs-ofctl: declare / set up colors for command output dynamic-string: define functions to print colored output ovs-ofctl: add output colors for flow attributes match: color output of match conditions for ovs-ofctl dump-flows ofp-actions: color output of flow actions for ovs-ofctl dump-flows lib/automake.mk | 2 + lib/bundle.c | 19 +- lib/bundle.h | 3 +- lib/colors.c | 132 +++++++++++++ lib/colors.h | 36 ++++ lib/dpif-netdev.c | 2 +- lib/dynamic-string.c | 32 ++++ lib/dynamic-string.h | 7 + lib/flow.c | 7 +- lib/flow.h | 3 +- lib/learn.c | 59 ++++-- lib/learn.h | 3 +- lib/learning-switch.c | 2 +- lib/match.c | 288 +++++++++++++++++----------- lib/match.h | 3 +- lib/meta-flow.c | 7 +- lib/multipath.c | 9 +- lib/multipath.h | 3 +- lib/nx-match.c | 18 +- lib/nx-match.h | 9 +- lib/odp-util.c | 6 +- lib/ofp-actions.c | 428 +++++++++++++++++++++++++++--------------- lib/ofp-actions.h | 3 +- lib/ofp-print.c | 98 ++++++---- lib/ofp-print.h | 8 +- lib/vconn.c | 6 +- ofproto/ofproto-dpif-xlate.c | 2 +- ofproto/ofproto-dpif.c | 4 +- ofproto/ofproto.c | 2 +- ovn/controller/ofctrl.c | 12 +- ovn/controller/pinctrl.c | 2 +- tests/test-ovn.c | 2 +- third-party/ofp-tcpdump.patch | 2 +- utilities/ovs-ofctl.c | 101 +++++++--- 34 files changed, 929 insertions(+), 391 deletions(-) create mode 100644 lib/colors.c create mode 100644 lib/colors.h -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev