summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-11-27 15:33:06 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2007-11-27 15:33:06 -0800
commite937ae5d376b03e89f8ade6e6c015979f59fa363 (patch)
tree1a98b0f932b464faabca0219979b5c8cbdb0160a /etc
parentfae7c4099efc2f247ed9eb4a52f3839bcedf987a (diff)
downloadvyatta-cfg-e937ae5d376b03e89f8ade6e6c015979f59fa363.tar.gz
vyatta-cfg-e937ae5d376b03e89f8ade6e6c015979f59fa363.zip
don't expand empty command line
Diffstat (limited to 'etc')
-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\" "