ip: use print_nl() to handle one line mode
The helper function print_nl() does the right thing and prints the newline or backslash. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
970db267a0
commit
f4d7ce9bfa
|
|
@ -1633,7 +1633,8 @@ static int show_handler(struct rtnl_ctrl_data *ctrl,
|
||||||
struct ifaddrmsg *ifa = NLMSG_DATA(n);
|
struct ifaddrmsg *ifa = NLMSG_DATA(n);
|
||||||
|
|
||||||
open_json_object(NULL);
|
open_json_object(NULL);
|
||||||
print_int(PRINT_ANY, "index", "if%d:\n", ifa->ifa_index);
|
print_int(PRINT_ANY, "index", "if%d:", ifa->ifa_index);
|
||||||
|
print_nl();
|
||||||
print_addrinfo(n, stdout);
|
print_addrinfo(n, stdout);
|
||||||
close_json_object();
|
close_json_object();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue