diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-10-17 14:14:33 -0500 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-10-17 14:14:33 -0500 |
commit | a032121b9b6d873fa2c003adb23a3abfda7d1f40 (patch) | |
tree | da0f7fc3659790031286c3144e69e435ff543068 /etc | |
parent | 94d0bca705c0d49e6197abaeb2afb0aafbeeadba (diff) | |
download | vyatta-cfg-a032121b9b6d873fa2c003adb23a3abfda7d1f40.tar.gz vyatta-cfg-a032121b9b6d873fa2c003adb23a3abfda7d1f40.zip |
Make directory completions, if it is the first word of a run completion, work so that users can easily find scripts they may be trying to run.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/bash_completion.d/vyatta-cfg | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index aada483..c926ca1 100755 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -117,7 +117,6 @@ done vyatta_run_complete () { local restore_shopts=$( shopt -p extglob nullglob | tr \\n \; ) - shopt -s extglob nullglob local cur=${COMP_WORDS[COMP_CWORD]} @@ -129,7 +128,12 @@ vyatta_run_complete () COMP_WORDS=( "${COMP_WORDS[@]:1}" ) (( COMP_CWORD -= 1 )) - _vyatta_op_expand "$@" + if [[ ${COMP_WORDS[0]} =~ "/" ]]; then + _filedir_xspec + else + shopt -s extglob nullglob + _vyatta_op_expand "$@" + fi if [ -z "$cur" ] || [[ "${COMPREPLY[0]}" =~ "$cur" ]]; then |