Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Complete with _arguments -- for zsh



I sort of threw options at _arguments until it worked like I wanted,
Frank tested it too and it seems to work fine. The only thing it doesn't
do is complete the -o option itself more than one time, but it didn't
complete it at all before so I consider it an improvement still.

---
 Completion/Unix/Command/_sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Completion/Unix/Command/_sh b/Completion/Unix/Command/_sh
index 9e72a29..74aee53 100644
--- a/Completion/Unix/Command/_sh
+++ b/Completion/Unix/Command/_sh
@@ -5,7 +5,11 @@ if [[ $service == zsh ]]; then
   if [[ ${words[CURRENT-1]} == -o ]]; then
     _options
     # no other possibilities
-    return
+    return 0
+  fi
+  if _arguments -S -s -- \
+    '*:' ; then
+    return 0
   fi
 fi
 
-- 
1.7.4-rc1



Messages sorted by: Reverse Date, Date, Thread, Author