summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/bash_completion.d/vyatta-op8
1 files changed, 7 insertions, 1 deletions
diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op
index 4b6bdfc..be4892d 100644
--- a/etc/bash_completion.d/vyatta-op
+++ b/etc/bash_completion.d/vyatta-op
@@ -277,13 +277,19 @@ _vyatta_op_expand ()
if _vyatta_op_scan 0 "${COMP_WORDS[@]}" ; then
COMPREPLY=( )
if [ -n "${_vyatta_op_allowed[*]}" ] ; then
+ local nomatch=true
+ local joker=false
for a in "${_vyatta_op_allowed[@]}" ; do
if [ -n "$a" ] ; then
COMPREPLY+=($( compgen -W "$a" -- $cur ))
+ [[ -n "$cur" && $a == ${cur}* ]] && \
+ nomatch=false
else
- COMPREPLY+=( "" )
+ joker=true
fi
done
+ $nomatch && $joker && \
+ COMPREPLY+=( "" " " )
fi
if [[ ${#COMPREPLY[@]} -ne 0 || -z "${_vyatta_op_allowed[*]}" ]] &&
[[ "${COMP_WORDS[*]}" == "${_vyatta_op_comp_words[*]}" ]]