From: Bart Schaefer <schaefer@brasslantern.com>
To: "Alexey I. Froloff" <raorn@altlinux.org>, zsh-workers@zsh.org
Subject: Re: sudo rpm -e completion b0rken
Date: Sat, 21 Nov 2009 10:33:11 -0800 [thread overview]
Message-ID: <091121103311.ZM16872@torch.brasslantern.com> (raw)
In-Reply-To: <20091121173531.GA21302@altlinux.org>
On Nov 21, 8:35pm, Alexey I. Froloff wrote:
}
} Completion for rpm -e is broken (completes local files, not
} packages) when it's going to be executed under sudo.
It's not rpm completion that's broken, it's sudo completion, which
believes that the -e is an option of sudo itself.
-e The -e (edit) option indicates that, instead of running a
command, the user wishes to edit one or more files. In lieu of
a command, the string "sudoedit" is used when consulting the
sudoers file.
_sudo has:
if [[ $service = sudoedit || -n $words[(R)-e] ]]; then
args+=(
'*:file: _files'
)
else
...
fi
The file names don't have to directly follow the -e and there are a
bunch of other options that have their own arguments and that may be
used both with and withou -e, so it's not as trivial as this pretends
to determine where the command begins and the sudo options end.
It'd probably require using the _arguments state machine to get this
right; I'm not sure it's worth the effort for this one special case.
next prev parent reply other threads:[~2009-11-21 18:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-21 17:35 Alexey I. Froloff
2009-11-21 18:33 ` Bart Schaefer [this message]
2010-03-12 15:12 ` [PATCH] Do not look into $words for options, use _arguments powers instead Alexey I. Froloff
2010-03-12 15:24 ` Alexey I. Froloff
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=091121103311.ZM16872@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=raorn@altlinux.org \
--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).