From: Alexey Tourbin <at@altlinux.ru>
To: zsh-users@sunsite.dk
Subject: Re: Problem writing ri completion function
Date: Fri, 7 Oct 2005 13:08:28 +0400 [thread overview]
Message-ID: <20051007090828.GB3575@solemn.turbinal.org> (raw)
In-Reply-To: <20051006164111.GA8382@portfolio16.de>
[-- Attachment #1.1: Type: text/plain, Size: 362 bytes --]
On Thu, Oct 06, 2005 at 06:41:12PM +0200, Tobias Gruetzmacher wrote:
> Hi,
Hello,
> I was writing a new completion for ri, the ruby documentation viewing
BTW, I've got another _ri completion that was recently written by Sir Raorn.
https://bugzilla.altlinux.org/show_bug.cgi?id=7593
Please take a look (I believe it is available under the same terms as zsh).
[-- Attachment #1.2: zsh-4.3.0-alt-comp-ri.patch --]
[-- Type: text/plain, Size: 1258 bytes --]
--- zsh-4.3.0-20050926/Completion/Unix/Command/_ri- 2005-09-25 22:18:51 +0000
+++ zsh-4.3.0-20050926/Completion/Unix/Command/_ri 2005-09-25 22:22:25 +0000
@@ -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
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2005-10-07 9:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-06 16:41 Tobias Gruetzmacher
2005-10-07 9:08 ` Alexey Tourbin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051007090828.GB3575@solemn.turbinal.org \
--to=at@altlinux.ru \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).