Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: sudo rpm -e completion b0rken
- X-seq: zsh-workers 27421
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "Alexey I. Froloff" <raorn@xxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: sudo rpm -e completion b0rken
- Date: Sat, 21 Nov 2009 10:33:11 -0800
- In-reply-to: <20091121173531.GA21302@xxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20091121173531.GA21302@xxxxxxxxxxxx>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author