[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ccc21b33a1a338bc943ac5d0fb40a5bb7ad5fa43.1694625043.git.aclaudi@redhat.com>
Date: Wed, 13 Sep 2023 19:58:26 +0200
From: Andrea Claudi <aclaudi@...hat.com>
To: netdev@...r.kernel.org
Cc: Roopa Prabhu <roopa@...dia.com>,
Nikolay Aleksandrov <razor@...ckwall.org>,
bridge@...ts.linux-foundation.org,
Stephen Hemminger <stephen@...workplumber.org>,
David Ahern <dsahern@...il.com>
Subject: [PATCH iproute2-next 2/2] treewide: use configured value as the default color output
With Makefile providing -DCONF_COLOR, we can use its value as the
default color output.
This effectively allow users and packagers to define a default for the
color output feature without using shell aliases, and with minimum code
impact.
Signed-off-by: Andrea Claudi <aclaudi@...hat.com>
---
bridge/bridge.c | 3 ++-
ip/ip.c | 2 +-
tc/tc.c | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/bridge/bridge.c b/bridge/bridge.c
index 704be50c..339101a8 100644
--- a/bridge/bridge.c
+++ b/bridge/bridge.c
@@ -23,7 +23,6 @@ int preferred_family = AF_UNSPEC;
int oneline;
int show_stats;
int show_details;
-static int color;
int compress_vlans;
int json;
int timestamp;
@@ -103,6 +102,8 @@ static int batch(const char *name)
int
main(int argc, char **argv)
{
+ int color = CONF_COLOR;
+
while (argc > 1) {
const char *opt = argv[1];
diff --git a/ip/ip.c b/ip/ip.c
index 8c046ef1..860ff957 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -168,7 +168,7 @@ int main(int argc, char **argv)
const char *libbpf_version;
char *batch_file = NULL;
char *basename;
- int color = 0;
+ int color = CONF_COLOR;
/* to run vrf exec without root, capabilities might be set, drop them
* if not needed as the first thing.
diff --git a/tc/tc.c b/tc/tc.c
index 25820500..082c6677 100644
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -35,7 +35,6 @@ int use_iec;
int force;
bool use_names;
int json;
-int color;
int oneline;
int brief;
@@ -254,6 +253,7 @@ int main(int argc, char **argv)
{
const char *libbpf_version;
char *batch_file = NULL;
+ int color = CONF_COLOR;
int ret;
while (argc > 1) {
--
2.41.0
Powered by blists - more mailing lists