mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 05:45:46 +00:00
vsh: Extract vshCmddefCheckInternals from vshCmddefOptParse
Originally introduced by commit 2432521e
which correctly split
vshCmddefOptParse into command's options validation and options parsing.
However, command's 'internals' are not tied solely to .options, rather it
should be about the overall structure, therefore the validation should be
extracted from vshCmddefOptParse and performed only within our test suite, i.e.
in vshSelfTest.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
9b86282ecd
commit
3a9808b216
@ -428,9 +428,6 @@ static int
|
||||
vshCmddefOptParse(const vshCmdDef *cmd, uint64_t *opts_need_arg,
|
||||
uint64_t *opts_required)
|
||||
{
|
||||
if (vshCmddefCheckInternals(cmd) < 0)
|
||||
return -1;
|
||||
|
||||
if (vshCmddefOptFill(cmd, opts_need_arg, opts_required) < 0)
|
||||
return -1;
|
||||
|
||||
@ -3362,7 +3359,7 @@ cmdSelfTest(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
|
||||
if (def->flags & VSH_CMD_FLAG_ALIAS)
|
||||
continue;
|
||||
|
||||
if (!vshCmddefHelp(ctl, def->name))
|
||||
if (vshCmddefCheckInternals(def) < 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user