about summary refs log tree commit diff
path: root/Completion/Unix/Command/_bogofilter
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-10-14 23:03:40 +0200
committerOliver Kiddle <opk@zsh.org>2014-10-14 23:04:45 +0200
commit13fc579343b24d298fb8905933b6000d7fcda114 (patch)
treecbc1000696357438714107635f93166bcab76d3a /Completion/Unix/Command/_bogofilter
parent66320ca93a717467a0ed0d34da4c06257953aa50 (diff)
downloadzsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.gz
zsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.xz
zsh-13fc579343b24d298fb8905933b6000d7fcda114.zip
33467: correct return status on functions and numerous other minor fixes
Diffstat (limited to 'Completion/Unix/Command/_bogofilter')
-rw-r--r--Completion/Unix/Command/_bogofilter20
1 files changed, 8 insertions, 12 deletions
diff --git a/Completion/Unix/Command/_bogofilter b/Completion/Unix/Command/_bogofilter
index 44953cc71..ff36e83af 100644
--- a/Completion/Unix/Command/_bogofilter
+++ b/Completion/Unix/Command/_bogofilter
@@ -1,7 +1,5 @@
 #compdef bogoutil bogotune bogofilter
 
-local expl ret bogotokens
-
 _bogoutil_caching_policy () {
   local -a oldp
 
@@ -14,6 +12,7 @@ _bogoutil_caching_policy () {
 
 _bogoutil() {
 
+  local bogotokens expl ret=1
 	typeset -a _bogoutil_actions
 	_bogoutil_actions=(-h --help -V --version -d --dump -l --load -u
 		--upgrade -m -w -p -H --db-verify -r -R --db-prune --db-recover
@@ -46,30 +45,27 @@ _bogoutil() {
 	"($_bogoutil_actions)"'--db-remove-environment:database:_files -/' \
 	'--db_lk_max_locks[set max lock count]' \
 	'--db_lk_max_objects[set max object count]' \
-  	"($_bogoutil_actions)"'-h[help]' \
-  	"($_bogoutil_actions)"'--help' \
-  	"($_bogoutil_actions)"'-V[version]' \
-  	"($_bogoutil_actions)"'--version' \
+	"($_bogoutil_actions)"{-h,--help}'[help]' \
+	"($_bogoutil_actions)"{-V,--version}'[version]' \
   	'*:tokens:->tokens' && ret=0
 
   zstyle -s ":completion:${curcontext}:" cache-policy update_policy
   if [[ -z "$update_policy" ]]; then
     zstyle ":completion:${curcontext}:" cache-policy _bogoutil_caching_policy
   fi
-  
+
   case $state in
   	(tokens)
   	if ( [[ -z "$bogotokens" ]] || _cache_invalid bogotokens ) &&
   	  ! _retrieve_cache bogotokens; then
-  	  bogotokens=(${${(f)"$(_call_program bogoutil bogoutil -d ~/.bogofilter/wordlist.db -c 50)"}%% *})
+          bogotokens=(${${(f)"$(_call_program bogotokens bogoutil -d ~/.bogofilter/wordlist.db -c 50)"}%% *})
   	  _store_cache bogotokens bogotokens
-  	else
-  	  :
   	fi
-  	  _wanted tokens expl "token" \
-  	     compadd -a bogotokens
+          _wanted tokens expl "token" compadd -a bogotokens && ret=0
   	;;
   esac
+
+  return ret
 }
 
 case $service in