Tests weren't updated for vtysh-grammar yet...
NB: things still fail since some CLI behaviour changed.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
struct thread_master *master;
int dump_args(struct vty *vty, const char *descr,
- int argc, const char **argv)
+ int argc, struct cmd_token *argv[])
{
int i;
vty_out (vty, "%s with %d args.%s", descr, argc, VTY_NEWLINE);
for (i = 0; i < argc; i++)
{
- vty_out (vty, "[%02d]: %s%s", i, argv[i], VTY_NEWLINE);
+ vty_out (vty, "[%02d]: %s%s", i, argv[i]->arg, VTY_NEWLINE);
}
return CMD_SUCCESS;
extern struct thread_master *master;
extern int dump_args(struct vty *vty, const char *descr,
- int argc, const char **argv);
+ int argc, struct cmd_token *argv[]);
#define DUMMY_HELPSTR \
"00\n01\n02\n03\n04\n05\n06\n07\n08\n09\n" \
DUMMY_DEFUN(cmd1, "arg ipv4m A.B.C.D/M");
DUMMY_DEFUN(cmd2, "arg ipv6 X:X::X:X");
DUMMY_DEFUN(cmd3, "arg ipv6m X:X::X:X/M");
-DUMMY_DEFUN(cmd4, "arg range <5-15>");
-DUMMY_DEFUN(cmd5, "pat a ( a|b)");
-DUMMY_DEFUN(cmd6, "pat b (a|)");
-DUMMY_DEFUN(cmd7, "pat c (a | b|c) A.B.C.D");
+DUMMY_DEFUN(cmd4, "arg range (5-15)");
+DUMMY_DEFUN(cmd5, "pat a < a|b>");
+DUMMY_DEFUN(cmd6, "pat b <a|>");
+DUMMY_DEFUN(cmd7, "pat c <a | b|c> A.B.C.D");
DUMMY_DEFUN(cmd8, "pat d { foo A.B.C.D|bar X:X::X:X| baz }");
DUMMY_DEFUN(cmd9, "pat e [ WORD ]");
DUMMY_DEFUN(cmd10, "pat f [key]");
};
static int
-test_callback(struct cmd_element *cmd, struct vty *vty, int argc, const char *argv[])
+test_callback(const struct cmd_element *cmd, struct vty *vty, int argc, struct cmd_token *argv[])
{
int offset;
int rv;
for (i = 0; i < argc; i++)
{
rv = snprintf(test_buf + offset, sizeof(test_buf) - offset, "%s'%s'",
- (i == 0) ? ": " : ", ", argv[i]);
+ (i == 0) ? ": " : ", ", argv[i]->arg);
if (rv < 0)
abort();
offset += rv;
for (j = 0; j < vector_active(descriptions); j++)
{
struct cmd_token *cmd = vector_slot(descriptions, j);
- printf(" '%s' '%s'\n", cmd->cmd, cmd->desc);
+ printf(" '%s' '%s'\n", cmd->text, cmd->desc);
}
vector_free(descriptions);
}