summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/bash_completion.d/vyatta-op10
1 files changed, 7 insertions, 3 deletions
diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op
index 4ac0009..6d1eb9b 100644
--- a/etc/bash_completion.d/vyatta-op
+++ b/etc/bash_completion.d/vyatta-op
@@ -182,11 +182,15 @@ _vyatta_op_expand ()
if _vyatta_op_scan "${COMP_WORDS[@]}" ; then
COMPREPLY=($( compgen -W "${_vyatta_op_allowed[*]}" -- $cur ))
- if [ "${COMP_WORDS[*]}" == "${_vyatta_op_comp_words[*]}" ] ; then
+ if [[ ${#COMPREPLY[@]} -ne 0 &&
+ "${COMP_WORDS[*]}" == "${_vyatta_op_comp_words[*]}" ]]
+ then
_vyatta_op_help && \
- COMPREPLY=($( compgen -W "--" -- $cur ))
+ COMPREPLY=($( compgen -W "== --" -- $cur ))
+ _vyatta_op_comp_words=
+ else
+ _vyatta_op_comp_words=( "${COMP_WORDS[@]}" )
fi
- _vyatta_op_comp_words=( "${COMP_WORDS[@]}" )
fi
}