From 22572cc466addd0467da3200456b4ff0148ebe28 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Mon, 3 Oct 2011 11:24:03 -0500 Subject: Prevent config mode completions from getting stuck when backspacing over them --- etc/bash_completion.d/vyatta-cfg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index 9e9d652..ad1ccb0 100755 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -430,7 +430,10 @@ vyatta_simple_complete () # * "vyatta_help_text" is filled with the help text. # * "vyatta_completions" is an array of "filtered" possible completions # (i.e., only those starting with the current last component). - if $vyatta_do_help; then + if [ ${#vyatta_completions[@]} -eq 1 ] && + [[ "${vyatta_completions[0]}" =~ "${COMP_WORDS[COMP_CWORD]}" ]]; then + COMPREPLY=( "${vyatta_completions[@]}" ) + elif $vyatta_do_help; then printf "$vyatta_help_text" COMPREPLY=( "" " " ) else -- cgit v1.2.3