From 902f98e233479bb9e8fffa9d158d14739714d48a Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Fri, 2 Nov 2007 17:01:43 -0700 Subject: * config-mode "show" command now hides default values. * add "show -all" command to display all values. * "save" command saves all values. --- etc/bash_completion.d/20vyatta-cfg | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'etc') diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index b4449c8..26a4e72 100644 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -45,13 +45,22 @@ done show () { - eval "${vyatta_sbindir}/vyatta-output-config.pl \ - \${VYATTA_EDIT_LEVEL//\// } $@" + local show_all='' + local -a args=() + for arg in "$@"; do + if [ "$arg" == "-all" ]; then + show_all='-all' + else + args[${#args[@]}]="$arg" + fi + done + eval "${vyatta_sbindir}/vyatta-output-config.pl ${show_all}\ + \${VYATTA_EDIT_LEVEL//\// } ${args[@]}" } save () { - eval "${vyatta_sbindir}/vyatta-save-config.pl $@" + eval "sudo ${vyatta_sbindir}/vyatta-save-config.pl $@" } declare vyatta_cfg_prompt_level='' -- cgit v1.2.3