Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
'sudo chmod' completion of group names
- X-seq: zsh-workers 34412
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: 'sudo chmod' completion of group names
- Date: Tue, 27 Jan 2015 10:06:55 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=x-sasl-enc:date:from:to:subject:message-id :mime-version:content-type; s=mesmtp; bh=5dUZMOI/uOZBcPkfw80kpu7 nDl4=; b=0jsx/cxslvUIMqKIoj6zqzc34Y37cNmrCEWYKnV8TszJjJc84jKAbho ZeAQvJO9ZwtOPweRP+BX2wzBEg0wfMpsDKFKprOY9qDKCLimekp6jPXRx7O9Txwb VJKRtKzEHRZyUYEnToGrBybsy+CD4UeK/0LMPLXkdGm/XeNb4VjA=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:date:from:to:subject :message-id:mime-version:content-type; s=smtpout; bh=5dUZMOI/uOZ BcPkfw80kpu7nDl4=; b=unyjBn8gn+ulblDpbG6meFxUvwiFgtTbHV4k12KKhZb jz5hOjpSuosdFngkmMEN7Ed8YKzVkZ68DouitMYAU6JgVJxNjne4ioSvVNGKJwME SMgeHrStNp3PwlJZvktvr67B+Ax6kzZoP4o1rEt2n7JV2wB0O79Oo5F/0jn79E7A =
- 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
'sudo chown root:<tab>' completes only unix groups I'm in, rather than all
groups in the system. I'd like it to complete all unix groups in the system.
Would the following make sense? ---
diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown
index 7a7e591..1faedc3 100644
--- a/Completion/Unix/Command/_chown
+++ b/Completion/Unix/Command/_chown
@@ -32,7 +32,7 @@ _arguments -C -s "$args[@]" '*:files:->files' && ret=0
case $state in
owner)
if [[ $service = chgrp ]] || compset -P '*[:.]'; then
- if (( EGID && $+commands[groups] )); then # except for root
+ if (( EGID && $+commands[groups] && ! $+funcstack[(r)_sudo] )); then # except for root
_wanted groups expl 'group' compadd $(groups) && return 0
fi
_groups && ret=0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author