summaryrefslogtreecommitdiff
path: root/etc/bash_completion.d/20vyatta-cfg
diff options
context:
space:
mode:
Diffstat (limited to 'etc/bash_completion.d/20vyatta-cfg')
-rw-r--r--etc/bash_completion.d/20vyatta-cfg7
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg
index 14a09e8..fe64f40 100644
--- a/etc/bash_completion.d/20vyatta-cfg
+++ b/etc/bash_completion.d/20vyatta-cfg
@@ -631,8 +631,11 @@ ENDCOMMENT
COMPREPLY=( "" " " )
else
local -a f_comps=()
- get_prefix_filtered_list "${COMP_WORDS[COMP_CWORD]}" \
- vyatta_completions f_comps
+ local cword=
+ if (( ${#COMP_WORDS[@]} > 0 )); then
+ cword=${COMP_WORDS[COMP_CWORD]}
+ fi
+ get_prefix_filtered_list "$cword" vyatta_completions f_comps
local estr="COMPREPLY=( "
for w in "${f_comps[@]}"; do
estr="$estr\"$w\" "