mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-18 15:21:16 +02:00
28557: Alexey: update
This commit is contained in:
parent
24622be01c
commit
564fd4e8db
1 changed files with 12 additions and 6 deletions
|
@ -21,17 +21,23 @@ _arguments \
|
||||||
'*:ri name:->ri-name' && ret=0
|
'*:ri name:->ri-name' && ret=0
|
||||||
|
|
||||||
if [[ "$state" = ri-name ]]; then
|
if [[ "$state" = ri-name ]]; then
|
||||||
local -a ri_dirs ri_names ri_wants ri_names
|
local -a ri_dirs ri_ext ri_names ri_wants ri_names
|
||||||
local class_dir esc_name dir curtag tag descr expl
|
local class_dir esc_name dir curtag tag descr expl
|
||||||
|
|
||||||
ret=1
|
ret=1
|
||||||
|
|
||||||
if "ruby${words[1]#ri}" -rrdoc/ri/ri_options.rb -e 1 >/dev/null 2>&1; then
|
if "ruby${words[1]#ri}" -rrdoc/ri/ri_options -e 1 >/dev/null 2>&1; then
|
||||||
# Old-style Ruby 1.8.x RI
|
# Old-style Ruby 1.8.x RI
|
||||||
ri_dirs=( ${(f)"$(_call_program ri-names "ruby${words[1]#ri}" -rrdoc/ri/ri_options -e '"o = RI::Options.instance; o.parse(ARGV); o.path.each { |p| puts p }"' -- ${(kv)opt_args[(I)-d|--doc-dir|--(system|site|gems|home)]})"} )
|
ri_dirs=( ${(f)"$(_call_program ri-names "ruby${words[1]#ri}" -rrdoc/ri/ri_options -e '"o = RI::Options.instance; o.parse(ARGV); o.path.each { |p| puts p }"' -- ${(kv)opt_args[(I)-d|--doc-dir|--(system|site|gems|home)]})"} )
|
||||||
|
ri_ext=yaml
|
||||||
|
elif "ruby${words[1]#ri}" -rrdoc/ri -rrdoc/ri/store -e 1 >/dev/null 2>&1; then
|
||||||
|
# Newer-style Ruby 1.9.2 RI
|
||||||
|
ri_dirs=( ${(f)"$(_call_program ri-names "$words[1]" ${(kv)opt_args[(I)-d|--doc-dir|--((no-|)(system|site|gems|home)|standard-docs)]} --list-doc-dirs -f plain -T)"} )
|
||||||
|
ri_ext=ri
|
||||||
else
|
else
|
||||||
# New-style Ruby 1.9+ RI
|
# New-style Ruby 1.9+ RI
|
||||||
ri_dirs=( ${(f)"$(_call_program ri-names "$words[1]" ${(kv)opt_args[(I)-d|--doc-dir|--((no-|)(system|site|gems|home)|standard-docs)]} --list-doc-dirs -f plain -T)"} )
|
ri_dirs=( ${(f)"$(_call_program ri-names "$words[1]" ${(kv)opt_args[(I)-d|--doc-dir|--((no-|)(system|site|gems|home)|standard-docs)]} --list-doc-dirs -f plain -T)"} )
|
||||||
|
ri_ext=yaml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if compset -P '?*(::|\#|.)'; then
|
if compset -P '?*(::|\#|.)'; then
|
||||||
|
@ -64,14 +70,14 @@ if [[ "$state" = ri-name ]]; then
|
||||||
;;
|
;;
|
||||||
(class-methods)
|
(class-methods)
|
||||||
for dir in $ri_dirs[@]; do
|
for dir in $ri_dirs[@]; do
|
||||||
fnames=( $dir/$class_dir*-c.yaml(-.:t) )
|
fnames=( $dir/$class_dir*-c.$ri_ext(-.:t) )
|
||||||
ri_wants+=( ${${fnames%-c.yaml}//(#b)%(??)/$(print "\\x$match[1]")} )
|
ri_wants+=( ${${fnames%-c.$ri_ext}//(#b)%(??)/$(print "\\x$match[1]")} )
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
(instance-methods)
|
(instance-methods)
|
||||||
for dir in $ri_dirs[@]; do
|
for dir in $ri_dirs[@]; do
|
||||||
fnames=( $dir/$class_dir*-i.yaml(-.:t) )
|
fnames=( $dir/$class_dir*-i.$ri_ext(-.:t) )
|
||||||
ri_wants+=( ${${fnames%-i.yaml}//(#b)%(??)/$(print "\\x$match[1]")} )
|
ri_wants+=( ${${fnames%-i.$ri_ext}//(#b)%(??)/$(print "\\x$match[1]")} )
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue