提交 ebb402a7 编写于 作者: E Erik Skultety

vsh: Enforce checking for missing help string

The intention is to move vshCmddefCheckInternals out of vshCmddefOptParse to
our test suite. First step to do that is to enforce checking for an existing
help string (that also means it's non-empty) in a command because a command
without a help is not much of a use.
Signed-off-by: NErik Skultety <eskultet@redhat.com>
上级 b6056cb6
......@@ -328,6 +328,11 @@ static int
vshCmddefCheckInternals(const vshCmdDef *cmd)
{
size_t i;
const char *help = NULL;
/* Each command has to provide a non-empty help string. */
if (!(help = vshCmddefGetInfo(cmd, "help")) || !*help)
return -1;
if (!cmd->opts)
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册