提交 c0955c32 编写于 作者: Z Zhang Xiaohe 提交者: Eric Blake

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: NZhang Xiaohe <zhangxh@cn.fujitsu.com>
Reported-by: NLi Yang <liyang.fnst@cn.fujitsu.com>
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 6ac6f59c
......@@ -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++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册