Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: completion options update



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



Messages sorted by: Reverse Date, Date, Thread, Author