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 <roid@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
This commit is contained in:
Roi Dayan 2017-03-06 11:06:18 +02:00 committed by Stephen Hemminger
parent 51361a9f1c
commit 639785ff30
2 changed files with 13 additions and 3 deletions

View File

@ -2470,7 +2470,7 @@ static void help(void)
{ {
pr_err("Usage: devlink [ OPTIONS ] OBJECT { COMMAND | help }\n" pr_err("Usage: devlink [ OPTIONS ] OBJECT { COMMAND | help }\n"
"where OBJECT := { dev | port | sb | monitor }\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) static int dl_cmd(struct dl *dl)

View File

@ -20,19 +20,29 @@ devlink \- Devlink tool
.IR OPTIONS " := { " .IR OPTIONS " := { "
\fB\-V\fR[\fIersion\fR] | \fB\-V\fR[\fIersion\fR] |
\fB\-n\fR[\fIno-nice-names\fR] } \fB\-n\fR[\fIno-nice-names\fR] }
\fB\-j\fR[\fIjson\fR] }
\fB\-p\fR[\fIpretty\fR] }
.SH OPTIONS .SH OPTIONS
.TP .TP
.BR "\-V" , " -Version" .BR "\-V" , " --Version"
Print the version of the Print the version of the
.B devlink .B devlink
utility and exit. utility and exit.
.TP .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. 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 .SS
.I OBJECT .I OBJECT