summaryrefslogtreecommitdiff
path: root/etc/bash_completion.d
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-11-02 17:01:43 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2007-11-02 17:01:43 -0700
commit902f98e233479bb9e8fffa9d158d14739714d48a (patch)
treed5684cf1dc78d05218b1c8e2a5f522919b9bf2a1 /etc/bash_completion.d
parent0d97c5e0f56a22577abb0a38fec10a06e9b618e8 (diff)
downloadvyatta-cfg-902f98e233479bb9e8fffa9d158d14739714d48a.tar.gz
vyatta-cfg-902f98e233479bb9e8fffa9d158d14739714d48a.zip
* config-mode "show" command now hides default values.
* add "show -all" command to display all values. * "save" command saves all values.
Diffstat (limited to 'etc/bash_completion.d')
-rw-r--r--etc/bash_completion.d/20vyatta-cfg15
1 files changed, 12 insertions, 3 deletions
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=''