]> git.proxmox.com Git - mirror_iproute2.git/commit
lib: json_print: Add print_on_off()
authorPetr Machata <me@pmachata.org>
Thu, 12 Nov 2020 22:24:40 +0000 (23:24 +0100)
committerDavid Ahern <dsahern@gmail.com>
Sat, 14 Nov 2020 02:43:15 +0000 (19:43 -0700)
commit9091ff0251f8da256d55ca4e994dbd14e32d08ad
tree389db47e481b025ff037ebbfb95bb5f777895bc4
parent82604d28525aae8d9c5206d5c1d70aee88a7d960
lib: json_print: Add print_on_off()

The value of a number of booleans is shown as "on" and "off" in the plain
output, and as an actual boolean in JSON mode. Add a function that does
that.

RDMA tool already uses a function named print_on_off(). This function
always shows "on" and "off", even in JSON mode. Since there are probably
very few if any consumers of this interface at this point, migrate it to
the new central print_on_off() as well.

Signed-off-by: Petr Machata <me@pmachata.org>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
include/json_print.h
lib/json_print.c
rdma/dev.c
rdma/rdma.h
rdma/res-cq.c
rdma/utils.c