Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: detecting superuser condition in completion



 --- Borsenkow Andrej <Andrej.Borsenkow@xxxxxxxxxxxxxx> wrote:
> Sometimes some options make sense only for superuser. Unfortunately
> testing for EUID is not enough because it does not work for
> completions
> after sudo (at least).

> Brute force method is to make _sudo set some variable and test for it
> later. Any better idea? If not, I guess we should agree on variable
> name
> or provide some helper like
> 
> _is_superuser && _wanted ...

A variable seems best to me. _is_superuser could only differentiate
root as opposed to any user (less useful after su <user> -c ...) and
it'd probably need a variable underneath to work anyway.

Oliver

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



Messages sorted by: Reverse Date, Date, Thread, Author