about summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2006-11-01 02:58:07 +0000
committerClint Adams <clint@users.sourceforge.net>2006-11-01 02:58:07 +0000
commita7ba87f316b2c30c7f476f9bc7ccd697862d29b2 (patch)
tree1cf611ab87003f213c38e4b192aa4a246ec22bf5 /Completion/Unix
parent006229c32e692a5aacbef1f6237b6b076ce1816f (diff)
downloadzsh-a7ba87f316b2c30c7f476f9bc7ccd697862d29b2.tar.gz
zsh-a7ba87f316b2c30c7f476f9bc7ccd697862d29b2.tar.xz
zsh-a7ba87f316b2c30c7f476f9bc7ccd697862d29b2.zip
users/9483: completion for ri (ruby documentation viewer)
Diffstat (limited to 'Completion/Unix')
-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