From 150d2a3ef0b8fd559beda1cbcc47e0784b377fd9 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Wed, 5 Oct 2011 17:54:26 -0500 Subject: fix stuck completion on non-lastword --- etc/bash_completion.d/vyatta-op | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op index f96f877..560cbb4 100644 --- a/etc/bash_completion.d/vyatta-op +++ b/etc/bash_completion.d/vyatta-op @@ -422,6 +422,10 @@ _vyatta_op_expand () [ -n "$cur" ] && [[ "${COMPREPLY[0]}" =~ "$cur" ]]; then _vyatta_op_last_comp=${_vyatta_op_last_comp_init} + elif [ ${#_vyatta_op_completions[@]} -eq 1 ] && + [ -n "$current_prefix" ] && + [[ "${COMPREPLY[0]}" =~ "$current_prefix" ]]; then + _vyatta_op_last_comp=${_vyatta_op_last_comp_init} # if there are no completions then always show the non-comps elif [ "${COMP_WORDS[*]:0:$[$COMP_CWORD+1]}" == "$_vyatta_op_last_comp" ] || [ ${#_vyatta_op_completions[@]} -eq 0 ]; then -- cgit v1.2.3