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

Re: [PATCH] Add _gradle for gradle and gradlew completion.



On 24 March 2012 11:55, Jesper Nygårds <jesper.nygards@xxxxxxxxx> wrote:
> 2012/3/24 Mikael Magnusson <mikachu@xxxxxxxxx>:
>> The patch seems (extensively) mangled, you can't post patches by
>> pasting them in the gmail web interface. You can either attach the
>> patch, or use git send-email.
>
> OK, I try again, with the patch attached.

You're defining a single function with the same name as the autoloaded
function, and then calling it, that serves no purpose so you can just
remove that indirection. (It's used in completers that want to define
extra helper functions). You could move the _gradle_caching_policy to
the toplevel and then this pattern would make sense. (There's no
namespaces for functions, so even though you define it inside _gradle
now, it stays around after _gradle returns.)

zstyle -T ":completion:*:*:$service:*" gradle-inspect || gradle_inspect=no
can probably be
zstyle -b ":completion:*:*:$service:*" gradle-inspect gradle_inspect
but I didn't test. :)

You need to quote the ? in -?,-h,--help. (The completion system sets
the nullglob option, so the whole argument just disappears without
errors).

Other than that it looks pretty good to me.

-- 
Mikael Magnusson



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