zsh-users
 help / color / mirror / code / Atom feed
From: Danek Duvall <duvall@emufarm.org>
To: zsh-users@sunsite.dk
Subject: need for a fancier _pick_variant?
Date: Mon, 13 Oct 2003 23:29:33 -0700	[thread overview]
Message-ID: <20031014062933.GC13457@lorien.emufarm.org> (raw)

I was debugging why

    % diff -u foo ba<TAB>

failed to complete "bar" on Solaris.  The reason, of course is that
_diff_options calls

    _pick_variant -c diff 'gnu=GNU' unix -v

which doesn't match anything for Solaris diff, so the generic unix diff
options are chosen, and the result is thrown by the -u.

Unfortunately, I don't know of any way of distinguishing Solaris diff by
its output, short of a brittle check of its usage statement.  I can,
however, reliably check what options are available for it by running
"what /usr/bin/diff", noting SunOS, and the OS version.

I tried a very naive

   _pick_variant -c what -r diff solaris=SunOS unix '$(whence diff)'

as the test for an elif clause in _diff_options, but it didn't work.  On
re-reading the man page, I misunderstood what -r did, but that's only
the tip of the iceberg here.

I next tried

  elif [[ $(what $(whence $cmd)) == *SunOS\ 5.<9->* ]]; then

which seems to work pretty nicely.  Would you suggest that as a
solution, or to try to beef up _pick_variant to support running
auxiliary programs as tests?

Hm.  In investigating all this, I noticed that all the completion
directories end up duplicated in $fpath, which seems to be done in
compaudit.  This seems to happen on 4.0.5 on Solaris, 4.1.1 on Solaris,
and 4.1.1 on Linux, FWIW.

Thanks,
Danek


             reply	other threads:[~2003-10-14  6:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-14  6:29 Danek Duvall [this message]
2003-10-22  6:39 ` Bart Schaefer
2003-10-22  6:51   ` Dan Nelson

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=20031014062933.GC13457@lorien.emufarm.org \
    --to=duvall@emufarm.org \
    --cc=zsh-users@sunsite.dk \
    /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).