summaryrefslogtreecommitdiff
path: root/etc/bash_completion.d/vyatta-op
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-10-17 13:43:26 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-10-17 13:43:52 -0500
commit067dc4c3e5341fe616fd5f3a84585a2860f53c61 (patch)
treecd1bf4415ce88784548622e83a49c80a1a61d72a /etc/bash_completion.d/vyatta-op
parentc5bff0eefb6c8eb00d1c7baaef3ef068d1364b16 (diff)
downloadvyatta-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/bash_completion.d/vyatta-op')
-rw-r--r--etc/bash_completion.d/vyatta-op5
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