From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11742 invoked from network); 28 Feb 2003 00:32:04 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 28 Feb 2003 00:32:04 -0000 Received: (qmail 4652 invoked by alias); 28 Feb 2003 00:31:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18314 Received: (qmail 4637 invoked from network); 28 Feb 2003 00:31:54 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 28 Feb 2003 00:31:54 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [203.109.249.143] by sunsite.dk (MessageWall 1.0.8) with SMTP; 28 Feb 2003 0:31:53 -0000 Received: from p1-tnt4.syd.ihug.com.au (localhost.localdomain) [203.173.134.1] by grunt23.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) id 18oYRL-0006U2-00; Fri, 28 Feb 2003 11:31:52 +1100 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.5/8.12.5) with ESMTP id h1S0YC9P004405 for ; Fri, 28 Feb 2003 11:34:12 +1100 Received: (from doug@localhost) by localhost.localdomain (8.12.5/8.12.5/Submit) id h1S0YAjt004403 for zsh-workers@sunsite.dk; Fri, 28 Feb 2003 11:34:10 +1100 X-Authentication-Warning: localhost.localdomain: doug set sender to djkea2@mugca.its.monash.edu.au using -f Date: Fri, 28 Feb 2003 11:34:09 +1100 From: Doug Kearns To: zsh-workers@sunsite.dk Subject: PATCH: improved ruby completion Message-ID: <20030228003409.GP26325@localhost.localdomain> Mail-Followup-To: zsh-workers@sunsite.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Some improvements to the ruby completion function. Regards, Doug Index: Completion/Unix/Command/_ruby =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ruby,v retrieving revision 1.1 diff -u -r1.1 _ruby --- Completion/Unix/Command/_ruby 1 Jun 2001 05:37:03 -0000 1.1 +++ Completion/Unix/Command/_ruby 28 Feb 2003 00:20:00 -0000 @@ -1,49 +1,45 @@ #compdef ruby -# completion function for Ruby. # http://www.ruby-lang.org/ local expl curcontext="$curcontext" line state typeset -A opt_args local dirs -_arguments -C -s \ - '--version[print version]' \ +_arguments -C -s -S \ + '(1 * -)--version[print version]' \ '-c[syntax check]' \ '-w[verbose mode without printing version message at the beginning]' \ - '(-d)--debug[debug mode]' \ - '(--debug)-d[debug mode]' \ - '(-h)--help[print help message]' \ - '(--help)-h[print help message]' \ + '(-d --debug)'{-d,--debug}'[debug mode]' \ + '(1 * -)'{-h,--help}'[print help message]' \ '-l[automatic line-ending processing]' \ - '-p[loop and print]' \ - '-n[loop]' \ + '(-n)-p[loop and print]' \ + '(-p)-n[loop]' \ '-a[auto-split mode]' \ '-s[switch parsing]' \ '-0-[input record separator]:input record separator in octal:' \ '-K-[specifies KANJI (Japanese) encoding]:KANJI encoding:((e\:EUC-JP s\:Shift_JIS u\:UTF-8 N\:None))' \ '-F-[input field separator]:input field separator:' \ '-i-[in-place-edit mode]:suffix for in-place-edit mode:(.bak)' \ - '-I+[library directory]:library directory:_files -/' \ - '-r+[require library]:library name:->library' \ + '*-I+[library directory]:library directory:_files -/' \ + '*-r+[require library]:library name:->library' \ '-S[search ruby script in PATH]' \ - '(--verbose)-v[verbose mode]' \ - '(-v)--verbose[verbose mode]' \ + '(-v --verbose)'{-v,--verbose}'[verbose mode]' \ '-x-[embedded script]:directory:_files -/' \ '-C+[chdir]:directory:_files -/' \ - '(--yydebug)-y[compiler debug mode]' \ - '(-y)--yydebug[compiler debug mode]' \ - '--copyright[copyright notice]' \ - '-T-[taint check]:taint level:' \ - '(1)-e+[ruby command]:ruby command:' \ - ':script file:_files' \ - ':script argument:_files' && return 0 + '(-y --yydebug)'{-y,--yydebug}'[compiler debug mode]' \ + '(1 * -)--copyright[copyright notice]' \ + '-T-[taint check]:taint level:({0..4})' \ + '(1)*-e+[ruby command]:ruby command:' \ + '(-)1:script file:_files -g \*.rb' \ + '*:script argument:_files' && return 0 case $state in library) dirs=($(_call_program directories $words[1] -e 'print\ \$:.join\(\"\\n\"\)')) _wanted directories expl library \ - _path_files -W dirs + _path_files -W dirs && return 0 ;; esac - + +return 1