From 6c83a427370acbdc4de3eee6feed143500fb4d8c Mon Sep 17 00:00:00 2001 From: Tom Grennan Date: Fri, 21 Sep 2007 19:12:46 -0700 Subject: yet more help crap --- etc/bash_completion.d/vyatta-op | 10 +++++++--- 1 file 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 } -- cgit v1.2.3