From 71e86c3a577a3db60a372e433cf603e50795e327 Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Tue, 29 Jun 2010 10:45:09 -0700 Subject: add option to save w/o default values. --- scripts/vyatta-save-config.pl | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/scripts/vyatta-save-config.pl b/scripts/vyatta-save-config.pl index 9a95906..cebdf96 100755 --- a/scripts/vyatta-save-config.pl +++ b/scripts/vyatta-save-config.pl @@ -29,16 +29,27 @@ my $bootpath = $etcdir . "/config"; my $save_file = $bootpath . "/config.boot"; my $url_tmp_file = $bootpath . "/config.boot.$$"; - -if ($#ARGV > 0) { - print "Usage: save [config_file_name]\n"; +my $set_show_opt = 1; +if ($#ARGV > 1) { + print "Usage: save [config_file_name] --no-defaults\n"; exit 1; } + if (defined($ARGV[0])) { - $save_file = $ARGV[0]; + if ($ARGV[0] ne '--no-defaults') { + $save_file = $ARGV[0]; + } + else { + $set_show_opt = 0; + } + + if (defined($ARGV[1]) && $ARGV[1] eq '--no-defaults') { + $set_show_opt = 0; + } } + my $mode = 'local'; my $proto; @@ -89,7 +100,7 @@ if ($mode eq 'local') { } select $save; -set_show_all(1); +set_show_all($set_show_opt); outputActiveConfig(); print $version_str; select STDOUT; -- cgit v1.2.3 From 5cc772e57ef3a21f7c5ae6e48b0f8758c82b275d Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Tue, 29 Jun 2010 10:47:38 -0700 Subject: 0.16.88 --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 98055e3..7ddcc58 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +vyatta-cfg (0.16.88) unstable; urgency=low + + [ An-Cheng Huang ] + * return false for invalid value instead of exiting + + [ Michael Larson ] + * add option to save w/o default values. + + -- Michael Larson Tue, 29 Jun 2010 10:47:37 -0700 + vyatta-cfg (0.16.87) unstable; urgency=low * fix for bug 5721 and 5722--actually these were duplicates. -- cgit v1.2.3