summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-29 14:50:40 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-29 14:50:40 -0700
commit2cc65f95744125844c4444715ce24eb6d9c56b82 (patch)
tree71c11fee3ab90a7e68ff079f4a9a6adf82545cee /etc
parent0ad60e798fc8258a2890143e06120769e00fa5b7 (diff)
parent73c104cf5cdc67ef2fd3a3fb0ba0071536fdf0ac (diff)
downloadvyatta-cfg-2cc65f95744125844c4444715ce24eb6d9c56b82.tar.gz
vyatta-cfg-2cc65f95744125844c4444715ce24eb6d9c56b82.zip
Merge branch 'jenner' of suva.vyatta.com:/git/vyatta-cfg into jenner
Diffstat (limited to 'etc')
-rwxr-xr-xetc/bash_completion.d/20vyatta-cfg53
1 files changed, 53 insertions, 0 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg
index ef8810a..34724f8 100755
--- a/etc/bash_completion.d/20vyatta-cfg
+++ b/etc/bash_completion.d/20vyatta-cfg
@@ -373,6 +373,57 @@ vyatta_run_complete ()
eval $restore_shopts
}
+vyatta_save_complete()
+{
+ # Generate completion help for the "save" command
+ local restore_shopts=$( shopt -p extglob nullglob | tr \\n \; )
+ shopt -s extglob nullglob
+
+ if (( $COMP_CWORD <= 1 )); then
+ echo
+ echo "Possible completions:"
+ echo -e " <file>\t\t\t\tSave to file on local machine"
+ echo -e " scp://<user>:<passwd>@<host>/<file>\tSave to file on remote machine"
+ echo -e " ftp://<user>:<passwd>@<host>/<file>\tSave to file on remote machine"
+ echo -e " tftp://<host>/<file>\t\t\tSave to file on remote machine"
+
+ COMP_WORDS=( "${COMP_WORDS[@]:1}" )
+ (( COMP_CWORD -= 1 ))
+ COMPREPLY=( "" " " )
+ else
+ COMPREPLY=()
+ fi
+
+ eval $restore_shopts
+}
+
+vyatta_load_complete()
+{
+ # Generate completion help for the "load" command
+ local restore_shopts=$( shopt -p extglob nullglob | tr \\n \; )
+ shopt -s extglob nullglob
+
+ if (( $COMP_CWORD <= 1 )); then
+ echo
+ echo "Possible completions:"
+ echo -e " <file>\t\t\t\tLoad from file on local machine"
+ echo -e " scp://<user>:<passwd>@<host>/<file>\tLoad from file on remote machine"
+ echo -e " ftp://<user>:<passwd>@<host>/<file>\tLoad from file on remote machine"
+ echo -e " http://<user>:<passwd>@<host>/<file>\tLoad from file on remote machine"
+ echo -e " tftp://<host>/<file>\t\t\tLoad from to file on remote machine"
+
+ COMP_WORDS=( "${COMP_WORDS[@]:1}" )
+ (( COMP_CWORD -= 1 ))
+ COMPREPLY=( "" " " )
+ else
+ COMPREPLY=()
+ fi
+
+ eval $restore_shopts
+}
+
+
+
declare v_cfg_completion_debug=0
decho ()
{
@@ -1167,6 +1218,8 @@ complete -F vyatta_config_complete show
complete -F vyatta_config_complete edit
complete -F vyatta_config_complete exit
complete -F vyatta_run_complete run
+complete -F vyatta_save_complete save
+complete -F vyatta_load_complete load
# Local Variables:
# mode: shell-script