vam->vlib_main = vm;
vam->my_client_index = (u32) ~ 0;
init_error_string_table (vam);
- vat_api_hookup (vam);
rv = vat_plugin_init (vam);
if (rv)
clib_warning ("vat_plugin_init returned %d", rv);
/* 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')
}
argsp = cmdp;
+
+ /* Advance past the command */
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;
}
+ /* NULL terminate the command */
*argsp++ = 0;
while (argsp < (this_cmd + vec_len (this_cmd)))
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* */