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 #5: Simple Darwin and Linux utilities
Date: Fri, 5 Jan 2018 18:28:35 -0600	[thread overview]
Message-ID: <1BCD7B33-7A90-4877-9CFE-A89B3844178B@dana.is> (raw)
In-Reply-To: <26360.1515196233@thecus.kiddle.eu>

On 5 Jan 2018, at 17:50, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
>That is with the exception of Linux/Command/_ldd – there's already a
>completion for ldd in Unix/Command that also handles Solaris and the
>BSDs.

Oops, i didn't see that. I'd just assumed it was missing because it's actually
broken — at least it is on Ubuntu Xenial. Here is a fix for that:

diff --git a/Completion/Unix/Command/_ldd b/Completion/Unix/Command/_ldd
index 19b8a9105..1de1659a5 100644
--- a/Completion/Unix/Command/_ldd
+++ b/Completion/Unix/Command/_ldd
@@ -1,6 +1,6 @@
 #compdef ldd
 
-if _pick_variant gnu='(GNU|EGLIBC|Gentoo)' unix --version; then
+if _pick_variant gnu='(Free Soft|GNU|EGLIBC|Gentoo)' unix --version; then
   args=(
     '(- *)--version[display version information]'
     '(- *)--help[display help information]'

(Changing 'EGLIBC' to just 'GLIBC' would also do it.)

On 5 Jan 2018, at 17:50, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
>It is also better
>in general to use $words[1] instead of $service in case a command is
>specified by the user with a full path and there's another version of
>the command elsewhere in $PATH.

Ah, that makes sense in hind sight. Would you like a patch to fix the
_call_program and $service stuff you mentioned?

On 5 Jan 2018, at 17:50, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
>The idea is that when looking up styles with zstyle, this should be
>included. Unlike _wanted, _alternative, _tags and others, this can't be
>passed on to _values other than in $curcontext. So in this case, using
>_arguments -C might be better.

Is there any case where -C is actually *undesirable*? I'd asked myself earlier
why it isn't simply the default, and i decided that maybe it was for backwards
compatibility with functions/styles that existed before -C was added...?

On 5 Jan 2018, at 17:50, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
>Can you elaborate on what doesn't work here?

The command doesn't want to take a host name (and so i don't want to complete
one) unless -r has been given. But it's also valid to give it as -rW or -Wr, and
i found that if i tried to give -r its own set the completion system failed to
'detect' that i was in it when i provided the options stacked like that. In
other words, assuming i have a set for -r and friends:

  % scutil -r <tab>  # completes only args from the -r set, as expected
  % scutil -rW <tab> # erroneously completes args from other sets

After some research i found workers/33249, which i assume (?) is related:

http://www.zsh.org/mla/workers/2014/msg01037.html

On 5 Jan 2018, at 17:50, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
>Sets have some oddities and
>are often better avoided.

Yeah, that's the conclusion i came to as well...


      reply	other threads:[~2018-01-06  0:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05 20:26 dana
2018-01-05 23:50 ` Oliver Kiddle
2018-01-06  0:28   ` dana [this message]

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=1BCD7B33-7A90-4877-9CFE-A89B3844178B@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).