zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: dana <dana@dana.is>
Cc: Zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: completion options update
Date: Thu, 30 Aug 2018 09:43:57 +0200	[thread overview]
Message-ID: <50656-1535615037.515804@RqXh.6zO4.U8_o> (raw)
In-Reply-To: <A6E7EE1E-DE5C-4F6A-9F9C-291AA8B0FFD9@dana.is>

dana wrote:
> >+(( $#words > 2 )) && ign='!'
>
> Is this a new convention or did i miss it somehow?
>
> I often (a) use completion as a quick substitute for man pages (i.e., to see
> which options are supported) and (b) append --help to the end of a command that
> i can't get to work using the completion clues alone. Maybe that's a bizarre

And in 42730 on 30th April, Matthew Martin wrote:

| Is there an established position for --help and --version? Completing
| them would be more complete, but also useless noise in my opinion.

At the time, that message spurred me to give it some thought and I've
been applying the trick with ! that dana mentions since then.

There are plenty of functions where we've explicitly excluded help and
version style options in the past but, where they don't naturally fit
with sets/groups/variables to cover multiple exclusions, it is irksome
to shove '(--help --version -h -V -?') on the front of every single
argument definition.

I've had dana's (b) use case happen occasionally too but it's also
always useful to cut out noise. Limiting the completion to when there
are no other arguments on the line seems like a good compromise to me.
And it is possible to use push-input or a custom widget in the manner of
run-help. However, it'd be good to hear what other people would prefer.
There might be other options like wrapping the $#words check in a
helper that looks up a style.

> (If it *is* something we should be doing as standard, maybe a note in the guide
> is warranted?

Yes, a note in the guide would be useful, assuming we get to the point
of having agreed to what that standard should be.

Oliver


  reply	other threads:[~2018-08-30  7:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 21:16 Oliver Kiddle
2018-08-30  2:30 ` dana
2018-08-30  7:43   ` Oliver Kiddle [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-20  0:11 Oliver Kiddle
2021-08-27 12:43 Oliver Kiddle
2018-11-11  8:57 Oliver Kiddle
2018-06-19 22:09 Oliver Kiddle
2018-03-30 22:37 Oliver Kiddle

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=50656-1535615037.515804@RqXh.6zO4.U8_o \
    --to=okiddle@yahoo.co.uk \
    --cc=dana@dana.is \
    --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).