summaryrefslogtreecommitdiff
path: root/etc/bash_completion.d/20vyatta-cfg
diff options
context:
space:
mode:
Diffstat (limited to 'etc/bash_completion.d/20vyatta-cfg')
-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=''