As a preparatory step for supporting the NO_COLOR environment
variable, replace the direct use of CONF_COLOR with a
default_color_opt() function which initially returns CONF_COLOR.
Signed-off-by: Ben Hutchings <benh@debian.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
int
main(int argc, char **argv)
{
- int color = CONF_COLOR;
+ int color = default_color_opt();
while (argc > 1) {
const char *opt = argv[1];
COLOR_OPT_ALWAYS = 2
};
+int default_color_opt(void);
bool check_enable_color(int color, int json);
bool matches_color(const char *arg, int *val);
int color_fprintf(FILE *fp, enum color_attr attr, const char *fmt, ...);
const char *libbpf_version;
char *batch_file = NULL;
char *basename;
- int color = CONF_COLOR;
+ int color = default_color_opt();
/* to run vrf exec without root, capabilities might be set, drop them
* if not needed as the first thing.
set_color_palette();
}
+int default_color_opt(void)
+{
+ return CONF_COLOR;
+}
+
bool check_enable_color(int color, int json)
{
if (json || color == COLOR_OPT_NEVER)
{
const char *libbpf_version;
char *batch_file = NULL;
- int color = CONF_COLOR;
+ int color = default_color_opt();
int ret;
while (argc > 1) {