summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-10-06 00:35:48 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-10-06 00:36:17 -0500
commita4279a5025e4ddd08e5e191e14ee32217be14d23 (patch)
tree72538433211768092cb82c01f8c9f14d4e41053a
parent050130428d0708840f66dadc646cd94fa069b3c9 (diff)
downloadvyatta-op-a4279a5025e4ddd08e5e191e14ee32217be14d23.tar.gz
vyatta-op-a4279a5025e4ddd08e5e191e14ee32217be14d23.zip
Fix: first word completions; empty completions on tag nodes, if there is a tag node there should always be at least a non-comp so that the help text will be displayed; invalid completions in the middle of the string
-rw-r--r--etc/bash_completion.d/vyatta-op10
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op
index 560cbb4..16e25b0 100644
--- a/etc/bash_completion.d/vyatta-op
+++ b/etc/bash_completion.d/vyatta-op
@@ -103,7 +103,7 @@ _vyatta_op_default_expand ()
local wc=${#COMP_WORDS[@]}
if (( wc < 2 )) ||
[[ $COMP_CWORD -eq 0 ]]; then
- _vyatta_op_expand
+ _vyatta_op_expand "$@"
else
# after the first word => cannot be vyatta command so use original default
_filedir_xspec
@@ -210,7 +210,7 @@ _vyatta_op_set_completions ()
if [ ${#a[@]} -ne 0 ] ; then
allowed+=( "${a[@]}" )
else
- allowed+=( "" )
+ allowed+=( "<text>" )
fi
else
local sdir=${ndef%/*}
@@ -417,6 +417,12 @@ _vyatta_op_expand ()
_vyatta_op_invalid_completion
COMPREPLY=( "" " " )
_vyatta_op_last_comp=${_vyatta_op_last_comp_init}
+ elif [ ${#COMPREPLY[@]} -eq 0 ] &&
+ [ -n "$current_prefix" ]; then
+ echo
+ _vyatta_op_invalid_completion
+ COMPREPLY=( "" " " )
+ _vyatta_op_last_comp=${_vyatta_op_last_comp_init}
# Stop completions from getting stuck
elif [ ${#_vyatta_op_completions[@]} -eq 1 ] &&
[ -n "$cur" ] &&