From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: sudo completion problem
Date: Mon, 8 May 2000 11:00:04 +0200 (MET DST) [thread overview]
Message-ID: <200005080900.LAA13146@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Zefram's message of Sat, 6 May 2000 09:19:54 +0100 (BST)
Zefram wrote:
> ...
>
> If we can determine that a particular command is processing options in
> this way, it would be nice to complet options accordingly. However,
> by default options should only be completed before the first non-option
> argument. In either case, options should never be completed after a "--".
I don't buy this. There *may* be commands or shell functions which
take `--' to, e.g., separate different sets of options and arguments.
_arguments is intended to be general enough to generate sensible
completions even for user-written shell functions, after all.
Please lets not make _arguments treat any string from the line special
like this. Lets add it to:
> I envision _arguments first of all deciding whether the command allows
> options everywhere or not. This should be under the control of the
> caller, via options to _arguments; possible values are "everywhere",
> "only before first argument", "autodetect GNU getopt" (if possible).
So wo would have these plus these combined with `and no options after --'.
Ok?
> _arguments must also check for a "--" argument, and not do option
> completion (regardless of option style) if the cursor is after the "--".
> All of this then lets it decide whether to complete options or not;
> non-option arguments are always a possibility, though we might want to
> be clever about handling arguments that start with "-".
No patch yet, but adding an option to comparguments (the builtin) for
the second (i.e. "only before first argument" the first would still be
the default, _arguments could use a different default, I don't care
that much about it for now) should be easy. And another option for the
"no options after `--'" would be easy, too.
But before I start writing it: should the default for _arguments be
changed? And would someone be willing to check all uses of _arguments
and add the option to the calls that need them? Oh, and does anyone
have an idea how to test for GNU-getopts. Reliably?
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-05-08 9:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-08 9:00 Sven Wischnowsky [this message]
2000-05-08 9:44 ` optional argument? Sven Wischnowsky
2000-05-08 10:01 ` Peter Stephenson
2000-05-08 14:49 ` Tanaka Akira
2000-05-08 17:58 ` Assorted _arguments arguments Bart Schaefer
2000-05-08 18:12 ` Peter Stephenson
2000-05-08 15:25 ` PATCH: Re: sudo completion problem Tanaka Akira
-- strict thread matches above, loose matches on Subject: below --
2000-05-04 13:40 Sven Wischnowsky
2000-05-04 20:12 ` Tanaka Akira
2000-05-04 20:40 ` Tanaka Akira
2000-05-04 8:03 Sven Wischnowsky
2000-05-03 14:42 Sven Wischnowsky
2000-05-03 14:56 ` Andrej Borsenkow
2000-05-03 15:09 ` Zefram
2000-05-04 7:23 ` Andrej Borsenkow
2000-05-04 12:02 ` Tanaka Akira
2000-05-06 6:56 ` Andrej Borsenkow
2000-05-06 7:40 ` Tanaka Akira
2000-05-06 7:51 ` Andrej Borsenkow
2000-05-06 8:19 ` Zefram
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=200005080900.LAA13146@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.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).