From db23175f41f01367889e5df7b7a2d60e17079efe Mon Sep 17 00:00:00 2001 From: John Southworth Date: Mon, 17 Oct 2011 13:43:26 -0500 Subject: 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. --- etc/bash_completion.d/vyatta-op | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3