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

Re: Passing state information from one completion function to another?



On Aug 15, 11:31am, Andrej Borsenkow wrote:
} Subject: Passing state information from one completion function to another
}
} Is it possible for _sudo to set some state info (notably, that we are after
} sudo at all and user name) that can be queried by other functions?

Well, _killall (for example) uses $EUID to decide what process IDs to show.
So we can use `local -h EUID' in _sudo to make other completion functions
believe that the effective user ID has changed.

The question is, do we simply always set the local EUID to 0?  Do we set it
to an EUID specified by a style?  Or do we compute it somehow by parsing out
the `-u' option argument?  Probably one of the latter two; parsing probably
requires adding a state for the -u option and an extra call to _arguments,
or some such.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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