Re: [PATCH iproute2-next v2 03/11] lib: utils: Add print_on_off_bool()
From: Petr Machata <hidden>
Date: 2020-10-31 21:25:15
From: Petr Machata <hidden>
Date: 2020-10-31 21:25:15
Stephen Hemminger [off-list ref] writes:
On Fri, 30 Oct 2020 13:29:50 +0100 Petr Machata [off-list ref] wrote:quoted
+void print_on_off_bool(FILE *fp, const char *flag, bool val) +{ + if (is_json_context()) + print_bool(PRINT_JSON, flag, NULL, val); + else + fprintf(fp, "%s %s ", flag, val ? "on" : "off"); +}Please use print_string(PRINT_FP for non json case. I am use fprintf(fp as indicator for code that has not been already converted to JSON. And passing the FILE *fp is also indication of old code. Original iproute2 passed it around but it was always stdout.
Ack, will fix.