mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 20:29:45 +01:00
[plugin/chruby] Add "system" to completion list
Detect system Ruby in default PATH, and provide "system" completion if Ruby is found.
This commit is contained in:
parent
a7e30b26ba
commit
36808ff61e
1 changed files with 7 additions and 1 deletions
|
@ -95,5 +95,11 @@ function chruby_prompt_info() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# complete on installed rubies
|
# 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
|
compdef _chruby chruby
|
||||||
|
|
Loading…
Reference in a new issue