Unverified Commit 40a60d28 authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub
Browse files

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).
parents 6dcea3de 36808ff6
......@@ -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
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