mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh: omit OPTION section in 'virsh help' if no option exists
Don't print 'OPTION' if there's no options. Just behaves as DESCRIPTION does. This mostly affects 'interface' command group. Signed-off-by: Zhang Xiaohe <zhangxh@cn.fujitsu.com> Reported-by: Li Yang <liyang.fnst@cn.fujitsu.com> Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
6ac6f59c98
commit
c0955c3206
@ -1268,7 +1268,7 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
|
|||||||
fprintf(stdout, " %s\n", _(desc));
|
fprintf(stdout, " %s\n", _(desc));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (def->opts) {
|
if (def->opts && def->opts->name) {
|
||||||
const vshCmdOptDef *opt;
|
const vshCmdOptDef *opt;
|
||||||
fputs(_("\n OPTIONS\n"), stdout);
|
fputs(_("\n OPTIONS\n"), stdout);
|
||||||
for (opt = def->opts; opt->name; opt++) {
|
for (opt = def->opts; opt->name; opt++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user