From: Zhang Xiaohe Date: Wed, 22 May 2013 03:15:45 +0000 (+0800) Subject: virsh: omit OPTION section in 'virsh help' if no option exists X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c0955c320609588c7caab3f237d28ef0e8802f92;p=libvirt.git 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 Reported-by: Li Yang Signed-off-by: Eric Blake --- diff --git a/tools/virsh.c b/tools/virsh.c index ecb7bd4e65..6f0c1ef7dc 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -1268,7 +1268,7 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname) fprintf(stdout, " %s\n", _(desc)); } - if (def->opts) { + if (def->opts && def->opts->name) { const vshCmdOptDef *opt; fputs(_("\n OPTIONS\n"), stdout); for (opt = def->opts; opt->name; opt++) {