summary refs log tree commit diff
diff options
context:
space:
mode:
authorDoug Kearns <dkearns@users.sourceforge.net>2005-07-11 18:32:54 +0000
committerDoug Kearns <dkearns@users.sourceforge.net>2005-07-11 18:32:54 +0000
commita18270da295568cae6f7a0689e28638d03867529 (patch)
treeb76828495936ff0b55aed4c9929b92f637bf2658
parentec8bbd0e942a64e6fac743f2b2f20c5e042ef1dc (diff)
downloadzsh-a18270da295568cae6f7a0689e28638d03867529.tar.gz
zsh-a18270da295568cae6f7a0689e28638d03867529.tar.xz
zsh-a18270da295568cae6f7a0689e28638d03867529.zip
21443: new completion for rake
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/.distfiles4
-rw-r--r--Completion/Unix/Command/_rake42
3 files changed, 48 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 60b811106..0f8402780 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 2005-07-11  Doug Kearns  <djkea2@gus.gscit.monash.edu.au>
 
-	* unposted: fix typo in first normal arg action
+	* 21443: Completion/Unix/Command/_rake: new completion for rake
+
+	* unposted: Completion/Unix/Command/_ruby: fix typo in first normal arg
+	action
 
 2005-07-10  Bart Schaefer  <schaefer@zsh.org>
 
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
index e61834a8a..7b9f36cc2 100644
--- a/Completion/Unix/Command/.distfiles
+++ b/Completion/Unix/Command/.distfiles
@@ -24,8 +24,8 @@ _ncftp          _netcat         _nice           _nmap           _nslookup
 _pack           _patch          _pbm            _perforce       _perl
 _perldoc        _php            _pine           _postfix        _prcs
 _printenv       _psutils        _python
-_raggle         _rar            _rcs            _renice         _rlogin
-_rsync          _ruby
+_raggle         _rake           _rar            _rcs            _renice
+_rlogin         _rsync          _ruby
 _sablotron      _samba          _sccs           _screen         _sed
 _sh             _showmount      _slrn           _socket         _spamassassin
 _ssh            _strip          _stty           _su             _subversion
diff --git a/Completion/Unix/Command/_rake b/Completion/Unix/Command/_rake
new file mode 100644
index 000000000..badbabb43
--- /dev/null
+++ b/Completion/Unix/Command/_rake
@@ -0,0 +1,42 @@
+#compdef rake
+
+# rake, version 0.5.4
+
+local curcontext="$curcontext" state line ret=1
+typeset -A opt_args
+
+_arguments -C \
+  '(--dry-run -n)'{--dry-run,-n}'[do a dry run without executing actions]' \
+  '(- *)'{--help,-H}'[display help information]' \
+  '(--libdir -I)'{--libdir,-I}'[include specified directory in the search path for required modules]:library directory:_files -/' \
+  '(--nosearch -N)'{--nosearch,-N}'[do not search parent directories for the Rakefile]' \
+  '(--prereqs -P)'{--prereqs,-P}'[display the tasks and prerequisites, then exit]' \
+  '(--quiet -q --silent -s)'{--quiet,-q}'[do not log messages to standard output]' \
+  '(--rakefile -f)'{--rakefile,-f}'[use specified file as the rakefile]:rake file:_files' \
+  '(--require -r)'{--require,-r}'[require specified module before executing rakefile]' \
+  '(--silent -s --quiet -q)'{--silent,-s}"[like --quiet, but also suppresses the 'in directory' announcement]" \
+  '(--tasks -T)'{--tasks,-T}'[display the tasks and dependencies, then exit]' \
+  '(--trace -t)'{--trace,-t}'[turn on invoke/execute tracing, enable full backtrace]' \
+  '(--usage -h)'{--usage,-h}'[display usage information]' \
+  '(--verbose -v)'{--verbose,-v}'[log message to standard output (default)]' \
+  '(- *)'{--version,-V}'[display version information]' \
+  '*:target:->target' && ret=0
+
+case "$state" in
+  library)
+    local -a dirs
+    dirs=( $(_call_program directories ruby -e 'puts\ $:' 2>/dev/null) )
+    _wanted libraries expl library _path_files -W dirs && ret=0
+  ;;
+  target)
+    local -a targets
+    targets=( ${${(f)"$(_call_program targets $words[1] -sT 2>/dev/null)"}/(#b)rake ([^ ]##) ##\# (*)/$match[1]:${match[2]:l}} )
+    if (( ! ${targets[(I)rake aborted!]} )) then
+      _describe -t targets 'rake target' targets && ret=0
+    else
+      _message -e targets 'rake target'
+    fi
+  ;;
+esac
+
+return ret