summaryrefslogtreecommitdiffstats
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_ruby33
1 files changed, 25 insertions, 8 deletions
diff --git a/Completion/Unix/Command/_ruby b/Completion/Unix/Command/_ruby
index 500dadbfd..d0f3c3eb0 100644
--- a/Completion/Unix/Command/_ruby
+++ b/Completion/Unix/Command/_ruby
@@ -1,13 +1,30 @@
-#compdef ruby
+#compdef ruby -P -value-,RUBY(LIB|OPT|PATH),-default-
# ruby 1.8.0 (2003-08-14) [i686-linux]
-local expl curcontext="$curcontext" line state ret=1
+local curcontext="$curcontext" state line expl ret=1
typeset -A opt_args
-local dirs
+
+local -a args
+args=(
+ '(-)1:script file:->script'
+ '*::script argument: _normal'
+)
+
+case "$service" in
+ *RUBY(LIB|PATH)*)
+ _dir_list && return 0
+ ;;
+ *RUBYOPT*)
+ compset -q
+ words=( fake "$words[@]" )
+ (( CURRENT++ ))
+ args=()
+ ;;
+esac
_arguments -C -s -S \