about summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2013-10-12 09:19:24 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2013-10-12 09:19:24 -0700
commitd5ba3ed24579bb12df958c09224367e16e70bad2 (patch)
treecfc1855ecdee02a0f7fa35d5c583c57e32013eef /Completion/Unix
parent3057036472ace1ac946132c8acbe281cf0048d7c (diff)
downloadzsh-d5ba3ed24579bb12df958c09224367e16e70bad2.tar.gz
zsh-d5ba3ed24579bb12df958c09224367e16e70bad2.tar.xz
zsh-d5ba3ed24579bb12df958c09224367e16e70bad2.zip
31818: fix completion for zsh in _sh, and document the _arguments behavior that made the fix necessary
To avoid side effects, reposition the _arguments call in _sh for the zsh
special case. Document the side effects so avoided, and clean up the
_arguments documentation a bit along the way.
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/_sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_sh b/Completion/Unix/Command/_sh
index 7258e4260..104c7576c 100644
--- a/Completion/Unix/Command/_sh
+++ b/Completion/Unix/Command/_sh
@@ -5,10 +5,7 @@ if [[ $service == zsh ]]; then
   if [[ ${words[CURRENT-1]} == -o ]]; then
     _options
     # no other possibilities
-    return 0
-  fi
-  if _arguments -S -s -- '*:'; then
-    return 0
+    return
   fi
 fi
 
@@ -25,3 +22,9 @@ else
   fi
   _default
 fi
+
+local ret=$?
+
+[[ $service == zsh ]] && _arguments -S -s -- '*:' && ret=0
+
+return ret