diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-10-17 13:43:26 -0500 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-10-17 13:43:52 -0500 |
commit | 067dc4c3e5341fe616fd5f3a84585a2860f53c61 (patch) | |
tree | cd1bf4415ce88784548622e83a49c80a1a61d72a /etc | |
parent | c5bff0eefb6c8eb00d1c7baaef3ef068d1364b16 (diff) | |
download | vyatta-op-067dc4c3e5341fe616fd5f3a84585a2860f53c61.tar.gz vyatta-op-067dc4c3e5341fe616fd5f3a84585a2860f53c61.zip |
Make directory completions, if it is the first word of the completion, work so that users can easily find scripts they may be trying to run.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/bash_completion.d/vyatta-op | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op index 5bcc460..0c75378 100644 --- a/etc/bash_completion.d/vyatta-op +++ b/etc/bash_completion.d/vyatta-op @@ -101,7 +101,10 @@ _vyatta_op_debug () _vyatta_op_default_expand () { local wc=${#COMP_WORDS[@]} - if (( wc < 2 )) || + if [[ "${COMP_WORDS[0]}" =~ "/" ]]; then + # if we are looking for a directory on the first completion then do directory completions + _filedir_xspec + elif (( wc < 2 )) || [[ $COMP_CWORD -eq 0 ]]; then _vyatta_op_expand "$@" else |