mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
chruby: add "system" to completion list if available (#5280)
Detect system Ruby in default `PATH`, and provide "system" completion if found. Tested with [the Dockerfile](https://gist.github.com/franklinyu/b8deda6a5093a17b575679b5808b371f).
This commit is contained in:
commit
40a60d2847
1 changed files with 7 additions and 1 deletions
|
@ -111,5 +111,11 @@ function chruby_prompt_info() {
|
|||
}
|
||||
|
||||
# complete on installed rubies
|
||||
_chruby() { compadd $(chruby | tr -d '* ') }
|
||||
_chruby() {
|
||||
compadd $(chruby | tr -d '* ')
|
||||
local default_path='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
|
||||
if PATH=${default_path} type ruby &> /dev/null; then
|
||||
compadd system
|
||||
fi
|
||||
}
|
||||
compdef _chruby chruby
|
||||
|
|
Loading…
Reference in a new issue