Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Add _gradle for gradle and gradlew completion.
- X-seq: zsh-workers 30375
- From: Jesper Nygårds <jesper.nygards@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Add _gradle for gradle and gradlew completion.
- Date: Sat, 24 Mar 2012 23:04:34 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=4zACRzirG0WuYvuCVUGFzgNJj+vjXji19zGlzcK4erE=; b=Ff0oGQR49eqGxnbRH5B9OyZTUQunxZY6r2jAVkaKxkbLri3hfxIyeOU8rHukeSeRJ2 B0jg1Y+OGJ0O9R+/GCEgbl3q8xcfI8gefZtYqHraAamc5dUZMKdqxYTmg9HU/ahH/c+B ccybmN9rD/KV+RCwCxWh2i1qVAVP4Pag5K24Fb8T6Uw6zub/VDFMusiIGq4uDggOSYDF +7RpDcPU8MyjQgBQ2XU8mwk17IIQlxGIXWJXePJ7lb39RW+eMdpkFPJFh70mOf5KOvPQ GYWhElF1xM02O9iDdWWzIVfTWuYYqaSNJC8LGkdfTBut49bW11Cl94rOirxGqaltXoan ZLQQ==
- In-reply-to: <CABZhJg9xgaM7mr4dy8GYKHopAofnVRCzZmxfOsEca1VNugv6Cw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CABZhJg_V5objd2LHhvpGbukBsgNoau_2tTYcn+UOgWh3pAEmjg@mail.gmail.com> <CAHYJk3SbDQWZF2cNBhOzmqXeRLzNXFL05N-192kWuvy09HQG-g@mail.gmail.com> <CABZhJg__v4hN_9D+KCdwrBA0E06UB2C2w2grtdLw=c=zxkuhiw@mail.gmail.com> <CAHYJk3TL73yjCpJ7ArH81J9nN3r=TVCXknX9prtcaRrzAXA2og@mail.gmail.com> <CABZhJg9xgaM7mr4dy8GYKHopAofnVRCzZmxfOsEca1VNugv6Cw@mail.gmail.com>
2012/3/24 Mikael Magnusson <mikachu@xxxxxxxxx>:
> 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.
Good call. I'll just remove it.
> 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.)
I did know that functions are global, but I must define the function
where I do, because I can only set it once I know what build file is
to be parsed, i.e. the $build_file is a local variable, but the
_gradle_caching_policy needs to know its value. In some other
languages, I would call this a closure.
> 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. :)
Unless I misunderstand something, this doesn't seem to work as I'd
like it to. It works if the style is set, but I want the
gradle_inspect variable to default to be true if the gradle-inspect
style is unset, and this doesn't seem to happen with your suggestion.
> You need to quote the ? in -?,-h,--help. (The completion system sets
> the nullglob option, so the whole argument just disappears without
> errors).
Thanks, I had overlooked that one.
> Other than that it looks pretty good to me.
Great. I'll submit a new patch tomorrow, unless I have any other
errors pointed out by you or someone else.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author