aboutsummaryrefslogtreecommitdiffstats
path: root/src/vty
diff options
context:
space:
mode:
Diffstat (limited to 'src/vty')
-rw-r--r--src/vty/command.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vty/command.c b/src/vty/command.c
index 35169eb0..0d24b667 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -2927,9 +2927,10 @@ static int write_config_file(const char *config_file, char **outpath)
/* Write current configuration into file. */
DEFUN(config_write_file,
config_write_file_cmd,
- "write file",
+ "write file [PATH]",
"Write running configuration to memory, network, or terminal\n"
- "Write to configuration file\n")
+ "Write to configuration file\n"
+ "Set file path to store the config, or replace if already exists\n")
{
char *failed_file;
int rc;
@@ -2943,6 +2944,9 @@ DEFUN(config_write_file,
}
}
+ if (argc == 1)
+ host_config_set(argv[0]);
+
if (host.config == NULL) {
vty_out(vty, "Can't save to configuration file, using vtysh.%s",
VTY_NEWLINE);