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

PATCH: allow for build options in gem completion



With a -- argument after gem install, build options can be specified. We
can't do much to complete them but completing gems is slow so it is
better to be calling _default. I'm sure it was fast enough not to need
a cache when _gem was new but it's taking a few seconds now. I've not as
yet added that.

Oliver

diff --git a/Completion/Unix/Command/_gem b/Completion/Unix/Command/_gem
index 7e244ccad..7d81619bb 100644
--- a/Completion/Unix/Command/_gem
+++ b/Completion/Unix/Command/_gem
@@ -56,6 +56,11 @@ if [[ $state = command ]]; then
     check|cleanup|contents|dependency|list|open|pristine|rdoc|uninstall|unpack|update)
       args+=( '(--all --skip)*:installed gem:->gems-local' )
     ;|
+    install)
+      (( ${(M)#line:#[^-]*} > 1 )) && args+=(
+        '(*)--[specify build options]:*:build option:_default'
+      )
+    ;|
     fetch|install|lock|owner|search|yank)
       args+=( '*:gem:->gems-remote' )
     ;|




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