[ovs-git] [openvswitch/ovs] 20174b: ovs-ofctl: Add option for color output to dump-flo...

GitHub noreply at github.com
Fri Mar 18 21:03:09 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 20174b74619bfe85fa8e4948a368e3600b557412
      https://github.com/openvswitch/ovs/commit/20174b74619bfe85fa8e4948a368e3600b557412
  Author: Quentin Monnet <quentin.monnet at 6wind.com>
  Date:   2016-03-18 (Fri, 18 Mar 2016)

  Changed paths:
    M AUTHORS
    M lib/util.c
    M lib/util.h
    M utilities/ovs-ofctl.c

  Log Message:
  -----------
  ovs-ofctl: Add option for color output to dump-flows command.

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.

Examples:
This first call will output colorized flows:

    ovs-ofctl dump-flows br0 --color=always

These two calls will produce colorized output on a tty, but they will
not use color markers if the output is redirected to a file or piped
into another command:

    ovs-ofctl dump-flows br0 --color=auto
    ovs-ofctl dump-flows br0 --color

These two calls will not use color markers:

    ovs-ofctl dump-flows br0 --color=never
    ovs-ofctl dump-flows br0

The result of this option is stored into a variable which is to be
forwarded (in next commits) as a function argument until it reaches the
functions that print the elements of the flows.

Signed-off-by: Quentin Monnet <quentin.monnet at 6wind.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: ef7b593bdd86ce9976aff3a7de985ad7dbae7ae4
      https://github.com/openvswitch/ovs/commit/ef7b593bdd86ce9976aff3a7de985ad7dbae7ae4
  Author: Quentin Monnet <quentin.monnet at 6wind.com>
  Date:   2016-03-18 (Fri, 18 Mar 2016)

  Changed paths:
    M lib/automake.mk
    A lib/colors.c
    A lib/colors.h
    M utilities/ovs-ofctl.c

  Log Message:
  -----------
  ovs-ofctl: Declare / set up colors for command output.

OVS_COLORS environment variable is parsed to extract user-defined
preferences regarding colors (this is used to set up a color theme, not
to replace the `--color` option for activating color output).

The string should be of a format similar to LS_COLORS or GREP_COLORS,
with available colors being as follows:

* ac: action field
* dr: drop keyword
* le: learn keyword
* pm: parameters receiving attributes
* pr: keyword having parenthesis
* sp: some special keywords
* vl: lone values with no parameter name

For color whose idendifier does not appear in the string, the default
hardcoded value is used instead.

As an example, setting OVS_COLORS to the following string is equivalent
to using the default values:

    OVS_COLORS="ac:01;31:dr=34:le=31:pm=36:pr=35:sp=33:vl=32"

Signed-off-by: Quentin Monnet <quentin.monnet at 6wind.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: ab8e7f7db9fae70af44cec4daf3f3e5b9cdc4de8
      https://github.com/openvswitch/ovs/commit/ab8e7f7db9fae70af44cec4daf3f3e5b9cdc4de8
  Author: Quentin Monnet <quentin.monnet at 6wind.com>
  Date:   2016-03-18 (Fri, 18 Mar 2016)

  Changed paths:
    M lib/ofp-print.c

  Log Message:
  -----------
  ovs-ofctl: Add output colors for flow attributes.

This commit adds colors to the “left part” of printed flows (to flow
properties that are always present: `cookie`, `table`, timeouts, etc.).

Signed-off-by: Quentin Monnet <quentin.monnet at 6wind.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 0deec6d26106c881e265e90a301d7975ffc06eab
      https://github.com/openvswitch/ovs/commit/0deec6d26106c881e265e90a301d7975ffc06eab
  Author: Quentin Monnet <quentin.monnet at 6wind.com>
  Date:   2016-03-18 (Fri, 18 Mar 2016)

  Changed paths:
    M lib/flow.c
    M lib/match.c

  Log Message:
  -----------
  match: Color output of match conditions for ovs-ofctl dump-flows.

Add color output for flow match conditions for ovs-ofctl dump-flows
command utility, by inserting color markers in the functions responsible
for printing those match condictions.

Signed-off-by: Quentin Monnet <quentin.monnet at 6wind.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: b1c5bf1f39d32ed4c6dc5b752d17e0cd12b924e8
      https://github.com/openvswitch/ovs/commit/b1c5bf1f39d32ed4c6dc5b752d17e0cd12b924e8
  Author: Quentin Monnet <quentin.monnet at 6wind.com>
  Date:   2016-03-18 (Fri, 18 Mar 2016)

  Changed paths:
    M lib/bundle.c
    M lib/learn.c
    M lib/multipath.c
    M lib/nx-match.c
    M lib/ofp-actions.c

  Log Message:
  -----------
  ofp-actions: Color output of flow actions for ovs-ofctl dump-flows.

Add color output for flow actions for ovs-ofctl dump-flows command
utility, by inserting color markers in the functions responsible for
printing those actions.

Signed-off-by: Quentin Monnet <quentin.monnet at 6wind.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: e7019d994e9f2a7ec3354d318e2ce77fdb961ceb
      https://github.com/openvswitch/ovs/commit/e7019d994e9f2a7ec3354d318e2ce77fdb961ceb
  Author: Quentin Monnet <quentin.monnet at 6wind.com>
  Date:   2016-03-18 (Fri, 18 Mar 2016)

  Changed paths:
    M lib/automake.mk
    A lib/colors.man
    M manpages.mk
    M utilities/ovs-ofctl.8.in

  Log Message:
  -----------
  ovs-ofctl: Update manpage for --color option.

Document the `--color` option for ovs-ofctl in its manpage. The option
documentation has been added into a new file (included into the
manpage) so that it can easily be added to other manpages as well when
support for colorized output is extended to other utilities.

The use of the environment variable OVS_COLORS (used for user-defined
colors) has been documented as well.

Signed-off-by: Quentin Monnet <quentin.monnet at 6wind.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 8743fa8cb61b1672cc506d515efd5703e3795c23
      https://github.com/openvswitch/ovs/commit/8743fa8cb61b1672cc506d515efd5703e3795c23
  Author: Quentin Monnet <quentin.monnet at 6wind.com>
  Date:   2016-03-18 (Fri, 18 Mar 2016)

  Changed paths:
    M NEWS

  Log Message:
  -----------
  NEWS: Update (--color option for ovs-ofctl).

Signed-off-by: Quentin Monnet <quentin.monnet at 6wind.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/3e76999536ec...8743fa8cb61b


More information about the git mailing list