提交 3a9808b2 编写于 作者: E Erik Skultety

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: NErik Skultety <eskultet@redhat.com>
上级 9b86282e
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册