zsh-workers
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] Completion batch #2: Misc. trivial fixes
Date: Thu, 4 Jan 2018 10:05:19 -0600	[thread overview]
Message-ID: <0D626F37-219D-49BC-A1CA-31A8F1CABF1E@dana.is> (raw)
In-Reply-To: <20806.1515066433@thecus.kiddle.eu>

On 4 Jan 2018, at 05:47, Oliver Kiddle <okiddle@yahoo.co.uk> 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@yahoo.co.uk> 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@yahoo.co.uk> 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@yahoo.co.uk> 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


  reply	other threads:[~2018-01-04 16:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 21:29 dana
2018-01-03 23:40 ` Oliver Kiddle
2018-01-04  0:03   ` dana
2018-01-04 11:47     ` Oliver Kiddle
2018-01-04 16:05       ` dana [this message]
2018-01-06  6:11         ` dana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0D626F37-219D-49BC-A1CA-31A8F1CABF1E@dana.is \
    --to=dana@dana.is \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).