return 0;
}
-static void vtysh_pager_envdef(void)
+static void vtysh_pager_envdef(bool fallback)
{
char *pager_defined;
if (pager_defined)
vtysh_pager_name = strdup(pager_defined);
- else
+ else if (fallback)
vtysh_pager_name = strdup(VTYSH_PAGER);
}
vtysh_pager_name = NULL;
if (strcmp(argv[0]->text, "no"))
- vtysh_pager_envdef();
+ vtysh_pager_envdef(true);
return CMD_SUCCESS;
}
if (!strcmp(argv[0]->text, "no") || !strcmp(argv[1]->text, "no")) {
/* "terminal no length" = use VTYSH_PAGER */
- vtysh_pager_envdef();
+ vtysh_pager_envdef(true);
return CMD_SUCCESS;
}
vty_out(vty,
"%% The \"terminal length\" command is deprecated and its value is ignored.\n"
"%% Please use \"terminal paginate\" instead with OS TTY length handling.\n");
- vtysh_pager_envdef();
+ vtysh_pager_envdef(true);
}
return CMD_SUCCESS;
/* set default output */
vty->of = stdout;
+ vtysh_pager_envdef(false);
/* Initialize commands. */
cmd_init(0);
/* "write memory" command. */
install_element(ENABLE_NODE, &vtysh_write_memory_cmd);
+ install_element(CONFIG_NODE, &vtysh_terminal_paginate_cmd);
install_element(VIEW_NODE, &vtysh_terminal_paginate_cmd);
install_element(VIEW_NODE, &vtysh_terminal_length_cmd);
install_element(VIEW_NODE, &vtysh_terminal_no_length_cmd);