From c0955c320609588c7caab3f237d28ef0e8802f92 Mon Sep 17 00:00:00 2001 From: Zhang Xiaohe Date: Wed, 22 May 2013 11:15:45 +0800 Subject: [PATCH] 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 --- tools/virsh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++) { -- GitLab