mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 13:47:13 +03:00
tools: vshCmddefHelp: Don't call vshCmddefOptParse
The help formatter called vshCmddefOptParse just for validation purposes. Since vshCmddefOptParse no longer validates the command itself and we don't need the bitmaps returned by it we can drop the call entirely. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
cd0602290a
commit
fde5b4cf9d
12
tools/vsh.c
12
tools/vsh.c
@ -606,20 +606,12 @@ vshCmdGrpHelp(vshControl *ctl, const vshCmdGrp *grp)
|
||||
}
|
||||
|
||||
static bool
|
||||
vshCmddefHelp(vshControl *ctl, const vshCmdDef *def)
|
||||
vshCmddefHelp(const vshCmdDef *def)
|
||||
{
|
||||
const char *desc = NULL;
|
||||
char buf[256];
|
||||
uint64_t opts_need_arg;
|
||||
uint64_t opts_required;
|
||||
bool shortopt = false; /* true if 'arg' works instead of '--opt arg' */
|
||||
|
||||
if (vshCmddefOptParse(def, &opts_need_arg, &opts_required)) {
|
||||
vshError(ctl, _("internal error: bad options in command: '%s'"),
|
||||
def->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs(_(" NAME\n"), stdout);
|
||||
fprintf(stdout, " %s - %s\n", def->name,
|
||||
_(vshCmddefGetInfo(def, "help")));
|
||||
@ -3113,7 +3105,7 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd)
|
||||
if ((def = vshCmddefSearch(name))) {
|
||||
if (def->flags & VSH_CMD_FLAG_ALIAS)
|
||||
def = vshCmddefSearch(def->alias);
|
||||
return vshCmddefHelp(ctl, def);
|
||||
return vshCmddefHelp(def);
|
||||
} else if ((grp = vshCmdGrpSearch(name))) {
|
||||
return vshCmdGrpHelp(ctl, grp);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user