Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to complete alias after alias of sudo?
- X-seq: zsh-users 22725
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: How to complete alias after alias of sudo?
- Date: Fri, 02 Jun 2017 18:26:01 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=pf/Nbg EFuZJKLdzZhjaF5uTJV+ZZVvci3yAerAbJ/mU=; b=yN7ar06F2XJ99OETrc6DZq eOWjz4K6/A8hCEyuRPK8cVd2odE3VrhOyCnBcIZnaPR+QTXAOU321/EAdIPW5cx7 qKDA41RS2NE3Qj1NX9Hzqo141Ua/12eZH8zZ3pX/l5q7EaUf9Msk9NT+CT7SL89z unubQmYStMMQD0GRd6vyO7O8ldaAWPi0H0I+y/M/bUMjgpw1abvORLkz5tmJhA65 cihypsuHzkSkzPt0PqJZljTrBsrI54c5+9y1z6DMxz4zeVpsifEIbfwgt2nvc+/p dOAfhKMD/Z/rCeLAnVOPW61doFHbqZNVSGH0+BRsbyko/CHdfxkXG8uASt3coRFQ ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=pf/Nbg EFuZJKLdzZhjaF5uTJV+ZZVvci3yAerAbJ/mU=; b=Rad7Ej+D/82obuUzo54/fD 2kCXf6Y0AzysCZpXZoXwgMfFWf7IFLrz6SkEK5Ot5cAErgOcCvtIsop+eYX+ulft cX8IkuKk7ATI1QpDY+H/eIDCRUr36x7Dzr5qjB8Nk4R08V8wUeNlTyv/FsNIP9Rh OAPNjgN76zL7xtQp3yFXBDwoKNEjv7AkTewV2GVivbOV4ajaJkxY8twMKoIvGFX2 TIyFd20ynjH52fAv94yJ1cLgdU2eMisJcDoxVdZkkmtpYo2gTAgyVJPSEhPkNVP+ xcnLjPTewrUbad5T3Cu0Fif+1kGAGUjcll/L26daU51lr8yxW3vTJXouxm9zSW+w ==
- In-reply-to: <20170602094656.2945cd77@pwslap01u.europe.root.pri>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20170531082709epcas5p4cb74739bb440049fd96ca18a08489bbd@epcas5p4.samsung.com> <20170531064655.GA8512@localhost.localdomain> <20170531094310.59bb7110@pwslap01u.europe.root.pri> <20170601054320.GA3602@localhost.localdomain> <20170601101945.02560589@pwslap01u.europe.root.pri> <20170602035746.GA6211@localhost.localdomain> <20170602094656.2945cd77@pwslap01u.europe.root.pri>
Peter Stephenson wrote on Fri, 02 Jun 2017 09:46 +0100:
> Standard case: "sudo -i" runs the command in a shell, so it will use
> whatever shell environment has been provided in the sudo environment.
> In general we don't know what that is, and quite like using the local
> environment for completing functions and aliases isn't right. But
> without much more digging this may be the best solution.
There's no easy way for us to complete aliases for root; we don't even
know what shell sudo will run its command under.
However, we could add a layer of indirection so people can fill this in
their own configs:
[[[
_arguments ... '(-)1:command:_sudo_command'
_sudo_command() {
if -i or -s passed:
_sudo_aliases
else
_command_names
fi
}
_sudo_aliases() {
_command_names -e
}
]]]
... and document that _sudo_aliases is intended to be
overwritten/redefined by a user's .zshrc file.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author