Commit 36808ff6 authored by Franklin Yu's avatar Franklin Yu
Browse files

[plugin/chruby] Add "system" to completion list

Detect system Ruby in default PATH, and provide "system" completion if
Ruby is found.
parent a7e30b26
...@@ -95,5 +95,11 @@ function chruby_prompt_info() { ...@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment