From: Roi Dayan Date: Mon, 6 Mar 2017 09:06:18 +0000 (+0200) Subject: devlink: Add json and pretty options to help and man X-Git-Tag: v4.11.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=639785ff30042cd5f7fdcd2e761ba1fedd36acac;p=thirdparty%2Fiproute2.git devlink: Add json and pretty options to help and man While at it also fixed missing double dash for long opts. Signed-off-by: Roi Dayan Acked-by: Jiri Pirko --- diff --git a/devlink/devlink.c b/devlink/devlink.c index c357580a5..e90226e48 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -2470,7 +2470,7 @@ static void help(void) { pr_err("Usage: devlink [ OPTIONS ] OBJECT { COMMAND | help }\n" "where OBJECT := { dev | port | sb | monitor }\n" - " OPTIONS := { -V[ersion] | -n[no-nice-names] }\n"); + " OPTIONS := { -V[ersion] | -n[no-nice-names] | -j[json] | -p[pretty] }\n"); } static int dl_cmd(struct dl *dl) diff --git a/man/man8/devlink.8 b/man/man8/devlink.8 index cf0563b90..a480766cb 100644 --- a/man/man8/devlink.8 +++ b/man/man8/devlink.8 @@ -20,19 +20,29 @@ devlink \- Devlink tool .IR OPTIONS " := { " \fB\-V\fR[\fIersion\fR] | \fB\-n\fR[\fIno-nice-names\fR] } +\fB\-j\fR[\fIjson\fR] } +\fB\-p\fR[\fIpretty\fR] } .SH OPTIONS .TP -.BR "\-V" , " -Version" +.BR "\-V" , " --Version" Print the version of the .B devlink utility and exit. .TP -.BR "\-n" , " -no-nice-names" +.BR "\-n" , " --no-nice-names" Turn off printing out nice names, for example netdevice ifnames instead of devlink port identification. +.TP +.BR "\-j" , " --json" +Generate JSON output. + +.TP +.BR "\-p" , " --pretty" +When combined with -j generate a pretty JSON output. + .SS .I OBJECT