about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-11-05 01:45:22 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-11-05 01:45:22 +0000
commit2f592c70328052e967cb0bf68f772d658b878c6f (patch)
tree12a241afdb084b86f9064613e8ce0e93f0f9a8c5 /Completion
parent2a4f805f8e5e0cac3d97a209577f417672775d40 (diff)
downloadzsh-2f592c70328052e967cb0bf68f772d658b878c6f.tar.gz
zsh-2f592c70328052e967cb0bf68f772d658b878c6f.tar.xz
zsh-2f592c70328052e967cb0bf68f772d658b878c6f.zip
users/9483: Merge new completion onto 4.2 branch.
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_ri24
1 files changed, 24 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_ri b/Completion/Unix/Command/_ri
new file mode 100644
index 000000000..e26b91861
--- /dev/null
+++ b/Completion/Unix/Command/_ri
@@ -0,0 +1,24 @@
+#compdef ri
+
+local curcontext="$curcontext" state line ret=1
+typeset -A opt_args
+
+_arguments \
+  '(- *)'{-h,--help}'[print help information and exit]' \
+  '(- *)'{-v,--version}'[display the version of ri]' \
+  '(-c --classes)'{-c,--classes}'[display the names of classes and modules we know about]' \
+  '(-d --doc-dir)'{-d,--doc-dir}'[directory to search for documentation]:ri doc directory:_files -/' \
+  '(-f --format)'{-f,--format}'[format to use when displaying output]:output format:(ansi bs html plain simple)' \
+  '(-l --list-names)'{-l,--list-names}'[list all the names known to RDoc]' \
+  '(-T --no-pager)'{-T,--no-pager}'[send output directly to stdout]' \
+  '(-w --width)'{-w,--width}'[set the width of the output]:output width:' \
+  '*:ri name:->ri-name' && ret=0
+
+if [[ "$state" = ri-name ]]; then
+    local ri_names expl
+
+    ri_names=( ${(f)"$( _call_program ri-names "$words[1]" ${(v)opt_args[(I)(-d|--doc-dir)]:+-d "${(v)opt_args[(I)(-d|--doc-dir)]}"} -l -T )"} )
+    _wanted ri-names expl "ri name" compadd -a ri_names && ret=0
+fi
+
+return $ret