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:
Zhang Xiaohe 2013-05-22 11:15:45 +08:00 committed by Eric Blake
parent 6ac6f59c98
commit c0955c3206

View 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++) {