]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: omit OPTION section in 'virsh help' if no option exists
authorZhang Xiaohe <zhangxh@cn.fujitsu.com>
Wed, 22 May 2013 03:15:45 +0000 (11:15 +0800)
committerEric Blake <eblake@redhat.com>
Wed, 22 May 2013 22:17:24 +0000 (16:17 -0600)
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>
tools/virsh.c

index ecb7bd4e65c6a908fdfeb6f80637aa91e8d1ec79..6f0c1ef7dc1ff255b1ccfb7860e2f2d9a1685367 100644 (file)
@@ -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++) {