From a6bc112b675730f41bfe473c63e39bfb74d323a7 Mon Sep 17 00:00:00 2001 From: Franklin Yu Date: Wed, 3 Aug 2016 11:57:48 -0400 Subject: [PATCH] [plugin/chruby] Add "system" to completion list Detect system Ruby in default PATH, and provide "system" completion if Ruby is found. --- plugins/chruby/chruby.plugin.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh index 758b4a56..03c05425 100644 --- a/plugins/chruby/chruby.plugin.zsh +++ b/plugins/chruby/chruby.plugin.zsh @@ -95,5 +95,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