From dc1c13c019523928b49a2caa32d87762ee2d4e08 Mon Sep 17 00:00:00 2001
From: Dinesh Dutt
Date: Tue, 7 May 2019 21:00:34 -0400
Subject: [PATCH 1/2] lib, vtysh: Make archaic "terminal" optional in configure
command
The 'configure terminal' command is a bit redundant, so make
the terminal portion optional.
Signed-off-by: Dinesh Dutt
---
lib/command.c | 2 +-
vtysh/vtysh.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/command.c b/lib/command.c
index b3ef028004..d6fd1fa561 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -1386,7 +1386,7 @@ int config_from_file(struct vty *vty, FILE *fp, unsigned int *line_num)
/* Configuration from terminal */
DEFUN (config_terminal,
config_terminal_cmd,
- "configure terminal",
+ "configure [terminal]",
"Configuration from vty interface\n"
"Configuration terminal\n")
{
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index eff1e996ed..24effa7047 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -502,7 +502,7 @@ static int vtysh_execute_func(const char *line, int pager)
vtysh_execute("exit");
} else if (tried) {
vtysh_execute("end");
- vtysh_execute("configure terminal");
+ vtysh_execute("configure");
}
}
/*
@@ -540,7 +540,7 @@ static int vtysh_execute_func(const char *line, int pager)
if (pager && strncmp(line, "exit", 4))
vty_open_pager(vty);
- if (!strcmp(cmd->string, "configure terminal")) {
+ if (!strcmp(cmd->string, "configure")) {
for (i = 0; i < array_size(vtysh_client); i++) {
cmd_stat = vtysh_client_execute(
&vtysh_client[i], line);
@@ -674,7 +674,7 @@ int vtysh_mark_file(const char *filename)
vty->node = CONFIG_NODE;
vtysh_execute_no_pager("enable");
- vtysh_execute_no_pager("configure terminal");
+ vtysh_execute_no_pager("configure");
vty_buf_copy = XCALLOC(MTYPE_VTYSH_CMD, VTY_BUFSIZ);
while (fgets(vty->buf, VTY_BUFSIZ, confp)) {
@@ -1744,7 +1744,7 @@ DEFUNSH(VTYSH_REALLYALL, vtysh_disable, vtysh_disable_cmd, "disable",
}
DEFUNSH(VTYSH_REALLYALL, vtysh_config_terminal, vtysh_config_terminal_cmd,
- "configure terminal",
+ "configure [terminal]",
"Configuration from vty interface\n"
"Configuration terminal\n")
{
@@ -1786,7 +1786,7 @@ static int vtysh_exit(struct vty *vty)
case BFD_NODE:
case RPKI_NODE:
vtysh_execute("end");
- vtysh_execute("configure terminal");
+ vtysh_execute("configure");
vty->node = CONFIG_NODE;
break;
case BGP_VPNV4_NODE:
From 982589a31a76e2a043f10d7ccbc31cc7183540ca Mon Sep 17 00:00:00 2001
From: Dinesh Dutt
Date: Tue, 7 May 2019 21:03:25 -0400
Subject: [PATCH 2/2] doc: Modify documentation to reflect new configure
changes
This is the document changes to reflect the configure option
making `terminal` optional.
Signed-off-by: Dinesh Dutt
---
doc/user/basic.rst | 4 ++--
doc/user/static.rst | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/user/basic.rst b/doc/user/basic.rst
index 8fbea29ee7..f55b1b9d73 100644
--- a/doc/user/basic.rst
+++ b/doc/user/basic.rst
@@ -287,8 +287,8 @@ Terminal Mode Commands
Write current configuration to configuration file.
-.. index:: configure terminal
-.. clicmd:: configure terminal
+.. index:: configure [terminal]
+.. clicmd:: configure [terminal]
Change to configuration mode. This command is the first step to
configuration.
diff --git a/doc/user/static.rst b/doc/user/static.rst
index 1705b6379e..09bdc9cbea 100644
--- a/doc/user/static.rst
+++ b/doc/user/static.rst
@@ -123,7 +123,7 @@ but this time, the route command will apply to the VRF.
.. code-block:: frr
# case with VRF
- configure terminal
+ configure
vrf r1-cust1
ip route 10.0.0.0/24 10.0.0.2
exit-vrf