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

Re: Bug#246305: zsh: completion for sudo doesn't add commands under root's path



On Apr 30, 11:39am, Clint Adams wrote:
}
} > If you use a style, give it a generic sounding name then. Perhaps it
} > could be looked up from _command_names instead of _sudo. Keep in mind
} > that people might want to do things like add to the existing path or
} > remove `.'.
} 
} So... it should be eval'd?

If it needs eval-ing, that can be done with "zstyle -e ...".

I think he means that it should have several possible values, e.g. (just
throwing out ideas):

zstyle ':completion:*:sudo:*' command-path delete . .. '../*'

zstyle ':completion:*:sudo:*' command-path append /usr/local/bin /opt/bin

zstyle ':completion:*:sudo:*' command-path prepend ~/bin /usr/local/bin

zstyle ':completion:*:sudo:*' command-path assign /bin /usr/bin /usr/sbin

(This begs the question of what to do if you want to add things at both
the end and the beginning.)



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