Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: ruby completion - update for 1.8.0
- X-seq: zsh-workers 18944
- From: Doug Kearns <djkea2@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: ruby completion - update for 1.8.0
- Date: Sat, 16 Aug 2003 18:55:40 +1000
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Updated _ruby for version 1.8.0 with some minor improvements.
Regards,
Doug
Index: Completion/Unix/Command/_ruby
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ruby,v
retrieving revision 1.2
diff -u -r1.2 _ruby
--- Completion/Unix/Command/_ruby 6 Mar 2003 03:47:45 -0000 1.2
+++ Completion/Unix/Command/_ruby 16 Aug 2003 08:28:36 -0000
@@ -1,45 +1,45 @@
#compdef ruby
-# http://www.ruby-lang.org/
+# ruby 1.8.0 (2003-08-14) [i686-linux]
-local expl curcontext="$curcontext" line state
+local expl curcontext="$curcontext" line state ret=1
typeset -A opt_args
local dirs
_arguments -C -s -S \
- '(1 * -)--version[print version]' \
- '-c[syntax check]' \
- '-w[verbose mode without printing version message at the beginning]' \
- '(-d --debug)'{-d,--debug}'[debug mode]' \
+ '-0-[specify record separator]:input record separator in octal (default\: \0):' \
+ '-a[autosplit mode with -n or -p (splits $_ into $F)]' \
+ '-c[check syntax only]' \
+ '-C+[cd to directory, before executing your script]:directory:_files -/' \
+ '(-d --debug)'{-d,--debug}'[set debugging flags (set $DEBUG to true)]' \
+ "(1)*-e+[one line of script (several -e's allowed, omit program file)]:one line of script:" \
+ '-F-[split() pattern for autosplit (-a)]:input field separator:' \
+ '-i-[edit ARGV files in place (make backup if extension supplied)]:suffix for in-place-edit mode:(.bak)' \
+ '*-I+[specify $LOAD_PATH directory (may be used more than once)]:library directory:_files -/' \
+ '-K-[specifies KANJI (Japanese) code-set]:KANJI encoding:((e\:EUC-JP s\:Shift_JIS u\:UTF-8 N\:None))' \
+ "-l[assume 'while gets(); ... end' loop around your script]" \
+ "(-p)-n[assume 'while gets(); ... end' loop around your script]" \
+ '(-n)-p[assume loop like -n but print line also like sed]' \
+ '*-r+[require the library, before executing your script]:library name:->library' \
+ '-s[enable some switch parsing for switches after script name]' \
+ '-S[look for the script using PATH environment variable]' \
+ '-T-[turn on tainting checks]:taint level (default\: 0):((0\:strings\ from\ streams/environment/ARGV\ are\ tainted 1\:no\ dangerous\ operation\ by\ tainted\ value 2\:process/file\ operations\ prohibited 3\:all\ generated\ objects\ are\ tainted 4\:no\ global\ \(non-tainted\)\ variable\ modification/no\ direct\ output))' \
+ '(-v --verbose)'{-v,--verbose}'[print version number, then turn on verbose mode]' \
+ '-w[turn warnings on for your script]' \
+ '-W-[set warning level]:warning level (default\: 2):((0\:silent 1\:medium 2\:verbose))' \
+ '(-y --yydebug)'{-y,--yydebug}'[enable yacc debugging in the parser]' \
+ '-x-[strip off text before #!ruby line and perhaps cd to directory]:directory:_files -/' \
+ '(1 * -)--copyright[print the copyright]' \
'(1 * -)'{-h,--help}'[print help message]' \
- '-l[automatic line-ending processing]' \
- '(-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' \
- '-S[search ruby script in PATH]' \
- '(-v --verbose)'{-v,--verbose}'[verbose mode]' \
- '-x-[embedded script]:directory:_files -/' \
- '-C+[chdir]:directory:_files -/' \
- '(-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 * -)--version[print the version]' \
'(-)1:script file:_files -g \*.rb' \
- '*:script argument:_files' && return 0
+ '*:script argument:_files' && ret=0
case $state in
library)
- dirs=($(_call_program directories $words[1] -e 'print\ \$:.join\(\"\\n\"\)'))
- _wanted directories expl library \
- _path_files -W dirs && return 0
+ dirs=($(_call_program directories $words[1] -e 'puts\ \$:'))
+ _wanted directories expl library _path_files -W dirs && ret=0
;;
esac
-return 1
+return ret
Messages sorted by:
Reverse Date,
Date,
Thread,
Author