From d5ba3ed24579bb12df958c09224367e16e70bad2 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 12 Oct 2013 09:19:24 -0700 Subject: 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. --- Completion/Unix/Command/_sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Completion/Unix/Command') 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 -- cgit 1.4.1