diff options
author | David Lamparter <equinox@diac24.net> | 2019-08-08 20:04:52 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2020-05-26 19:09:32 +0200 |
commit | 309414434b28b97be71aeb758c44a6fa1e92f657 (patch) | |
tree | ae3018435f8e86e086cb0e3cf1d2cc2d02974ca1 /vtysh | |
parent | vtysh: throw mark output on stdout, not stderr (diff) | |
download | frr-309414434b28b97be71aeb758c44a6fa1e92f657.tar.xz frr-309414434b28b97be71aeb758c44a6fa1e92f657.zip |
vtysh: add "no-header" to show running-config
... to skip the "Building configuration..." header that gets in the way
of automated processing.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'vtysh')
-rw-r--r-- | vtysh/vtysh.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 4a03b4ffd..29e0842da 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -2845,17 +2845,22 @@ DEFUNSH(VTYSH_ALL, no_vtysh_config_enable_password, DEFUN (vtysh_write_terminal, vtysh_write_terminal_cmd, - "write terminal ["DAEMONS_LIST"]", + "write terminal ["DAEMONS_LIST"] [no-header]", "Write running configuration to memory, network, or terminal\n" "Write to terminal\n" - DAEMONS_STR) + DAEMONS_STR + "Skip \"Building configuration...\" header\n") { unsigned int i; char line[] = "do write terminal\n"; - vty_out(vty, "Building configuration...\n"); - vty_out(vty, "\nCurrent configuration:\n"); - vty_out(vty, "!\n"); + if (!strcmp(argv[argc - 1]->arg, "no-header")) + argc--; + else { + vty_out(vty, "Building configuration...\n"); + vty_out(vty, "\nCurrent configuration:\n"); + vty_out(vty, "!\n"); + } for (i = 0; i < array_size(vtysh_client); i++) if ((argc < 3) @@ -2874,10 +2879,11 @@ DEFUN (vtysh_write_terminal, DEFUN (vtysh_show_running_config, vtysh_show_running_config_cmd, - "show running-config ["DAEMONS_LIST"]", + "show running-config ["DAEMONS_LIST"] [no-header]", SHOW_STR "Current operating configuration\n" - DAEMONS_STR) + DAEMONS_STR + "Skip \"Building configuration...\" header\n") { return vtysh_write_terminal(self, vty, argc, argv); } |