From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "ZSH workers mailing list" <zsh-workers@sunsite.auc.dk>
Subject: Problem with _arguments and invalid options
Date: Fri, 10 Sep 1999 17:23:08 +0400 [thread overview]
Message-ID: <000b01befb8f$9f2f87e0$21c9ca95@mow.siemens.ru> (raw)
Currently, invalid (not listed in description) options are not handled very
nicely. Here is half-hearted example of sudo completion:
_arguments \
'-V[show version]' \
'-l[list commands]' \
'-h[show help]' \
'-v[validate timestamp file]' \
'-k[remove timestamp file]' \
'-b[run command in background]' \
'-r:Kerberos realm:' \
'-p:prompt:' \
'-u:user name:_users' \
'-s[run SHELL]' \
'-H[set HOME environment variable]' \
'*::complete command and/or arguments:_normal'
And now
bor@itsrm2:~/.zsh.d/completion%> sudo -z TAB
bor@itsrm2:~/.zsh.d/completion%> sudo -z _normal: bad option: -z [33]
_
--- file
_sudo _umount
What's worse - if a command does not list `-s', but you *do* give `-s' - it
seems to be propagated downward and interpreted by _arguments itself (or some
other function, dunno). Just remove definition for -s from above and try:
bor@itsrm2:~/.zsh.d/completion%> sudo -u nTAB
bor@itsrm2:~/.zsh.d/completion%> sudo -u n
--- user
nerv nobody nuucp
but
bor@itsrm2:~/.zsh.d/completion%> sudo -s -u nTAB
B-e-e-p
and
bor@itsrm2:~/.zsh.d/completion%> sudo -s -u TAB
bor@itsrm2:~/.zsh.d/completion%> sudo -s -u _
--- file
_sudo _umount
/andrej
next reply other threads:[~1999-09-10 13:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-10 13:23 Andrej Borsenkow [this message]
1999-09-10 16:19 ` Problem with _arguments and _normal as action if nolistambiguous is set Andrej Borsenkow
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='000b01befb8f$9f2f87e0$21c9ca95@mow.siemens.ru' \
--to=andrej.borsenkow@mow.siemens.ru \
--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).