summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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" ] &&