mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-15 14:05:22 +08:00
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@redhat.com> Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
parent
5e704f4b5b
commit
b5d0273fdb
@ -23,7 +23,6 @@ int preferred_family = AF_UNSPEC;
|
|||||||
int oneline;
|
int oneline;
|
||||||
int show_stats;
|
int show_stats;
|
||||||
int show_details;
|
int show_details;
|
||||||
static int color;
|
|
||||||
int compress_vlans;
|
int compress_vlans;
|
||||||
int json;
|
int json;
|
||||||
int timestamp;
|
int timestamp;
|
||||||
@ -103,6 +102,8 @@ static int batch(const char *name)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
int color = CONF_COLOR;
|
||||||
|
|
||||||
while (argc > 1) {
|
while (argc > 1) {
|
||||||
const char *opt = argv[1];
|
const char *opt = argv[1];
|
||||||
|
|
||||||
|
2
ip/ip.c
2
ip/ip.c
@ -168,7 +168,7 @@ int main(int argc, char **argv)
|
|||||||
const char *libbpf_version;
|
const char *libbpf_version;
|
||||||
char *batch_file = NULL;
|
char *batch_file = NULL;
|
||||||
char *basename;
|
char *basename;
|
||||||
int color = 0;
|
int color = CONF_COLOR;
|
||||||
|
|
||||||
/* to run vrf exec without root, capabilities might be set, drop them
|
/* to run vrf exec without root, capabilities might be set, drop them
|
||||||
* if not needed as the first thing.
|
* if not needed as the first thing.
|
||||||
|
2
tc/tc.c
2
tc/tc.c
@ -35,7 +35,6 @@ int use_iec;
|
|||||||
int force;
|
int force;
|
||||||
bool use_names;
|
bool use_names;
|
||||||
int json;
|
int json;
|
||||||
int color;
|
|
||||||
int oneline;
|
int oneline;
|
||||||
int brief;
|
int brief;
|
||||||
|
|
||||||
@ -254,6 +253,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
const char *libbpf_version;
|
const char *libbpf_version;
|
||||||
char *batch_file = NULL;
|
char *batch_file = NULL;
|
||||||
|
int color = CONF_COLOR;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
while (argc > 1) {
|
while (argc > 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user