Change-Id: I12311be8ebd376b8aeac25364d010d70a85c7874
Signed-off-by: Dave Barach <dave@barachs.net>
static int
q_or_quit (vat_main_t * vam)
{
static int
q_or_quit (vat_main_t * vam)
{
+#if VPP_API_TEST_BUILTIN == 0
longjmp (vam->jump_buf, 1);
longjmp (vam->jump_buf, 1);
return 0; /* not so much */
}
return 0; /* not so much */
}
/* Split input into cmd + args */
this_cmd = cmdp = vam->inbuf;
/* Split input into cmd + args */
this_cmd = cmdp = vam->inbuf;
+ /* Skip leading whitespace */
while (cmdp < (this_cmd + vec_len (this_cmd)))
{
if (*cmdp == ' ' || *cmdp == '\t' || *cmdp == '\n')
while (cmdp < (this_cmd + vec_len (this_cmd)))
{
if (*cmdp == ' ' || *cmdp == '\t' || *cmdp == '\n')
+
+ /* Advance past the command */
while (argsp < (this_cmd + vec_len (this_cmd)))
{
while (argsp < (this_cmd + vec_len (this_cmd)))
{
- if (*argsp != ' ' && *argsp != '\t' && *argsp != '\n')
+ if (*argsp != ' ' && *argsp != '\t' && *argsp != '\n' && argsp != 0)
{
argsp++;
}
else
break;
}
{
argsp++;
}
else
break;
}
+ /* NULL terminate the command */
*argsp++ = 0;
while (argsp < (this_cmd + vec_len (this_cmd)))
*argsp++ = 0;
while (argsp < (this_cmd + vec_len (this_cmd)))
VLIB_CLI_COMMAND (api_command, static) =
{
.path = "binary-api",
VLIB_CLI_COMMAND (api_command, static) =
{
.path = "binary-api",
- .short_help = "binary-api <name> [<args>]",
+ .short_help = "binary-api [help] <name> [<args>]",
.function = api_command_fn,
};
/* *INDENT-ON* */
.function = api_command_fn,
};
/* *INDENT-ON* */