Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Completion batch #2: Misc. trivial fixes
On 4 Jan 2018, at 05:47, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
>Given that that works well, I'd go with that solution. It'd be possible
>to add an option to _normal/_dispatch. Having them know about
>_pick_variant internals is less ugly. It is, however, probably only worthwhile if
>it is going to be used elsewhere. It might be wise to dig around for
>other use cases. _builtin is the only thing that comes to mind.
That's the only thing i can find that's similar too. As far as use cases we
might develop in the future: I've heard there is a GNU coreutils multi-call (so
you can do like `coreutils expand`), but i've never seen it in the wild. And
there is a BSD-licensed competitor to BusyBox called Toybox, but i've only ever
heard of it being used by Android.
On 4 Jan 2018, at 05:47, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
>Caching the
>result is unlikely to be necessary but if it is, don't use _cmd_variant.
>poweroff likely doesn't get run many times in a single zsh session
>anyway.
Caching is not necessary in terms of performance — checking for file paths like
you mentioned is a fast operation. But if i want to complete `busybox poweroff`
using the method discussed it seems like i'll either need to call _pick_variant
or deal with _cmd_variant myself, right? (Or i guess i could have _busybox pass
down some *other* variable, but that seems even messier.)
On 4 Jan 2018, at 05:47, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
>Doesn't "superfluous" have much the same meaning as "pointless" in this
>case.
It does indeed
>On 4 Jan 2018, at 05:47, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
It seems to work as it is but I'd clean it up if making changes
for the busybox variant anyway. Doesn't busybox allow expand to be a
hard link to busybox to run expand?
BusyBox does allow you to link its 'applets', yeah. And in that case of course
_pick_variant will correctly identify a command as BusyBox without any special
cases. But sometimes you have coreutils or whatever for your normal stuff
existing side-by-side with the busybox multi-call for other things. At least,
that was my own use case.
I will clean up my _expand change when i submit _busybox. Let me know if you
have any other thoughts in the mean time. Thanks!
dana
Messages sorted by:
Reverse Date,
Date,
Thread,
Author