diff options
author | Quentin Monnet <quentin.monnet@6wind.com> | 2016-03-02 15:56:17 +0100 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-03-18 14:02:41 -0700 |
commit | ef7b593bdd86ce9976aff3a7de985ad7dbae7ae4 (patch) | |
tree | 46f13973989b641a2851f5fecb5aca8f7a43963e /utilities | |
parent | 20174b74619bfe85fa8e4948a368e3600b557412 (diff) | |
download | openvswitch-ef7b593bdd86ce9976aff3a7de985ad7dbae7ae4.tar.gz |
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@6wind.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/ovs-ofctl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index db59ff671..73dc7ea40 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -33,6 +33,7 @@ #include "classifier.h" #include "command-line.h" #include "daemon.h" +#include "colors.h" #include "compiler.h" #include "dirs.h" #include "dynamic-string.h" @@ -363,6 +364,8 @@ parse_options(int argc, char *argv[]) allowed_protocols &= version_protocols; mask_allowed_ofp_versions(ofputil_protocols_to_version_bitmap( allowed_protocols)); + + colors_init(enable_color); } static void |