summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_ruby
diff options
context:
space:
mode:
authorJun T <takimoto-j@kba.biglobe.ne.jp>2014-07-04 00:59:13 +0900
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2014-07-03 22:55:42 +0100
commitd13c6dc44168ed4c0e71497ec2bbb752600a9e53 (patch)
treee4bc839b3f74121cc1e97cd7726d6720982ca39d /Completion/Unix/Command/_ruby
parentc8e5be9d0fbbc6fb1cf06175b7c3d4757f6d973c (diff)
downloadzsh-d13c6dc44168ed4c0e71497ec2bbb752600a9e53.tar.gz
zsh-d13c6dc44168ed4c0e71497ec2bbb752600a9e53.zip
32833: complete Python and Ruby arguments as for Perl
Diffstat (limited to 'Completion/Unix/Command/_ruby')
-rw-r--r--Completion/Unix/Command/_ruby14
1 files changed, 12 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_ruby b/Completion/Unix/Command/_ruby
index 03f4e60c7..80f92d5e1 100644
--- a/Completion/Unix/Command/_ruby
+++ b/Completion/Unix/Command/_ruby
@@ -8,7 +8,7 @@ typeset -A opt_args
local -a args opts
args=(
- '(-)1:script file:_files'
+ '(-)1:script or argument:->script_or_arg'
'*::script argument: _normal'
)
@@ -18,7 +18,7 @@ opts=(
'-c[check syntax only]'
'-C+[cd to directory, before executing your script]:directory:_files -/'
'(-d --debug)'{-d,--debug}'[set debugging flags (set $DEBUG to true)]'
- "(1)*-e+[one line of script (several -e's allowed, omit program file)]:one line of script:"
+ "*-e+[one line of script (several -e's allowed, omit program file)]:one line of script:"
'-F-[split() pattern for autosplit (-a)]:input field separator:'
'-i-[edit ARGV files in place (make backup if extension supplied)]:suffix for in-place-edit mode:(.bak)'
'*-I+[specify $LOAD_PATH directory (may be used more than once)]:library directory:_files -/'
@@ -67,6 +67,16 @@ case "$state" in
dirs=( $(_call_program directories $cmd -e 'puts\ \$:' 2>/dev/null) ${(s.:.)opt_args[-I]} )
_wanted libraries expl library _path_files -W dirs && ret=0
;;
+ script_or_arg)
+ if [[ -n "$opt_args[(I)-e]" ]]; then
+ _description arg expl 'file'
+ _files "$expl[@]" && ret=0
+ else
+ _description script expl 'Ruby script'
+ _files "$expl[@]" && ret=0
+ #_files "$expl[@]" -g "*.rb(-.)" && ret=0
+ fi
+ ;;
esac
return ret