aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJulien Nicoulaud <julien.nicoulaud@gmail.com>2012-08-01 13:23:11 +0200
committerJulien Nicoulaud <julien.nicoulaud@gmail.com>2012-08-01 13:23:11 +0200
commit10ffeb0c153258896531b2b8939e94486d58b378 (patch)
treef735059d34c7f2ade7eb410643f39ecf402833d9 /src
parentAdd call for deb and rpm packagers (diff)
downloadzsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar.gz
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar.bz2
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar.lz
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar.xz
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.tar.zst
zsh-completions-10ffeb0c153258896531b2b8939e94486d58b378.zip
[BREAKING CHANGE] Move compdefs to own directory (to ease packaging and
avoid bloating users fpath with unneeded files such as README.md)
Diffstat (limited to 'src')
-rw-r--r--src/_ack173
-rw-r--r--src/_adb412
-rw-r--r--src/_android326
-rw-r--r--src/_attach50
-rw-r--r--src/_baselayout163
-rw-r--r--src/_bpython47
-rw-r--r--src/_brew101
-rw-r--r--src/_bundle85
-rw-r--r--src/_cap51
-rw-r--r--src/_choc55
-rw-r--r--src/_coffee66
-rw-r--r--src/_cpanm77
-rw-r--r--src/_debuild60
-rw-r--r--src/_dhcpcd73
-rw-r--r--src/_ditz48
-rw-r--r--src/_emulator134
-rw-r--r--src/_eselect202
-rw-r--r--src/_fab78
-rw-r--r--src/_gas48
-rw-r--r--src/_gcc-config73
-rw-r--r--src/_geany68
-rw-r--r--src/_gem456
-rw-r--r--src/_genlop150
-rw-r--r--src/_gentoo_packages224
-rw-r--r--src/_gentoolkit405
-rw-r--r--src/_git-flow334
-rw-r--r--src/_git-pulls103
-rw-r--r--src/_git-wtf53
-rw-r--r--src/_github267
-rw-r--r--src/_google64
-rw-r--r--src/_gradle130
-rw-r--r--src/_heroku169
-rw-r--r--src/_jmeter69
-rw-r--r--src/_jmeter-plugins62
-rw-r--r--src/_jonas120
-rw-r--r--src/_knife194
-rw-r--r--src/_language_codes270
-rw-r--r--src/_layman98
-rw-r--r--src/_lein44
-rw-r--r--src/_lunar309
-rw-r--r--src/_lunchy49
-rw-r--r--src/_manage.py240
-rw-r--r--src/_mosh30
-rw-r--r--src/_mvn623
-rw-r--r--src/_node61
-rw-r--r--src/_optirun67
-rw-r--r--src/_pear84
-rw-r--r--src/_perf274
-rw-r--r--src/_periscope56
-rw-r--r--src/_pgsql_utils266
-rw-r--r--src/_pip120
-rw-r--r--src/_pkcon132
-rw-r--r--src/_play210
-rw-r--r--src/_port102
-rw-r--r--src/_portage353
-rw-r--r--src/_portage_utils189
-rw-r--r--src/_pygmentize142
-rw-r--r--src/_redis-cli158
-rw-r--r--src/_rvm118
-rw-r--r--src/_sbt49
-rw-r--r--src/_scala212
-rw-r--r--src/_setup.py703
-rw-r--r--src/_showoff79
-rw-r--r--src/_smartmontools110
-rw-r--r--src/_srm63
-rw-r--r--src/_ssh-copy-id50
-rw-r--r--src/_subliminal58
-rw-r--r--src/_symfony451
-rw-r--r--src/_teamocil50
-rw-r--r--src/_thor23
-rw-r--r--src/_tmuxinator55
-rw-r--r--src/_vagrant127
-rw-r--r--src/_virtualbox312
-rw-r--r--src/_vpnc202
-rw-r--r--src/_yaourt346
75 files changed, 12075 insertions, 0 deletions
diff --git a/src/_ack b/src/_ack
new file mode 100644
index 0000000..9893c35
--- /dev/null
+++ b/src/_ack
@@ -0,0 +1,173 @@
+#compdef ack ack-grep
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for ack 1.94 (http://betterthangrep.com).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_ack() {
+ local curcontext="$curcontext" state line cmds update_policy ret=1
+
+ zstyle -s ":completion:${curcontext}:" cache-policy update_policy
+ [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _ack_types_caching_policy
+
+ unset _ack_raw_types
+ if ( [[ ${+_ack_raw_types} -eq 0 ]] || _cache_invalid "ack-grep" ) && ! _retrieve_cache "ack-grep"; then
+ _ack_raw_types=(${(S)${(f)${${"$(_call_program types $words[1] --help=types)"}#*--\[no\]}}#*no\]})
+ [[ $#_ack_raw_types -gt 0 ]] && _store_cache "ack-grep" _ack_raw_types
+ fi
+
+ _arguments -C \
+ '(- 1 *)--version[display version and copyright information]' \
+ '(- 1 *)--help[print a short help statement]' \
+ '(- 1 *)--man[print the manual page]' \
+ '(-a --all -u --unrestricted)'{-a,--all}'[operate on all files, regardless of type (but still skip directories like blib, CVS, etc.)]' \
+ '(-A --after-context -C --context)'{-A,--after-context}'[print N lines of trailing context after matching lines]:number' \
+ '(-B --before-context -C --context)'{-B,--before-context}'[print N lines of leading context before matching lines]:number' \
+ '(-C --context -A --after-context -B --before-context)'{-C,--context}'[print N lines (default 2) of context around matching lines]:number' \
+ '(-c --count)'{-c,--count}'[suppress normal output; instead print a count of matching lines for each input file]' \
+ '(--nocolor)--color[highlight the matching text]' \
+ '(--color --color-filename --color-match --color-lineno)--nocolor[supress the color]' \
+ '(--nocolor --color)--color-filename[sets the color to be used for filenames]:color:->colors' \
+ '(--nocolor --color)--color-match[sets the color to be used for matches]:color:->colors' \
+ '(--nocolor --color)--color-lineno[sets the color to be used for line numbers]:color:->colors' \
+ '--column[show the column number of the first match]' \
+ '(--noenv)--env[enable environment processing]' \
+ '(--env)--noenv[disable all environment processing, no .ackrc is read and all environment variables are ignored]' \
+ '--flush[flush output immediately]' \
+ '-f[only print the files that would be searched, without actually doing any searching]' \
+ '(--nofollow)--follow[follow symlinks]' \
+ '(--follow)--nofollow[don'\''t follow symlinks]' \
+ '-G[only paths matching the given regex are included in the search]:regex' \
+ '-g[print files where the relative path + filename matches the given regex]:regex' \
+ '(--nogroup)--group[group matches by file name]' \
+ '(--group)--nogroup[do not group matches by file name]' \
+ '(-H --with-filename -h --no-filename)'{-H,--with-filename}'[print the filename for each match]' \
+ '(-h --no-filename -H --with-filename)'{-h,--no-filename}'[suppress the prefixing of filenames on output when multiple files are searched]' \
+ '(-i --ignore-case)'{-i,--ignore-case}'[ignore case in the search strings]' \
+ '*--ignore-dir[ignore directory]:directory:_files -/' \
+ '*--noignore-dir[don'\''t ignore directory]:directory:_files -/' \
+ '--line[only print given line of each file]:number' \
+ '(-l --files-with-matches -L --files-without-matches)'{-l,--files-with-matches}'[only print the filenames of matching files, instead of the matching text]' \
+ '(-L --files-without-matches -l --files-with-matches)'{-L,--files-without-matches}'[only print the filenames of files that do NOT match]' \
+ '--match[specify the regular expression explicitly]:regex' \
+ '(-m --max-count)'{-m,--max-count}'[stop reading a file after N matches]:number' \
+ '(-r -R --recurse -n --no-recurse)'{-r,-R,--recurse}'[recurse into sub-directories]' \
+ '(-n --no-recurse -r -R --recurse)'{-n,--no-recurse}'[no descending into subdirectories]' \
+ '-o[show only the part of each line matching PATTERN (turns off text highlighting)]:pattern' \
+ '--output[output the evaluation of expr for each line (turns off text highlighting)]:expression' \
+ '--pager[direct ack'\''s output through program]:pager program:_command_names' \
+ '--passthru[prints all lines, whether or not they match the expression]' \
+ '--print0[the filenames are output separated with a null byte instead of the usual newline]' \
+ '(-Q --literal)'{-Q,--literal}'[quote all metacharacters in the pattern, it is treated as a literal]' \
+ '(--no-smart-case)--smart-case[ignore case in the search strings if pattern contains no uppercase characters]' \
+ '(--smart-case)--no-smart-case[disable --smart-case option]' \
+ '--sort-files[sorts the found files lexically]' \
+ '--show-types[outputs the filetypes that ack associates with each file]' \
+ '--thpppt[display the all-important Bill The Cat logo]' \
+ '*--type[specify the types of files to include or exclude from a search]:type:->types' \
+ '*--type-add[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \
+ '*--type-set[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \
+ '(-u --unrestricted -a --all)'{-u,--unrestricted}'[all files and directories (including blib/, core.*, ...) are searched, nothing is skipped]' \
+ '(-v --invert-match)'{-v,--invert-match}'[invert match: select non-matching lines]' \
+ '(-w --word-regexp)'{-w,--word-regexp}'[force the given pattern to match only whole words]' \
+ '-1[stops after reporting first match of any kind]' \
+ {'--','--no'}${_ack_raw_types/ ##/\[}']' \
+ '1: :->patterns' \
+ '*: :_files' \
+ && ret=0
+
+ case $state in
+ patterns)
+ _message -e patterns 'pattern' && ret=0
+ ;;
+ colors)
+ local colors; colors=(
+ 'black' 'on_black'
+ 'red' 'on_red'
+ 'green' 'on_green'
+ 'yellow' 'on_yellow'
+ 'blue' 'on_blue'
+ 'magenta' 'on_magenta'
+ 'cyan' 'on_cyan'
+ 'white' 'on_white'
+ 'clear'
+ 'reset'
+ 'dark'
+ 'bold'
+ 'underline'
+ 'underscore'
+ 'blink'
+ 'reverse'
+ 'concealed'
+ )
+ _describe -t 'colors' 'color' colors && ret=0
+ ;;
+ type-defs)
+ if compset -P '*='; then
+ local extensions; extensions=(*.*(:e))
+ _values -s ',' 'file extension' '.'$extensions && ret=0
+ else
+ _message -e type-name 'type name' && ret=0
+ fi
+ ;;
+ types)
+ local types; types=({'','no'}${_ack_raw_types/ ##/:})
+ _describe -t 'types' 'type' types
+ ;;
+ esac
+
+ return ret
+}
+
+_ack_types_caching_policy() {
+
+ # Rebuild if ackrc more recent than cache.
+ [[ -f $HOME/.ackrc && $$HOME/.ackrc -nt "$1" ]] && return 0
+
+ # Rebuild if cache is older than one week.
+ local -a oldp
+ oldp=( "$1"(Nmw+1) )
+ (( $#oldp )) && return 0
+
+ return 1
+}
+
+_ack "$@"
diff --git a/src/_adb b/src/_adb
new file mode 100644
index 0000000..e8a378a
--- /dev/null
+++ b/src/_adb
@@ -0,0 +1,412 @@
+#compdef adb
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for adb (Android Debug Bridge) 1.0.26
+# (http://developer.android.com/guide/developing/tools/adb.html).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_adb() {
+ typeset -A opt_args
+ local context state line curcontext="$curcontext" adb_args
+
+ local ret=1
+
+ _arguments -C \
+ '(-e -s)-d[directs command to the only connected USB device, returns an error if more than one USB device is present]' \
+ '(-d -s)-e[directs command to the only running emulator, returns an error if more than one emulator is running]' \
+ '(-d -e)-s[directs command to the USB device or emulator with the given serial number]: :_adb_serial_numbers' \
+ '-p[simple product name or a relative/absolute path to a product out directory]: :_adb_products' \
+ '1: :_adb_cmds' \
+ '*::arg:->args' \
+ && ret=0
+
+ adb_args="${(fkv)opt_args[(I)-d|-e|-s|-p]}"
+
+ case "$state" in
+ (args)
+ curcontext="${curcontext%:*:*}:adb-cmd-$words[1]:"
+ case $words[1] in
+ (help|version|devices|jdwp|bugreport|wait-for-device|start-server|kill-server|get-state|get-serialno|status-window|remount|reboot-bootloader|root|usb)
+ _message 'no more arguments' && ret=0
+ ;;
+ (connect|disconnect)
+ _arguments \
+ '1: :_adb_host_colon_ports' \
+ && ret=0
+ ;;
+ (push)
+ _arguments \
+ '1:local directory:_files -/' \
+ '2: :_adb_remote_files -/' \
+ && ret=0
+ ;;
+ (pull)
+ _arguments \
+ '1: :_adb_remote_files -/' \
+ '2:local directory:_files -/' \
+ && ret=0
+ ;;
+ (sync)
+ _arguments \
+ '-l[list but do not copy]' \
+ '1: :_adb_sync_directories' \
+ && ret=0
+ ;;
+ (shell|emu)
+ _arguments -C \
+ '1: :_adb_remote_commands' \
+ '*::remote-command-arg:->remote-command-args' \
+ && ret=0
+ case "$state" in
+ (remote-command-args)
+ curcontext="${curcontext%:*:*}:adb-remote-cmd-$words[1]:"
+ if (( $+functions[_adb_remote_command_$words[1]_args] )); then
+ _adb_remote_command_$words[1] && ret=0
+ # TODO Write handlers for following commands:
+ # * am (Activity Manager)
+ # * pm (Package Manager)
+ # TODO Reuse existing compdefs for standard commands (ls, id, ifconfig, kill, etc) ?
+ # How do we tell them to use _remote_ files/pids/users/etc ?
+ else
+ _adb_remote_command_default && ret=0
+ fi
+ ;;
+ esac
+ ;;
+ (logcat)
+ local -a rotation_opts
+ [[ -n ${(M)words:#"-f"} ]] && rotation_opts+=('-r[rotates the log file every kbytes of output. The default value is 16]:value (in kb)')
+ [[ -n ${(M)words:#"-r"} ]] && rotation_opts+=('-n[sets the maximum number of rotated logs. The default value is 4]:count')
+ _arguments \
+ '-b[loads an alternate log buffer for viewing, such as event or radio. The main buffer is used by default]: :_adb_logcat_buffers' \
+ '-c[clears (flushes) the entire log and exits]' \
+ '-d[dumps the log to the screen and exits]' \
+ '-f[writes log message output to file. The default is stdout]: :_files' \
+ '-g[prints the size of the specified log buffer and exits]' \
+ '-s[sets the default filter spec to silent]' \
+ '-v[sets the output format for log messages]: :_adb_logcat_output_formats' \
+ "${rotation_opts[@]}" \
+ '*: :_adb_logcat_filter_specs' \
+ && ret=0
+ ;;
+ (forward)
+ _arguments \
+ '1: :_adb_local_forward_specs' \
+ '2: :_adb_remote_forward_specs' \
+ && ret=0
+ ;;
+ (install)
+ _arguments \
+ '-l[forward-lock the app]' \
+ '-r[reinstall the app, keeping its data]' \
+ '-s[install on SD card instead of internal storage]' \
+ '1: :_files' \
+ && ret=0
+ ;;
+ (uninstall)
+ _arguments \
+ '-k[keep the data and cache directories]' \
+ '1: :_adb_packages' \
+ && ret=0
+ ;;
+ (reboot)
+ _arguments \
+ '1:program:((bootloader:reboot\ into\ the\ bootloader\ program recovery:reboot\ into\ the\ recovery\ program))' \
+ && ret=0
+ ;;
+ (tcpip)
+ _arguments \
+ '1::port' \
+ && ret=0
+ ;;
+ (ppp)
+ # TODO Complete tty (See http://developer.android.com/guide/developing/tools/adb.html#commandsummary)
+ # TODO Complete PPP parameters (See http://ppp.samba.org/pppd.html)
+ _arguments \
+ '1::tty' \
+ '*::parameters' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+
+ return ret
+}
+
+(( $+functions[_adb_cmds] )) ||
+_adb_cmds() {
+ _alternative \
+ 'general-commands:general command:_adb_general_cmds' \
+ 'device-commands:device command:_adb_device_cmds' \
+ 'scripting-commands:scripting command:_adb_scripting_cmds'
+}
+
+(( $+functions[_adb_general_cmds] )) ||
+_adb_general_cmds() {
+ local commands; commands=(
+ 'help:show help message'
+ 'version:show version number'
+ 'devices:list all connected devices'
+ 'connect:connect to a device via TCP/IP'
+ 'disconnect:disconnect from a TCP/IP device'
+ )
+ _describe -t general-commands 'general command' commands "$@"
+}
+
+(( $+functions[_adb_device_cmds] )) ||
+_adb_device_cmds() {
+ local commands; commands=(
+ 'push:copy file/dir to device'
+ 'pull:copy file/dir from device'
+ 'sync:copy host->device only if changed'
+ 'shell:run remote shell interactively or command'
+ 'emu:run emulator console command'
+ 'logcat:view device log'
+ 'forward:forward socket connections'
+ 'jdwp:list PIDs of processes hosting a JDWP transport'
+ 'install:push this padbage file to the device and install it'
+ 'uninstall:remove this app padbage from the device'
+ 'bugreport:return all information from the device'
+ )
+ _describe -t device-commands 'device command' commands "$@"
+}
+
+(( $+functions[_adb_scripting_cmds] )) ||
+_adb_scripting_cmds() {
+ local commands; commands=(
+ 'wait-for-device:block until device is online'
+ 'start-server:ensure that there is a server running'
+ 'kill-server:kill the server if it is running'
+ 'get-state:prints\: offline | bootloader | device'
+ 'get-serialno:prints\: <serial-number>'
+ 'status-window:continuously print device status for a specified device'
+ 'remount:remounts the /system partition on the device read-write'
+ 'reboot:reboots the device, optionally into the bootloader or recovery program'
+ 'reboot-bootloader:reboots the device into the bootloader'
+ 'root:restarts the adbd daemon with root permissions'
+ 'usb:restarts the adbd daemon listening on USB'
+ 'tcpip:restarts the adbd daemon listening on TCP on the specified port'
+ 'ppp:run PPP over USB'
+ )
+ _describe -t scripting-commands 'scripting command' commands "$@"
+}
+
+(( $+functions[_adb_products] )) ||
+_adb_products() {
+ _alternative \
+ 'product-names:product name:_adb_product_names' \
+ 'directories:directory:_files -/'
+}
+
+(( $+functions[_adb_product_names] )) ||
+_adb_product_names() {
+ local ret=1
+ if [[ -n "$ANDROID_PRODUCT_OUT" ]]; then
+ local product_names; product_names=("$ANDROID_PRODUCT_OUT:default value set in ANDROID_PRODUCT_OUT environment variable")
+ _describe -t product-names 'product name' product_names && ret=0
+ else
+ _message -e product-names 'product name' && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_adb_serial_numbers] )) ||
+_adb_serial_numbers() {
+ local serial_numbers; serial_numbers=(${${(M)${(f)"$(_call_program devices $service devices)"}:#*device}%%[[:space:]]*}":connected device")
+ [[ -n "$ANDROID_SERIAL" ]] && serial_numbers+=("$ANDROID_SERIAL:default value set in ANDROID_SERIAL environment variable")
+ _describe -t serial-numbers 'serial number' serial_numbers "$@" && ret=0
+}
+
+(( $+functions[_adb_packages] )) ||
+_adb_packages() {
+ local packages; packages=(${${(ps:\r\n:)"$(_call_program packages $service $adb_args shell 'ls /data/data 2>/dev/null')"}:#\**\*})
+ _multi_parts . packages
+}
+
+(( $+functions[_adb_host_colon_ports] )) ||
+_adb_host_colon_ports() {
+ local ret=1
+ if compset -P '*:'; then
+ _message -e ports 'port' && ret=0
+ else
+ _wanted hosts expl 'host' _hosts -qS: && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_adb_remote_files] )) ||
+_adb_remote_files() {
+ local dirsonly command="ls -d ${(S)words[CURRENT]/\/*//}*/ 2>/dev/null"
+ zparseopts -D -E '/=dirsonly'
+ (( ! $#dirsonly )) && command+="; ls -d ${words[CURRENT]}* 2>/dev/null"
+ local files; files=(${${(ps:\r\n:)"$(_call_program files $service $adb_args shell "'$command'" 2>/dev/null)"}:#\**\*})
+ _multi_parts "$@" / files
+}
+
+(( $+functions[_adb_remote_commands] )) ||
+_adb_remote_commands() {
+ local commands; commands=(${${(ps:\r\n:)"$(_call_program commands $service $adb_args shell "'IFS=:;for path_dir in \$PATH; do ls \$path_dir 2>/dev/null; done'" 2>/dev/null)"}:#\**\*})
+ _describe -t remote-commands 'remote command' commands && ret=0
+}
+
+(( $+functions[_adb_local_forward_specs] )) ||
+_adb_local_forward_specs() {
+ local ret=1
+ if compset -P '*:'; then
+ case ${IPREFIX%:} in
+ (tcp)
+ _message -e ports 'port' && ret=0
+ ;;
+ (localabstract|localreserved)
+ _wanted sockets expl 'socket' _socket && ret=0
+ ;;
+ (localfilesystem)
+ _wanted socket-files expl 'socket file' _files && ret=0
+ ;;
+ (dev)
+ _wanted devices expl 'device' _files -g "/dev/**" && ret=0
+ ;;
+ esac
+ else
+ local modes; modes=(
+ 'tcp:TCP socket'
+ 'localabstract:local abstract socket'
+ 'localreserved:local reserved socket'
+ 'localfilesystem:local filesystem socket'
+ 'dev:device'
+ )
+ _describe -t forward-modes 'forward mode' modes -qS: && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_adb_remote_forward_specs] )) ||
+_adb_remote_forward_specs() {
+ local ret=1
+ if compset -P '*:'; then
+ case ${IPREFIX%:} in
+ (tcp)
+ _message -e ports 'remote port' && ret=0
+ ;;
+ (localabstract|localreserved|localfilesystem)
+ _message -e sockets 'remote socket' && ret=0
+ ;;
+ (dev)
+ _message -e devices 'remote device' && ret=0
+ ;;
+ (jdwp)
+ local pids; pids=(${${(f)"$(_call_program pids $service $adb_args jdwp 2>/dev/null)"}:#\**\*})
+ _describe -t remote-pids 'remote pid' pids && ret=0
+ ;;
+ esac
+ else
+ local modes; modes=(
+ 'tcp:TCP socket'
+ 'localabstract:local abstract socket'
+ 'localreserved:local reserved socket'
+ 'localfilesystem:local filesystem socket'
+ 'dev:device'
+ 'jdwp:Java Debug Wire Protocol'
+ )
+ _describe -t forward-modes 'forward mode' modes -qS: && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_adb_sync_directories] )) ||
+_adb_sync_directories() {
+ _alternative \
+ 'partitions:partition:((system:the\ /system\ partition data:the\ /data\ partition))' \
+ 'directories:directory:_adb_remote_files -/'
+}
+
+(( $+functions[_adb_logcat_filter_specs] )) ||
+_adb_logcat_filter_specs() {
+ local ret=1
+ if compset -P '*:'; then
+ local priorities; priorities=(
+ 'V:verbose (lowest priority)'
+ 'D:debug'
+ 'I:info'
+ 'W:warning'
+ 'E:error'
+ 'F:fatal'
+ 'S:silent (highest priority, on which nothing is ever printed)'
+ )
+ _describe -t log-priorities 'log priority' priorities "$@" && ret=0
+ else
+ local tags; tags=(${(u)${${${(f)"$(_call_program tags $service $adb_args logcat -d 2>/dev/null)"}%%[[:space:]]#\(*}##*\/}:#\**\*})
+ _describe -t log-tags 'log tag' tags -qS: "$@" && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_adb_logcat_output_formats] )) ||
+_adb_logcat_output_formats() {
+ local formats; formats=(
+ 'brief:display priority/tag and PID of originating process (the default format)'
+ 'process:display PID only'
+ 'tag:display the priority/tag only'
+ 'thread:display process:thread and priority/tag only'
+ 'raw:display the raw log message, with no other metadata fields'
+ 'time:display the date, invocation time, priority/tag, and PID of the originating process'
+ 'long:display all metadata fields and separate messages with a blank lines'
+ )
+ _describe -t log-formats 'log format' formats "$@" && ret=0
+}
+
+(( $+functions[_adb_logcat_buffers] )) ||
+_adb_logcat_buffers() {
+ local buffers; buffers=(
+ 'main:view the main log buffer (default)'
+ 'radio:view the buffer that contains radio/telephony related messages'
+ 'events:view the buffer containing events-related messages'
+ )
+ _describe -t log-buffers 'log buffer' buffers "$@" && ret=0
+}
+
+(( $+functions[_adb_remote_command_default] )) ||
+_adb_remote_command_default() {
+ _wanted remote-files expl 'remote file' _adb_remote_files
+}
+
+_adb "$@"
diff --git a/src/_android b/src/_android
new file mode 100644
index 0000000..920b3f8
--- /dev/null
+++ b/src/_android
@@ -0,0 +1,326 @@
+#compdef android
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for the android command (Revision 12)
+# (http://developer.android.com/guide/developing/tools/android.html).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_android() {
+ typeset -A opt_args
+ local context state line curcontext="$curcontext"
+
+ local ret=1
+
+ _arguments -C -A "-*" \
+ '(- : *)'{-h,--help}'[get help on a specific command]:command:_android_cmds' \
+ '(-s --silent -v --verbose)'{-v,--verbose}'[verbose mode: errors, warnings and informational messages are printed]' \
+ '(-v --verbose -s --silent)'{-s,--silent}'[silent mode: only errors are printed out]' \
+ '1: :_android_cmds' \
+ '*::arg:->args' \
+ && ret=0
+
+ case "$state" in
+ (args)
+ curcontext="${curcontext%:*:*}:android-cmd-$words[1]:"
+ case $words[1] in
+ (list)
+ _arguments -C \
+ '1: :_android_list_entities' \
+ '*::list-arg:->list-args' \
+ && ret=0
+ case "$state" in
+ (list-args)
+ case $words[1] in
+ (avd|target)
+ _arguments \
+ '(-0 --null)'{-0,--null}'[terminate lines with \0 instead of \n (e.g. for xargs -0)]' \
+ '(-c --compact)'{-c,--compact}'[compact output (suitable for scripts)]' \
+ && ret=0
+ ;;
+ (sdk)
+ _arguments \
+ '(-o --obsolete)'{-o,--obsolete}'[install obsolete packages]' \
+ '--proxy-host[HTTP/HTTPS proxy host (overrides settings if defined)]:proxy host:_hosts' \
+ '--proxy-port[HTTP/HTTPS proxy port (overrides settings if defined)]:proxy port number' \
+ '(-s --no-https)'{-s,--no-https}'[use HTTP instead of HTTPS (the default) for downloads]' \
+ '(-u --no-ui)'{-u,--no-ui}'[display list result on console (no GUI)]' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ (create)
+ _arguments -C \
+ '1: :_android_create_entities' \
+ '*::create-arg:->create-args' \
+ && ret=0
+ case "$state" in
+ (create-args)
+ case $words[1] in
+ (avd)
+ _arguments \
+ '(-c --sdcard)'{-c,--sdcard}'[path to a shared SD card image, or size of a new sdcard for the new AVD]:SD card image or size:_files -g "*.img"' \
+ '(-n --name)'{-n,--name}'[name of the new AVD]:name' \
+ '(-a --snapshot)'{-a,--snapshot}'[place a snapshots file in the AVD, to enable persistence]' \
+ '(-p --path)'{-p,--path}'[directory where the new AVD will be created]: :_files -/' \
+ '(-f --force)'{-f,--force}'[forces creation (overwrites an existing AVD)]' \
+ '(-s --skin)'{-s,--skin}'[skin for the new AVD]:skin' \
+ '(-t --target)'{-t,--target}'[target ID of the new AVD]: :_android_targets' \
+ && ret=0
+ ;;
+ (project)
+ _arguments \
+ '(-n --name)'{-n,--name}'[project name]:project name' \
+ '(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
+ '(-k --package)'{-k,--package}'[Android package name for the application]:package name' \
+ '(-a --activity)'{-a,--activity}'[name of the default Activity that is created]:activity name' \
+ '(-t --target)'{-t,--target}'[target ID of the new project]: :_android_targets' \
+ && ret=0
+ ;;
+ (test-project)
+ _arguments \
+ '(-n --name)'{-n,--name}'[project name]:project name' \
+ '(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
+ '(-m --main)'{-m,--main}'[path to directory of the app under test, relative to the test project directory]:path' \
+ && ret=0
+ ;;
+ (lib-project)
+ _arguments \
+ '(-n --name)'{-n,--name}'[project name]:project name' \
+ '(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
+ '(-k --package)'{-k,--package}'[Android package name for the application]:package name' \
+ '(-t --target)'{-t,--target}'[target ID of the new project]: :_android_targets' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ (update)
+ _arguments -C \
+ '1: :_android_update_entities' \
+ '*::update-arg:->update-args' \
+ && ret=0
+ case "$state" in
+ (update-args)
+ case $words[1] in
+ (avd)
+ _arguments \
+ '(-n --name)'{-n,--name}'[name of the AVD to update]: :_android_avd_names' \
+ && ret=0
+ ;;
+ (project)
+ _arguments \
+ '(-l --library)'{-l,--library}'[directory of an Android library to add, relative to this project'\''s directory]: :_files -/' \
+ '(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
+ '(-n --name)'{-n,--name}'[project name]:name' \
+ '(-t --target)'{-t,--target}'[target ID to set for the project]: :_android_targets' \
+ '(-s --subprojects)'{-s,--subprojects}'[also updates any projects in sub-folders, such as test projects]' \
+ && ret=0
+ ;;
+ (test-project)
+ _arguments \
+ '(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
+ '(-m --main)'{-m,--main}'[directory of the app under test, relative to the test project directory]:path' \
+ && ret=0
+ ;;
+ (lib-project)
+ _arguments \
+ '(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
+ '(-t --target)'{-t,--target}'[target ID to set for the project]: :_android_targets' \
+ && ret=0
+ ;;
+ (sdk)
+ _arguments \
+ '(-o --obsolete)'{-o,--obsolete}'[install obsolete packages]' \
+ '--proxy-host[HTTP/HTTPS proxy host (overrides settings if defined)]:proxy host:_hosts' \
+ '--proxy-port[HTTP/HTTPS proxy port (overrides settings if defined)]:proxy port number' \
+ '(-s --no-https)'{-s,--no-https}'[use HTTP instead of HTTPS (the default) for downloads]' \
+ '(-u --no-ui)'{-u,--no-ui}'[update from command-line (no GUI)]' \
+ '(-f --force)'{-f,--force}'[force replacement of a package or its parts, even if something has been modified]' \
+ '(-t --filter)'{-t,--filter}'[a filter that limits the update to the specified types of packages]: :_android_sdk_update_filters -s ,' \
+ '(-n --dry-mode)'{-n,--dry-mode}'[simulate the update but does not download or install anything]' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ (move)
+ _arguments -C \
+ '1: :_android_move_entities' \
+ '*::move-arg:->move-args' \
+ && ret=0
+ case "$state" in
+ (move-args)
+ case $words[1] in
+ (avd)
+ _arguments \
+ '(-n --name)'{-n,--name}'[name of the AVD to move or rename]: :_android_avd_names' \
+ '(-p --path)'{-p,--path}'[path to the AVD'\''s new directory]: :_files -/' \
+ '(-r --rename)'{-r,--rename}'[new name of the AVD]:name' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ (delete)
+ _arguments -C \
+ '1: :_android_delete_entities' \
+ '*::delete-arg:->delete-args' \
+ && ret=0
+ case "$state" in
+ (delete-args)
+ case $words[1] in
+ (avd)
+ _arguments \
+ '(-n --name)'{-n,--name}'[name of the AVD to delete]: :_android_avd_names' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ (display)
+ _arguments \
+ '1: :_android_display_entities' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+
+ return ret
+}
+
+(( $+functions[_android_cmds] )) ||
+_android_cmds() {
+ local commands; commands=(
+ 'list:list existing targets or virtual devices'
+ 'create:create new virtual devices or projects'
+ 'update:update a virtual device, project, SDK or adb'
+ 'move:move a virtual device'
+ 'delete:delete a virtual device'
+ 'display:display manager windows'
+ )
+ _describe -t commands 'command' commands "$@"
+}
+
+(( $+functions[_android_list_entities] )) ||
+_android_list_entities() {
+ local entities; entities=(
+ 'avd:list existing Android Virtual Devices'
+ 'target:list existing targets'
+ 'sdk:list remote SDK repository'
+ )
+ _describe -t entities 'entity' entities "$@"
+}
+
+(( $+functions[_android_create_entities] )) ||
+_android_create_entities() {
+ local entities; entities=(
+ 'avd:create a new Android Virtual Device'
+ 'project:create a new Android project'
+ 'test-project:create a new Android project for a test package'
+ 'lib-project:create a new Android library project'
+ )
+ _describe -t entities 'entity' entities "$@"
+}
+
+(( $+functions[_android_update_entities] )) ||
+_android_update_entities() {
+ local entities; entities=(
+ 'avd:update an Android Virtual Device to match the folders of a new SDK'
+ 'project:update an Android project'
+ 'test-project:update the Android project for a test package'
+ 'lib-project:update an Android library project'
+ 'adb:update adb to support the USB devices declared in the SDK add-ons'
+ 'sdk:update the SDK by suggesting new platforms to install if available'
+ )
+ _describe -t entities 'entity' entities "$@"
+}
+
+(( $+functions[_android_move_entities] )) ||
+_android_move_entities() {
+ local entities; entities=(
+ 'avd:move or rename an Android Virtual Device'
+ )
+ _describe -t entities 'entity' commands "$@"
+}
+
+(( $+functions[_android_delete_entities] )) ||
+_android_delete_entities() {
+ local entities; entities=(
+ 'avd:delete an Android Virtual Device'
+ )
+ _describe -t entities 'entity' entities "$@"
+}
+
+(( $+functions[_android_display_entities] )) ||
+_android_display_entities() {
+ local entities; entities=(
+ 'sdk:display the SDK Manager window'
+ 'avd:display the AVD Manager window'
+ )
+ _describe -t entities 'entity' entities "$@"
+}
+
+(( $+functions[_android_targets] )) ||
+_android_targets() {
+ local targets; targets=(${(f)"$(_call_program targets $service list target --compact)"//:/\\:})
+ _describe -t targets 'target' targets "$@"
+}
+
+(( $+functions[_android_avd_names] )) ||
+_android_avd_names() {
+ local avd_names; avd_names=(${(f)"$(_call_program targets $service list avd --compact)"//:/\\:})
+ _describe -t avd-names 'AVD name' avd_names "$@"
+}
+
+(( $+functions[_android_sdk_update_filters] )) ||
+_android_sdk_update_filters() {
+ local filters; filters=(platform tool platform-tool doc sample extra)
+ _values $@ 'filter' "${filters[@]}"
+}
+
+_android "$@"
diff --git a/src/_attach b/src/_attach
new file mode 100644
index 0000000..ac0c344
--- /dev/null
+++ b/src/_attach
@@ -0,0 +1,50 @@
+#compdef attach
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for attach (http://github.com/sorin-ionescu/attach).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Sorin Ionescu <sorin.ionescu@gmail.com>
+#
+# ------------------------------------------------------------------------------
+
+local state mode_values existing_sessions ret=1
+
+mode_values=(
+ "none:disable redrawing"
+ "ctrl_l:use ctrl + l to redraw"
+ "winch:use sigwinch to redraw"
+)
+
+existing_sessions=($(_call_program session attach))
+
+_arguments -C -s -S \
+ '(--list -l)'{--list,-l}'[list sessions]' \
+ '(--sockets -L)'{--sockets,-L}'[list sockets]' \
+ '(--session -s)'{--session=,-s+}'[set the session name]:session' \
+ '(--char -c)'{--char=,-c+}'[set the detach character (default: ^\\)]:char' \
+ '(--redraw -r)'{--redraw=,-r+}'[set the redraw method (none, ctrl_l, or winch)]:mode:->mode' \
+ '(--detached -d)'{--detached,-d}'[start the session detached]' \
+ '(--no-detach -D)'{--no-detach,-D}'[disable detaching]' \
+ '(--no-suspend -Z)'{--no-suspend,-Z}'[disable suspending]' \
+ '(--version -v)'{--version,-v}'[display version and copyright]' \
+ '(--help -h)'{--help,-h}'[display help]' \
+ '(-)::args:->session-or-command' && ret=0
+
+case "$state" in
+ (mode)
+ _describe -t mode 'redraw mode' mode_values && ret=0
+ ;;
+ (session-or-command)
+ _describe -t 'session' 'sessions' existing_sessions && ret=0
+ _path_commands && ret=0
+ ;;
+esac
+
+return $ret
+
diff --git a/src/_baselayout b/src/_baselayout
new file mode 100644
index 0000000..e6662de
--- /dev/null
+++ b/src/_baselayout
@@ -0,0 +1,163 @@
+#compdef rc-update rc-status rc rc-service
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Gentoo Baselayout v2 and OpenRC v0.8 (init system).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Vadim A. Misbakh-Soloviev <mva@mva.name>
+# * Bapt <bapt@tuxfamily.org>
+# * kaworu <kaworu@kaworu.ch>
+# * David Durrleman <dualmoo@gmail.com>
+# * oberyno <oberyno@gmail.com>
+# * Mamoru Komachi <usata@usata.org>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+#<sys-apps/baselayout-1.12.11.1>
+#
+# Status:
+# rc (fully done)
+# rc-update (fully done)
+# rc-status (fully done)
+# rc-service (to be improved)
+
+
+local gentoo_runlevels
+gentoo_runlevels=(/etc/runlevels/*(:t))
+
+
+# Stuff for rc
+_rc () {
+ if (( CURRENT == 2 )); then
+ _values 'runlevels' $gentoo_runlevels
+ fi
+}
+
+_rc_list_service () {
+ local servicelist
+ servicelist=(${(f)"$(/sbin/rc-service -Cl 2>/dev/null)"})
+ _values 'services' $servicelist
+}
+# Stuff for rc-service
+_rc-service () {
+ servicelist=${(f)"$(/sbin/rc-service -Cl 2>/dev/null)"}
+ if (( CURRENT == 2 ));then
+ _arguments -s \
+ '(-e --exists)'{-e,--exists}"[tests if the service exists or not]" \
+ '(-l --list)'{-l,--list}'[list all available services]' \
+ '(-r --resolve)'{-r,--resolve}'[resolve the service name to an init script]' \
+ '(-C --nocolor)'{-C,--nocolor}'[Disable color output]' \
+ '(-v --verbose)'{-v,--verbose}'[Run verbosely]' \
+ '(-q --quiet)'{-q,--quiet}'[Run quietly]'
+ _rc_list_service
+ else
+ case $words[2] in
+ -e|--exists|-r|--resolve)
+ (( CURRENT > 3 )) && return 0
+ _rc_list_service
+ ;;
+ -*)
+ return 0
+ ;;
+ *)
+ _values "action" stop start restart describe zap
+ ;;
+ esac
+ fi
+}
+
+# Stuff for rc-status
+_rc-status () {
+ _arguments -s \
+ '(-a --all)'{-a,--all}'[Show services at all run levels]' \
+ '(-l --list)'{-l,--list}'[Show list of run levels]' \
+ '(-nc --nocolor)'{-nc,--nocolor}'[Disable color output]' \
+ '(-s --servicelist)'{-s,--servicelist}'[Show all services]' \
+ '(-u --unused)'{-u,--unused}'[Show services not assigned to any run level]'
+
+ _values 'runlevels' $gentoo_runlevels
+}
+
+
+# Stuff for rc-update
+_rc-update () {
+ local used_init
+
+ # FIXME: ${=${(f)"$(rc-update show 2>/dev/null)"}% |*} yield the same result (for me).
+ # we probably don't need any more the (M) matcher part.
+ used_init=(${=${(M)${(f)"$(/sbin/rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*})
+
+ if (( CURRENT == 2 )); then
+ _values 'rc-update actions' \
+ 'add[Add script to a runlevel]' \
+ 'del[Delete script from a runlevel]' \
+ 'show[Show scripts lanched at a runlevel]' \
+ '-a[Add script to a runlevel]' \
+ '-d[Delete script from a runlevel]' \
+ '-s[Show scripts lanched at a runlevel]'
+ elif (( CURRENT == 3 )); then
+ case "$words[2]" in
+ add|-a)
+ _values 'scripts' /etc/init.d/*~*.sh(:t)
+ ;;
+ del|-d)
+ _values 'scripts' $used_init
+ ;;
+ show|-s)
+ _values 'runlevels' $gentoo_runlevels \
+ '-v[Show all init scripts]' \
+ '--verbose[Show all init scripts]'
+ ;;
+ esac
+ elif (( CURRENT == 4 )); then
+ _values 'runlevels' $gentoo_runlevels
+ fi
+}
+
+
+case "$service" in
+ rc-update)
+ _rc-update "$@" && return 0
+ ;;
+ rc-service)
+ _rc-service "$@" && return 0
+ ;;
+ rc-status)
+ _rc-status "$@" && return 0
+ ;;
+ rc)
+ _rc "$@" && return 0
+ ;;
+esac
diff --git a/src/_bpython b/src/_bpython
new file mode 100644
index 0000000..3ce52df
--- /dev/null
+++ b/src/_bpython
@@ -0,0 +1,47 @@
+#compdef bpython bpython2
+# ------------------------------------------------------------------------------
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for bpython (http://bpython-interpreter.org/).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+_arguments -A "-*" \
+ '(-h --help)'{-h,--help}'[Show help message]' \
+ '(-i --interactive)'{-i,--interactive}'[Drop to bpython shell after running file instead of exiting]' \
+ '(-q --quiet)'{-q,--quiet}"[Don't flush the output to stdout]" \
+ '(-V --version)'{-V,--version}'[Print version and exit]' \
+ '--config[Use CONFIG instead of default config file]:Config file:_files' \
+ '*: :_files' \ No newline at end of file
diff --git a/src/_brew b/src/_brew
new file mode 100644
index 0000000..d374cca
--- /dev/null
+++ b/src/_brew
@@ -0,0 +1,101 @@
+#compdef brew
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for brew (https://github.com/mxcl/homebrew).
+#
+# Source: https://github.com/mxcl/homebrew/blob/master/Library/Contributions/brew_zsh_completion.zsh
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * kulakowski (https://github.com/kulakowski)
+# * Gabe Berke-Williams (https://github.com/gabebw)
+# * James Conroy-Finn (https://github.com/jcf)
+# * Daniel Schauenberg (https://github.com/mrtazz)
+# * Adam Vandenberg (https://github.com/adamv)
+# * Erik Kastner (https://github.com/kastner)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_brew_all_formulae() {
+ formulae=(`brew search`) # FIXME _call_program should be used here
+}
+
+_brew_installed_formulae() {
+ installed_formulae=(`brew list`) # FIXME _call_program should be used here
+}
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'cat:display formula file for a formula'
+ 'cleanup:uninstall unused and old versions of packages'
+ 'create:create a new formula'
+ 'deps:list dependencies and dependants of a formula'
+ 'doctor:audits your installation for common issues'
+ 'edit:edit a formula'
+ 'home:visit the homepage of a formula or the brew project'
+ 'info:information about a formula'
+ 'install:install a formula'
+ 'link:link a formula'
+ 'list:list files in a formula or not-installed formulae'
+ 'log:git commit log for a formula'
+ 'missing:check all installed formulae for missing dependencies.'
+ 'outdated:list formulae for which a newer version is available'
+ 'prune:remove dead links'
+ 'remove:remove a formula'
+ 'search:search for a formula (/regex/ or string)'
+ 'server:start a local web app that lets you browse formulae (requires Sinatra)'
+ 'unlink:unlink a formula'
+ 'update:freshen up links'
+ 'upgrade:upgrade outdated formulae'
+ 'uses:show formulae which depend on a formula'
+)
+
+local expl
+local -a formulae installed_formulae
+
+_arguments \
+ '(-v)-v[verbose]' \
+ '(--cellar)--cellar[brew cellar]' \
+ '(--config)--config[brew configuration]' \
+ '(--env)--env[brew environment]' \
+ '(--repository)--repository[brew repository]' \
+ '(--version)--version[version information]' \
+ '(--prefix)--prefix[where brew lives on this system]' \
+ '(--cache)--cache[brew cache]' \
+ '*:: :->subcmds' && return 0
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "brew subcommand" _1st_arguments
+ return
+fi
+
+case "$words[1]" in
+ search|-S)
+ _arguments \
+ '(--macports)--macports[search the macports repository]' \
+ '(--fink)--fink[search the fink repository]' ;;
+ list|ls)
+ _arguments \
+ '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
+ '(--versions)--versions[list all installed versions of a formula]' \
+ '1: :->forms' && return 0
+
+ if [[ "$state" == forms ]]; then
+ _brew_installed_formulae
+ _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
+ fi ;;
+ install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
+ _brew_all_formulae
+ _wanted formulae expl 'all formulae' compadd -a formulae ;;
+ remove|rm|uninstall|unlink|cleanup|link|ln)
+ _brew_installed_formulae
+ _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
+esac
diff --git a/src/_bundle b/src/_bundle
new file mode 100644
index 0000000..e07acf5
--- /dev/null
+++ b/src/_bundle
@@ -0,0 +1,85 @@
+#compdef bundle
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Bundler (http://gembundler.com).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Bruno Michel (https://github.com/nono)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local curcontext="$curcontext" state line _gems _opts ret=1
+
+_arguments -C -A "-v" -A "--version" \
+ '(- 1 *)'{-v,--version}'[display version information]' \
+ '1: :->cmds' \
+ '*:: :->args' && ret=0
+
+case $state in
+ cmds)
+ _values "bundle command" \
+ "install[Install the gems specified by the Gemfile or Gemfile.lock]" \
+ "update[Update dependencies to their latest versions]" \
+ "package[Package the .gem files required by your application]" \
+ "exec[Execute a script in the context of the current bundle]" \
+ "config[Specify and read configuration options for bundler]" \
+ "check[Determine whether the requirements for your application are installed]" \
+ "list[Show all of the gems in the current bundle]" \
+ "show[Show the source location of a particular gem in the bundle]" \
+ "console[Start an IRB session in the context of the current bundle]" \
+ "open[Open an installed gem in the editor]" \
+ "viz[Generate a visual representation of your dependencies]" \
+ "init[Generate a simple Gemfile, placed in the current directory]" \
+ "gem[Create a simple gem, suitable for development with bundler]" \
+ "help[Describe available tasks or one specific task]"
+ ret=0
+ ;;
+ args)
+ case $line[1] in
+ help)
+ _values 'commands' 'install update package exec config check list show console open viz init gem help' && ret=0
+ ;;
+ install)
+ _arguments \
+ '(--no-color)--no-color[disable colorization in output]' \
+ '(--local)--local[do not attempt to connect to rubygems.org]' \
+ '(--quiet)--quiet[only output warnings and errors]' \
+ '(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
+ '(--system)--system[install to the system location]' \
+ '(--deployment)--deployment[install using defaults tuned for deployment environments]' \
+ '(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
+ '(--path)--path=-[specify a different path than the system default]:path:_files' \
+ '(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
+ '(--without)--without=-[exclude gems that are part of the specified named group]:groups'
+ ret=0
+ ;;
+ exec)
+ _normal && ret=0
+ ;;
+ (open|show)
+ _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
+ if [[ $_gems != "" ]]; then
+ _values 'gems' $_gems && ret=0
+ fi
+ ;;
+ *)
+ _opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
+ _opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
+ if [[ $_opts != "" ]]; then
+ _values 'options' $_opts && ret=0
+ fi
+ ;;
+ esac
+ ;;
+esac
+
+return ret
diff --git a/src/_cap b/src/_cap
new file mode 100644
index 0000000..6ed1287
--- /dev/null
+++ b/src/_cap
@@ -0,0 +1,51 @@
+#compdef cap
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Capistrano (http://capify.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Bruno Michel (https://github.com/nono)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local curcontext="$curcontext" state line cmds ret=1
+
+_arguments -C \
+ {-d,--debug}'[Prompts before each remote command execution]' \
+ {-e,--explain}'[Displays help (if available) for the task]:task' \
+ {-F,--default-config}'[Always use default config, even with -f]' \
+ {-f,--file}'[A recipe file to load. May be given more than once]:file:_files' \
+ {-H,--long-help}'[Explain these options and environment variables]' \
+ {-h,--help}'[Display this help message]' \
+ {-l,--logger}'[Choose logger method. STDERR used by default]:file:_files' \
+ {-n,--dry-run}'[Prints out commands without running them]' \
+ {-p,--password}'[Immediately prompt for the password]' \
+ {-q,--quiet}'[Make the output as quiet as possible]' \
+ {-r,--preserve-roles}'[Preserve task roles]' \
+ {-S,--set-before}'[Set a variable before the recipes are loaded]:variable' \
+ {-s,--set}'[Set a variable after the recipes are loaded]:variable' \
+ {-T,--tasks}'[List all tasks (matching optional PATTERN) in the loaded recipe files]:pattern' \
+ {-t,--tool}'[Abbreviates the output of -T for tool integration]' \
+ {-V,--version}'[Display the Capistrano version, and exit]' \
+ {-v,--verbose}'[Be more verbose. May be given more than once]' \
+ {-X,--skip-system-config}'[Do not load the system config file (capistrano.conf)]' \
+ {-x,--skip-user-config}'[Do not load the user config file (.caprc)]' \
+ '*: :->cmds' && ret=0
+
+case $state in
+ cmds)
+ cmds=( ${(f)"$(_call_program commands cap -T 2> /dev/null | sed -e '/ # /!d; s/:/\\:/g; s/cap \([A-Za-z0-9\\:_-]*\) .*# /\1:/')"} )
+ _describe -t commands 'cap command' cmds && ret=0
+ ;;
+esac
+
+return ret
diff --git a/src/_choc b/src/_choc
new file mode 100644
index 0000000..cba20c2
--- /dev/null
+++ b/src/_choc
@@ -0,0 +1,55 @@
+#compdef choc
+# ------------------------------------------------------------------------------
+# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for choc (http://chocolatapp.com)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Nicholas Penree (https://github.com/drudge)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+local curcontext="$curcontext" state line ret=1
+typeset -A opt_args
+
+_arguments -C \
+ '(-a --async)'{-a,--async}'[do not wait for the user to close the file in Chocolat]' \
+ '(-w --wait)'{-w,--wait}'[wait for file to be closed by Chocolat]' \
+ '(-n --no-reactivation)'{-n,--no-reactivation}'[after editing with -w, do not reactivate the calling app]' \
+ '(-h --help)'{-h,--help}'[show help information]' \
+ '(-v --version)'{-v,--version}'[print version information]' \
+ '*:script or directory:_files' && ret=0
+
+return ret \ No newline at end of file
diff --git a/src/_coffee b/src/_coffee
new file mode 100644
index 0000000..27c38c8
--- /dev/null
+++ b/src/_coffee
@@ -0,0 +1,66 @@
+#compdef coffee
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Mario Fernandez (https://github.com/sirech)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+local curcontext="$curcontext" state line ret=1
+typeset -A opt_args
+
+_arguments -C \
+ '(- *)'{-h,--help}'[display this help message]' \
+ '(- *)'{-v,--version}'[display the version number]' \
+ '(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
+ '(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
+ '(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
+ '(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
+ '(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]' \
+ '(--nodejs)--nodejs[pass options directly to the "node" binary]' \
+ '(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
+ '(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
+ '(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
+ '(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
+ '(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
+ '(-r --require)'{-r,--require}'[require a library before executing your script]:library' \
+ '(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
+ '(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
+ '*:script or directory:_files' && ret=0
+
+return ret
diff --git a/src/_cpanm b/src/_cpanm
new file mode 100644
index 0000000..2dfba66
--- /dev/null
+++ b/src/_cpanm
@@ -0,0 +1,77 @@
+#compdef cpanm
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for cpanm (http://search.cpan.org/dist/App-cpanminus/lib/App/cpanminus.pm).
+#
+# Source: https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Ryushi (https://github.com/rshhh)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local arguments curcontext="$curcontext"
+typeset -A opt_args
+
+
+arguments=(
+
+# Commands
+# '(--install -i)'{--install,-i}'[Installs the modules]'
+ '(- :)--self-upgrade[Upgrades itself]'
+ '(- :)--info[Displays distribution info on CPAN]'
+ '(--installdeps)--installdeps[Only install dependencies]'
+ '(--look)--look[Download/unpack the distribution and then open the directory with your shell]'
+ '(- :)'{--help,-h}'[Displays help information]'
+ '(- :)'{--version,-V}'[Displays software version]'
+
+# Options
+ {--force,-f}'[Force install]'
+ {--notest,-n}'[Do not run unit tests]'
+ {--sudo,-S}'[sudo to run install commands]'
+ '(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]'
+ '(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]'
+ {--local-lib,-l}'[Specify the install base to install modules]'
+ {--local-lib-contained,-L}'[Specify the install base to install all non-core modules]'
+ '--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls'
+ '--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]'
+ '--prompt[Prompt when configure/build/test fails]'
+ '--reinstall[Reinstall the distribution even if you already have the latest version installed]'
+ '--interactive[Turn on interactive configure]'
+
+ '--scandeps[Scan the depencencies of given modules and output the tree in a text format]'
+ '--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)'
+
+ '--save-dists[Specify the optional directory path to copy downloaded tarballs]'
+# '--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]'
+
+ '--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]'
+ '(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]'
+ '(--man-pages)--no-man-pages[Do not generate man pages]'
+
+
+ # Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP,
+ # Wget, cURL and HTTP::Tiny (in that order) and uses the first one available.
+ # (So that the exclusions are not enabled here for the completion)
+ '(--lwp)--lwp[Use LWP module to download stuff]'
+ '(--wget)--wget[Use GNU Wget (if available) to download stuff]'
+ '(--curl)--curl[Use cURL (if available) to download stuff]'
+
+# Other completions
+ '*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"'
+ # '*::args: _normal' # this looks for default files (any files)
+)
+_arguments -s $arguments \
+ && return 0
+
+return 1
+
diff --git a/src/_debuild b/src/_debuild
new file mode 100644
index 0000000..73e3704
--- /dev/null
+++ b/src/_debuild
@@ -0,0 +1,60 @@
+#compdef debuild
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for debuild 2.10.
+#
+# Status: incomplete.
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+# FIXME --noconf is only allowed in first position
+_arguments \
+ '(- 1 *)'{-h,--help}'[show help]' \
+ '(- 1 *)--version[show version and copyright information]' \
+ {--no-conf,--noconf}'[don'\''t read devscripts config files]' \
+ {-r-,--rootcmd=}'[command used to become root if debuild not setuid root (default: fakeroot)]: :_command_names' \
+ '*'{-e-,--preserve-envvar=}'[preserve environment variable]: :_vars' \
+ '(-e --preserve-envvar)--preserve-env[preserve all environment vars (except PATH)]' \
+ '*'{-e-,--set-envvar=}'[preserve environment variable]: :_vars -qS=' \
+ '--prepend-path=[prepend to the sanitised PATH]: :_files -/' \
+ '(-D)-d[skip checking of build dependencies]' \
+ '(-d)-D[force checking of build dependencies]' \
+ '--check-dirname-level[how much to check directory names]:level:((0\:never 1\:only\ if\ program\ changes\ directory\ \(default\) 2\:always))' \
+ '--check-dirname-regex[Perl regex defining matching directory names, the string PACKAGE will be replaced by the package name (default: '\''PACKAGE(-.+)?'\'')]:regex'
diff --git a/src/_dhcpcd b/src/_dhcpcd
new file mode 100644
index 0000000..5f7ea05
--- /dev/null
+++ b/src/_dhcpcd
@@ -0,0 +1,73 @@
+#compdef dhcpcd
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for dhcpcd 2.3.2.
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_arguments \
+ '1:network interface:_net_interfaces' \
+ - release \
+ '(-k --release)'{-k,--release}'[causes an existing dhcpcd process running on the interface to release it'\''s lease, deconfigure the interface and then exit]' \
+ - exit \
+ '(-x --exit)'{-x,--exit}'[causes an existing dhcpcd process running on the interface to exit]' \
+ - main \
+ '(-d --debug)'{-d,--debug}'[echo debug and informational messages to the console]' \
+ '(-h --hostname)'{-h,--hostname}'[specify the hostname sent, or an empty string to stop any hostname from being sent]:hostname:_hosts' \
+ '(-i --classid)'{-i,--classid}'[override the DHCP vendor classid field we send]:classid' \
+ '(-l --leasetime)'{-l,--leasetime}'[request a specific lease time in seconds]:lesae time \(seconds\)' \
+ '(-m --metric)'{-m,--metric}'[added routes will use the metric on systems where this is supported]:metric' \
+ '(-n --renew)'{-n,--renew}'[notifies an existing dhcpcd process running on the interface to renew it'\''s lease]' \
+ '(-p --persistent)'{-p,--persistent}'[don'\''t deconfigure the interface and configuration at exit]' \
+ '(-r --request)'{-r,--request}'[skip the broadcast request step and just request an address]:address' \
+ '(-s --inform)'{-s,--inform}'[behaves exactly like -r, but sends a DHCP inform instead of a request]:address' \
+ '(-t --timeout)'{-t,--timeout}'[timeout after seconds, instead of the default 20]:timeout \(seconds\)' \
+ '(-u --userclass)'{-u,--userclass}'[tags the DHCP message with the userclass class]:class' \
+ '*'{-H,--sethostname}'[forces dhcpcd to set the hostname as supplied by the DHCP server]' \
+ '({-I --clientid)'{-I,--clientid}'[send clientid as a client identifier string]:clientid' \
+ '*'{-S,--mscsr}'[request Microsoft specific Classless Static Routes (RFC 3442) code as well]' \
+ '(-A --noarp)'{-A,--noarp}'[don'\''t request or claim the address by ARP]' \
+ '(-G --nogateway)'{-G,--nogateway}'[don'\''t set any default routes]' \
+ '(-L --noipv4ll)'{-L,--noipv4ll}'[don'\''t use IPv4LL at all]' \
+ '(-M --nomtu)'{-M,--nomtu}'[don'\''t set the MTU of the interface]' \
+ '(-N --nontp)'{-N,--nontp}'[don'\''t touch /etc/ntpd.conf or restart the ntp service]' \
+ '(-R --nodns)'{-R,--nodns}'[don'\''t send DNS information to resolvconf or touch /etc/resolv.conf]' \
+ '(-T --test)'{-T,--test}'[on receipt of discover messages, simply print the contents of the DHCP message to the console]' \
+ '(-Y --nonis)'{-Y,--nonis}'[don'\''t touch /etc/yp.conf or restart the ypbind service]'
diff --git a/src/_ditz b/src/_ditz
new file mode 100644
index 0000000..b96f111
--- /dev/null
+++ b/src/_ditz
@@ -0,0 +1,48 @@
+#compdef ditz
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Ditz (http://ditz.rubyforge.org).
+#
+# Source: https://github.com/technolize/zsh-completion-funcs
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * technolize (https://github.com/technolize)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local ME=ditz
+local COMMANDS=--commands
+local OPTIONS='<options>'
+
+if (($CURRENT == 2)); then
+ # We're completing the first word after the tool: the command.
+ _wanted command expl "$ME command" \
+ compadd -- $( "$ME" "$COMMANDS" )
+else
+ # Find the options/files/URL/etc. for the current command by using the tool itself.
+ case "${words[$CURRENT]}"; in
+ -*)
+ _wanted args expl "Arguments for $ME ${words[2]}" \
+ compadd -- $( "$ME" "${words[2]}" "$OPTIONS" ; _files )
+ ;;
+ ht*|ft*)
+ _arguments '*:URL:_urls'
+ ;;
+ /*|./*|\~*|../*)
+ _arguments '*:file:_files'
+ ;;
+ *)
+ _wanted args expl "Arguments for $ME ${words[2]}" \
+ compadd -- $( "$ME" "${words[2]}" "$OPTIONS" )
+ ;;
+ esac
+fi
diff --git a/src/_emulator b/src/_emulator
new file mode 100644
index 0000000..c9945c4
--- /dev/null
+++ b/src/_emulator
@@ -0,0 +1,134 @@
+#compdef emulator
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for emulator (Android Emulator) 12.0
+# (http://developer.android.com/guide/developing/tools/emulator.html).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+typeset -A opt_args
+local context state line curcontext="$curcontext"
+
+# TODO All image options are contextual to -sysdir value
+# TODO All skin options are contextual to -skindir value
+# TODO snapshot options are mutually exclusive
+# TODO Use '-snapshot-list' output for snapshot names
+# TODO Complete -avd with avd names ?
+# TODO -logcat: use completer from _adb
+# TODO Complete options with device values
+# TODO Complete -prop
+_arguments \
+ '(- : *)-version[display emulator version number]' \
+ '(- : *)-help[display help information]' \
+ '(- : *)-help-disk-images[about disk images]' \
+ '(- : *)-help-keys[supported key bindings]' \
+ '(- : *)-help-debug-tags[debug tags for -debug <tags>]' \
+ '(- : *)-help-char-devices[character <device> specification]' \
+ '(- : *)-help-environment[environment variables]' \
+ '(- : *)-help-keyset-file[key bindings configuration file]' \
+ '(- : *)-help-virtual-device[virtual device management]' \
+ '(- : *)-help-sdk-images[about disk images when using the SDK]' \
+ '(- : *)-help-build-images[about disk images when building Android]' \
+ '(- : *)-help-all[prints all help content]' \
+ '(- : *)-help-'{version,sysdir,system,image,datadir,kernel,ramdisk,initdata,data,partition-size,cache,no-cache,nocache,sdcard,snapstorage,no-snapstorage,snapshot,no-snapshot,no-snapshot-save,no-snapshot-load,snapshot-list,no-snapshot-update-time,wipe-data,avd,skindir,skin,noskin,no-skin,memory,netspeed,netdelay,netfast,trace,show-kernel,shell,no-jni,nojni,logcat,noaudio,no-audio,audio,raw-keys,radio,port,ports,onion,onion-alpha,onion-rotation,scale,dpi-device,http-proxy,timezone,dns-server,cpu-delay,no-boot-anim,no-window,report-console,gps,keyset,shell-serial,tcpdump,bootchart,charmap,prop,shared-net-id,nand-limits,memcheck,qemu,verbose}'[print option-specific help]' \
+ '-sysdir[search for system disk images in the directory]: :_files -/' \
+ '(-system -image)'{-system,-image}'[read initial system image from the file]: :_files -g "*.img"' \
+ '-datadir[write user data into the directory]: :_files -/' \
+ '-kernel[use specific emulated kernel]: :_files' \
+ '-ramdisk[ramdisk image (default <system>/ramdisk.img]: :_files -g "*.img"' \
+ '-initdata[same as '\''-init-data <file>'\'']: :_files' \
+ '-data[data image (default <datadir>/userdata-qemu.img]: :_files -g "*.img"' \
+ '-partition-size[system/data partition size]:size (in MBs)' \
+ '(-no-cache -nocache)-cache[cache partition image (default is temporary file)]: :_files -g "*.img"' \
+ '(-cache -no-cache -nocache)'{-no-cache,-nocache}'[disable the cache partition]' \
+ '-sdcard[SD card image (default <system>/sdcard.img]: :_files -g "*.img"' \
+ '(-no-snapstorage)-snapstorage[file that contains all state snapshots (default <datadir>/snapshots.img)]: :_files -g "*.img"' \
+ '(-snapstorage)-no-snapstorage[do not mount a snapshot storage file (this disables all snapshot functionality)]' \
+ '-snapshot[name of snapshot within storage file for auto-start and auto-save (default '\''default-boot'\'')]:snapshot name' \
+ '-no-snapshot[perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage]' \
+ '-no-snapshot-save[do not auto-save to snapshot on exit: abandon changed state]' \
+ '-no-snapshot-load[do not auto-start from snapshot: perform a full boot]' \
+ '-snapshot-list[show a list of available snapshots]' \
+ '-no-snapshot-update-time[do not do try to correct snapshot time on restore]' \
+ '-wipe-data[reset the user data image (copy it from initdata)]' \
+ '-avd[use a specific android virtual device]:android virtual device name' \
+ '-skindir[search skins in <dir> (default <system>/skins)]: :_files -/' \
+ '-skin[select a given skin]' \
+ '(-noskin -no-skin)'{-noskin,-no-skin}'[don'\''t use any emulator skin]' \
+ '-memory[physical RAM size in MBs]:size (in MBs)' \
+ '-netspeed[maximum network download/upload speeds]:speed' \
+ '-netdelay[network latency emulation]:delay' \
+ '-netfast[disable network shaping]' \
+ '-trace[enable code profiling (F9 to start)]:trace name' \
+ '-show-kernel[display kernel messages]' \
+ '-shell[enable root shell on current terminal]' \
+ {-no-jni,-nojni}'[disable JNI checks in the Dalvik runtime]' \
+ '-logcat[enable logcat output with given tags]:logcat tags' \
+ '(-audio -noaudio -no-audio)'{-noaudio,-no-audio}'[disable audio support]' \
+ '(-noaudio -no-audio)-audio[use specific audio backend]:audio backend' \
+ '-raw-keys[disable Unicode keyboard reverse-mapping]' \
+ '-radio[redirect radio modem interface to character device]:device' \
+ '-port[TCP port that will be used for the console]:port number' \
+ '-ports[TCP ports used for the console and adb bridge]:console port,adb port' \
+ '-onion[use overlay PNG image over screen]: :_files -g "*.(png|PNG)"' \
+ '-onion-alpha[specify onion-skin translucency]:percentage' \
+ '-onion-rotation[specify onion-skin rotation]:rotation:((1 2 3 4))' \
+ '-scale[scale emulator window]:scale' \
+ '-dpi-device[specify device'\''s resolution in dpi (default 165)]:dpi' \
+ '-http-proxy[make TCP connections through a HTTP/HTTPS proxy]:proxy' \
+ '-timezone[use this timezone instead of the host'\''s default]:timezone' \
+ '-dns-server[use this DNS server(s) in the emulated system]:DNS servers' \
+ '-cpu-delay[throttle CPU emulation]:CPU delay' \
+ '-no-boot-anim[disable animation for faster boot]' \
+ '-no-window[disable graphical window display]' \
+ '-report-console[report console port to remote socket]: :_socket' \
+ '-gps[redirect NMEA GPS to character device]:device' \
+ '-keyset[specify keyset file name]: :_files' \
+ '-shell-serial[specific character device for root shell]:device' \
+ '-tcpdump[capture network packets to file]: :_files' \
+ '-bootchart[enable bootcharting]:timeout' \
+ '-charmap[use specific key character map]: :_files' \
+ '*-prop[set system property on boot]:name=value' \
+ '-shared-net-id[join the shared network, using IP address 10.1.2.<number>]:number' \
+ '-nand-limits[enforce NAND/Flash read/write thresholds]:limits' \
+ '-memcheck[enable memory access checking]:flags' \
+ '-qemu[pass arguments to qemu]:arguments' \
+ '-verbose[same as '\''-debug-init'\'']' \
+ '*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag'
diff --git a/src/_eselect b/src/_eselect
new file mode 100644
index 0000000..f734c35
--- /dev/null
+++ b/src/_eselect
@@ -0,0 +1,202 @@
+#compdef eselect
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Eselect (symlink manager for multiversioning
+# and multibranding support for some libraries and binaries).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Vadim A. Misbakh-Soloviev <mva@mva.name>
+# * Bapt <bapt@tuxfamily.org>
+# * kaworu <kaworu@kaworu.ch>
+# * David Durrleman <dualmoo@gmail.com>
+# * oberyno <oberyno@gmail.com>
+# * Mamoru Komachi <usata@usata.org>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+#<app-admin/eselect-1.0.11>
+#
+
+
+_eselect_env () {
+ if (( $words[(I)(update)] )); then
+ _values 'update options' \
+ 'makelinks[force updating of links]' \
+ 'noldconfig[Do not alter the ld.so cache or configuration]' && return 0
+ fi
+ _values 'env options' $stdopts[@] \
+ 'update[Collect environment variables from all scripts]' && return 0
+}
+
+_eselect_binutils () {
+ local binutilslist
+ if (( $words[(I)(set)] )); then
+ binutilslist=(${${${(M)${(f)"$(eselect --no-color binutils list)"}## *}// \**/}//( \[*\] | \[*\] )/})
+ _values 'available binutils version' $binutilslist[@] && return 0
+ fi
+ _values 'binutils options' $stdopts[@] \
+ 'list[List all installed version of binutils]' \
+ 'show[Print the currently active binutils version]' \
+ 'set[Activate one of the installed binutils]' && return 0
+}
+
+_eselect_kernel () {
+ local kernellist
+ if (( $words[(I)(set)] )); then
+ kernellist=(${${${(M)${(f)"$(eselect --no-color kernel list)"}## *}// \**/}//( \[*\] | \[*\] )/})
+ _values 'available kernel version' $kernellist[@] && return 0
+ fi
+ _values 'kenrel options' $stdopts[@] \
+ 'list[List available kernel symlink targets]' \
+ 'show[Show the current kernel symlink]' \
+ 'set[Set a new kernel symlink target]' && return 0
+}
+_eselect_ctags () {
+ local ctagslist
+ if (( $words[(I)(set)] )); then
+ ctagslist=(${${${(M)${(f)"$(eselect --no-color ctags list)"}## *}// \**/}//( \[*\] | \[*\] )/})
+ _values 'available ctags version' $ctagslist[@] && return 0
+ fi
+ _values 'ctags options' $stdopts[@] \
+ 'list[List available ctags symlink targets]' \
+ 'show[Show the current target of the ctags symlink]' \
+ 'update[Automatically update the ctags symlink]' \
+ 'set[Set a new ctags symlink target]' && return 0
+}
+_eselect_profile () {
+ local profilelist
+ if (( $words[(I)(set)] )); then
+ profilelist=(${${${(M)${(f)"$(eselect --no-color profile list)"}## *}// \**/}//( \[*\] | \[*\] )/})
+ _values -w 'available profiles' $profilelist[@] \
+ '--force[Forcibly set the symlink]' && return 0
+ fi
+ _values 'profile options' $stdopts[@] \
+ 'list[List available profile symlink targets]' \
+ 'show[Show the current make.profile symlink]' \
+ 'set[Set a new profile symlink target]' && return 0
+}
+_eselect_fontconfig () {
+ local fclistenabled fclistdisabled
+ if (( $words[(I)(enable)] )); then
+ fclistdisabled=(${${${${(M)${(f)"$(eselect --no-color fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
+ _values -w '.conf to enable' $fclistdisabled[@] && return 0
+ elif (( $words[(I)(disable)] )); then
+ fclistenabled=(${${${(M)${(M)${(f)"$(eselect --no-color fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
+ _values -w '.conf to disable' $fclistenabled[@] && return 0
+ fi
+ _values 'fontconfig options' $stdopts[@] \
+ 'list[List available fontconfig .conf files]' \
+ 'disable[Disable specified fontconfig .conf file(s)]' \
+ 'enable[Enable specified fontconfig .conf file(s)]' && return 0
+}
+_eselect_opengl () {
+ local opengllist
+ if (( $words[(I)(set)] )); then
+ opengllist=(${${${(M)${(f)"$(eselect --no-color opengl list)"}## *}// \**/}//( \[*\] | \[*\] )/})
+ _values -w 'opengl implementations and options' $opengllist[@] \
+ '--use-old[If an implementationis already set, use that one instead]' \
+ '--prefix[Set the source prefix]:path:_files -/' \
+ '--dst-prefix[Set the destination prefix]:path:_files -/' \
+ '--impl-headers[Override global headers with ones provided by this profile]' && return 0
+ fi
+ _values 'opengl options' $stdopts[@] \
+ 'list[List the available OpenGL implementations]' \
+ 'set[Select the OpenGL implementation]' \
+ 'show[Print the current OpenGL implementation]' && return 0
+}
+_eselect_vi () {
+ local vilist
+ if (( $words[(I)(set)] )); then
+ vilist=(${${${(M)${(f)"$(eselect --no-color vi list)"}## *}// \**/}//( \[*\] | \[*\] )/})
+ _values -w 'vi implementation' $vilist[@] && return 0
+ elif (( $words[(I)(update)] )); then
+ _values -w 'option' '--if-unset[Do not override existing implementation]' && return 0
+ fi
+ _values 'vi options' $stdopts[@] \
+ 'list[List available vi implementations]' \
+ 'set[Set a new vi implementation provider]' \
+ 'show[Show the current vi implementation]' \
+ 'update[Automatically update the vi provider]' && return 0
+}
+_eselect () {
+ local globopts sedcmd modnames modopts
+ local stdopts
+ stdopts=(
+ 'help[Display help text]'
+ 'usage[Display usage information]'
+ 'version[Display version information]'
+ )
+ globopts=(
+ '--no-colour[Disable coloured output]'
+ '--no-color[Disable coloured output]'
+ )
+ modnames=(${${${(M)${(f)"$(eselect --no-color list-modules)"}## *}// */}// /})
+ if ((CURRENT == 2)); then
+ _arguments -s \
+ "$globopts[@]" \
+ "*:portage:_values 'eselect modules' \$modnames[@]" && return 0
+ elif ((CURRENT == 3)); then
+ if [[ $words[2] == --no-colour || $words[2] == --no-color ]]; then
+ _arguments -s \
+ "*:portage:_values 'eselect modules' \$modnames[@]" && return 0
+ elif (( $modnames[(I)$words[2]] )); then
+ if [[ "$words[2]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi) ]]; then
+ _eselect_$words[2] "$@"
+ else
+ modopts=(${${${(M)${(f)"$(eselect --no-color $words[2] usage)"}## *}// */}// /})
+ _arguments -s \
+ "*:portage:_values 'eselect $words[2] options' \$modopts[@]" && return 0
+ fi
+ fi
+ elif ((CURRENT >= 4)); then
+ if (( $words[(I)(--no-color|--no-colour)] )); then
+ if (( $modnames[(I)$words[3]] )); then
+ if [[ "$words[3]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi) ]]; then
+ _eselect_$words[3] "$@"
+ else
+ modopts=(${${${${(M)${(f)"$(eselect --no-color $words[3] usage)"}## *}// */}// /}// *})
+ _arguments -s \
+ "*:portage:_values 'eselect $words[3] options' \$modopts[@]" && return 0
+ fi
+ fi
+ else
+ if (( $modnames[(I)$words[2]] )); then
+ _eselect_$words[2] "$@"
+ fi
+ fi
+ fi
+}
+
+_eselect "$@"
diff --git a/src/_fab b/src/_fab
new file mode 100644
index 0000000..0bb1196
--- /dev/null
+++ b/src/_fab
@@ -0,0 +1,78 @@
+#compdef fab
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Fabric (http://fabfile.org)
+#
+# Source: https://github.com/vhbit/fabric-zsh-autocomplete
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Valerii Hiora (https://github.com/vhbit)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local curcontext=$curcontext state line
+declare -A opt_args
+
+declare target_list
+target_list=(`fab --shortlist 2>/dev/null`)
+
+_targets() {
+ _describe -t commands "fabric targets" target_list
+}
+
+output_levels=(
+ 'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.'
+ 'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!'
+ 'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.'
+ 'running: Printouts of commands being executed or files transferred, e.g. [myserver] run: ls /var/www. Also controls printing of tasks being run, e.g. [myserver] Executing task ''foo''.'
+ 'stdout: Local, or remote, stdout, i.e. non-error output from commands.'
+ 'stderr: Local, or remote, stderr, i.e. error-related output from commands.'
+ 'user: User-generated output, i.e. local output printed by fabfile code via use of the fastprint or puts functions.'
+)
+
+_arguments -w -S -C \
+ '(-)'{-h,--help}'[show this help message and exit]: :->noargs' \
+ '(-)'{-V,--version}'[show program''s version number and exit]: :->noargs' \
+ '(-)--list[print list of possible commands and exit]: :->noargs' \
+ '(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \
+ '(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \
+ '(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \
+ "(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \
+ '(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \
+ '(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \
+ '(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \
+ '(-p+ --password=-)'{-p+,--password=-}'[password for use with authentication and/or sudo]: :' \
+ '(-H+ --hosts=-)'{-H+,--hosts=-}'[comma separated list of hosts to operate on]: :' \
+ '(-R+ --roles=-)'{-R+,--roles=-}'[comma separated list of roles to operate on]: :' \
+ '(-a --no-agent)'{-a,--no-agent}'[don''t use the running SSH agent]' \
+ '(-k --no-keys)'{-k,--no-keys}'[don''t load private key files from ~/.ssh/]' \
+ '(-w --warn-only)'{-w,--warn-only}'[warn instead of abort, when commands fail]' \
+ '-i+[path to SSH private key file. May be repeated]: :_files' \
+ "(-f+ --fabfile=)"{-f+,--fabfile=}"[Python module file to import]: :_files -g *.py" \
+ '(-c+ --config=-)'{-c+,--config=-}'[specify location of config file to use]: :_files' \
+ '(-s+ --shell=-)'{-s+,--shell=-}'[specify a new shell, defaults to ''/bin/bash -l -c'']: :' \
+ '(--hide=-)--hide=-[comma-separated list of output levels to hide]: :->levels' \
+ '(--show=-)--show=-[comma-separated list of output levels to show]: :->levels' \
+ '*::: :->subcmds' && return 0
+
+if [[ CURRENT -ge 1 ]]; then
+ case $state in
+ noargs)
+ _message "nothing to complete";;
+ levels)
+ _describe -t commands "output levels" output_levels;;
+ *)
+ _targets;;
+ esac
+
+ return
+fi
diff --git a/src/_gas b/src/_gas
new file mode 100644
index 0000000..18da7e4
--- /dev/null
+++ b/src/_gas
@@ -0,0 +1,48 @@
+#compdef gas
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for gas (https://github.com/walle/gas).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Fredrik Wallgren <fredrik.wallgren@gmail.com>
+#
+# ------------------------------------------------------------------------------
+
+local curcontext="$curcontext" state line cmds ret=1
+
+_arguments -C \
+ '(- 1 *)'{-v,--version}'[display version information]' \
+ '(-h|--help)'{-h,--help}'[show help information]' \
+ '1: :->cmds' \
+ '*: :->args' && ret=0
+
+case "$state" in
+ (cmds)
+ cmds=(
+ "version:Prints Gas's version"
+ "use:Uses author"
+ "show:Shows your current user"
+ "list:Lists your authors"
+ "import:Imports current user to gasconfig"
+ "help:Describe available tasks or one specific task"
+ "delete:Deletes author"
+ "add:Adds author to gasconfig"
+ )
+ _describe -t commands 'gas command' cmds && ret=0
+ ;;
+ (args)
+ case "$line[1]" in
+ (use|delete)
+ _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
+ ;;
+ esac
+ ;;
+esac
+
+return ret
+
diff --git a/src/_gcc-config b/src/_gcc-config
new file mode 100644
index 0000000..91bc9fd
--- /dev/null
+++ b/src/_gcc-config
@@ -0,0 +1,73 @@
+#compdef gcc-config
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for GCC config script (symlink manager for multiversioning).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Vadim A. Misbakh-Soloviev <mva@mva.name>
+# * Bapt <bapt@tuxfamily.org>
+# * kaworu <kaworu@kaworu.ch>
+# * David Durrleman <dualmoo@gmail.com>
+# * oberyno <oberyno@gmail.com>
+# * Mamoru Komachi <usata@usata.org>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+#<sys-devel/gcc-config-0.0>
+
+local arguments
+
+arguments=(
+ '(- :)'{--use-old,-O}'[use the old profile if one was selected]'
+ '(- :)'{--use-portage-chost,-P}'[only set profile if its CHOST matches /etc/make.conf]:profiles:_gcc_profile'
+ '(- :)'{--get-current-profile,-c}'[print current used gcc profile]'
+ '(- :)'{--list-profiles,-l}'[print a list of available profiles]'
+ '(- :)'{--print-environ,-E}'[print environment of the given/current profile]:profiles:_gcc_profile'
+ '(- :)'{--get-bin-path,-B}'[print binary path of given/current profile]:profiles:_gcc_profile'
+ '(- :)'{--get-lib-path,-L}'[print library path of given/current profile]:profiles:_gcc_profile'
+ '(- :)'{--get-stdcxx-incdir,-X}'[print g++ include path of given/current profile]:profiles:_gcc_profile'
+ '(- :)'{--help,-h}'[show help]'
+ '(- :)'{--version,-v}'[show version info]'
+ '(- :):profiles:_gcc_profile'
+)
+
+_gcc_profile () {
+ local profile
+ profile=(${(f)"$(_call_program gcc-installed RC_NOCOLOR=yes gcc-config --list-profiles)"})
+ profile=${${profile/\[([^]]*)\]/}/\*}
+ _tags profile && { compadd "$@" -k profile || compadd "$@" ${(kv)=profile} }
+}
+
+_arguments $arguments
diff --git a/src/_geany b/src/_geany
new file mode 100644
index 0000000..37ed492
--- /dev/null
+++ b/src/_geany
@@ -0,0 +1,68 @@
+#compdef geany
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Geany (http://www.geany.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_arguments \
+ '(- 1 *)'{-h,--help}'[Show help options]' \
+ '(- 1 *)--help-all[Show all help options]' \
+ '(- 1 *)--help-gtk[Show GTK+ Options]' \
+ '(- 1 *)'{-V,--version}'[Show version and exit]' \
+ '(--column)--column[Set initial column number for the first opened file (useful in conjunction with --line)]:column number' \
+ '(-c --config)'{-c,--config}'[Use an alternate configuration directory]:configuration file:_files' \
+ '(--ft-names)--ft-names[Print internal filetype names]' \
+ '(-g --generate-tags)'{-g,--generate-tags}'[Generate global tags file (see documentation)]' \
+ '(-P --no-preprocessing)'{-P,--no-preprocessing}'[Don'\''t preprocess C/C++ files when generating tags]' \
+ '(-i --new-instance)'{-i,--new-instance}'[Don'\''t open files in a running instance, force opening a new instance]' \
+ '(--socket-file)--socket-file[Use this socket filename for communication with a running Geany instance]:socket file:_files' \
+ '(--list-documents)--list-documents[Return a list of open documents in a running Geany instance]' \
+ '(-l --line)'{-l,--line}'[Set initial line number for the first opened file]:line number' \
+ '(-m --no-msgwin)'{-m,--no-msgwin}'[Don'\''t show message window at startup]' \
+ '(-n --no-ctags)'{-n,--no-ctags}'[Don'\''t load auto completion data (see documentation)]' \
+ '(-p --no-plugins)'{-p,--no-plugins}'[Don'\''t load plugins]' \
+ '(--print-prefix)--print-prefix[Print Geany'\''s installation prefix]' \
+ '(-s --no-session)'{-s,--no-session}'[Don'\''t load the previous session'\''s files]' \
+ '(-t --no-terminal)'{-t,--no-terminal}'[Don'\''t load terminal support]' \
+ '(--vte-lib)--vte-lib[Filename of libvte.so]:libvte.so filename:_files -g "*.so"' \
+ '(-v --verbose)'{-v,--verbose}'[Be verbose]' \
+ '(--display)--display[X display to use]:X display:_x_display' \
+ '*: :_files'
diff --git a/src/_gem b/src/_gem
new file mode 100644
index 0000000..9ae642f
--- /dev/null
+++ b/src/_gem
@@ -0,0 +1,456 @@
+#compdef gem gem1.9
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for gem (http://rubygems.org).
+#
+# Source: https://gist.github.com/164465
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Alex Vollmer (https://github.com/alexvollmer)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_gem() {
+ local -a gem_general_flags
+
+ gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]"
+ "(-V --verbose)"{-V,--verbose}"[Set the verbose level of output]"
+ "(-q --quiet)"{-q,--quiet}"[Silence commands]"
+ "--config-file[Use this config file instead of default]:file:_files"
+ "--backtrace[Show stack backtrace on errors]"
+ "--debug[Turn on Ruby debugging]"
+ $nul_arg
+ )
+
+ if (( CURRENT > 2 )); then
+ (( CURRENT-- ))
+ shift words
+ _call_function 1 _gem_${words[1]}
+ else
+ _values "gem command" \
+ "build[Build a gem from a gemspec]" \
+ "cert[Manage RubyGems certificates and signing settings]" \
+ "check[Check installed gems]" \
+ "cleanup[Clean up old versions of installed gems in the local repository]" \
+ "contents[Display the contents of the installed gems]" \
+ "dependency[Show the dependencies of an installed gem]" \
+ "environment[Display information about the RubyGems environment]" \
+ "fetch[Download a gem and place it in the current directory]" \
+ "generate_index[Generates the index files for a gem server directory]" \
+ "help[Provide help on the 'gem' command]" \
+ "install[Install a gem into the local repository]" \
+ "list[Display gems whose name starts with STRING]" \
+ "lock[Generate a lockdown list of gems]" \
+ "mirror[Mirror a gem repository]" \
+ "outdated[Display all gems that need updates]" \
+ "pristine[Restores installed gems to pristine condition from files located in the gem cache]" \
+ "query[Query gem information in local or remote repositories]" \
+ "rdoc[Generates RDoc for pre-installed gems]" \
+ "search[Display all gems whose name contains STRING]" \
+ "server[Documentation and gem repository HTTP server]" \
+ "sources[Manage the sources and cache file RubyGems uses to search for gems]" \
+ "specification[Display gem specification (in yaml)]" \
+ "stale[List gems along with access times]" \
+ "uninstall[Uninstall gems from the local repository]" \
+ "unpack[Unpack an installed gem to the current directory]" \
+ "update[Update the named gems (or all installed gems) in the local repository]" \
+ "which[Find the location of a library file you can require]"
+ fi
+}
+
+__all_gems() {
+ _gem_names=($(${service} list | awk '{print $1}'))
+ compadd "$@" -k _gem_names
+}
+
+__all_gems_all() {
+ _gem_names=($(gem list | awk '{print $1}') "--all")
+ compadd "$@" -k _gem_names
+}
+
+__gem_help_arguments() {
+ _args=("commands"
+ "examples"
+ "build"
+ "cert"
+ "check"
+ "cleanup"
+ "contents"
+ "dependency"
+ "environment"
+ "fetch"
+ "generate_index"
+ "help"
+ "install"
+ "list"
+ "lock"
+ "mirror"
+ "outdated"
+ "pristine"
+ "query"
+ "rdoc"
+ "search"
+ "server"
+ "sources"
+ "specification"
+ "stale"
+ "uninstall"
+ "unpack"
+ "update"
+ "which")
+ compadd "$@" -k _args
+}
+
+__gem_trust_policies() {
+ _args=("NoSecurity"
+ "LowSecurity"
+ "MediumSecurity"
+ "HighSecurity")
+ compadd "$@" -k _args
+}
+
+_gem_build() {
+ _arguments \
+ '*:file:_files -g "*.gemspec"' \
+ $gem_general_flags && ret=0
+}
+
+_gem_cert() {
+ _arguments \
+ "(-a --add)"{-a,--add}"[Add a trusted certificate.]":file:_files \
+ "(-l --list)"{-l,--list}"[List trusted certificates.]" \
+ "(-r --remove)"{-r,--remove}"[Remove trusted certificates containing STRING.]" \
+ "(-b --build)"{-b,--build}"[Build private key and self-signed certificate for EMAIL_ADDR.]" \
+ "(-C --certificate)"{-C,--certificate}"[Certificate for --sign command.]":file:_files \
+ "(-K --private-key)"{-K,--private-key}"[Private key for --sign command.]":file:_files \
+ "(-s --sign)"{-s,--sign}"[Sign a certificate with my key and certificate.]":file:_files \
+ $gem_general_flags && ret=0
+}
+
+_gem_check() {
+ _arguments \
+ "--verify[Verify gem file against its internal checksum]":file:_files \
+ "(-a --alien)"{-a,--alien}"[Report 'unmanaged' or rogue files in the gem repository]" \
+ "(-v --verbose)"{-v,--verbose}"[Spew more words]" \
+ "(-t --test)"{-t,--test}"[Run unit tests for gem]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to run tests for]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_cleanup() {
+ _arguments \
+ "*:gemname:__all_gems" \
+ "(-d --dryrun)"{-d,--dryrun}"[]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_contents() {
+ _arguments \
+ "*:gemname:__all_gems" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to contents]" \
+ "--all[Contents for all gems]" \
+ "(-s --spec-dir)"{-s,--spec-dir}"[Search for gems under specific paths]" \
+ "(-l --no-lib-only)"{-l,--no-lib-only}"[Only return files in the Gem's lib_dirs]" \
+ "--no-prefix[Don't include installed path prefix]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_dependency() {
+ _arguments \
+ ":gemname:__all_gems" \
+ "(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
+ "(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
+ "(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
+ "(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
+ "--source[Use URL as the remote source for gems]" \
+ "(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
+ "(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to dependency]" \
+ "--platform[Specify the platform of gem to dependency]" \
+ "(-R --no-reverse-dependencies)"{-R,--no-reverse-dependencies}"[Include reverse dependencies in the output]" \
+ "(-p --pipe)"{-p,--pipe}"[Pipe Format (name --version ver)]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_environment() {
+ typeset -g _environment_arg=
+ _environment_arg='::environment:((packageversion\:"display the package version"
+ gemdir\:"display the path where gems are installed"
+ gempath\:"display path used to search for gems"
+ version\:"display the gem format version"
+ remotesources\:"display the remote gem servers"))'
+ _arguments \
+ $_environment_arg \
+ $gem_general_flags && ret=0
+}
+
+_gem_fetch() {
+ _arguments \
+ "*:gemname:__all_gems" \
+ "(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
+ "(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
+ "--source[Use URL as the remote source for gems]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to fetch]" \
+ "--platform[Specify the platform of gem to fetch]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_generate_index() {
+ _arguments \
+ "(-d --directory=DIRNAME)"{-d,--directory=-}"[repository base dir containing gems subdir]":directory:_directories \
+ "--no-legacy[Generate indexes for RubyGems older than 1.2.0]" \
+ "--no-modern[Generate indexes for RubyGems newer than 1.2.0]" \
+ "--update[Update modern indexes with gems added since the last update]" \
+ "--rss-gems-host=-[Host name where gems are served from, used for GUID and enclosure values]" \
+ "--rss-host=-[Host name for more gems information, used for RSS feed link]" \
+ "--rss-title=-[Set title for RSS feed]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_help() {
+ _arguments \
+ ":argument:__gem_help_arguments" \
+ $gem_general_flags && ret=0
+}
+
+_gem_install() {
+ _arguments \
+ "*:URI: _alternative 'files:file:_files -g *.gem' 'urls:URL:__all_gems'" \
+ "(-i --install-dir)"{-i,--install-dir}"[Gem repository directory to get installed gems]":directory:_directories \
+ "(-n --bindir)"{-n,--bindir}"[Directory where binary files are located]":directory:_directories \
+ "(-d --no-rdoc)"{-d,--no-rdoc}"[Generate RDoc documentation for the gem on install]" \
+ "--no-ri[Generate RI documentation for the gem on install]" \
+ "(-E --no-env-shebang)"{-E,--no-env-shebang}"[Rewrite the shebang line on installed scripts to use /usr/bin/env]" \
+ "(-f --no-force)"{-f,--no-force}"[Force gem to install, bypassing dependency checks]" \
+ "(-t --no-test)"{-t,--no-test}"[Run unit tests prior to installation]" \
+ "(-w --no-wrappers)"{-w,--no-wrappers}"[Use bin wrappers for executables Not available on dosish platforms]" \
+ "(-P --trust-policy)"{-P,--trust-policy}"[Specify gem trust policy]:trust policy:__gem_trust_policies" \
+ "--ignore-dependencies[Do not install any required dependent gems]" \
+ "(-y --include-dependencies)"{-y,--include-dependencies}"[Unconditionally install the required dependent gems]" \
+ "--no-format-executable[Make installed executable names match ruby. If ruby is ruby18, foo_exec will be foo_exec18]" \
+ "--no-user-install[Install in user's home directory instead of GEM_HOME. Defaults to using home only if GEM_HOME is not writable.]" \
+ "--development[Install any additional development dependencies]" \
+ "--prerelease[Install prerelease versions of a gem if available. Defaults to skipping prereleases.]" \
+ "(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
+ "(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
+ "(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
+ "(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
+ "--source[Use URL as the remote source for gems]" \
+ "(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
+ "(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
+ "--platform[Specify the platform of gem to install]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to install]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_list() {
+ _arguments \
+ ":gem name: " \
+ "(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to list]" \
+ "(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
+ "--no-versions[Display only gem names]" \
+ "(-a --all)"{-a,--all}"[Display all gem versions]" \
+ "--prerelease[Display prerelease versions]" \
+ "(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
+ "(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
+ "(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
+ "(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
+ "--source[Use URL as the remote source for gems]" \
+ "(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
+ "(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_lock() {
+ _arguments \
+ ":gemname:__all_gems" \
+ "(-s --no-strict)"{-s,--no-strict}"[fail if unable to satisfy a dependency]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_mirror() {
+ _arguments \
+ $gem_general_flags && ret=0
+}
+
+_gem_outdated() {
+ _arguments \
+ "(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
+ "(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
+ "(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
+ "(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
+ "--source[Use URL as the remote source for gems]" \
+ "(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
+ "(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
+ "--platform[Specify the platform of gem to outdated]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_pristine() {
+ _arguments \
+ ":gem name:__all_gems_all" \
+ "--all[Restore all installed gems to pristine condition]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to restore to pristine condition]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_query() {
+ _arguments \
+ "(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to query]" \
+ "(-n --name-matches)"{-n,--name-matches}"[Name of gem(s) to query on matches the provided REGEXP]" \
+ "(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
+ "--no-versions[Display only gem names]" \
+ "(-a --all)"{-a,--all}"[Display all gem versions]" \
+ "--prerelease[Display prerelease versions]" \
+ "(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
+ "(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
+ "(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
+ "(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
+ "--source[Use URL as the remote source for gems]" \
+ "(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
+ "(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_rdoc() {
+ _arguments \
+ ":gem name:__all_gems_all" \
+ "--all[Generate RDoc/RI documentation for all installed gems]" \
+ "--no-rdoc[Include RDoc generated documents]" \
+ "--no-ri[Include RI generated documents]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to rdoc]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_search() {
+ _arguments \
+ ":gem name::" \
+ "(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to search]" \
+ "(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
+ "--no-versions[Display only gem names]" \
+ "(-a --all)"{-a,--all}"[Display all gem versions]" \
+ "--prerelease[Display prerelease versions]" \
+ "(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
+ "(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
+ "(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
+ "(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
+ "--source[Use URL as the remote source for gems]" \
+ "(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
+ "(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_server() {
+ _arguments \
+ "(-p --port=PORT)"{-p,--port=-}"[port to listen on]" \
+ "(-d --dir=GEMDIR)"{-d,--dir=-}"[directory from which to serve gems]":directory:_directories \
+ "--no-daemon[run as a daemon]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_sources() {
+ _arguments \
+ "(-a --add)"{-a,--add}"[Add source]" \
+ "(-l --list)"{-l,--list}"[List sources]" \
+ "(-r --remove)"{-r,--remove}"[Remove source]" \
+ "(-c --clear-all)"{-c,--clear-all}"[Remove all sources (clear the cache)]" \
+ "(-u --update)"{-u,--update}"[Update source cache]" \
+ "(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_specification() {
+ _arguments \
+ ":gemname:__all_gems" \
+ "(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
+ "(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
+ "(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
+ "(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
+ "--source[Use URL as the remote source for gems]" \
+ "(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
+ "(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to examine]" \
+ "--platform[Specify the platform of gem to specification]" \
+ "--all[Output specifications for all versions of the gem]" \
+ "--ruby[Output ruby format]" \
+ "--yaml[Output RUBY format]" \
+ "--marshal[Output Marshal format]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_stale() {
+ _arguments \
+ $gem_general_flags && ret=0
+}
+
+_gem_uninstall() {
+ _arguments \
+ "*:gemname:__all_gems" \
+ "(-a --no-all)"{-a,--no-all}"[Uninstall all matching versions]" \
+ "(-I --no-ignore-dependencies)"{-I,--no-ignore-dependencies}"[Ignore dependency requirements while uninstalling]" \
+ "(-x --no-executables)"{-x,--no-executables}"[Uninstall applicable executables without confirmation]" \
+ "(-i --install-dir)"{-i,--install-dir}"[Directory to uninstall gem from]":directory:_directories \
+ "(-n --bindir)"{-n,--bindir}"[Directory to remove binaries from]":directory:_directories \
+ "--no-user-install[Uninstall from user's home directory in addition to GEM_HOME.]" \
+ "(-v --version)"{-v,--version}"[Specify version of gem to uninstall]" \
+ "--platform[Specify the platform of gem to uninstall]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_unpack() {
+ _arguments \
+ ":gemname:__all_gems" \
+ "--target=-[target directory for unpacking]":directory:_directories \
+ "(-v --version)"{-v,--version}"[Specify version of gem to unpack]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_update() {
+ _arguments \
+ "*:gemname:__all_gems" \
+ "(-i --install-dir)"{-i,--install-dir}"[Gem repository directory to get installed gems]":directory:_directories \
+ "(-n --bindir)"{-n,--bindir}"[Directory where binary files are located]":directory:_directories \
+ "(-d --no-rdoc)"{-d,--no-rdoc}"[Generate RDoc documentation for the gem on install]" \
+ "--no-ri[Generate RI documentation for the gem on install]" \
+ "(-E --no-env-shebang)"{-E,--no-env-shebang}"[Rewrite the shebang line on installed scripts to use /usr/bin/env]" \
+ "(-f --no-force)"{-f,--no-force}"[Force gem to install, bypassing dependency checks]" \
+ "(-t --no-test)"{-t,--no-test}"[Run unit tests prior to installation]" \
+ "(-w --no-wrappers)"{-w,--no-wrappers}"[Use bin wrappers for executables Not available on dosish platforms]" \
+ "(-P --trust-policy)"{-P,--trust-policy}"[Specify gem trust policy]:trust policy:__gem_trust_policies" \
+ "--ignore-dependencies[Do not install any required dependent gems]" \
+ "(-y --include-dependencies)"{-y,--include-dependencies}"[Unconditionally install the required dependent gems]" \
+ "--no-format-executable[Make installed executable names match ruby. If ruby is ruby18, foo_exec will be foo_exec18]" \
+ "--no-user-install[Install in user's home directory instead of GEM_HOME. Defaults to using home only if GEM_HOME is not writable.]" \
+ "--development[Install any additional development dependencies]" \
+ "--prerelease[Install prerelease versions of a gem if available. Defaults to skipping prereleases.]" \
+ "(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
+ "(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
+ "(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
+ "(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
+ "--source[Use URL as the remote source for gems]" \
+ "(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
+ "(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
+ "--system[Update the RubyGems system software]" \
+ "--platform[Specify the platform of gem to update]" \
+ $gem_general_flags && ret=0
+}
+
+_gem_which() {
+ _arguments \
+ *:file:_files -f \
+ "(-a --no-all)"{-a,--no-all}"[show all matching files]" \
+ "(-g --no-gems-first)"{-g,--no-gems-first}"[search gems before non-gems]" \
+ $gem_general_flags && ret=0
+}
diff --git a/src/_genlop b/src/_genlop
new file mode 100644
index 0000000..8243154
--- /dev/null
+++ b/src/_genlop
@@ -0,0 +1,150 @@
+#compdef genlop
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for GenLop (Gentoo Installation log parser).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Vadim A. Misbakh-Soloviev <mva@mva.name>
+# * Bapt <bapt@tuxfamily.org>
+# * kaworu <kaworu@kaworu.ch>
+# * David Durrleman <dualmoo@gmail.com>
+# * oberyno <oberyno@gmail.com>
+# * Mamoru Komachi <usata@usata.org>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+#<app-portage/genlop-0.30.8>
+
+
+_genlop () {
+local prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]" days months arg single state lstate
+days=(monday tuesday wednesday thursday friday saturday sunday)
+months=(january february march april may june july august september october november december)
+arg=( --current -c --time -t --gmt -g --info -i --file -f --rsync -r --unmerge -u --date --search -s --list -l )
+single=( --current -c --pretend -p --help -h --version -v )
+
+ [[ ${prev2} == (1st|2nd|3rd|4th|5th) ]] &&
+ compadd in\ $months && return 0
+ [[ ${prev1} == ([2-9]|[1-9][0-9]*) && ${prev2} != \
+ (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
+ _values '' 'days ago' 'months ago' 'years ago' 'weeks ago' && return 0
+ [[ ${prev1} == (1) && ${prev2} != \
+ (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
+ _values '' 'day ago' 'month ago' 'year ago' 'week ago' && return 0
+
+ case "$prev1" in
+ last)
+ _values '' month week
+ compadd $days && return 0
+ ;;
+ 1st|2nd|3rd|4th|5th)
+ compadd $days && return 0
+ ;;
+ january|february|march|april|may|june|july|august|september|october|november|december)
+ compadd {1..31} && return 0
+ ;;
+ --date)
+ _message 'enter number for more options or use mm/dd/yyyy format'
+ _values '' \
+ last yesterday 1st 2nd 3rd 4th 5th
+ _alternative \
+ '*:*:_genlop_days' '*:*:_genlop_months' && return 0
+ ;;
+ --file|-f)
+ _arguments '*:logfile:_files' && return 0
+ ;;
+ *)
+ _arguments \
+ "($single $arg *)"{--current,-c}"[display the current merge in action]" \
+ "($single)*--date[specify date of event]:date:->date" \
+ "($single)*-f[specify the logfile to use]:logfile:_files" \
+ "($single --gmt -g)"{--gmt,-g}"[display time in GMT/UTC format (default is local time)]" \
+ "($single $arg *)"{--help,-h}"[display help information]" \
+ "($single --info -i --list -l)"{--info,-i}"[print brief summary about installed ebuild]" \
+ "($single --search -s --info -i --list -l *)"{--list,-l}"[list merge history]" \
+ "(--nocolor -n)"{--nocolor,-n}"[disable colored output]" \
+ "($single $arg *)"{--pretend,-p}"[estimate build time of a piped emerge -p]" \
+ "($single --search -s --info -i --time -t --unmerge -u --rsync -r *)"{--rsync,-r}"[display rsync history]" \
+ "($single --rsync -r --search -s --list -l *)"{--search,-s}"[select ebuilds matching the provided regular expression]:pattern:" \
+ "($single --time -t)"{--time,-t}"[display merge time]" \
+ "($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
+ "($single $arg *)"{--version,-v}"[display version information]" \
+ "($single)*:package:_gentoo_packages available"
+ ;;
+ esac
+
+ while [[ -n "$state" ]]; do
+ lstate=$state
+ state=''
+ case "$lstate" in
+ date) _message 'enter number for more options or use mm/dd/yyyy format'
+ _values '' \
+ last yesterday 1st 2nd 3rd 4th 5th
+ _alternative \
+ ':*:_genlop_days' ':*:_genlop_months' && return 0
+ ;;
+ esac
+ done
+}
+
+_genlop_days() {
+ local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday"
+ local day=$(date +%u)
+ if [[ ${day} == 1 ]] then compadd $m
+ elif [[ ${day} == 2 ]] then compadd $m $t
+ elif [[ ${day} == 3 ]] then compadd $m $t $w
+ elif [[ ${day} == 4 ]] then compadd $m $t $w $T
+ elif [[ ${day} == 5 ]] then compadd $m $t $w $T $f
+ elif [[ ${day} == 6 ]] then compadd $m $t $w $T $f $s
+ elif [[ ${day} == 7 ]] then compadd $m $t $w $T $f $s $S
+ fi
+}
+_genlop_months() {
+ local j="january" f="february" m="march" a="april" M="may" ju="june" J="july" A="august" s="september" o="october" n="november" d="december"
+ local month=$(date +%m)
+ if [[ ${month} == 01 ]] then compadd $j
+ elif [[ ${month} == 02 ]] then compadd $j $f
+ elif [[ ${month} == 03 ]] then compadd $j $f $m
+ elif [[ ${month} == 04 ]] then compadd $j $f $m $a
+ elif [[ ${month} == 05 ]] then compadd $j $f $m $a $M
+ elif [[ ${month} == 06 ]] then compadd $j $f $m $a $M $ju
+ elif [[ ${month} == 07 ]] then compadd $j $f $m $a $M $ju $J
+ elif [[ ${month} == 08 ]] then compadd $j $f $m $a $M $ju $J $A
+ elif [[ ${month} == 09 ]] then compadd $j $f $m $a $M $ju $J $A $s
+ elif [[ ${month} == 10 ]] then compadd $j $f $m $a $M $ju $J $A $s $o
+ elif [[ ${month} == 11 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n
+ elif [[ ${month} == 12 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n $d
+ fi
+}
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
new file mode 100644
index 0000000..1f58965
--- /dev/null
+++ b/src/_gentoo_packages
@@ -0,0 +1,224 @@
+#autoload
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# functions for gentoo packages
+# inspired by _deb_packages
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Vadim A. Misbakh-Soloviev <mva@mva.name>
+# * Bapt <bapt@tuxfamily.org>
+# * kaworu <kaworu@kaworu.ch>
+# * David Durrleman <dualmoo@gmail.com>
+# * oberyno <oberyno@gmail.com>
+# * Mamoru Komachi <usata@usata.org>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+#Usage: _gentoo_packages installed|available|installed_versions|available_versions|binary|category|useflag|overlays|sets|licenses
+
+# List installed overlays
+_gentoo_packages_overlays () {
+ for f in /etc/make.conf /etc/make.globals; do
+ [[ -z "$PORTDIR_OVERLAY" && -r "$f" ]] &&
+ local PORTDIR_OVERLAY="`. "$f" 2>/dev/null; echo ${PORTDIR_OVERLAY}`"
+ done
+ compadd $=PORTDIR_OVERLAY
+}
+
+#List the sets
+_gentoo_packages_sets() {
+ local sets
+ [[ -f /usr/share/portage/config/sets.conf ]] && sets=(${${${(M)${(f)"$(</usr/share/portage/config/sets.conf)"}##\[*}/\[/@}/\]})
+ [[ -f /etc/portage/sets.conf ]] && sets=($sets ${${${(M)${(f)"$(</etc/portage/sets.conf)"}##\[*}/\[/@}/\]})
+ compadd $sets
+}
+
+#List licenses
+_gentoo_packages_licenses () {
+ local licenses var PORTDIR
+ var=PORTDIR
+ [[ -z ${(P)var} && -r /etc/make.conf ]] &&
+ local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
+ [[ -z ${(P)var} && -r /etc/make.globals ]] &&
+ local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
+ licenses=($PORTDIR/licenses/*(:t))
+ compadd $licenses
+}
+
+# Completion function to show useflags.
+_gentoo_packages_useflag(){
+ local flags var PORTDIR
+ var=PORTDIR
+ [[ -z ${(P)var} && -r /etc/make.conf ]] &&
+ local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
+ [[ -z ${(P)var} && -r /etc/make.globals ]] &&
+ local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
+
+ flags=( ${${(M)${(f)"$(<$PORTDIR/profiles/use.desc)"}:#* - *}%% - *}
+ ${${${(M)${(f)"$(<$PORTDIR/profiles/use.local.desc)"}#* - *}%% - *}#*:} )
+ compadd $flags
+}
+
+_gentoo_packages_active_useflag(){
+ local flags var USE
+ var=USE
+ [[ -z ${(P)var} && -r /etc/make.conf ]] &&
+ local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
+ flags=(${${${=USE}%-*}%\\*})
+ compadd $flags
+}
+_gentoo_packages_category(){
+ local var trees category
+ for var in PORTDIR PORTDIR_OVERLAY ; do
+ [[ -z ${(P)var} && -r /etc/make.conf ]] &&
+ local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
+ [[ -z ${(P)var} && -r /etc/make.globals ]] &&
+ local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
+ done
+ trees=($PORTDIR $=PORTDIR_OVERLAY)
+ category=( $trees/*-*(/:t) )
+ _wanted cat_packages expl 'category' compadd "$@" $category
+}
+
+_gentoo_packages_installed(){
+ local installed_dir installed_portage installed_list expl
+ installed_dir="/var/db/pkg"
+ installed_portage=($installed_dir/*-*/*)
+
+ installed_pkgname=( ${${installed_portage:t}%%-[0-9]*} )
+ _wanted packages expl 'category/package' compadd "$@" ${installed_pkgname}
+
+ installed_list=( ${${installed_portage#$installed_dir/}%%-[0-9]*} )
+ _wanted cat_packages expl 'category/package' _multi_parts "$@" / installed_list
+
+}
+
+_gentoo_packages_installed_versions(){
+ local installed_list installed_portage expl
+
+ installed_portage=(/var/db/pkg/*-*/*)
+ _wanted packages expl 'package' compadd "$@" ${installed_portage:t}
+
+ installed_list=( ${installed_portage##*/pkg/} )
+ _wanted cat_packages expl 'category/package' _multi_parts "$@" / installed_list
+}
+
+_gentoo_packages_available_pkgnames_only(){
+ local var trees packages
+
+ for var in PORTDIR PORTDIR_OVERLAY ; do
+ [[ -z ${(P)var} && -r /etc/make.conf ]] &&
+ local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
+ [[ -z ${(P)var} && -r /etc/make.globals ]] &&
+ local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
+ done
+ trees=( $PORTDIR $=PORTDIR_OVERLAY)
+
+ packages=( $trees/*-*/*(:t) )
+ _wanted packages expl 'package' compadd - "${(@)packages}"
+}
+
+_gentoo_packages_available(){
+ local var trees category packages pkg expl
+
+ for var in PORTDIR PORTDIR_OVERLAY ; do
+ [[ -z ${(P)var} && -r /etc/make.conf ]] &&
+ local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
+ [[ -z ${(P)var} && -r /etc/make.globals ]] &&
+ local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
+ done
+ trees=( $PORTDIR $=PORTDIR_OVERLAY)
+ category=( $trees/*-*(/:t) )
+
+ packages=( $trees/*-*/*(:t) )
+ _wanted packages expl 'package' compadd - "${(@)packages}"
+
+ # Complete cat/pkg. _multi_parts is much to slow for such a large task,
+ # _sep_parts removes the dash from gnome-<tab>, and _path_files wants to
+ # complete cat/pkg/files (if "files" is ignored with -F, miscfiles, etc...
+ # don't get completed).
+ if [[ $PREFIX != */* ]] ; then
+ _wanted cat_packages expl 'category/package' compadd -S '/' $category
+ else
+ compset -P '*/'
+ pkg=( $trees/$IPREFIX/*(:t) )
+ _wanted cat_packages expl 'category/package' compadd $pkg
+ fi
+}
+
+_gentoo_packages_available_versions(){
+ local var overlay_ebuilds portage_ebuilds expl trees category
+
+ for var in PORTDIR PORTDIR_OVERLAY ; do
+ [[ -z ${(P)var} && -r /etc/make.conf ]] &&
+ local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
+ [[ -z ${(P)var} && -r /etc/make.globals ]] &&
+ local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
+ done
+ trees=($PORTDIR $=PORTDIR_OVERLAY)
+ category=( $trees/*-*(/:t) )
+ typeset -U category
+
+ if [[ $#PREFIX -ge 1 && -z $words[(r)(--inject|-i)] ]] ; then
+ overlay_ebuilds=($=PORTDIR_OVERLAY/*-*/${PREFIX%%-[0-9]#*}*/*.ebuild(:t:r) )
+ portage_ebuilds=($PORTDIR/metadata/cache/*-*/${PREFIX%%-[0-9]#*}*(:t))
+ _wanted packages expl 'package' compadd $portage_ebuilds $overlay_ebuilds
+ fi
+ pkg=( $trees/${PREFIX%%/*}/*/*.ebuild(:t:r) )
+ _wanted cat_packages expl 'category/package' _sep_parts category / pkg
+}
+
+#Function to show tbz2 files available
+_gentoo_packages_binary() {
+ [[ -z $PKGDIR && -r /etc/make.conf ]] &&
+ local PKGDIR="`. /etc/make.conf 2>/dev/null; echo $PKGDIR`"
+ [[ -z $PKGDIR && -r /etc/make.globals ]] &&
+ local PKGDIR="`. /etc/make.globals 2>/dev/null; echo $PKGDIR`"
+
+ # this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
+ # binary mirror will be available we should rewrite it accordingly.
+ _path_files -g \*.tbz2 -W "$PKGDIR/All"
+}
+
+_gentoo_packages () {
+ local command="$argv[$#]"
+ [[ "$command" == (sets|licenses|installed(_versions|)|available(_versions|)|binary|category|(active_|)useflag|available_pkgnames_only|overlays) ]] || {
+ _message "unknown command: $command"
+ return 1
+ }
+ _gentoo_packages_$command
+}
+
+_gentoo_packages "$@"
diff --git a/src/_gentoolkit b/src/_gentoolkit
new file mode 100644
index 0000000..346b499
--- /dev/null
+++ b/src/_gentoolkit
@@ -0,0 +1,405 @@
+#compdef equery euse eclean eclean-dist eclean-pkg epkginfo genpkgindex glsa-check revdep-rebuild
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Gentoolkit (collection of Gentoo administrative scripts).
+# (Means portage helper python-scrips and some usefull staff)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Vadim A. Misbakh-Soloviev <mva@mva.name>
+# * Bapt <bapt@tuxfamily.org>
+# * kaworu <kaworu@kaworu.ch>
+# * David Durrleman <dualmoo@gmail.com>
+# * oberyno <oberyno@gmail.com>
+# * Mamoru Komachi <usata@usata.org>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+#<app-portage/gentoolkit-0.2.4-rc3>
+#
+# Status:
+# euse (fully done)
+# equery (fully done)
+# eclean* (fully done)
+# epkginfo (fully done)
+# genpkgindex (fully done)
+# glsa-check (fully done)
+# revdep-rebuild (fully done)
+# eread (nothing todo)
+
+
+# XXX: shouldn't this go to _gentoo_package?
+_packages () {
+ if compset -P '(\\|)(>=|<=|<|>|=)' ; then
+ _gentoo_packages ${*/(#m)(installed|available)/${MATCH}_versions}
+ else
+ _gentoo_packages $*
+ fi
+}
+
+
+_euse () {
+ local state tmp start_args suboptions_args
+ start_args=(
+ {'(--help)-h','(-h)--help'}'[show help]'
+ {'(--version)-v','(-v)--version'}'[show version]'
+ {'(--info)-i','(-i)--info'}'[show descriptions for the given useflags]'
+ {'(--active)-a','(-a)--active'}'[show currently active useflags and their origin]'
+ {'(--enable)-E','(-E)--enable'}'[enable the given useflags]'
+ {'(--disable)-D','(-D)--disable'}'[disable the given useflags]'
+ {'(--prune)-P','(-P)--prune'}'[show version]'
+ )
+ suboptions_args=(
+ {'(--global)-g','(-g)--global'}'[show only global use flags]'
+ {'(--local)-l','(-l)--local'}'[show only local use flags]'
+ )
+ if (( CURRENT == 2 ));then
+ _arguments -s $start_args
+ elif (( CURRENT == 3 ));then
+ case "$words[2]" in
+ -i|--info|-a|--active)
+ _arguments -s $suboptions_args \
+ '*:useflags:_gentoo_packages useflag' && ret=0
+ ;;
+ -E|--enable)
+ _arguments \
+ '*:useflags:_gentoo_packages useflag' && ret=0
+ ;;
+ -D|--disable)
+ _arguments \
+ '*:active useflags:_gentoo_packages active_useflag' && ret=0
+ esac
+ else
+ _arguments \
+ '*:useflag:_gentoo_packages useflag' && ret=0
+ fi
+}
+
+
+_equery () {
+ # Based off of X/_xauth.
+ local state context line expl ret=1
+ local tmp cmd start_args common_args
+
+ start_args=(
+ {'(--nocolor)-C','(-C)--nocolor'}'[turns off colors]'
+ {'(--quiet)-q','(-q)--quiet'}'[minimal output]'
+ {'(--help)-h','(-h)--help'}'[show help]'
+ {'(--version)-V','(-V)--version'}'[show version]'
+ )
+
+ common_args=(
+ '(-i --installed -I --exclude-installed)'{-i,--installed}'[search installed packages]'
+ '(-I --exclude-installed -i --installed)'{-I,--exclude-installed}'[do not search installed packages]'
+ '(-p --portage)'{-p,--portage-tree}'[also search in portage tree]'
+ '(-o --overlay-tree)'{-o,--overlay-tree}'[also search in overlay tree]'
+ )
+
+
+ _arguments -s $start_args \
+ '*::command:->command' && ret=0
+
+ while [[ -n "$state" ]]; do
+ tmp="$state"
+ state=
+ case "$tmp" in
+ command)
+ if (( CURRENT == 1 )); then
+ state=subcommands
+ else
+ cmd="$words[1]"
+ curcontext="${curcontext%:*:*}:equery-${cmd}:"
+ case "$cmd" in
+ belongs|b)
+ _arguments \
+ '(-c --category)'{-c,--category}'[only search in specified category]:category:_gentoo_packages category' \
+ '(-e --earlyout)'{-e,--earlyout}'[stop when first match found]' \
+ '(-f --full-regex)'{-f,--full-regex}'[supplied query is a full regex]:pattern:' \
+ '*:file:_files' && ret=0
+ ;;
+ check|k)
+ _arguments \
+ ':portage:_packages installed' && ret=0
+ ;;
+ depends|d)
+ _arguments \
+ '(-a --all-packages)'{-a,--all-packages}'[search in all available packages (slow)]:all packages:->packages' \
+ '(-d --direct -D --indirect)'{-d,--direct}'[search direct dependencies only (default)]' \
+ '(-d --direct -D --indirect)'{-D,--indirect}'[search indirect dependencies (VERY slow)]' \
+ '*:package:_packages installed' && ret=0
+ ;;
+ depgraph|g)
+ _arguments \
+ '(-U --no-useflags)'{-U,--no-useflags}'[do not show USE flags]' \
+ '(-l --linear)'{-l,--linear}'[do not use fancy formatting]' \
+ ':package:_packages installed' && ret=0
+ ;;
+ files|f)
+ _arguments \
+ '--timestamp[append timestamp]' \
+ '--md5sum[append md5sum]' \
+ '--type[prepend file type]' \
+ '--filter=[filter output]:filter(s):_values -s , '' dir obj sym dev fifo path conf cmd doc man info' \
+ ':installed pkgname:_packages installed' && ret=0
+ ;;
+ hasuse|h)
+ _arguments \
+ $common_args \
+ ':useflag:_gentoo_packages useflag' && ret=0
+ ;;
+ list|l)
+ _arguments \
+ $common_args \
+ ': :_guard "^--*" pattern' && ret=0
+ ;;
+ size|s)
+ _arguments \
+ '(-b --bytes)'{-b,--bytes}'[report size in bytes]' \
+ ':package:_packages installed' && ret=0
+ ;;
+ which|w)
+ _arguments \
+ ':portage:_packages available' && ret=0
+ ;;
+ uses|u)
+ _arguments \
+ {--all,-a}'[include non-installed packages]' \
+ ":portage:_packages installed" && ret=0
+ ;;
+ *)
+ _message 'command not found'
+ ;;
+ esac
+ fi
+ ;;
+ subcommands)
+ tmp=(
+ {belongs,b}'[list all packages owning file(s)]'
+ {check,k}'[check MD5sums and timestamps of package]'
+ {depends,d}'[list all packages depending on specified package]'
+ {depgraph,g}'[display a dependency tree for package]'
+ {files,f}'[list files owned by package]'
+ {hasuse,h}'[list all packages with specified useflag]'
+ {list,l}'[list all packages matching pattern]'
+ {size,s}'[print size of files contained in package]'
+ {uses,u}'[display USE flags for package]'
+ {which,w}'[print full path to ebuild for package]'
+ )
+ _values 'equery command' $tmp && ret=0
+ ;;
+ esac
+ done
+}
+
+
+_eclean_wrapper () {
+ local global_opts pkg_opts dist_opts
+
+ global_opts=(
+ '(-C --nocolor)'{-C,--nocolor}'[turns off colors]'
+ '(-d,--destructive)'{-d,--destructive}'[only keep the minimum for a reinstallation]'
+ '(-e,--exclude-file)'{-e,--exclude-file}'[path to the exclusion file]:filename:_files'
+ '(-i,--interactive)'{-i,--interactive}'[ask confirmation before deletions]'
+ '(-n,--package-names)'{-n,--package-names}'[protect all versions (when --destructive)]'
+ '(-p,--pretend)'{-p,--pretend}'[only display what would be cleaned]'
+ '(-q,--quiet)'{-q,--quiet}'[minimal output]'
+ '(-t,--time-limit)'{-t,--time-limit}'[don’t delete files modified since <time>]:time:_eclean_time'
+ '(: -)'{-h,--help}'[show help]'
+ '(: -)'{-V,--version}'[show version]'
+ )
+ dist_opts=(
+ '(-s,--size-limit)'{-s,--size-limit}'[do not delete disfiles bigger than <size>]:size:_eclean_size'
+ '(-f,--fetch-restricted)'{-f,--fetch-restricted}'[protect fetch-restricted files]'
+ )
+ # XXX: If you add options here make sure that it'll work.
+ # since there isn't any option *right* now, $pkg_opts
+ # is never used.
+ pkg_opts=()
+
+ # check which kind of eclean command we run.
+ case "$words[1]" in
+ eclean-pkg)
+ _arguments -s $global_opts $pkg_opts &&
+ return 0
+ ;;
+ eclean-dist)
+ _arguments -s $global_opts $dist_opts &&
+ return 0
+ ;;
+ eclean)
+ # eclean. complete only specifics options if an action has been given,
+ # global_opts and packages|distfiles otherwhise.
+ if (( $words[(I)(packages)] )); then
+ # Currently no options so return 0
+ #_values "packages options" $pkg_opts &&
+ return 0
+ elif (( $words[(I)(distfiles)] )); then
+ _values "distfiles options" $dist_opts &&
+ return 0
+ else
+ _arguments -s $global_opts
+ # complete packages|distfiles only if CURRENT-1 don't need an arg
+ if [[ ! $words[CURRENT-1] =~ -(e|-exclude-file|t|-time-limit|s|-size-limit|h|-help|v|-version) ]]; then
+ _values 'eclean command' \
+ 'packages[clean outdated binary packages]' \
+ 'distfiles[clean outdated packages sources files]' &&
+ return 0
+ fi
+ fi
+ ;;
+ esac
+}
+_eclean_time () {
+ # adapted from _chmod
+ compset -P '*'
+ suf=( -S '' )
+ _alternative -O suf \
+ 'number:number:(0 1 2 3 4 5 6 7 8 9)' \
+ 'time_unit:time_unit:((y\:year m\:month w\:week d\:day h\:hour))' &&
+ return 0
+}
+_eclean_size () {
+ # adapted from _chmod
+ compset -P '*'
+ suf=( -S '' )
+ _alternative -O suf \
+ 'number:number:(0 1 2 3 4 5 6 7 8 9)' \
+ 'time_unit:time_unit:((G\:gigabytes M\:megabytes K\:kilobytes B\:bytes))' &&
+ return 0
+}
+
+
+_epkginfo () {
+ if (( CURRENT == 2 )); then
+ _arguments -s '*:package:_gentoo_packages available'
+ fi
+}
+
+
+_genpkgindex () {
+ _arguments -s \
+ '(: -)'{-h,--help}'[Display help and exit]' \
+ '(-h --help -q --quiet -v --verbose)'{-q,--quiet}'[Be quiet]' \
+ '(-h --help -q --quiet -v --verbose)'{-v,--verbose}'[Be verbose]' \
+ '(-h --help -c --compress)'{-c,--compress}'[Compresses the generated metadata with bzip2]' \
+ '(-h --help -P --pkgdir)'{-P,--pkgdir}'[Set the base location of the binary packages (default $PKGDIR)]:file:_files'
+}
+
+
+_glsa-check () {
+ local actions
+
+ actions=(-l --list -d --dump --print -t --test -p --pretend -f --fix -i --inject -h --help -V --version -m --mail)
+
+ _arguments -s \
+ "($actions)"{-l,--list}'[list all unapplied GLSA]:glsa_id:_glsa_id' \
+ "($actions)"{-d,--dump,--print}'[show all information about the given GLSA]:glsa_id:_glsa_id' \
+ "($actions)"{-t,--test}'[test if this system is affected by the given GLSA]:glsa_id:_glsa_id' \
+ "($actions)"{-p,--pretend}'[show the necessary commands to apply this GLSA]:glsa_id:_glsa_id' \
+ "($actions)"{-f,--fix}'[try to auto-apply this GLSA (experimental)]:glsa_id:_glsa_id' \
+ "($actions)"{-i,--inject}'[inject the given GLSA into the checkfile]:glsa_id:_glsa_id' \
+ '(-n --nocolor)'{-n,--nocolor}'[disable colors (option)]' \
+ '(: -)'{-h,--help}'[Show help message]' \
+ '(: -)'{-V,--version}'[some information about this tool]' \
+ '(-v --verbose)'{-v,--verbose}'[print more messages (option)]' \
+ '(-c --cve)'{-c,--cve}'[show CAN ids in listing mode (option)]' \
+ "($actions)"{-m,--mail}'[send a mail with the given GLSAs to the administrator]:glsa_id:_glsa_id'
+}
+# glsa-list can contain an arbitrary number of GLSA ids,
+# filenames containing GLSAs or the special identifiers
+# 'all', 'new' and 'affected'
+_glsa_id () {
+# XXX: we'll avoid displaying GLSA ids, because the ratio use/noise
+# will be low. May be we should display only the X previous GLSA,
+# or GLSA ids of the X last month.
+#
+# start to look at /usr/lib/gentoolkit/pym/glsa.py if GLSA_DIR is still
+# PORTDIR + "metadata/glsa/"
+# and then get the list (it's only xml files in GLSA_DIR, easy!)
+
+ compadd 'all' 'new' 'affected'
+ _files
+}
+
+
+_revdep-rebuild () {
+ if (( $words[(I)(--)] )); then
+ # here it's no more revdep-rebuild options, but emerge options that are called
+ _arguments -s '*:portage:_portage --emerge $@' && return 0
+ fi
+
+ _arguments -s \
+ '(-C --nocolor)'{-C,--nocolor}'[Turn off colored output]' \
+ '(-d --debug)'{-d,--debug}'[Print way too much information (uses bash set -xv)]' \
+ '(-e --exact)'{-e,--exact}'[Emerge based on exact package version]' \
+ '(: -)'{-h,--help}'[Print help]' \
+ '(-i --ignore)'{-i,--ignore}'[Ignore temporary files from previous runs]' \
+ '(-k --keep-temp)'{-k,--keep-temp}'[Do not delete temporary files on exit]' \
+ '(-L --library)'{-L,--library}'[<NAME> Emerge existing packages that use the library with NAME]:file:_files' \
+ '(-l --no-ld-path)'{-l,--no-ld-path}'[Do not set LD_LIBRARY_PATH]' \
+ '(-o --no-order)'{-o,--no-order}'[Do not check the build order (Saves time, but may cause breakage)]' \
+ '(-p --pretend)'{-p,--pretend}'[Do a trial run without actually emerging anything (also passed to emerge command)]' \
+ '(-P --no-progress)'{-P,--no-progress}'[Turn off the progress meter]' \
+ '(-q --quiet)'{-q,--quiet}'[Be less verbose (also passed to emerge command)]' \
+ '(-v --verbose)'{-v,--verbose}'[Be more verbose (also passed to emerge command)]' \
+ '(-u --no-util)'{-u,--no-util}'[<UTIL> Do not use features provided by UTIL]:file:_files'
+ # XXX: does someone really use -u|--no-util option?
+ # we can check packages installed (like portage-utils etc) to see
+ # which "UTIL" is avaiable.
+}
+
+
+case "$service" in
+ euse)
+ _euse "$@" && return 0
+ ;;
+ equery)
+ _equery "$@" && return 0
+ ;;
+ eclean*)
+ _eclean_wrapper "$@" && return 0
+ ;;
+ epkginfo)
+ _epkginfo "$@" && return 0
+ ;;
+ genpkgindex)
+ _genpkgindex "$@" && return 0
+ ;;
+ glsa-check)
+ _glsa-check "$@" && return 0
+ ;;
+ revdep-rebuild)
+ _revdep-rebuild "$@" && return 0
+ ;;
+esac
diff --git a/src/_git-flow b/src/_git-flow
new file mode 100644
index 0000000..6472117
--- /dev/null
+++ b/src/_git-flow
@@ -0,0 +1,334 @@
+#compdef git-flow
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for git-flow (http://github.com/nvie/gitflow).
+#
+# Source: https://github.com/bobthecow/git-flow-completion
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Justin Hileman (https://github.com/bobthecow)
+# * Yusuke Muraoka (https://github.com/jbking)
+# * Vincent Driessen (https://github.com/nvie)
+# * Zifei Tong (https://github.com/chevalun)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_git-flow ()
+{
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+
+ local -a subcommands
+ subcommands=(
+ 'init:Initialize a new git repo with support for the branching model.'
+ 'feature:Manage your feature branches.'
+ 'release:Manage your release branches.'
+ 'hotfix:Manage your hotfix branches.'
+ 'support:Manage your support branches.'
+ 'version:Shows version information.'
+ )
+ _describe -t commands 'git flow' subcommands
+ ;;
+
+ (options)
+ case $line[1] in
+
+ (init)
+ _arguments \
+ -f'[Force setting of gitflow branches, even if already configured]'
+ ;;
+
+ (version)
+ ;;
+
+ (hotfix)
+ __git-flow-hotfix
+ ;;
+
+ (release)
+ __git-flow-release
+ ;;
+
+ (feature)
+ __git-flow-feature
+ ;;
+ esac
+ ;;
+ esac
+}
+
+__git-flow-release ()
+{
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+
+ local -a subcommands
+ subcommands=(
+ 'start:Start a new release branch.'
+ 'finish:Finish a release branch.'
+ 'list:List all your release branches. (Alias to `git flow release`)'
+ )
+ _describe -t commands 'git flow release' subcommands
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+
+ (options)
+ case $line[1] in
+
+ (start)
+ _arguments \
+ -F'[Fetch from origin before performing finish]'\
+ ':version:__git_flow_version_list'
+ ;;
+
+ (finish)
+ _arguments \
+ -F'[Fetch from origin before performing finish]' \
+ -s'[Sign the release tag cryptographically]'\
+ -u'[Use the given GPG-key for the digital signature (implies -s)]'\
+ -m'[Use the given tag message]'\
+ -p'[Push to $ORIGIN after performing finish]'\
+ ':version:__git_flow_version_list'
+ ;;
+
+ *)
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+__git-flow-hotfix ()
+{
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+
+ local -a subcommands
+ subcommands=(
+ 'start:Start a new hotfix branch.'
+ 'finish:Finish a hotfix branch.'
+ 'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
+ )
+ _describe -t commands 'git flow hotfix' subcommands
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+
+ (options)
+ case $line[1] in
+
+ (start)
+ _arguments \
+ -F'[Fetch from origin before performing finish]'\
+ ':hotfix:__git_flow_version_list'\
+ ':branch-name:__git_branch_names'
+ ;;
+
+ (finish)
+ _arguments \
+ -F'[Fetch from origin before performing finish]' \
+ -s'[Sign the release tag cryptographically]'\
+ -u'[Use the given GPG-key for the digital signature (implies -s)]'\
+ -m'[Use the given tag message]'\
+ -p'[Push to $ORIGIN after performing finish]'\
+ ':hotfix:__git_flow_hotfix_list'
+ ;;
+
+ *)
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+__git-flow-feature ()
+{
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+
+ local -a subcommands
+ subcommands=(
+ 'start:Start a new feature branch.'
+ 'finish:Finish a feature branch.'
+ 'list:List all your feature branches. (Alias to `git flow feature`)'
+ 'publish: public'
+ 'track: track'
+ 'diff: diff'
+ 'rebase: rebase'
+ 'checkout: checkout'
+ 'pull: pull'
+ )
+ _describe -t commands 'git flow feature' subcommands
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+
+ (options)
+ case $line[1] in
+
+ (start)
+ _arguments \
+ -F'[Fetch from origin before performing finish]'\
+ ':feature:__git_flow_feature_list'\
+ ':branch-name:__git_branch_names'
+ ;;
+
+ (finish)
+ _arguments \
+ -F'[Fetch from origin before performing finish]' \
+ -r'[Rebase instead of merge]'\
+ ':feature:__git_flow_feature_list'
+ ;;
+
+ (publish)
+ _arguments \
+ ':feature:__git_flow_feature_list'\
+ ;;
+
+ (track)
+ _arguments \
+ ':feature:__git_flow_feature_list'\
+ ;;
+
+ (diff)
+ _arguments \
+ ':branch:__git_branch_names'\
+ ;;
+
+ (rebase)
+ _arguments \
+ -i'[Do an interactive rebase]' \
+ ':branch:__git_branch_names'
+ ;;
+
+ (checkout)
+ _arguments \
+ ':branch:__git_flow_feature_list'\
+ ;;
+
+ (pull)
+ _arguments \
+ ':remote:__git_remotes'\
+ ':branch:__git_branch_names'
+ ;;
+
+ *)
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+__git_flow_version_list ()
+{
+ local expl
+ declare -a versions
+
+ versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
+ __git_command_successful || return
+
+ _wanted versions expl 'version' compadd $versions
+}
+
+__git_flow_feature_list ()
+{
+ local expl
+ declare -a features
+
+ features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
+ __git_command_successful || return
+
+ _wanted features expl 'feature' compadd $features
+}
+
+__git_remotes () {
+ local expl gitdir remotes
+
+ gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
+ __git_command_successful || return
+
+ remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
+ __git_command_successful || return
+
+ # TODO: Should combine the two instead of either or.
+ if (( $#remotes > 0 )); then
+ _wanted remotes expl remote compadd $* - $remotes
+ else
+ _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
+ fi
+}
+
+__git_flow_hotfix_list ()
+{
+ local expl
+ declare -a hotfixes
+
+ hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
+ __git_command_successful || return
+
+ _wanted hotfixes expl 'hotfix' compadd $hotfixes
+}
+
+__git_branch_names () {
+ local expl
+ declare -a branch_names
+
+ branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
+ __git_command_successful || return
+
+ _wanted branch-names expl branch-name compadd $* - $branch_names
+}
+
+__git_command_successful () {
+ if (( ${#pipestatus:#0} > 0 )); then
+ _message 'not a git repository'
+ return 1
+ fi
+ return 0
+}
+
+_git-flow "$@"
diff --git a/src/_git-pulls b/src/_git-pulls
new file mode 100644
index 0000000..36a9a50
--- /dev/null
+++ b/src/_git-pulls
@@ -0,0 +1,103 @@
+#compdef git-pulls
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for git-pulls 0.3.1 (https://git-pulls.com/schacon/git-pulls).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud (https://github.com/nicoulaj)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_git-pulls() {
+ typeset -A opt_args
+ local context state line curcontext="$curcontext"
+
+ local ret=1
+
+ _arguments -C \
+ '(- 1 *)--help[show usage]' \
+ '1:cmd:->cmds' \
+ '*::arg:->args' \
+ && ret=0
+
+ case "$state" in
+ (cmds)
+ local commands; commands=(
+ 'update:update pull requests list'
+ 'list:list pull requests'
+ 'show:show pull request'
+ 'browse:open pull request in a web browser'
+ 'merge:merge pull request'
+ )
+ _describe -t commands 'command' commands && ret=0
+ ;;
+ (args)
+ curcontext="${curcontext%:*:*}:git-pulls-cmd-$words[1]:"
+ case $words[1] in
+ (update)
+ _message 'no more arguments' && ret=0
+ ;;
+ (list)
+ _arguments \
+ '--reverse[list in reverse order]' \
+ && ret=0
+ ;;
+ (show)
+ _arguments \
+ '1: :_git-pulls_pull_requests_numbers' \
+ '--full[use verbose output]' \
+ && ret=0
+ ;;
+ (browse|merge)
+ _arguments \
+ '1: :_git-pulls_pull_requests_numbers' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+
+ return ret
+}
+
+(( $+functions[_git-pulls_pull_requests_numbers] )) ||
+_git-pulls_pull_requests_numbers() {
+ local pull_requests; pull_requests=(${${${(M)${(f)"$(_call_program users $service list)"}:#[[:digit:]]##[[:space:]]*}//:/\\:}/[[:space:]]##/:})
+ _describe -t pull-request-numbers 'pull request number' pull_requests "$@"
+}
+
+_git-pulls "$@"
diff --git a/src/_git-wtf b/src/_git-wtf
new file mode 100644
index 0000000..e2d57c4
--- /dev/null
+++ b/src/_git-wtf
@@ -0,0 +1,53 @@
+#compdef git-wtf
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for git-wtf, authored by
+# William Morgan (http://git-wt-commit.rubyforge.org/git-wtf)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Mario Fernandez (https://github.com/sirech)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+_arguments -w -C -s \
+ '(--long --short)'{-l,--long}'[include author info and date for each commit]' \
+ '(--long --short)'{-s,--short}'[do not show commits]' \
+ '(--all)'{-a,--all}'[show all branches across all remote repos, not just those from origin]' \
+ '(--all-commits)'{-A,--all-commits}'[show all commits, not just the first 5]' \
+ '(--key)'{-k,--key}'[show key]' \
+ '(--relations)'{-r,--relations}'[show relation to features / integration branches]' \
+ '(--dump-config)--dump-config[print out current configuration and exit]' \
+ '*: :__git_branch_names'
diff --git a/src/_github b/src/_github
new file mode 100644
index 0000000..f27190b
--- /dev/null
+++ b/src/_github
@@ -0,0 +1,267 @@
+#compdef github gh
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Github gem 0.6.2 (https://github.com/defunkt/github-gem).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud (https://github.com/nicoulaj)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_github() {
+ typeset -A opt_args
+ local context state line curcontext="$curcontext"
+
+ local ret=1
+
+ _arguments -C \
+ '1:cmd:->cmds' \
+ '*::arg:->args' \
+ && ret=0
+
+ case "$state" in
+ (cmds)
+ local commands; commands=(
+ 'admin:open this repo'\''s Admin panel a web browser'
+ 'browse:open this repo in a web browser'
+ 'clone:clone a repo'
+ 'config:automatically set configuration info, or pass args to specify'
+ 'create:create a new, empty GitHub repository'
+ 'create-from-local:create a new GitHub repository from the current local repository'
+ 'fetch:fetch from a remote to a local branch'
+ 'fetch_all:fetch all refs from a user'
+ 'fork:forks a GitHub repository'
+ 'home:open this repo'\''s master branch in a web browser'
+ 'ignore:ignore a SHA'
+ 'info:info about this project'
+ 'issues:project issues tools'
+ 'network:project network tools'
+ 'open:open the given user/project in a web browser'
+ 'pull:pull from a remote'
+ 'pull-request:generate the text for a pull request'
+ 'search:search GitHub for the given repository name'
+ 'track:track another user'\''s repository'
+ )
+ _describe -t commands 'command' commands && ret=0
+ ;;
+ (args)
+ curcontext="${curcontext%:*:*}:github-cmd-$words[1]:"
+ case $words[1] in
+ (admin|fetch|fetch_all|home|info)
+ _message 'no more arguments' && ret=0
+ ;;
+ (browse)
+ _arguments \
+ '1: :_github_users' \
+ '2: :_github_branches' \
+ && ret=0
+ ;;
+ (clone)
+ _arguments \
+ '1: :_github_users' \
+ '2: :_github_repos' \
+ '3: :_files -/' \
+ '--search[search for user or repo and clone selected repository]:user or repo' \
+ '--ssh[clone using the git@github.com style url]' \
+ && ret=0
+ ;;
+ (config)
+ _arguments \
+ '1: :_github_users' \
+ '2: :_github_repos' \
+ && ret=0
+ ;;
+ (create)
+ _arguments \
+ '1:repo name' \
+ '--markdown[create README.markdown]' \
+ '--mdown[create README.mdown]' \
+ '--private[create private repository]' \
+ '--rdoc[create README.rdoc]' \
+ '--rst[create README.rst]' \
+ '--textile[create README.textile]' \
+ && ret=0
+ ;;
+ (create-from-local)
+ _arguments \
+ '--private[create private repository]' \
+ && ret=0
+ ;;
+ (fork)
+ _arguments \
+ '1: :_github_user_slash_repos' \
+ && ret=0
+ ;;
+ (ignore)
+ _arguments \
+ '1: :_github_network_commits' \
+ && ret=0
+ ;;
+ (issues)
+ _arguments -C \
+ '1:issue-status:->issue-statuses' \
+ '2:: :_github_users' \
+ '--after[only show issues updated after a certain date]:date' \
+ '--label[only show issues with a certain label]:label' \
+ && ret=0
+ case "$state" in
+ (issue-statuses)
+ local statuses; statuses=(
+ 'open:show open issues'
+ 'closed:show closed issues'
+ )
+ _describe -t statuses 'status' statuses && ret=0
+ ;;
+ esac
+ ;;
+ (network)
+ _arguments -C \
+ '1:network-subcommand:->network-subcommands' \
+ '*::network-arg:->network-args' \
+ '(--after)--before[only show commits before a certain date]:date' \
+ '(--before)--after[only show commits after a certain date]:date' \
+ '--applies[filter commits to patches that apply cleanly]' \
+ '--author[filter commits on a email address of author]:author' \
+ '--cache[use the network data even if it'\''s expired]' \
+ '--common[show common branch point]' \
+ '--limit[only look through the first X heads - useful for really large projects]:number' \
+ '--noapply[filter commits to patches that do not apply cleanly]' \
+ '--nocache[do not use the cached network data]' \
+ '--project[filter commits on a certain project]:project' \
+ '--shas[only show shas]' \
+ '--sort[how to sort : date, branch, author]:sort type:((date\:sort\ by\ date\ \(default\) branch\:sort\ by\ branch author\:sort\ by\ author))' \
+ '--thisbranch[look at branches that match the current one]' \
+ && ret=0
+ case "$state" in
+ (network-subcommands)
+ local subcommands; subcommands=(
+ 'web:open network in a web browser'
+ 'list:list network members'
+ 'fetch:fetch network members commits'
+ 'commits:list network members commits'
+ )
+ _describe -t subcommands 'subcommand' subcommands && ret=0
+ ;;
+ (network-args)
+ case $words[1] in
+ (web)
+ _arguments \
+ '1: :_github_users' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ (open)
+ _arguments \
+ '1: :_github_user_slash_repos' \
+ && ret=0
+ ;;
+ (pull)
+ _arguments \
+ '1: :_github_users' \
+ '2: :_github_branches' \
+ '--merge[automatically merge remote'\''s changes into your master]' \
+ && ret=0
+ ;;
+ (pull-request)
+ _arguments \
+ '1: :_github_users' \
+ '2: :_github_branches' \
+ && ret=0
+ ;;
+ (search)
+ _arguments \
+ '1:query' \
+ && ret=0
+ ;;
+ (track)
+ _arguments \
+ '1:: :((remote))' \
+ '*: :_github_user_slash_repos' \
+ {--private,--ssh}'[use git@github.com: instead of git://github.com/]' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+
+ return ret
+}
+
+(( $+functions[_github_users] )) ||
+_github_users() {
+ _alternative \
+ 'users:user:_users' \
+ 'github-network-users:github network user:_github_network_users'
+}
+
+(( $+functions[_github_network_users] )) ||
+_github_network_users() {
+ local users; users=(${(f)"$(_call_program users $service network list 2>/dev/null)"})
+ _describe -t github-network-users 'github network user' users "$@"
+}
+
+(( $+functions[_github_repos] )) ||
+_github_repos() {
+ _message -e repos 'repo'
+}
+
+(( $+functions[_github_branches] )) ||
+_github_branches() {
+ _message -e branches 'branch'
+}
+
+(( $+functions[_github_user_slash_repos] )) ||
+_github_user_slash_repos() {
+ local ret=1
+ if compset -P '*/'; then
+ _wanted repos expl 'repo' _github_repos && ret=0
+ else
+ _wanted users expl 'user' _github_users -qS/ && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_github_network_commits] )) ||
+_github_network_commits() {
+ local commits; commits=(${${(f)"$(_call_program commits $service network commits 2>/dev/null)"}%%[[:blank:]]*})
+ _describe -t commits 'commit' commits "$@"
+}
+
+_github "$@"
diff --git a/src/_google b/src/_google
new file mode 100644
index 0000000..82f8508
--- /dev/null
+++ b/src/_google
@@ -0,0 +1,64 @@
+#compdef google
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for googlecl (https://code.google.com/p/googlecl/)
+#
+# Source: https://raw.github.com/dadrc/zsh-cfg/master/completions/_google
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * dadrc (https://github.com/dadrc)
+# * Ben O'Hara (https://github.com/benohara)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+_google() {
+ # init variables
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ # init state
+ _arguments \
+ '1: :->service'\
+ '2: :->task'
+
+ case $state in
+ service)
+ _arguments '1:service:(picasa blogger youtube docs contacts calendar finance)'
+ ;;
+ *)
+ case $words[2] in
+ picasa)
+ compadd "$@" get create list list-albums tag post delete
+ ;;
+ blogger)
+ compadd "$@" post tag list delete
+ ;;
+ youtube)
+ compadd "$@" post tag list delete
+ ;;
+ docs)
+ compadd "$@" edit delete list upload get
+ ;;
+ contacts)
+ compadd "$@" list list-groups add add-groups delete-groups delete
+ ;;
+ calendar)
+ compadd "$@" add list today delete
+ ;;
+ finance)
+ compadd "$@" list-txn delete-pos create-pos delete-txn create create-txn list list-pos delete
+ ;;
+ *)
+ esac
+ esac
+}
+
+_google "$@" \ No newline at end of file
diff --git a/src/_gradle b/src/_gradle
new file mode 100644
index 0000000..7f7442a
--- /dev/null
+++ b/src/_gradle
@@ -0,0 +1,130 @@
+#compdef gradle gradlew
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Gradle 1.0-milestone-5 (http://www.gradle.org).
+#
+# Status: incomplete (see TODO/FIXME tags)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_gradle() {
+ typeset -A opt_args
+ local context state line
+
+ local curcontext="$curcontext"
+
+ _arguments \
+ '(- 1 *)'{-?,-h,--help}'[show help message]' \
+ '(-a --no-rebuild)'{-a,--no-rebuild}'[do not rebuild project dependencies]' \
+ '(-b --build-file)'{-b,--build-file}'[specify the build file]:build file:_gradle_scripts' \
+ '(-C --cache)'{-C,--cache}'[specify how compiled build scripts should be cached]:cache strategy:((rebuild\:rebuild\ the\ cache on\:use\ the\ cache\ \(default\)))' \
+ '(-c --settings-file)'{-c,--settings-file}'[speciy the settings file]:settings file:_gradle_scripts' \
+ '*'{-D-,--system-prop}'[set system property of the JVM]:property:_gradle_properties' \
+ '(-d --debug -q --quiet -i --info)'{-d,--debug}'[log in debug mode (includes normal stacktrace)]' \
+ '(--foreground --no-daemon --stop)--daemon[use the Gradle daemon to run the build, starts the daemon if not running]' \
+ '(-e --embedded)'{-e,--embedded}'[specify an embedded build script]:embedded build script' \
+ '(--daemon --no-daemon --stop)--foreground[start the Gradle daemon in the foreground]' \
+ '(-g --gradle-user-home)'{-g,--gradle-user-home}'[specify the gradle user home directory]: :_files -/' \
+ '--gui[launch a GUI application]' \
+ '(-I --init-script)'{-I,--init-script}'[specify an initialization script]:init script:_gradle_scripts' \
+ '(-i --info -q --quiet -d --debug)'{-i,--info}'[set log level to info]' \
+ '(-m --dry-run)'{-m,--dry-run}'[run the builds with all task actions disabled]' \
+ '(-n --dependencies)'{-n,--dependencies}'[show list of all project dependencies]' \
+ '--no-color[do not use color in the console output]' \
+ '(--daemon --foreground --stop)--no-daemon[do not use the Gradle daemon to run the build]' \
+ '--no-opt[ignore any task optimization]' \
+ '*'{-P-,--project-prop}'[set project property for the build script]:property:_gradle_properties' \
+ '(-p --project-dir)'{-p,--project-dir}'[specify the start directory for Gradle]: :_files -/' \
+ '--profile[profile build execution time and generate a report in the <build_dir>/reports/profile directory]' \
+ '(-q --quiet -d --debug -i --info)'{-q,--quiet}'[log errors only]' \
+ '(-r --properties)'{-r,--properties}'[show list of all available project properties]' \
+ '(-S --full-stacktrace)'{-S,--full-stacktrace}'[print out the full (very verbose) stacktrace for any exceptions]' \
+ '(-s --stacktrace)'{-s,--stacktrace}'[print out the stacktrace also for user exceptions]' \
+ '(--daemon --foreground)--stop[stop the Gradle daemon if it is running]' \
+ '(-t --tasks)'{-t,--tasks}'[show list of available tasks]' \
+ '(-u --no-search-upward)'{-u,--no-search-upward}'[don'\''t search in parent folders for a settings.gradle file]' \
+ '(-v --version)'{-v,--version}'[print version info]' \
+ '(-x --exclude-task)*'{-x,--exclude-task}'[specify a task to be excluded from execution]:task:_gradle_tasks' \
+ '*: :_gradle_tasks'
+}
+
+(( $+functions[_gradle_tasks] )) ||
+_gradle_tasks() {
+ local alternatives task_group task_group_name task_group_tasks
+ local project="${PREFIX%:*}"
+ alternatives=("project:project:_gradle_projects -qS:")
+ for task_group in ${(M)${(ps:\n\n:)"$($service --daemon --quiet --no-color ${project}:tasks 2>/dev/null)"}:#*[[:space:]]\-[[:space:]]*}; do
+ task_group_name="${${${task_group%%---*}%[[:space:]]tasks[[:space:]]*}:l}"
+ task_group_tasks=(${(q)${(f)${task_group##*---}}/[[:space:]]\-[[:space:]]/:})
+ alternatives+=("${task_group_name//[[:space:]]/-}-task:${task_group_name} task:((${task_group_tasks[@]}))")
+ done
+ _alternative "${alternatives[@]}"
+}
+
+(( $+functions[_gradle_projects] )) ||
+_gradle_projects() {
+ local project="${PREFIX%:*}"
+ local projects; projects=(${${${(M)${(f)"$($service --daemon --quiet --no-color ${project}:projects 2>/dev/null)"}:#*--- Project\ \':*}#*\'}%\'*})
+ _multi_parts $@ : projects
+}
+
+(( $+functions[_gradle_scripts] )) ||
+_gradle_scripts() {
+ _files -g '*.gradle*'
+}
+
+(( $+functions[_gradle_properties] )) ||
+_gradle_properties() {
+ local ret=1
+ if compset -P '*='; then
+ _message -e property-values 'property value' && ret=0
+ else
+ _wanted property-names expl 'property name' _gradle_property_names -qS= && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_gradle_property_names] )) ||
+_gradle_property_names() {
+ local property_names; property_names=(${${(M)${(f)"$($service --daemon --quiet --no-color :properties 2>/dev/null)"}:#*:*}%%:*})
+ _describe -t property_names 'property name' property_names "$@"
+}
+
+_gradle "$@"
diff --git a/src/_heroku b/src/_heroku
new file mode 100644
index 0000000..388ee6b
--- /dev/null
+++ b/src/_heroku
@@ -0,0 +1,169 @@
+#compdef heroku
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for the Heroku client gem (https://github.com/heroku/heroku)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Ali B. (http://awhitebox.com)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+local -a _1st_arguments
+_1st_arguments=(
+ "account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
+ "addons":"list installed addons"
+ "addons\:list":"list all available addons"
+ "addons\:add":"install an addon"
+ "addons\:upgrade":"upgrade an existing addon"
+ "addons\:downgrade":"downgrade an existing addon"
+ "addons\:remove":"uninstall an addon"
+ "addons\:open":"open an addon's dashboard in your browser"
+ "apps":"list your apps"
+ "apps\:info":"show detailed app information"
+ "apps\:create":"create a new app"
+ "apps\:rename":"rename the app"
+ "apps\:open":"open the app in a web browser"
+ "apps\:destroy":"permanently destroy an app"
+ "auth\:login":"log in with your heroku credentials"
+ "auth\:logout":"clear local authentication credentials"
+ "config":"display the config vars for an app"
+ "config\:add":"add one or more config vars"
+ "config\:remove":"remove a config var"
+ "db\:push":"push local data up to your app"
+ "db\:pull":"pull heroku data down into your local database"
+ "domains":"list custom domains for an app"
+ "domains\:add":"add a custom domain to an app"
+ "domains\:remove":"remove a custom domain from an app"
+ "domains\:clear":"remove all custom domains from an app"
+ "help":"list available commands or display help for a specific command"
+ "keys":"display keys for the current user"
+ "keys\:add":"add a key for the current user"
+ "keys\:remove":"remove a key from the current user"
+ "keys\:clear":"remove all authentication keys from the current user"
+ "logs":"display recent log output"
+ "logs\:cron":"DEPRECATED: display cron logs from legacy logging"
+ "logs\:drains":"manage syslog drains"
+ "maintenance\:on":"put the app into maintenance mode"
+ "maintenance\:off":"take the app out of maintenance mode"
+ "pg\:info":"display database information"
+ "pg\:ingress":"allow direct connections to the database from this IP for one minute"
+ "pg\:promote":"sets DATABASE as your DATABASE_URL"
+ "pg\:psql":"open a psql shell to the database"
+ "pg\:reset":"delete all data in DATABASE"
+ "pg\:unfollow":"stop a replica from following and make it a read/write database"
+ "pg\:wait":"monitor database creation, exit when complete"
+ "pgbackups":"list captured backups"
+ "pgbackups\:url":"get a temporary URL for a backup"
+ "pgbackups\:capture":"capture a backup from a database id"
+ "pgbackups\:restore":"restore a backup to a database"
+ "pgbackups\:destroy":"destroys a backup"
+ "plugins":"list installed plugins"
+ "plugins\:install":"install a plugin"
+ "plugins\:uninstall":"uninstall a plugin"
+ "ps\:dynos":"scale to QTY web processes"
+ "ps\:workers":"scale to QTY background processes"
+ "ps":"list processes for an app"
+ "ps\:restart":"restart an app process"
+ "ps\:scale":"scale processes by the given amount"
+ "releases":"list releases"
+ "releases\:info":"view detailed information for a release"
+ "rollback":"roll back to an older release"
+ "run":"run an attached process"
+ "run\:rake":"remotely execute a rake command"
+ "run\:console":"open a remote console session"
+ "sharing":"list collaborators on an app"
+ "sharing\:add":"add a collaborator to an app"
+ "sharing\:remove":"remove a collaborator from an app"
+ "sharing\:transfer":"transfer an app to a new owner"
+ "ssl":"list certificates for an app"
+ "ssl\:add":"add an ssl certificate to an app"
+ "ssl\:remove":"remove an ssl certificate from an app"
+ "ssl\:clear":"remove all ssl certificates from an app"
+ "stack":"show the list of available stacks"
+ "stack\:migrate":"prepare migration of this app to a new stack"
+ "version":"show heroku client version"
+)
+
+_arguments '*:: :->command'
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "heroku command" _1st_arguments
+ return
+fi
+
+local -a _command_args
+case "$words[1]" in
+ apps:info)
+ _command_args=(
+ '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
+ )
+ ;;
+ apps:create)
+ _command_args=(
+ '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
+ '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \
+ '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \
+ )
+ ;;
+ config)
+ _command_args=(
+ '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
+ )
+ ;;
+ db:push)
+ _command_args=(
+ '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
+ '(-d|--debug)'{-d,--debug}'[enable debugging output]' \
+ '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \
+ '(-f|--filter)'{-f,--filter}'[only push certain tables]' \
+ '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
+ '(-t|--tables)'{-t,--tables}'[only push the specified tables]' \
+ )
+ ;;
+ db:pull)
+ _command_args=(
+ '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
+ '(-d|--debug)'{-d,--debug}'[enable debugging output]' \
+ '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \
+ '(-f|--filter)'{-f,--filter}'[only pull certain tables]' \
+ '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
+ '(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \
+ )
+ ;;
+ keys)
+ _command_args=(
+ '(-l|--long)'{-l,--long}'[display extended information for each key]' \
+ )
+ ;;
+ logs)
+ _command_args=(
+ '(-n|--num)'{-n,--num}'[the number of lines to display]' \
+ '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \
+ '(-s|--source)'{-s,--source}'[only display logs from the given source]' \
+ '(-t|--tail)'{-t,--tail}'[continually stream logs]' \
+ )
+ ;;
+ pgbackups:capture)
+ _command_args=(
+ '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
+ )
+ ;;
+ stack)
+ _command_args=(
+ '(-a|--all)'{-a,--all}'[include deprecated stacks]' \
+ )
+ ;;
+ esac
+
+_arguments \
+ $_command_args \
+ '(--app)--app[the app name]' \
+ && return 0
diff --git a/src/_jmeter b/src/_jmeter
new file mode 100644
index 0000000..ab873b5
--- /dev/null
+++ b/src/_jmeter
@@ -0,0 +1,69 @@
+#compdef jmeter
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for JMeter (http://jakarta.apache.org/jmeter).
+#
+# Status: incomplete
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_arguments \
+ '(- 1 *)'{-h,--help}'[print usage information and exit]' \
+ '(- 1 *)'{-v,--version}'[print the version information and exit]' \
+ {-p,--propfile}'[the jmeter property file to use]:properties file:_files -g "*.properties"' \
+ '*'{-q,--addprop}'[additional property file(s)]:properties file:_files -g "*.properties"' \
+ {-t,--testfile}'[the jmeter test plan file to run]:JMeter test plan file:_files -g "*.jmx"' \
+ {-j,--jmeterlogfile}'[the jmeter log file]: :_files -g "*.log"' \
+ {-l,--logfile}'[the file to log samples to]: :_files -g "*.jtl"' \
+ {-n,--nongui}'[run JMeter in nongui mode]' \
+ {-s,--server}'[run the JMeter server]' \
+ {-H,--proxyHost}'[set a proxy server for JMeter to use]: :_hosts' \
+ {-P,--proxyPort}'[set proxy server port for JMeter to use]:number' \
+ {-u,--username}'[set username for proxy server that JMeter is to use]:username:_users' \
+ {-a,--password}'[set password for proxy server that JMeter is to use]:password' \
+ {-J-,--jmeterproperty}'[define additional JMeter properties]:argument=value' \
+ {-G-,--globalproperty}'[define Global properties (sent to servers)]:argument=value' \
+ {-D-,--systemproperty}'[define additional System properties]:argument=value' \
+ {-S,--systemPropertyFile}'[a property file to be added as System properties]:properties file:_files -g "*.properties"' \
+ {-L,--loglevel}'[define loglevel]:[category=]level' \
+ {-r,--runremote}'[start remote servers (as defined by the jmeter property remote_hosts)]' \
+ {-R,--remotestart}'[start these remote servers (overrides remote_hosts)]:remote servers list' \
+ {-d,--homedir}'[the JMeter home directory to use]: :_files -/' \
+ {-X,--remoteexit}'[exit the remote servers at end of test (non-GUI)]'
diff --git a/src/_jmeter-plugins b/src/_jmeter-plugins
new file mode 100644
index 0000000..b1ffa7a
--- /dev/null
+++ b/src/_jmeter-plugins
@@ -0,0 +1,62 @@
+#compdef jmeter-plugins
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for jmeter-plugins command line tool 0.4.2
+# (http://code.google.com/p/jmeter-plugins).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_arguments \
+ '(- 1 *)--help[show help options]' \
+ '--generate-png[generate PNG file containing graph]:PNG file name:_files -g "*.png"' \
+ '--generate-csv[generate CSV file containing graph data]:CSV file name:_files -g "*.csv"' \
+ '--input-jtl[load data from specified JTL file]:JTL file:_files -g "*.jtl"' \
+ '--plugin-type[type of graph to use for results generation]:class:((AggregateReport ThreadsStateOverTime BytesThroughputOverTime HitsPerSecond LatenciesOverTime PerfMon ResponseCodesPerSecond ResponseTimesDistribution ResponseTimesOverTime ResponseTimesPercentiles ThroughputOverTime ThroughputVsThreads TimesVsThreads TransactionsPerSecond))' \
+ '--width[set graph width]:graph width (pixels)' \
+ '--height[set graph height]::graph height (pixels)' \
+ '--granulation[granulation time for samples]:time (ms)' \
+ '--relative-times[use relative X axis times, no will set absolute times]: :((yes no))' \
+ '--aggregate-rows[aggregate all rows into one]: :((yes no))' \
+ '--paint-gradient[paint gradient background]: :((yes no))' \
+ '--paint-zeroing[paint zeroing lines]: :((yes no))' \
+ '--prevent-outliers[prevent outliers on distribution graph]: :((yes no))' \
+ '--limit-rows[limit number of points in row]:number of points' \
+ '--force-y[force Y axis limit]:limit' \
+ '--hide-low-counts[hide points with sample count below limit]:limit'
diff --git a/src/_jonas b/src/_jonas
new file mode 100644
index 0000000..bd75c38
--- /dev/null
+++ b/src/_jonas
@@ -0,0 +1,120 @@
+#compdef jonas
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for JOnAS 5.2 (http://jonas.ow2.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+typeset -A opt_args
+local context state line curcontext="$curcontext" ret=1
+
+_arguments -C \
+ '1:cmd:->cmds' \
+ '*::arg:->args' \
+&& ret=0
+
+case "$state" in
+ (cmds)
+ local commands; commands=(
+ 'version:show version information'
+ 'check:check that the JOnAS environment is correctly set'
+ 'start:start a server instance'
+ 'stop:stop a server instance'
+ 'admin:administrate a server instance'
+ )
+ _describe -t commands 'command' commands && ret=0
+ ;;
+ (args)
+ curcontext="${curcontext%:*:*}:jonas-cmd-$words[1]:"
+ case $words[1] in
+ (version|check)
+ _message 'no more arguments' && ret=0
+ ;;
+ (start)
+ _arguments \
+ '-standby[start a minimal JOnAS server with only mandatory services]' \
+ '(-bg)-fg[start the server in foreground mode]' \
+ '(-fg)-bg[start the server in background mode]' \
+ '-win[start the server in a new window]' \
+ '(-bg)-tui[start the Apache Felix TUI (force foreground mode)]' \
+ '-gui[start the Apache Felix GUI]' \
+ '-dev[start a JOnAS server by using bundles present in the default maven repository instead of bundles under $JONAS_ROOT/lib/bundles]' \
+ '-clean[clean the Apache Felix cache before starting a JOnAS server]' \
+ '-n[set the server name, must be unique in the domain (default: jonas)]:name' \
+ '-target[start another server or cluster (group of servers) in the domain]:server' \
+ '-Ddomain.name=[set the name of the management domain to which the server belongs]:domain' \
+ && ret=0
+ ;;
+ (stop)
+ _arguments \
+ '-standby[stop all services except the mandatory ones]' \
+ '-n[set the name of the server to stop (default: jonas)]:name' \
+ '-target[stop another server or cluster (group of servers) in the domain]:server' \
+ '-Ddomain.name=[set the name of the management domain to which the server belongs]:domain' \
+ && ret=0
+ ;;
+ (admin)
+ _arguments \
+ '(- : *)-?[print the help message]' \
+ '-win[administer the server in a new window]' \
+ '-n[set the name of the server to administer (default: jonas)]:name' \
+ '-username[set the username when authentication is required]: :_users' \
+ '-password[set the password when authentication is required]:password' \
+ '-registry[set the registry URL]: :_urls' \
+ '-protocol[set the protocol name]:protocol:((jrmp\:JRE\ implementation\ of\ RMI\ on\ the\ JRMP\ protocol\ \(default\) iiop\:JacORB\ implementation\ of\ RMI\ over\ the\ IIOP\ protocol irmi\:Oracle\ JRE\ independant\ implementation\ of\ RMI))' \
+ '-a[deploy an application from a given filepath on the current server, or on another target in the domain if the current server is a master]:Java application archive:_files -g "*.(j|w|r|e)ar"' \
+ '-r[undeploy a previously deployed application from the current server or from the specified target if the current server is a master]:Java application archive:_files -g "*.(j|w|r|e)ar"' \
+ '-gc[run the garbage collector on the current JOnAS server]' \
+ '-passivate[passivate all entity bean instances]' \
+ '-e[list the properties of the current JOnAS server]' \
+ '-j[list the registered JNDI names, as seen by the current JOnAS server]' \
+ '-l[list the beans currently loaded by the current JOnAS server]' \
+ '-synch[synchronize the entity bean instances on the current JOnAS server]' \
+ '-debug[set the logging level for the given topic to DEBUG]:topic' \
+ '-tt[change the default timeout for transactions]:timeout (seconds)' \
+ '-ping[wait until the JOnAS server is available]' \
+ '-timeout[maximum time to wait when -ping is used]:timeout (seconds)' \
+ && ret=0
+ ;;
+ esac
+ ;;
+esac
+
+return ret
diff --git a/src/_knife b/src/_knife
new file mode 100644
index 0000000..989e892
--- /dev/null
+++ b/src/_knife
@@ -0,0 +1,194 @@
+#compdef knife
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Chef's knife (http://www.opscode.com/chef).
+#
+# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/knife
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Frank Louwers (https://github.com/franklouwers)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+# knife has a very special syntax, some example calls are:
+# knife status
+# knife cookbook list
+# knife role show ROLENAME
+# knife data bag show DATABAGNAME
+# knife role show ROLENAME --attribute ATTRIBUTENAME
+# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes
+
+# The -Q switch in compadd allow for completions of things like "data bag" without having to go through two rounds of completion and avoids zsh inserting a \ for escaping spaces
+_knife() {
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ # These flags should be available everywhere according to man knife
+ knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes )
+
+ cloudproviders=(bluebox ec2 rackspace slicehost terremark)
+ _arguments \
+ '1: :->knifecmd'\
+ '2: :->knifesubcmd'\
+ '3: :->knifesubcmd2' \
+ '4: :->knifesubcmd3' \
+ '5: :->knifesubcmd4' \
+ '6: :->knifesubcmd5'
+
+ case $state in
+ knifecmd)
+ compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
+ ;;
+ knifesubcmd)
+ case $words[2] in
+ (bluebox|ec2|rackspace|slicehost|terremark)
+ compadd "$@" server images
+ ;;
+ client)
+ compadd -Q "$@" "bulk delete" list create show delete edit reregister
+ ;;
+ configure)
+ compadd "$@" client
+ ;;
+ cookbook)
+ compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
+ ;;
+ node)
+ compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
+ ;;
+ recipe)
+ compadd "$@" list
+ ;;
+ role)
+ compadd -Q "$@" "bulk delete" create delete edit "from file" list show
+ ;;
+ windows)
+ compadd "$@" bootstrap
+ ;;
+ *)
+ _arguments '2:Subsubcommands:($(_knife_options1))'
+ esac
+ ;;
+ knifesubcmd2)
+ case $words[3] in
+ server)
+ compadd "$@" list create delete
+ ;;
+ images)
+ compadd "$@" list
+ ;;
+ site)
+ compadd "$@" vendor show share search download list unshare
+ ;;
+ (show|delete|edit)
+ _arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))'
+ ;;
+ (upload|test)
+ _arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)'
+ ;;
+ list)
+ compadd -a "$@" knife_general_flags
+ ;;
+ bag)
+ compadd -Q "$@" show edit list "from file" create delete
+ ;;
+ *)
+ _arguments '3:Subsubcommands:($(_knife_options2))'
+ esac
+ ;;
+ knifesubcmd3)
+ case $words[3] in
+ show)
+ case $words[2] in
+ cookbook)
+ versioncomp=1
+ _arguments '4:Cookbookversions:($(_cookbook_versions) latest)'
+ ;;
+ (node|client|role)
+ compadd "$@" --attribute
+ esac
+ esac
+ case $words[4] in
+ (show|edit)
+ _arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))'
+ ;;
+ file)
+ _arguments '*:file or directory:_files -g "*.(rb|json)"'
+ ;;
+ list)
+ compadd -a "$@" knife_general_flags
+ ;;
+ *)
+ _arguments '*:Subsubcommands:($(_knife_options3))'
+ esac
+ ;;
+ knifesubcmd4)
+ if (( versioncomp > 0 )); then
+ compadd "$@" attributes definitions files libraries providers recipes resources templates
+ else
+ _arguments '*:Subsubcommands:($(_knife_options2))'
+ fi
+ ;;
+ knifesubcmd5)
+ _arguments '*:Subsubcommands:($(_knife_options3))'
+ esac
+}
+
+# Helper functions to provide the argument completion for several depths of commands
+_knife_options1() {
+ ( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
+}
+
+_knife_options2() {
+ ( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
+}
+
+_knife_options3() {
+ ( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
+}
+
+# The chef_x_remote functions use knife to get a list of objects of type x on the server
+_chef_roles_remote() {
+ (knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_clients_remote() {
+ (knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_nodes_remote() {
+ (knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_cookbooks_remote() {
+ (knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_sitecookbooks_remote() {
+ (knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_data_bags_remote() {
+ (knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
+_chef_cookbooks_local() {
+ (for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
+}
+
+# This function extracts the available cookbook versions on the chef server
+_cookbook_versions() {
+ (knife cookbook show $words[4] | grep -v $words[4] | grep -v -E '\]|\[|\{|\}' | sed 's/ //g' | sed 's/"//g')
+}
+
+_knife "$@"
diff --git a/src/_language_codes b/src/_language_codes
new file mode 100644
index 0000000..5388b1d
--- /dev/null
+++ b/src/_language_codes
@@ -0,0 +1,270 @@
+#autoload
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completer for language codes.
+#
+# Usage: _language_codes ISO-639-1
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+(( $+functions[_language_codes_iso_639_1] )) ||
+_language_codes_iso_639_1() {
+ local codes; codes=(
+ 'aa:Afar'
+ 'ab:Abkhazian'
+ 'af:Afrikaans'
+ 'ak:Akan'
+ 'sq:Albanian'
+ 'am:Amharic'
+ 'ar:Arabic'
+ 'an:Aragonese'
+ 'hy:Armenian'
+ 'as:Assamese'
+ 'av:Avaric'
+ 'ae:Avestan'
+ 'ay:Aymara'
+ 'az:Azerbaijani'
+ 'ba:Bashkir'
+ 'bm:Bambara'
+ 'eu:Basque'
+ 'be:Belarusian'
+ 'bn:Bengali'
+ 'bh:Bihari languages'
+ 'bi:Bislama'
+ 'bo:Tibetan'
+ 'bs:Bosnian'
+ 'br:Breton'
+ 'bg:Bulgarian'
+ 'my:Burmese'
+ 'ca:Catalan'
+ 'cs:Czech'
+ 'ch:Chamorro'
+ 'ce:Chechen'
+ 'zh:Chinese'
+ 'cu:Church Slavic'
+ 'cv:Chuvash'
+ 'kw:Cornish'
+ 'co:Corsican'
+ 'cr:Cree'
+ 'cy:Welsh'
+ 'cs:Czech'
+ 'da:Danish'
+ 'de:German'
+ 'dv:Divehi'
+ 'nl:Dutch'
+ 'dz:Dzongkha'
+ 'el:Greek, Modern (1453-)'
+ 'en:English'
+ 'eo:Esperanto'
+ 'et:Estonian'
+ 'eu:Basque'
+ 'ee:Ewe'
+ 'fo:Faroese'
+ 'fa:Persian'
+ 'fj:Fijian'
+ 'fi:Finnish'
+ 'fr:French'
+ 'fy:Western Frisian'
+ 'ff:Fulah'
+ 'ka:Georgian'
+ 'de:German'
+ 'gd:Gaelic'
+ 'ga:Irish'
+ 'gl:Galician'
+ 'gv:Manx'
+ 'gn:Guarani'
+ 'gu:Gujarati'
+ 'ht:Haitian'
+ 'ha:Hausa'
+ 'he:Hebrew'
+ 'hz:Herero'
+ 'hi:Hindi'
+ 'ho:Hiri Motu'
+ 'hr:Croatian'
+ 'hu:Hungarian'
+ 'hy:Armenian'
+ 'ig:Igbo'
+ 'is:Icelandic'
+ 'io:Ido'
+ 'ii:Sichuan Yi'
+ 'iu:Inuktitut'
+ 'ie:Interlingue'
+ 'ia:Interlingua (International Auxiliary Language Association)'
+ 'id:Indonesian'
+ 'ik:Inupiaq'
+ 'is:Icelandic'
+ 'it:Italian'
+ 'jv:Javanese'
+ 'ja:Japanese'
+ 'kl:Kalaallisut'
+ 'kn:Kannada'
+ 'ks:Kashmiri'
+ 'ka:Georgian'
+ 'kr:Kanuri'
+ 'kk:Kazakh'
+ 'km:Central Khmer'
+ 'ki:Kikuyu'
+ 'rw:Kinyarwanda'
+ 'ky:Kirghiz'
+ 'kv:Komi'
+ 'kg:Kongo'
+ 'ko:Korean'
+ 'kj:Kuanyama'
+ 'ku:Kurdish'
+ 'lo:Lao'
+ 'la:Latin'
+ 'lv:Latvian'
+ 'li:Limburgan'
+ 'ln:Lingala'
+ 'lt:Lithuanian'
+ 'lb:Luxembourgish'
+ 'lu:Luba-Katanga'
+ 'lg:Ganda'
+ 'mk:Macedonian'
+ 'mh:Marshallese'
+ 'ml:Malayalam'
+ 'mi:Maori'
+ 'mr:Marathi'
+ 'ms:Malay'
+ 'mk:Macedonian'
+ 'mg:Malagasy'
+ 'mt:Maltese'
+ 'mn:Mongolian'
+ 'mi:Maori'
+ 'ms:Malay'
+ 'my:Burmese'
+ 'na:Nauru'
+ 'nv:Navajo'
+ 'nr:Ndebele, South'
+ 'nd:Ndebele, North'
+ 'ng:Ndonga'
+ 'ne:Nepali'
+ 'nl:Dutch'
+ 'nn:Norwegian Nynorsk'
+ 'nb:Bokmål, Norwegian'
+ 'no:Norwegian'
+ 'ny:Chichewa'
+ 'oc:Occitan (post 1500)'
+ 'oj:Ojibwa'
+ 'or:Oriya'
+ 'om:Oromo'
+ 'os:Ossetian'
+ 'pa:Panjabi'
+ 'fa:Persian'
+ 'pi:Pali'
+ 'pl:Polish'
+ 'pt:Portuguese'
+ 'ps:Pushto'
+ 'qu:Quechua'
+ 'rm:Romansh'
+ 'ro:Romanian'
+ 'ro:Romanian'
+ 'rn:Rundi'
+ 'ru:Russian'
+ 'sg:Sango'
+ 'sa:Sanskrit'
+ 'si:Sinhala'
+ 'sk:Slovak'
+ 'sk:Slovak'
+ 'sl:Slovenian'
+ 'se:Northern Sami'
+ 'sm:Samoan'
+ 'sn:Shona'
+ 'sd:Sindhi'
+ 'so:Somali'
+ 'st:Sotho, Southern'
+ 'es:Spanish'
+ 'sq:Albanian'
+ 'sc:Sardinian'
+ 'sr:Serbian'
+ 'ss:Swati'
+ 'su:Sundanese'
+ 'sw:Swahili'
+ 'sv:Swedish'
+ 'ty:Tahitian'
+ 'ta:Tamil'
+ 'tt:Tatar'
+ 'te:Telugu'
+ 'tg:Tajik'
+ 'tl:Tagalog'
+ 'th:Thai'
+ 'bo:Tibetan'
+ 'ti:Tigrinya'
+ 'to:Tonga (Tonga Islands)'
+ 'tn:Tswana'
+ 'ts:Tsonga'
+ 'tk:Turkmen'
+ 'tr:Turkish'
+ 'tw:Twi'
+ 'ug:Uighur'
+ 'uk:Ukrainian'
+ 'ur:Urdu'
+ 'uz:Uzbek'
+ 've:Venda'
+ 'vi:Vietnamese'
+ 'vietnamien'
+ 'vo:Volapük'
+ 'cy:Welsh'
+ 'wa:Walloon'
+ 'wo:Wolof'
+ 'xh:Xhosa'
+ 'yi:Yiddish'
+ 'yo:Yoruba'
+ 'za:Zhuang'
+ 'zh:Chinese'
+ 'zu:Zulu'
+ )
+ _describe -t language-codes 'ISO 639-1 language code' codes "$@"
+}
+
+_language_codes() {
+ local command="$argv[$#]" ret=1
+
+ case $command in
+ ISO-639-1)
+ _language_codes_${${command//-/_}:l} "${@[1,-2]}" && ret=0
+ ;;
+ *)
+ _message "unknown command: $command"
+ ;;
+ esac
+
+ return ret
+}
diff --git a/src/_layman b/src/_layman
new file mode 100644
index 0000000..a1aab02
--- /dev/null
+++ b/src/_layman
@@ -0,0 +1,98 @@
+#compdef layman
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for LayMan (Gentoo overLAYs (repositories) MANager).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Vadim A. Misbakh-Soloviev <mva@mva.name>
+# * Bapt <bapt@tuxfamily.org>
+# * kaworu <kaworu@kaworu.ch>
+# * David Durrleman <dualmoo@gmail.com>
+# * oberyno <oberyno@gmail.com>
+# * Mamoru Komachi <usata@usata.org>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+#<app-portage/layman-1.1.1>
+#
+
+local arguments actions_args actions global_opts add_actions
+_layman_remote_overlays() {
+ local layman_list_overlays
+ layman_list_overlays=(${(S)${${(f)"$(layman -k -N -L 2>/dev/null)"}//\[*}#\* })
+ compadd "$@" ${(kv)=layman_list_overlays} "ALL"
+}
+_layman_local_overlays() {
+ local layman_list_overlays
+ layman_list_overlays=(${(S)${${(f)"$(layman -N -l)"}//\[*}#\* })
+ compadd "$@" ${(kv)=layman_list_overlays} "ALL"
+}
+actions=(
+ --delete -d
+ --sync -s
+ --info -i
+ --sync-all -S
+ --list -L
+ --list-local -l
+ --fetch -f
+)
+
+global_opts=(
+ '(--config -c)'{-c,--config}'[Select an alternative configuration file]:configuration file:_files'
+ '(--overlays -o)'{-o,--overlays}'[Specifies the location of additional overlay lists]:overlay url:_urls'
+ '(--nofetch -n)'{-n,--nofetch}'[Prevents from automatically fetching the remote lists of overlays]'
+ '(--nocheck -k)'{-k,--nocheck}'[Prevents from checking the remote lists of overlays for complete overlay definitions]'
+ '(--quiet -q)'{-q,--quiet}'[Makes layman completely quiet]'
+ '(--verbose -v)'{-v,--verbose}'[Verbose output]'
+ '(--quietness -Q)'{-Q,--quietness}'[Makes layman less verbose]:level:({0..4})'
+ '(--nocolor -N)'{-N,--nocolor}'[Remove color codes from the output]'
+)
+add_actions=(
+ -p --priority
+ --add -a
+)
+actions_args=(
+ "($actions --add -a)"{--add,-a}'[Add the given overlay to your installed overlays]:overlay:_layman_remote_overlays'
+ "($actions --priority -p)"{--priority,-p}'[It will modify the priority of the added overlay]:priority:({0..100})'
+ "($actions $add_actions)"{--delete,-d}'[Delete the given overlay from your installed overlays]:overlay:_layman_local_overlays'
+ "($actions $add_actions)"{--sync,-s}'[Update the specified overlay]:overlat:_layman_local_overlays'
+ "($actions $add_actions)"{--info,-i}'[Display all available information about the specified overlay]:overlay:_layman_remote_overlays'
+ "($actions $add_actions)"{--sync-all,-S}'[Update all overlays]'
+ "($actions $add_actions)"{--list,-L}'[List the contents of the remote list]'
+ "($actions $add_actions)"{--list-local,-l}'[List the locally installed overlays]'
+ "($actions $add_actions)"{--fetch,-f}'[Fetches the remote list of overlays]'
+)
+
+_arguments $global_opts[@] $actions_args[@]
diff --git a/src/_lein b/src/_lein
new file mode 100644
index 0000000..39b5c3b
--- /dev/null
+++ b/src/_lein
@@ -0,0 +1,44 @@
+#compdef lein
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Leiningen (https://github.com/technomancy/leiningen)
+#
+# Source: https://github.com/technolize/zsh-completion-funcs
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * technolize (https://github.com/technolize)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local ret=1 state
+_arguments ':subcommand:->subcommand' && ret=0
+
+case $state in
+ subcommand)
+ subcommands=(
+ "clean:remove compiled files and dependencies from project"
+ "compile:ahead-of-time compile the project"
+ "deps:download and install all dependencies"
+ "help:display a list of tasks or help for a given task"
+ "install:install the project and its dependencies in your local repository"
+ "jar:create a jar file containing the compiled .class files"
+ "new:create a new project skeleton"
+ "pom:write a pom.xml file to disk for maven interop"
+ "test:run the project's tests"
+ "uberjar:Create a jar including the contents of each of deps"
+ "upgrade:upgrade leiningen to the latest stable release"
+ "version:print leiningen's version"
+ )
+ _describe -t subcommands 'leiningen subcommands' subcommands && ret=0
+esac
+
+return ret
diff --git a/src/_lunar b/src/_lunar
new file mode 100644
index 0000000..51be984
--- /dev/null
+++ b/src/_lunar
@@ -0,0 +1,309 @@
+#compdef lunar lin lrm lvu
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Lunar (http://www.lunar-linux.org)
+#
+# Source: https://github.com/Valodim/lunar-zsh-completion
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Valodim (https://github.com/Valodim)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+# completion for lunar itself (different name, see below)
+_lunar_comp() {
+ local suf ret=1 curcontext="$curcontext"
+ local -a vals state line expl
+
+ # regular arguments, this will probably just hand down to the * command below
+ _arguments -C \
+ '(- :)-d[Enables debug messages]' \
+ '(- :)-h[Display help text]' \
+ '(- :)-v[Increases the level of message output]' \
+ '*::command:->command' && return 0
+
+ # complete the first word, ie. subcommand
+ if (( CURRENT == 1 )); then
+ local -a lunar_commands
+ # all lunar subcommands
+ lunar_commands=(
+ 'prune:Removes old sources and install/compile logs'
+ 'renew:Checks ver. against moonbase & recompiles if necessary'
+ 'update:Fetches latest moonbase and then does a "renew"'
+ 'rebuild:Recompiles all installed modules'
+ 'optimize:Shortcut to the optimization menu'
+ 'fix:Check and fix all modules and internal state of lunar'
+ 'nofix:Check but do not fix modules and internal state'
+ 'fixdepends:Check and fix the dependency database of lunar'
+ 'set:Check internal variable(s) and assign their values'
+ 'unset:Unsets an internal variable'
+ 'resurrect:Force modulename(s) to be unpacked from /var/cache'
+ 'install:Install a checklist of modules'
+ 'remove:Remove a checklist of modules'
+ 'hold:Place a hold on a checklist of modules'
+ 'unhold:Remove a hold on a checklist of modules'
+ 'exile:Remove a module a/o prevent it from being resurrected'
+ 'unexile:Allows a module to be compiled|resurrected again')
+
+ # just show the commands with description
+ _describe -t commands 'lunar command' lunar_commands && ret=0
+ return ret
+ else
+
+ # at this point, we have to decide what to complete for specific subcommands
+
+ # make a list of subcommands with no further arguments for later
+ local -a lunar_no_args
+ lunar_no_args=( prune renew update rebuild optimize fix nofix fixdepends )
+
+ # update the current context
+ curcontext="${curcontext%:*:*}:lunar-$words[1]:"
+ # if there is a specific function of the form _lunar-subcommand
+ if (( $+functions[_lunar-$words[1]] )); then
+ # call that for completion
+ _call_function ret _lunar-$words[1]
+ elif [[ -n "${lunar_no_args[(r)${words[1]}]}" ]]; then
+ # all commands from the array above take no further arguments
+ _message "lunar ${words[1]} requires no arguments"
+ else
+ # by default, complete modules
+ _lunar_modules
+ fi
+ return ret
+ fi
+}
+
+# specific completion for lunar set
+_lunar-set() {
+ # second argument: all lunar variables
+ if (( CURRENT == 2 )); then
+ local vars
+ vars=( ${(f)"$(cat /var/lib/lunar/unset.sh | cut -d' ' -f2)"} )
+ _describe -t modules 'lunar variable' vars && return 0
+ # third argument: some value
+ elif (( CURRENT == 3 )); then
+ _message "value"
+ # no further argument
+ else
+ _message "no further arguments"
+ fi
+}
+
+_lunar-unset() {
+ local vars
+ vars=( ${(f)"$(cat /var/lib/lunar/unset.sh | cut -d' ' -f2)"} )
+ _describe -t modules 'lunar variable' vars && return 0
+}
+
+_lunar-unhold() {
+ local vals
+ vals=( ${(f)"$(lvu held | sort | uniq)"} )
+ _describe -t modules 'held modules' vals && return 0
+}
+
+_lunar-unexile() {
+ local vals
+ vals=( ${(f)"$(lvu exiled | sort | uniq)"} )
+ _describe -t modules 'exiled modules' vals && return 0
+}
+
+_lrm() {
+ _arguments \
+ '(-d --debug)'{-d,--debug}'[Enables debug messages]' \
+ '(-D --downgrade)'{-D,--downgrade}'[downgrades a module]:module:_lunar_modules:version' \
+ '(-h --help)'{-h,--help}'[Displays this help text]' \
+ '(-k --keepconfig)'{-k,--keepconfig}'[remove module(s) but keep dependencies and config]' \
+ '(-n --nosustain)'{-n,--nosustain}'[removes module(s) even if they are sustained]' \
+ '(-u --upgrade)'{-u,--upgrade}'[remove the module but do not run scripts etc.]' \
+ '(-v --verbose)'{-v,--verbose}'[Increases the level of message output]' \
+ '(-p --purge)'{-p,--purge}'[Delete all modules that depend on the module(s) being removed as well]' \
+ '*:module:_lunar_installed_modules' && return 0
+}
+
+_lin() {
+ _arguments \
+ '(-c --compile)'{-c,--compile}'[Ignore /var/cache/lunar and compiles]' \
+ '(-d --debug)'{-d,--debug}'[Enables debug messages]' \
+ '--deps[Configure modules and determine dependencies]' \
+ '(-f --from)'{-f,--from}'[Specify an alternate for /var/spool/lunar]:directory:_files -/' \
+ '(-h --help)'{-h,--help}'[Displays help text]' \
+ '--opts[Add custom configure options to the module]:configure option string' \
+ '(-p --probe)'{-p,--probe}'[Only lin if not already installed]' \
+ '(-r --reconfigure)'{-r,--reconfigure}'[Select new dependencies for modules]' \
+ '(-R --resurrect)'{-R,--resurrect}'[Force to be unpacked from /var/cache/lunar]' \
+ '(-s --silent)'{-s,--silent}'[Decreases the level of message output]' \
+ '(-v --verbose)'{-v,--verbose}'[Increases the level of message output]' \
+ '(-w --want)'{-w,--want}'[Try to install a different version]:wanted version' \
+ '*:module:_lunar_modules' && return 0
+}
+
+# completion for lvu, very similar to the lunar one above (therefore uncommented)
+_lvu() {
+ local suf ret=1 curcontext="$curcontext"
+ local -a vals state line expl
+
+ _arguments -C \
+ '(- :)-d[Enables debug messages]' \
+ '(- :)-h[Display help text]' \
+ '(- :)-v[Increases the level of message output]' \
+ '*::command:->command' && return 0
+
+ if (( CURRENT == 1 )); then
+ local -a lvu_commands
+ lvu_commands=(
+ 'what:display a module''s description'
+ 'short:display a module''s short description'
+ 'where:display a module''s section'
+ 'cd:change directory to module and execs a new shell'
+ 'alien:discover untracked files'
+ 'from:discover what installed a given file'
+ 'leafs:display installed modules that have no explicit dependencies on them'
+ 'orphans:display installed modules that are missing dependencies'
+ 'conflicts:display conflicting files'
+ 'held:display held modules'
+ 'exiled:display exiled modules'
+ 'expired:display a list of modules which need an update'
+ 'info:display terse summary information about module'
+ 'search:searches all modules long descriptions for phrase.'
+ 'service:displays modules that provide that service'
+ 'website:display a module''s website'
+ 'install:display an install log'
+ 'size:find and show installed size of a module or ALL (slow)'
+ 'installed:display installed modules/version of module'
+ 'compile:display a compile log'
+ 'compiler:display the compiler version used'
+ 'links:display a list of modules that this module links to'
+ 'sources:display source files for a module'
+ 'urls:display all URLs for a module'
+ 'maintainer:display maintainer for a module'
+ 'version:display version of module in moonbase'
+ 'new:attempt to create a new module from scratch'
+ 'edit:copy a module to zlocal for editing'
+ 'diff:view changes on edited module'
+ 'submit:attempt to submit a module to the lunar ML'
+ 'unedit:delete zlocal copy of a module'
+ 'sum:display checksums'
+ 'md5sum:display md5sums'
+ 'export:make snapshot of box''s configuration.'
+ 'import:restores an exported snapshot.'
+ 'section:display moonbase sections'
+ 'moonbase:display text listing of the moonbase'
+ 'html:display html listing of the moonbase'
+ 'updatelog:display summary log of previous lunar update'
+ 'activity:display main log file'
+ 'newer:display available modules newer than Aug 01, 2003'
+ 'older:display modules installed before Jan 01, 2003'
+ 'voyeur:peak into module compilation'
+ 'pam:display installed modules that are Linux-PAM aware'
+ 'depends:displays installed modules that explicitly or recursively depend on this module.'
+ 'tree:displays a tree of the module''s dependencies'
+ 'stree:same as ''tree'' but highly abbreviated'
+ 'eert:same as ''tree'' but reverse and installed deps only'
+ 'leert:full reverse dependency tree')
+
+ _describe -t commands 'lvu command' lvu_commands && ret=0
+
+ return ret
+ elif (( CURRENT == 2 )); then
+ local -a lvu_no_args
+ lvu_no_args=( alien leafs orphans conflicts held exiled expired export moonbase html updatelog pam )
+
+ curcontext="${curcontext%:*:*}:lvu-$words[1]:"
+ if (( $+functions[_lvu-$words[1]] )); then
+ _call_function ret _lvu-$words[1]
+ elif [[ -n "${lvu_no_args[(r)${words[1]}]}" ]]; then
+ _message "lvu ${words[1]} requires no arguments"
+ else
+ _lunar_modules
+ fi
+ return ret
+ else
+ _message "No further arguments"
+ fi
+
+}
+
+_lvu-service() {
+ _alternative \
+ 'service:service name:_lvu-service-service' \
+ 'port:port number:_guard "[0-9]#" "port number"'
+}
+
+_lvu-service-service() {
+ local vals
+ vals=( ${(f)"$(cat /etc/services | grep -E -o '^(\w+)' | sort | uniq)"} )
+ _describe -t modules 'service' vals && return 0
+}
+
+_lvu-diff() {
+ local vals
+ vals=( /var/lib/lunar/moonbase/zlocal/*(/:t) )
+ _describe -t modules 'moonbase module from zlocal' vals && return 0
+}
+
+_lvu-unedit() {
+ local vals
+ vals=( /var/lib/lunar/moonbase/zlocal/*(/:t) )
+ _describe -t modules 'moonbase module from zlocal' vals && return 0
+}
+
+_lvu-newer() {
+ _message "date string"
+}
+
+_lvu-older() {
+ _message "date string"
+}
+
+_lvu-import() {
+ _files
+}
+
+_lvu-from() {
+ _files
+}
+
+_lvu-new() {
+ _message "module name"
+}
+
+_lvu-search() {
+ _message "search string"
+}
+
+# specific completion for moonbase modules
+_lunar_modules() {
+ local vals
+ vals=( /var/lib/lunar/moonbase/*/*(/:t) )
+ _describe -t modules 'moonbase module' vals && return 0
+}
+
+# specific completion for moonbase modules
+_lunar_installed_modules() {
+ local vals
+ vals=( ${(f)"$(lvu installed | cut -d':' -f1)"} )
+ _describe -t modules 'moonbase installed module' vals && return 0
+}
+
+# hub function called for completion
+_lunar() {
+ # decide which completion to use
+ case "$service" in
+ lin) _lin "$@";;
+ lrm) _lrm "$@";;
+ lvu) _lvu "$@";;
+ lunar) _lunar_comp "$@";;
+ *) _message "unknown command $service";;
+ esac
+}
+
+_lunar "$@"
diff --git a/src/_lunchy b/src/_lunchy
new file mode 100644
index 0000000..652c186
--- /dev/null
+++ b/src/_lunchy
@@ -0,0 +1,49 @@
+#compdef lunchy
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for lunchy (https://github.com/mperham/lunchy).
+#
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Blake Walters (https://github.com/markupboy)
+#
+# ------------------------------------------------------------------------------
+
+local state line cmds ret=1
+
+_arguments -C '1: :->cmds' '*: :->args'
+
+case $state in
+ cmds)
+ local -a cmds
+ cmds=(
+ 'ls:list available agents'
+ 'start:start an agent'
+ 'stop:stop an agent'
+ 'restart:restart an agent'
+ 'status:get the status of agent[s]'
+ 'install:install an agents plist file'
+ 'edit:edit an agent'
+ )
+ _describe -t commands 'lunchy command' cmds && ret=0
+ ;;
+ args)
+ case $line[1] in
+ (install)
+ ;;
+ (restart|stop)
+ _values 'items' `lunchy status | awk '{print $3}' ` 2>/dev/null && ret=0
+ ;;
+ *)
+ _values 'items' `lunchy ls` 2>/dev/null && ret=0
+ ;;
+ esac
+ ;;
+esac
+
+return ret
diff --git a/src/_manage.py b/src/_manage.py
new file mode 100644
index 0000000..4d28099
--- /dev/null
+++ b/src/_manage.py
@@ -0,0 +1,240 @@
+#compdef manage.py
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Django's manage.py (https://www.djangoproject.com).
+#
+# Source: https://github.com/technolize/zsh-completion-funcs
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * technolize (https://github.com/technolize)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_managepy-adminindex(){
+ _arguments -s : \
+ $nul_args \
+ '*::directory:_directories' && ret=0
+}
+
+_managepy-createcachetable(){
+ _arguments -s : \
+ $nul_args && ret=0
+}
+
+_managepy-dbshell(){
+ _arguments -s : \
+ $nul_args && ret=0
+}
+
+_managepy-diffsettings(){
+ _arguments -s : \
+ $nul_args && ret=0
+}
+
+_managepy-dumpdata(){
+ _arguments -s : \
+ '--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
+ '--indent=-[specifies the indent level to use when pretty-printing output.]:' \
+ $nul_args \
+ '*::appname:_applist' && ret=0
+}
+
+_managepy-flush(){
+ _arguments -s : \
+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+ $nul_args && ret=0
+}
+
+_managepy-help(){
+ _arguments -s : \
+ '*:command:_managepy_cmds' \
+ $nul_args && ret=0
+}
+
+_managepy_cmds(){
+ local line
+ local -a cmd
+ _call_program help-command ./manage.py help \
+ |& sed -n '/^ /s/[(), ]/ /gp' \
+ | while read -A line; do cmd=($line $cmd) done
+ _describe -t managepy-command 'manage.py command' cmd
+}
+
+_managepy-inspectdb(){
+ _arguments -s : \
+ $nul_args && ret=0
+}
+
+_managepy-loaddata(){
+ _arguments -s : \
+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+ '*::file:_files' \
+ $nul_args && ret=0
+}
+
+_managepy-reset(){
+ _arguments -s : \
+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+ '*::appname:_applist' \
+ $nul_args && ret=0
+}
+
+_managepy-runfcgi(){
+ local state
+
+ local fcgi_opts
+ fcgi_opts=(
+ 'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
+ 'host[hostname to listen on..]:'
+ 'port[port to listen on.]:'
+ 'socket[UNIX socket to listen on.]::file:_files'
+ 'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
+ 'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
+ 'maxspare[max number of spare processes / threads.]:'
+ 'minspare[min number of spare processes / threads.]:'
+ 'maxchildren[hard limit number of processes / threads.]:'
+ 'daemonize[whether to detach from terminal.]:boolean:(False True)'
+ 'pidfile[write the spawned process-id to this file.]:file:_files'
+ 'workdir[change to this directory when daemonizing.]:directory:_files'
+ 'outlog[write stdout to this file.]:file:_files'
+ 'errlog[write stderr to this file.]:file:_files'
+ )
+
+ _arguments -s : \
+ $nul_args \
+ '*: :_values "FCGI Setting" $fcgi_opts' && ret=0
+}
+
+_managepy-runserver(){
+ _arguments -s : \
+ '--noreload[tells Django to NOT use the auto-reloader.]' \
+ '--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \
+ $nul_args && ret=0
+}
+
+_managepy-shell(){
+ _arguments -s : \
+ '--plain[tells Django to use plain Python, not IPython.]' \
+ $nul_args && ret=0
+}
+
+_managepy-sql(){}
+_managepy-sqlall(){}
+_managepy-sqlclear(){}
+_managepy-sqlcustom(){}
+_managepy-sqlflush(){}
+_managepy-sqlindexes(){}
+_managepy-sqlinitialdata(){}
+_managepy-sqlreset(){}
+_managepy-sqlsequencereset(){}
+_managepy-startapp(){}
+
+_managepy-syncdb() {
+ _arguments -s : \
+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+ $nul_args && ret=0
+}
+
+_managepy-test() {
+ _arguments -s : \
+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+ '*::appname:_applist' \
+ $nul_args && ret=0
+}
+
+_managepy-testserver() {
+ _arguments -s : \
+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+ '--addrport=-[port number or ipaddr:port to run the server on.]' \
+ '*::fixture:_files' \
+ $nul_args && ret=0
+}
+
+_managepy-validate() {
+ _arguments -s : \
+ $nul_args && ret=0
+}
+
+_managepy-commands() {
+ local -a commands
+
+ commands=(
+ 'adminindex:prints the admin-index template snippet for the given app name(s).'
+ 'createcachetable:creates the table needed to use the SQL cache backend.'
+ 'dbshell:runs the command-line client for the current DATABASE_ENGINE.'
+ "diffsettings:displays differences between the current settings.py and Django's default settings."
+ 'dumpdata:Output the contents of the database as a fixture of the given format.'
+ 'flush:Executes ``sqlflush`` on the current database.'
+ 'help:manage.py help.'
+ 'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
+ 'loaddata:Installs the named fixture(s) in the database.'
+ 'reset:Executes ``sqlreset`` for the given app(s) in the current database.'
+ 'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
+ 'runserver:Starts a lightweight Web server for development.'
+ 'shell:Runs a Python interactive interpreter.'
+ 'sql:Prints the CREATE TABLE SQL statements for the given app name(s).'
+ 'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).'
+ 'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).'
+ 'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).'
+ 'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.'
+ 'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).'
+ "sqlinitialdata:RENAMED: see 'sqlcustom'"
+ 'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).'
+ 'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).'
+ "startapp:Creates a Django app directory structure for the given app name in this project's directory."
+ "syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
+ 'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.'
+ 'testserver:Runs a development server with data from the given fixture(s).'
+ 'validate:Validates all installed models.'
+ )
+
+ _describe -t commands 'manage.py command' commands && ret=0
+}
+
+_applist() {
+ local line
+ local -a apps
+ _call_program help-command "python -c \"import os.path as op, re, settings, sys;\\
+ bn=op.basename(op.abspath(op.curdir));[sys\\
+ .stdout.write(str(re.sub(r'^%s\.(.*?)$' %
+ bn, r'\1', i)) + '\n') for i in settings.\\
+ INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \
+ | while read -A line; do apps=($line $apps) done
+ _values 'Application' $apps && ret=0
+}
+
+_manage.py() {
+ local -a nul_args
+ nul_args=(
+ '--settings=-[the Python path to a settings module.]:file:_files'
+ '--pythonpath=-[a directory to add to the Python path.]::directory:_directories'
+ '--traceback[print traceback on exception.]'
+ "--version[show program's version number and exit.]"
+ {-h,--help}'[show this help message and exit.]'
+ )
+
+ local curcontext=$curcontext ret=1
+
+ if ((CURRENT == 2)); then
+ _managepy-commands
+ else
+ shift words
+ (( CURRENT -- ))
+ curcontext="${curcontext%:*:*}:managepy-$words[1]:"
+ _call_function ret _managepy-$words[1]
+ fi
+}
+
+_manage.py "$@"
diff --git a/src/_mosh b/src/_mosh
new file mode 100644
index 0000000..c617f55
--- /dev/null
+++ b/src/_mosh
@@ -0,0 +1,30 @@
+#compdef mosh
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for mosh (http://mosh.mit.edu).
+#
+# Source: https://gist.github.com/2242920
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Ben O'Hara (https://github.com/benohara)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+_arguments \
+ '--client=:client helper:_command_names -e' \
+ '--server=:server helper:_files' \
+ '--ssh=:ssh command to run:_files' \
+ '(-a -n)--predict=:when:(adaptive always never)' \
+ '(--predict -n)-a[predict always]' \
+ '(--predict -a)-n[predict never]' \
+ {-p,--port=}':port:_ports' \
+ ':remote:_hosts' \
+ ':remote command:_command_names -e'
diff --git a/src/_mvn b/src/_mvn
new file mode 100644
index 0000000..1d10689
--- /dev/null
+++ b/src/_mvn
@@ -0,0 +1,623 @@
+#compdef mvn mvnDebug
+# ------------------------------------------------------------------------------
+# Copyright (c) 2010-2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Maven (http://maven.apache.org).
+#
+# Status: See FIXME and TODO tags.
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# Notes
+# -----
+#
+# * By default advanced phases are displayed only if you start typing them. To have
+# them always displayed:
+#
+# zstyle ':completion:*:mvn:*' show-all-phases true
+#
+# * By default full form plugins (groupId:artifactId[:version]) are only shown if you
+# start typing them. To have them always displayed:
+#
+# zstyle ':completion:*:mvn:*' show-full-form-plugins true
+#
+# * By default only the plugins for which the completion has already been
+# called ("mvn plugin:<TAB>") are shown. To define your own list of plugins:
+#
+# maven_plugins=(jboss tomcat gwt android)
+# zstyle ':completion:*:mvn:*' plugins $maven_plugins
+#
+# * To have a better presentation of completions:
+#
+# zstyle ':completion:*:*:mvn:*:matches' group 'yes'
+# zstyle ':completion:*:*:mvn:*:options' description 'yes'
+# zstyle ':completion:*:*:mvn:*:options' auto-description '%d'
+# zstyle ':completion:*:*:mvn:*:descriptions' format $'\e[1m -- %d --\e[22m'
+# zstyle ':completion:*:*:mvn:*:messages' format $'\e[1m -- %d --\e[22m'
+# zstyle ':completion:*:*:mvn:*:warnings' format $'\e[1m -- No matches found --\e[22m'
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_mvn() {
+ typeset -A opt_args
+ local context state line
+
+ local curcontext="$curcontext" maven_version excl_opts
+
+ excl_opts=(-h --help -v --version -ep --encrypt-password -emp --encrypt-master-password)
+
+ _pick_variant -r maven_version maven3='Maven 3' maven2='Maven 2' unknown --version
+ if [[ $maven_version == 'maven3' ]]; then
+ opts=(
+ "($excl_opts -T --threads)"{-T,--threads}'[thread count, for instance 2.0C where C is core multiplied]:thread count:_mvn_thread_counts'
+ "($excl_opts -t --toolchains)"{-t,--toolchains}'[alternate path for the user toolchains file]:toolchains file:_mvn_toolchains_files'
+ "($excl_opts -l --log-file)"{-l,--log-file}'[log file to where all build output will go]:log file:_mvn_log_files'
+ )
+ elif [[ $maven_version == 'maven2' ]]; then
+ opts=(
+ "($excl_opts -cpu --check-plugin-updates -up --update-plugins -npu --no-plugin-updates -o --offline)"{-cpu,--check-plugin-updates,-up,--update-plugins}'[force upToDate check for any relevant registered plugins]'
+ "($excl_opts -npr --no-plugin-registry)"{-npr,--no-plugin-registry}'[don'\''t use plugin-registry.xml for plugin versions]'
+ "($excl_opts -npu --no-plugin-updates -cpu --check-plugin-updates -up --update-plugins)"{-npu,--no-plugin-updates}'[suppress upToDate check for any relevant registered plugins]'
+ "($excl_opts -r --reactor)"{-r,--reactor}'[dynamically build reactor from subdirectories]:reactor:_mvn_reactors'
+ )
+ fi
+
+ [[ -n ${(M)words:#"-pl"} || -n ${(M)words:#"--projects"} ]] && opts+=(
+ "($excl_opts -am --also-make)"{-am,--also-make}'[if project list is specified, also build projects required by the list]'
+ "($excl_opts -amd --also-make-dependents)"{-amd,--also-make-dependents}'[if project list is specified, also build projects that depend on projects on the list]'
+ )
+
+ _arguments -C \
+ "(- : *)"{-h,--help}'[display help information]' \
+ "(- : *)"{-v,--version}'[display version information]' \
+ "(- : *)"{-emp,--encrypt-master-password}'[encrypt master security password]:master password:_mvn_passwords' \
+ "(- : *)"{-ep,--encrypt-password}'[encrypt server password]:password:_mvn_passwords' \
+ "($excl_opts -B --batch-mode)"{-B,--batch-mode}'[run in non-interactive (batch) mode]' \
+ "($excl_opts -V --show-version)"{-V,--show-version}'[display version information without stopping build]' \
+ "($excl_opts -q --quiet -X --debug)"{-q,--quiet}'[quiet output, only show errors]' \
+ "($excl_opts -X --debug -q --quiet)"{-X,--debug}'[produce execution debug output]' \
+ "($excl_opts -N --non-recursive)"{-N,--non-recursive}'[do not recurse into sub-projects]' \
+ "($excl_opts -C --strict-checksums -c --lax-checksums)"{-C,--strict-checksums}'[fail the build if checksums don'\''t match]' \
+ "($excl_opts -c --lax-checksums -C --strict-checksums)"{-c,--lax-checksums}'[warn if checksums don'\''t match]' \
+ "($excl_opts -e --errors)"{-e,--errors}'[produce execution error messages]' \
+ "($excl_opts -f --file)"{-f,--file}'[force the use of an alternate POM file]:POM file:_mvn_pom_files' \
+ "($excl_opts -s --settings)"{-s,--settings}'[alternate path for the user settings file]:settings file:_mvn_settings_files' \
+ "($excl_opts -gs --global-settings)"{-gs,--global-settings}'[alternate path for the global settings file]:global settings file:_mvn_settings_files' \
+ "($excl_opts -fae --fail-at-end -ff --fail-fast -fn --fail-never)"{-fae,--fail-at-end}'[only fail the build afterwards, allow all non-impacted builds to continue]' \
+ "($excl_opts -ff --fail-fast -fae --fail-at-end -fn --fail-never)"{-ff,--fail-fast}'[stop at first failure in reactorized builds]' \
+ "($excl_opts -fn --fail-never -fae --fail-at-end -ff --fail-fast)"{-fn,--fail-never}'[nerver fail the build, regardless of project result]' \
+ "($excl_opts)*"{-P,--activate-profiles}'[comma-delimited list of profiles to activate]:profile:_mvn_profiles -s ,' \
+ "($excl_opts -pl --projects)"{-pl,--projects}'[build specified reactor projects instead of all projects]:project list:_mvn_projects -s ,' \
+ "($excl_opts -rf --resume-from)"{-rf,--resume-from}'[resume reactor from specified project]:project:_mvn_projects' \
+ "($excl_opts -o --offline -U --update-snapshots -cpu --check-plugin-updates -up --update-plugins)"{-o,--offline}'[work offline]' \
+ "($excl_opts -U --update-snapshots -nsu --no-snapshot-updates -o --offline)"{-U,--update-snapshots}'[force a check for updated releases and snapshots on remote repositories]' \
+ "($excl_opts -nsu --no-snapshot-updates -U --update-snapshots -o --offline)"{-nsu,--no-snapshot-updates}'[Supress SNAPSHOT updates]' \
+ "*"{-D-,--define}'[define a system property]:property:_mvn_properties' \
+ "${opts[@]}" \
+ "($excl_opts)*: :_mvn_args"
+}
+
+(( $+functions[_mvn_args] )) ||
+_mvn_args() {
+ _alternative \
+ 'phases:phase:_mvn_phases' \
+ 'plugin-colon-goals:plugin colon goal:_mvn_plugin_colon_goals'
+}
+
+(( $+functions[_mvn_phases] )) ||
+_mvn_phases() {
+ local phases
+ phases=(
+ 'clean:remove all files generated by the previous build'
+ 'compile:compile the source code of the project'
+ 'test:run tests using a suitable unit testing framework'
+ 'package:take the compiled code and package it in its distributable format, such as a JAR'
+ 'integration-test:process and deploy the package if necessary into an environment where integration tests can be run'
+ 'verify:run any checks to verify the package is valid and meets quality criteria'
+ 'install:install the package into the local repository, for use as a dependency in other projects locally'
+ 'deploy:done in an integration or release environment, copies the final package to the remote repository'
+ 'site:generates the projects site documentation'
+ 'site-deploy:deploys the generated site documentation to the specified web server'
+ )
+ if [[ $#PREFIX -gt 0 ]] || zstyle -t ":completion:${curcontext}:" show-all-phases; then
+ phases+=(
+ 'pre-clean:executes processes needed prior to the actual project cleaning'
+ 'post-clean:executes processes needed to finalize the project cleaning'
+ 'validate:validate the project is correct and all necessary information is available'
+ 'initialize:initialize build state, e.g. set properties or create directories'
+ 'generate-sources:generate any source code for inclusion in compilation'
+ 'process-sources:process the source code, for example to filter any values'
+ 'generate-resources:generate resources for inclusion in the package'
+ 'process-resources:copy and process the resources into the destination directory, ready for packaging'
+ 'process-classes:post-process the generated files from compilation'
+ 'generate-test-sources:generate any test source code for inclusion in compilation'
+ 'process-test-sources:process the test source code, for example to filter any values'
+ 'generate-test-resources:create resources for testing'
+ 'process-test-resources:copy and process the resources into the test destination directory'
+ 'test-compile:compile the test source code into the test destination directory'
+ 'process-test-classes:post-process the generated files from test compilation'
+ 'prepare-package:perform any operations necessary to prepare a package before the actual packaging'
+ 'pre-integration-test:perform actions required before integration tests are executed'
+ 'post-integration-test:perform actions required after integration tests have been executed'
+ 'pre-site:executes processes needed prior to the actual project site generation.'
+ 'post-site:executes processes needed to finalize the site generation, and to prepare for site deployment'
+ )
+ fi
+ _describe -t 'phases' "phase" phases
+}
+
+(( $+functions[_mvn_plugins] )) ||
+_mvn_plugins() {
+ local ret=1
+ if [[ $words[CURRENT] == *.* ]] || zstyle -t ":completion:${curcontext}:" show-full-form-plugins; then
+ _wanted full-form-plugins expl 'full form plugin' _mvn_full_form_plugins && ret=0
+ else
+ _wanted plugin-prefixes expl 'plugin prefix' _mvn_plugin_prefixes && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_mvn_plugin_colon_goals] )) ||
+_mvn_plugin_colon_goals() {
+ local ret=1
+ if [[ $words[CURRENT] == *.* ]] || zstyle -t ":completion:${curcontext}:" show-full-form-plugins; then
+ _wanted full-form-plugin-colon-goals expl 'full form plugin colon goal' _mvn_full_form_plugin_colon_goals && ret=0
+ else
+ _wanted plugin-prefix-colon-goals expl 'plugin prefix colon goal' _mvn_plugin_prefix_colon_goals && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_mvn_plugin_prefix_colon_goals] )) ||
+_mvn_plugin_prefix_colon_goals() {
+ local ret=1
+ if compset -P '*:'; then
+ local plugin="${IPREFIX%:}"
+ _wanted goals expl "${plugin} plugin goal" _mvn_plugin_goals $plugin && ret=0
+ else
+ _wanted plugin-prefixes expl 'plugin prefix' _mvn_plugin_prefixes -qS: && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_mvn_plugin_prefixes] )) ||
+_mvn_plugin_prefixes() {
+ local plugins
+ zstyle -a ":completion:${curcontext}:" plugins plugins
+ [[ $#plugins -eq 0 ]] && plugins=($(__mvn_get_plugin_prefix $(__mvn_get_cache_dir)/mvn/plugins/*(:t)))
+ _describe -t plugin-prefixes 'plugin prefix' plugins $@
+}
+
+(( $+functions[_mvn_full_form_plugin_colon_goals] )) ||
+_mvn_full_form_plugin_colon_goals() {
+ local ret=1
+ # FIXME Duplicates _mvn_full_form_plugins
+ if compset -P 1 '*:'; then
+ local groupId="${${IPREFIX%:}##*:}"
+ if compset -P 1 '*:'; then
+ local artifactId="${${IPREFIX%:}##*:}"
+ if compset -P 1 '*:'; then
+ local version="${${IPREFIX%:}##*:}"
+ _wanted goals expl "${artifactId}:${version} goal" _mvn_plugin_goals "${groupId}:${artifactId}:${version}" && ret=0
+ else
+ _alternative \
+ "versions:${artifactId} version:_mvn_artifact_versions -qS: ${groupId}:${artifactId}" \
+ "goals:${artifactId} goal:_mvn_plugin_goals ${groupId}:${artifactId}" \
+ && ret=0
+ fi
+ else
+ _wanted artifactIds expl "${groupId} artifactId" _mvn_groupId_artifactIds -qS: $groupId && ret=0
+ fi
+ else
+ _wanted groupIds expl "groupId" _mvn_groupIds -qS: && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_mvn_full_form_plugins] )) ||
+_mvn_full_form_plugins() {
+ local ret=1 chunk="${PREFIX%%:*}"
+ if compset -P 1 '*:'; then
+ local groupId="$chunk"
+ chunk="${PREFIX%%:*}"
+ if compset -P 1 '*:'; then
+ _wanted versions expl "${current} version" _mvn_artifact_versions $@ "${groupId}:${chunk}" && ret=0
+ else
+ _wanted artifactIds expl "${groupId} artifactId" _mvn_groupId_artifactIds -qS: "${groupId}" && ret=0
+ fi
+ else
+ _wanted groupIds expl "groupId" _mvn_groupIds -qS: && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_mvn_groupIds] )) ||
+_mvn_groupIds() {
+ local repository_location=$(__mvn_get_repository_location) update_policy ret=1
+
+ zstyle -s ":completion:${curcontext}:" cache-policy update_policy
+ [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_groupIds_caching_policy
+
+ if [[ -d $repository_location ]]; then
+ unset _groupIds
+ if ( [[ ${+_groupIds} -eq 0 ]] || _cache_invalid "mvn/repositories/${repository_location}/groupIds" ) && ! _retrieve_cache "mvn/repositories/${repository_location}/groupIds"; then
+ _groupIds=($repository_location/**/)
+ _groupIds=(${${${(u)_groupIds:h:h}#"$repository_location/"}//\//.})
+ [[ $#_groupIds -gt 0 ]] && _store_cache "mvn/repositories/${repository_location}/groupIds" _groupIds
+ fi
+
+ [[ $#_groupIds -gt 0 ]] && _multi_parts $@ . _groupIds && ret=0
+ fi
+
+ return ret
+}
+
+(( $+functions[_mvn_groupId_artifactIds] )) ||
+_mvn_groupId_artifactIds() {
+ local groupId_repository_location="${$(__mvn_get_repository_location)}/${${@[-1]}//\.//}" ret=1
+
+ if [[ -d $groupId_repository_location ]]; then
+ local artifactIds; artifactIds=($groupId_repository_location/*/*/*.pom(:h:h:t))
+ _describe -t artifactIds "artifactId" artifactIds $@[0,-2] && ret=0
+ fi
+
+ return ret
+}
+
+(( $+functions[_mvn_artifact_versions] )) ||
+_mvn_artifact_versions() {
+ local artifact_repository_location="${$(__mvn_get_repository_location)}/${${@[-1]}//[\.:]//}" ret=1
+
+ if [[ -d $artifact_repository_location ]]; then
+ local versions; versions=($artifact_repository_location/*/*.pom(:h:t))
+ _describe -t versions "version" versions $@[0,-2]
+ fi
+
+ return ret
+}
+
+(( $+functions[_mvn_plugin_goals] )) ||
+_mvn_plugin_goals() {
+ local ret=1 plugin="$@[-1]" update_policy
+
+ zstyle -s ":completion:${curcontext}:" cache-policy update_policy
+ [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_goals_caching_policy
+
+ unset _goals
+ if ( [[ ${+_goals} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin}" ) && ! _retrieve_cache "mvn/plugins/${plugin}"; then
+ setopt localoptions extendedglob
+ _goals=(${(s:,,,:)${${${(f)${${${(f)${${${${(F)${(S)${(f)"$(_call_program goals $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=$plugin)"}//#$(__mvn_get_plugin_prefix $plugin):/,,,}}:#*BUILD FAILURE*}#*This plugin has*goals#:}%For more information, run \'mvn help:describe*}}//:/\\:}}}// ##/ }// Description\\: /:}})
+ [[ $#_goals -gt 0 ]] && _store_cache "mvn/plugins/${plugin}" _goals
+ fi
+
+ [[ $#_goals -gt 0 ]] && _describe -t "goals" "${plugin} goal" _goals $@[0,-2] && ret=0
+
+ return ret
+}
+
+(( $+functions[_mvn_profiles] )) ||
+_mvn_profiles() {
+
+ # FIXME Use "mvn help:all-profiles" output instead of parsing settings and pom files...
+ # Blocked on http://jira.codehaus.org/browse/MPH-82 and http://jira.codehaus.org/browse/MPH-83
+ local profs update_policy settings_file=$(__mvn_get_settings_file) parent_pom_file=$(__mvn_get_parent_pom_file) cache_name profiles_section ret=1
+
+ # TODO Should be split into _mvn_profiles/mvn_profiles_lists
+
+ zstyle -s ":completion:${curcontext}:" cache-policy update_policy
+ [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_profiles_caching_policy
+
+ profs=()
+
+ # Resolve profiles from settings.xml
+ if [[ -f $settings_file ]]; then
+ unset _profiles
+ cache_name="mvn/profiles${settings_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10
+ if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then
+ _profiles=()
+ profiles_section="${(M)${(f)$(<$settings_file)}:#*<profiles>*}"
+ if [[ -n "$profiles_section" ]]; then
+ for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*<profile>}%</profile>*}//<repositories>*<\/repositories>}//<pluginRepositories>*<\/pluginRepositories>}//<build>*<\/build>}//<\/id>*<id>/,,,}##*<id>}%%</id>*}}; do
+ [[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in settings file"']')
+ done
+ fi
+ [[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
+ fi
+ profs+=($_profiles)
+ fi
+
+ # Resolve project profiles
+ if [[ -f $parent_pom_file ]]; then
+ unset _profiles
+ cache_name="mvn/profiles${parent_pom_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10
+ if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then
+ _profiles=()
+ setopt localoptions extendedglob
+ for file in ${parent_pom_file:h}/**/pom.xml~*target\/*; do # FIXME project.build.directory is not always target/
+ profiles_section="${(M)${(f)$(<$file)}:#*<profiles>*}"
+ if [[ -n "$profiles_section" ]]; then
+ for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*<profile>}%</profile>*}//<repositories>*<\/repositories>}//<pluginRepositories>*<\/pluginRepositories>}//<build>*<\/build>}//<\/id>*<id>/,,,}##*<id>}%%</id>*}}; do
+ [[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in ${file#${parent_pom_file:h}\/}"']')
+ done
+ fi
+ done
+ [[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
+ fi
+ profs+=($_profiles)
+ fi
+
+ compset -P '-'; compset -P '+'; compset -P '!' # FIXME Only works for the first profile
+
+ [[ $#profs -gt 0 ]] && _values $@ 'profile' "${profs[@]}" && ret=0
+
+ return ret
+}
+
+(( $+functions[_mvn_projects] )) ||
+_mvn_projects() {
+ # TODO Projects can also be given in the form [groupId:]artifactId.
+ # TODO Should be split into _mvn_projects/mvn_projects_lists
+ local pom_file=$(__mvn_get_parent_pom_file) ret=1
+
+ if [[ -f $pom_file ]]; then
+ setopt localoptions extendedglob
+ local projects; projects=(${pom_file:h}/*/**/pom.xml~*target\/*) # FIXME project.build.directory is not always target/
+ projects=(${${projects#.\/}:h})
+ [[ $#projects -gt 0 ]] && _values "$@" 'project' "${projects[@]}" && ret=0
+ fi
+
+ return ret
+}
+
+(( $+functions[_mvn_properties] )) ||
+_mvn_properties() {
+ local ret=1
+ if compset -P '*='; then
+ _wanted property-values expl 'property value' _mvn_property_values ${${IPREFIX%=}#-D} && ret=0
+ else
+ _wanted property-names expl 'property name' _mvn_property_names -qS= && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_mvn_property_names] )) ||
+_mvn_property_names() {
+ # FIXME "-qS=" should be inherited from _mvn_properties
+ local alternatives; alternatives=(
+ "common-property-names:common property name:_mvn_common_property_names -qS="
+ )
+ for plugin_colon_goal in ${(M)words:#[^-]*:*}; do
+ alternatives+=("plugin-property-names:plugin property name:_mvn_plugin_goal_property_names -qS= ${plugin_colon_goal}")
+ done
+ _alternative "${alternatives[@]}"
+}
+
+(( $+functions[_mvn_common_property_names] )) ||
+_mvn_common_property_names() {
+ local properties; properties=(
+ 'skipTests:skip tests execution'
+ 'maven.test.skip:skip tests compilation and execution'
+ 'gpg.passphrase:gpg passphrase'
+ )
+ _describe -t 'common-property-names' 'common property name' properties $@
+}
+
+(( $+functions[_mvn_plugin_goal_property_names] )) ||
+_mvn_plugin_goal_property_names() {
+ local plugin_colon_goal="$@[-1]" update_policy ret=1
+
+ zstyle -s ":completion:${curcontext}:" cache-policy update_policy
+ [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_properties_caching_policy
+
+ unset _properties
+ if ( [[ ${+_properties} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin_colon_goal}" ) && ! _retrieve_cache "mvn/plugins/${plugin_colon_goal}"; then
+ # FIXME Does not work for:
+ # android:apk (new line before expression)
+ # ear:ear (unknown cause)
+ _properties=(${(M)${(ps:,,,:)${${${${(pj: :)${${${(f)${"$(_call_program properties $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=${plugin_colon_goal%:*} -Dgoal=${plugin_colon_goal##*:} -Ddetail)"#*Available parameters:}%%\[INFO\]*}//# [a-z]*/,,,}##*Expression: \$\{}}//\}[[:space:]]##/:}//[[:space:]]##/ }//[[:space:]]#,,,[[:space:]]#/,,,}}:#[a-zA-Z]##:*})
+ [[ $#_properties -gt 0 ]] && _store_cache "mvn/plugins/${plugin_colon_goal}" _properties
+ fi
+
+ [[ $#_properties -gt 0 ]] && _describe -t "${plugin_colon_goal//:/-}-property-names" "${plugin_colon_goal} property name" _properties $@[0,-2] && ret=0
+
+ return ret
+}
+
+(( $+functions[_mvn_property_values] )) ||
+_mvn_property_values() {
+ local ret=1
+ setopt localoptions extendedglob
+ case $@[-1] in
+ ((#i)*pomFile*) _wanted pom-files expl 'POM file' _mvn_pom_files && ret=0;;
+ ((#i)*file*) _wanted files expl 'file' _files && ret=0;;
+ ((#i)*groupId*) _wanted groupIds expl 'groupId' _mvn_groupIds && ret=0;;
+ ((#i)*artifactId*) _wanted artifactIds expl 'artifactId' _mvn_groupId_artifactIds ${${(M)${(ps.:.)opt_args[(K)-D]}:#groupId=*}#groupId=} && ret=0;;
+ ((#i)*version*) _wanted versions expl 'version' _mvn_artifact_versions ${${(M)${(ps.:.)opt_args[(K)-D]}:#groupId=*}#groupId=}:${${(M)${(ps.:.)opt_args[(K)-D]}:#artifactId=*}#artifactId=} && ret=0;;
+ ((#i)*repositoryId*) _message -e repositoryIds 'repositoryId' && ret=0;; # TODO Not implemented
+ ((#i)*classifier*) _message -e classifiers 'classifier' && ret=0;;
+ ((#i)*scope*) _wanted scopes expl 'scope' _mvn_scopes && ret=0;;
+ ((#i)*url*) _wanted urls expl 'url' _urls && ret=0;; # TODO Use _alternative and add repository urls from settings + projects
+ ((#i)*(password|passphrase)*) _wanted passwords expl password _mvn_passwords && ret=0;;
+ ((#i)*(createChecksum|generatePom|maven.test.skip)*) _wanted booleans expl 'boolean' _mvn_booleans && ret=0;;
+ ((#i)*user*) _wanted users expl 'user' _users && ret=0;; # TODO Use _alternative and add repository usernames from settings + projects
+ ((#i)*plugin*) _wanted plugin expl 'plugin' _mvn_plugins && ret=0;;
+ (*) _default && ret=0;;
+ esac
+ return ret
+}
+
+(( $+functions[_mvn_scopes] )) ||
+_mvn_scopes() {
+ local scopes; scopes=(
+ 'compile:default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.'
+ 'provided:much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.'
+ 'runtime:indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath.'
+ 'test:indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.'
+ 'system:similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.'
+ 'import:only used on a dependency of type pom in the <dependencyManagement> section. It indicates that the specified POM should be replaced with the dependencies in that POM'\''s <dependencyManagement> section. Since they are replaced, dependencies with a scope of import do not actually participate in limiting the transitivity of a dependency.'
+ )
+ _describe -t scopes 'scope' scopes
+}
+
+(( $+functions[_mvn_thread_counts] )) ||
+_mvn_thread_counts() {
+ local thread_counts; thread_counts=(
+ '1:build with 1 thread' '1C:build with 1 thread per CPU core'
+ '2:build with 2 threads' '2C:build with 2 threads per CPU core'
+ '3:build with 3 threads' '3C:build with 3 threads per CPU core'
+ '4:build with 4 threads' '4C:build with 4 threads per CPU core'
+ '5:build with 5 threads' '5C:build with 5 threads per CPU core'
+ '6:build with 6 threads' '6C:build with 6 threads per CPU core'
+ '7:build with 7 threads' '7C:build with 7 threads per CPU core'
+ '8:build with 8 threads' '8C:build with 8 threads per CPU core'
+ )
+ _describe -t thread-counts 'thread count' thread_counts
+}
+
+(( $+functions[_mvn_reactors] )) ||
+_mvn_reactors() {
+ _message -e reactors 'reactor' # FIXME No idea what kind of value the "--reactor" option is supposed to take
+}
+
+(( $+functions[_mvn_passwords] )) ||
+_mvn_passwords() {
+ _message -e passwords 'password'
+}
+
+(( $+functions[_mvn_pom_files] )) ||
+_mvn_pom_files() {
+ _files -g '*pom*\.xml*'
+}
+
+(( $+functions[_mvn_toolchains_files] )) ||
+_mvn_toolchains_files() {
+ _files -g '*toolchains*\.xml*'
+}
+
+(( $+functions[_mvn_settings_files] )) ||
+_mvn_settings_files() {
+ _files -g '*settings*\.xml*'
+}
+
+(( $+functions[_mvn_log_files] )) ||
+_mvn_log_files() {
+ _files
+}
+
+(( $+functions[_mvn_booleans] )) ||
+_mvn_booleans() {
+ local booleans; booleans=(
+ 'true:"true" boolean value'
+ 'false:"false" boolean value'
+ )
+ _describe -t booleans 'boolean' booleans
+}
+
+
+# ------------------------------------------------------------------------------
+# Helper functions
+# ------------------------------------------------------------------------------
+
+__mvn_get_pom_file() {
+ print ${~opt_args[-f]:-${opt_args[--file]:-pom.xml}}
+}
+
+__mvn_get_parent_pom_file() {
+ local pom_file=$(__mvn_get_pom_file)
+ while [[ -f ${pom_file:a:h:h}/pom.xml ]]; do
+ pom_file=${pom_file:a:h:h}/pom.xml;
+ done
+ print $pom_file
+}
+
+__mvn_get_settings_file() {
+ print ${~opt_args[-s]:-${opt_args[--settings]:-$HOME/.m2/settings.xml}}
+}
+
+__mvn_get_repository_location() {
+ print ${${${${(M)"$(<$(__mvn_get_settings_file))":#*<localRepository>*}:-$HOME/.m2/repository}##*<localRepository>}%%<\/localRepository>*}
+}
+
+__mvn_get_plugin_prefix() {
+ print ${${${${@#*.*:}%%:*}%-plugin}/-#maven-#}
+}
+
+__mvn_get_cache_dir() {
+ local cache_dir
+ zstyle -s ":completion:${curcontext}:" cache-path cache_dir
+ print ${cache_dir:-${ZDOTDIR:-$HOME}/.zcompcache}
+}
+
+
+# ------------------------------------------------------------------------------
+# Caching policies
+# ------------------------------------------------------------------------------
+
+(( $+functions[_mvn_goals_caching_policy] )) ||
+_mvn_goals_caching_policy() {
+ # Rebuild if cache is older than one month.
+ local -a oldp
+ oldp=( "$1"(NmM+1) )
+ (( $#oldp ))
+}
+
+(( $+functions[_mvn_properties_caching_policy] )) ||
+_mvn_properties_caching_policy() {
+ _mvn_goals_caching_policy
+}
+
+(( $+functions[_mvn_groupIds_caching_policy] )) ||
+_mvn_groupIds_caching_policy() {
+ _mvn_goals_caching_policy
+}
+
+(( $+functions[_mvn_profiles_caching_policy] )) ||
+_mvn_profiles_caching_policy() {
+ # Rebuild if cached file more recent than cache.
+ local cached_file="${1#$(__mvn_get_cache_dir)}"
+ [[ -f $cached_file && $cached_file -nt "$1" ]] && return 0
+
+ # Rebuild if cache is older than one week.
+ local -a oldp
+ oldp=( "$1"(Nmw+1) )
+ (( $#oldp )) && return 0
+
+ return 1
+}
+
+_mvn "$@"
diff --git a/src/_node b/src/_node
new file mode 100644
index 0000000..a32e6b6
--- /dev/null
+++ b/src/_node
@@ -0,0 +1,61 @@
+#compdef node
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Node.js v0.8.4 (http://nodejs.org)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Mario Fernandez (https://github.com/sirech)
+# * Nicholas Penree (https://github.com/drudge)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+local curcontext="$curcontext" state line ret=1
+typeset -A opt_args
+
+_arguments -C \
+ '(- 1 *)--help[print options help]' \
+ '(- 1 *)'{-v,--version}'[print node version]' \
+ '(--no-deprecation)--no-deprecation[silence deprecation warnings]' \
+ '(--trace-deprecation)--trace-deprecation[show stack traces on deprecations]' \
+ '(- 1 *)--v8-options[print v8 command line options]' \
+ '(--max-stack-size)--max-stack-size=[set max v8 stack size (bytes)]' \
+ '(-e --eval)'{-e,--eval}'[evaluate script]:Inline Script' \
+ '(-i --interactive)'{-i,--interactive}'[always enter the REPL even if stdin does not appear to be a terminal]' \
+ '(-p --print)'{-p,--print}'[print result of --eval]' \
+ '(--vars)--vars[print various compiled-in variables]' \
+ '*:JS Script:_files -g "*.js"' && ret=0
+
+return ret \ No newline at end of file
diff --git a/src/_optirun b/src/_optirun
new file mode 100644
index 0000000..2c05992
--- /dev/null
+++ b/src/_optirun
@@ -0,0 +1,67 @@
+#compdef optirun
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for the optirun command from bumblebee
+# (https://github.com/Bumblebee-Project/Bumblebee).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Christophe-Marie Duquesne <chm.duquesne@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+local curcontext="$curcontext" state line
+typeset -A opt_args
+
+local -a arguments
+
+arguments=(
+ '--version[output version information]'
+ '(-h --help)'{-h,--help}'[show help]'
+ '(-c --vgl-compress)'{-c,--vgl-compress}'[image transport method]:method:(proxy jpeg rgb xb yuv)'
+ '--failsafe[run a program even if the nvidia card is unavailable]'
+ '--no-failsafe[do not run a program if the nvidia card is unavailable]'
+ '--vgl-options[options to be passed to vglrun (example: +tr)]'
+ '(-q --quiet --silent)'{-q,--quiet,--silent}'[supress all logging messages]'
+ '(-v --verbose)'{-v,--verbose}'[increase the verbosity level of log messages]'
+ '--debug[set the verbosity level to the maximum]'
+ '(-d --display)'{-d,--display}'[the X display number to use]'
+ '(-C --config)'{-C,--config}'[retrieve settings for Bumblebee from FILE]:file:_files'
+ '(-l --ldpath)'{-l,--ldpath}'[PATH the libraries like libGL.so are searched in]:file:_files'
+ '(-s --socket)'{-s,--socket}'[use FILE for communication with the daemon]:file:_files'
+ '*::arguments: _normal'
+)
+
+_arguments $arguments
diff --git a/src/_pear b/src/_pear
new file mode 100644
index 0000000..a7eecaf
--- /dev/null
+++ b/src/_pear
@@ -0,0 +1,84 @@
+#compdef pear
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Pear (http://pear.php.net).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * aki77 (https://github.com/aki77)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_pear () {
+ local curcontext="$curcontext" state line expl ret=1
+
+ _arguments \
+ '1: :->subcmds' \
+ '*:: :->args' && ret=0
+
+ case $state in
+ subcmds)
+ _pear_commands
+ ;;
+ args)
+ local cmd args
+
+ cmd=$words[1]
+ args=()
+
+ case $cmd in
+ channel-alias|channel-delete|channel-info|channel-update)
+ args+=(
+ ':channel:_pear_discovered_channels'
+ )
+ ;;
+ uninstall|upgrade|run-scripts)
+ args+=(
+ ':package:_pear_installed_packages'
+ )
+ ;;
+ esac
+
+ _arguments "$args[@]" && ret=0
+ return
+ ;;
+ esac
+ return ret
+}
+
+_pear_commands () {
+ local commands
+
+ commands=(
+ ${${(f)${"$(_call_program commands $service 2>&1)"#*Commands:}%Usage:*}/[[:blank:]]*[[:blank:]][[:blank:]]/:}
+ )
+ _describe -t commands 'Pear commands' commands
+}
+
+_pear_installed_packages () {
+ local packages
+
+ packages=(
+ ${${(f)"$(pear list)"#*STATE}%%[[:blank:]]*}
+ )
+ _wanted package expl 'package' compadd -a packages
+}
+
+_pear_discovered_channels () {
+ local channels
+
+ channels=(
+ ${${${(f)"$(_call_program commands pear list-channels)"#*SUMMARY}%__uri*}%%[[:blank:]]*}
+ )
+ _wanted channel expl 'channel' compadd -a channels
+}
+
+_pear "$@"
diff --git a/src/_perf b/src/_perf
new file mode 100644
index 0000000..7790bbf
--- /dev/null
+++ b/src/_perf
@@ -0,0 +1,274 @@
+#compdef perf
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Linux performance counters 3.3 (perf.wiki.kernel.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_perf() {
+ local context curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ local ret=1
+
+ _arguments -C \
+ '(- : *)--version[show version number and exit]' \
+ '(- : *)--help[show help]: :_perf_cmds' \
+ '1: :_perf_cmds' \
+ '*::arg:->args' \
+ && ret=0
+
+ case $state in
+ (args)
+ curcontext="${curcontext%:*:*}:perf-cmd-$words[1]:"
+ case $line[1] in
+ (annotate)
+ # TODO Complete CPU list
+ # TODO Complete disassembler style
+ _arguments \
+ '(- : *)'{-a,--all}'[prints all the available commands on the standard output]' \
+ '(-i --input)'{-i,--input=}'[input file name]: :_files' \
+ '(-d --dsos)'{-d,--dsos=}'[only consider symbols in these dsos]:dso list' \
+ '(-s --symbol)'{-s,--symbol=}'[symbol to annotate]:symbol' \
+ '(-f --force)'{-f,--force}'[do not complain, do it]' \
+ '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
+ '(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \
+ '(-k --vmlinux)'{-k,--vmlinux=}'[vmlinux pathname]: :_files' \
+ '(-m --modules)'{-m,--modules}'[load module symbols]' \
+ '(-l --print-line)'{-l,--print-line}'[print matching source lines]' \
+ '(-P --full-paths)'{-P,--full-paths}'[don'\''t shorten the displayed pathnames]' \
+ '--stdio[use the stdio interface]' \
+ '--tui[use the TUI interface]' \
+ '(-C --cpu)'{-C,--cpu}'[only report samples for the list of CPUs provided]:CPU list' \
+ '--asm-raw[show raw instruction encoding of assembly instructions]' \
+ '(--no-source)--source[interleave source code with assembly code]' \
+ '(--source)--no-source[don'\''t interleave source code with assembly code]' \
+ '--symfs=[look for files with symbols relative to this directory]: :_files -/' \
+ '(-M --disassembler-style)'{-M,--disassembler-style=}'[set disassembler style for objdump]:disassembler style' \
+ '1::symbol name' \
+ && ret=0
+ ;;
+ (archive)
+ _arguments \
+ '1: :_files' \
+ && ret=0
+ ;;
+ (bench)
+ # TODO Complete subsystems
+ # TODO Complete suites
+ _arguments \
+ '(-f --format)'{-f,--format=}'[specify format style]: :((default\:mainly\ for\ human\ reading simple\:friendly\ for\ automated\ processing\ by\ scripts))' \
+ '1::subsystem' \
+ '2::suite' \
+ && ret=0
+ ;;
+ (buildid-cache)
+ _arguments \
+ '(-a --add)'{-a,--add=}'[add specified file to the cache]: :_files' \
+ '(-r --remove)'{-r,--remove=}'[remove specified file from the cache]: :_files' \
+ '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
+ && ret=0
+ ;;
+ (buildid-list)
+ _arguments \
+ '(-H --with-hits)'{-H,--with-hits}'[show only DSOs with hits]' \
+ '(-i --input)'{-i,--input=}'[input file name]: :_files' \
+ '(-f --force)'{-f,--force}'[don'\''t do ownership validation]' \
+ '(-k --kernel)'{-k,--kernel}'[show running kernel build id]' \
+ '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
+ && ret=0
+ ;;
+ (diff)
+ _arguments \
+ '(-M --displacement)'{-M,--displacement}'[show position displacement relative to baseline]' \
+ '(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \
+ '(-m --modules)'{-m,--modules}'[load module symbols]' \
+ '(-d --dsos)'{-d,--dsos=}'[only consider symbols in these dsos]:dso list' \
+ '(-C --comms)'{-C,--comms=}'[only consider symbols in these comms]:comm list' \
+ '(-S --symbols)'{-S,--symbols=}'[only consider these symbols]:symbol list' \
+ '(-s --sort)'{-s,--sort=}'[sort by key(s)]: :_values -s , key pid comm dso symbol' \
+ '(-t --field-separator)'{-t,--field-separator=}'[use a special separator character and don'\''t pad with spaces]:separator' \
+ '(-v --verbose)'{-v,--verbose}'[be verbose, for instance, show the raw counts in addition to the diff]' \
+ '(-f --force)'{-f,--force}'[don'\''t complain, do it]' \
+ '--symfs=[look for files with symbols relative to this directory]: :_files -/' \
+ '1:old file:_files' \
+ '2:new file:_files' \
+ && ret=0
+ ;;
+ (evlist)
+ _arguments \
+ '(-i --input)'{-i,--input=}'[input file name]: :_files' \
+ && ret=0
+ ;;
+ (inject)
+ _arguments \
+ '(-b --build-ids)'{-b,--build-ids=}'[inject build-ids into the output stream]:build-id list' \
+ '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
+ && ret=0
+ ;;
+ (kmem)
+ # TODO Complete 'record' command
+ _arguments \
+ '(-i --input)'{-i,--input=}'[input file name]: :_files' \
+ '--caller[show per-callsite statistics]' \
+ '--alloc[show per-allocation statistics]' \
+ '(-s --sort)'{-s,--sort=}'[sort by output]: :_values -s , key frag hit bytes' \
+ '(-n --lines)'{-n,--lines}'[print n lines only]:number' \
+ '1:command:((record\:record\ the\ kmem\ events\ of\ an\ arbitrary\ workload stat\:report\ kernel\ memory\ statistics))' \
+ && ret=0
+ ;;
+ (kvm)
+ _arguments \
+ '(-i --input)'{-i,--input=}'[input file name]: :_files' \
+ '(-o --output)'{-o,--output=}'[output file name]: :_files' \
+ '--host=[collect host side performance profile]:host' \
+ '--guest=[collect guest side performance profile]:guest' \
+ '--guestmount=[guest os root file system mount directory]: :_files -/' \
+ '--guestkallsyms=[guest os /proc/kallsyms file copy]: :_files' \
+ '--guestmodules=[guest os /proc/modules file copy]: :_files' \
+ '--guestvmlinux=[guest os kernel vmlinux]: :_files' \
+ '1:command:((top record report diff buildid-list))' \
+ && ret=0
+ ;;
+ (list)
+ _arguments \
+ '1:event type:((hw\:hardware\ events hardware\:hardware\ events sw\:software\ events software\:software\ events cache\:cache\ events hwcache\:cache\ events tracepoint\:tracepoint\ events))' \
+ && ret=0
+ ;;
+ (lock)
+ # TODO Complete 'record' command
+ # TODO Complete 'report' command options
+ _arguments \
+ '(-i --input)'{-i,--input=}'[input file name]: :_files' \
+ '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
+ '(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \
+ '1:command:((record\:record\ lock\ events trace\:show\ raw\ lock\ events report\:report\ statistical\ data))' \
+ && ret=0
+ ;;
+ (probe)
+ # TODO not implemented
+ ;;
+ (record)
+ # TODO not implemented
+ ;;
+ (report)
+ # TODO not implemented
+ ;;
+ (sched)
+ # TODO Complete 'record' command
+ _arguments \
+ '(-i --input)'{-i,--input=}'[input file name]: :_files' \
+ '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
+ '(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \
+ '1:command:((record\:record\ scheduling\ events script\:see\ a\ detailed\ trace replay\:simulate\ the\ workload map\:print\ a\ textual\ context-switching\ outline))' \
+ && ret=0
+ ;;
+ (script)
+ # TODO not implemented
+ ;;
+ (stat)
+ # TODO not implemented
+ ;;
+ (test)
+ _arguments \
+ '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
+ && ret=0
+ ;;
+ (timechart)
+ # TODO Complete 'record' command
+ _arguments \
+ '(-i --input)'{-i,--input=}'[input file name]: :_files' \
+ '(-o --output)'{-o,--output=}'[output file name]: :_files' \
+ '(-w --width)'{-w,--width=}'[select the width of the SVG file]:width' \
+ '(-P --power-only)'{-P,--power-only}'[only output the CPU power section of the diagram]' \
+ '(-p --process)'{-p,--process}'[select the processes to display, by name or PID]:process' \
+ '--symfs=[look for files with symbols relative to this directory]: :_files -/' \
+ '1:command:((record))' \
+ && ret=0
+ ;;
+ (top)
+ # TODO not implemented
+ ;;
+ (help)
+ _arguments \
+ '(- : *)'{-a,--all}'[prints all the available commands on the standard output]' \
+ '1: :_perf_cmds' \
+ && ret=0
+ ;;
+ *)
+ _call_function ret _perf_cmd_$words[1] && ret=0
+ (( ret )) && _message 'no more arguments'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# FIXME Parse 'perf --help' instead of hard-coding.
+(( $+functions[_perf_cmds] )) ||
+_perf_cmds() {
+ local commands; commands=(
+ 'annotate:read perf.data (created by perf record) and display annotated code'
+ 'archive:create archive with object files with build-ids found in perf.data file'
+ 'bench:general framework for benchmark suites'
+ 'buildid-cache:manage build-id cache'
+ 'buildid-list:list the buildids in a perf.data file'
+ 'diff:read two perf.data files and display the differential profile'
+ 'evlist:list the event names in a perf.data file'
+ 'inject:filter to augment the events stream with additional information'
+ 'kmem:tool to trace/measure kernel memory(slab) properties'
+ 'kvm:tool to trace/measure kvm guest os'
+ 'list:list all symbolic event types'
+ 'lock:analyze lock events'
+ 'probe:define new dynamic tracepoints'
+ 'record:run a command and record its profile into perf.data'
+ 'report:read perf.data (created by perf record) and display the profile'
+ 'sched:tool to trace/measure scheduler properties (latencies)'
+ 'script:read perf.data (created by perf record) and display trace output'
+ 'stat:run a command and gather performance counter statistics'
+ 'test:runs sanity tests'
+ 'timechart:tool to visualize total system behavior during a workload'
+ 'top:system profiling tool'
+ 'help:show command usage information'
+ )
+ _describe -t commands 'command' commands "$@"
+}
+
+_perf "$@"
diff --git a/src/_periscope b/src/_periscope
new file mode 100644
index 0000000..4ea182d
--- /dev/null
+++ b/src/_periscope
@@ -0,0 +1,56 @@
+#compdef periscope
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Periscope (http://code.google.com/p/periscope).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_arguments \
+ '(- : *)'{-h,--help}'[show help message and exit]' \
+ '(- : *)--version[show version number and exit]' \
+ '*'{-l,--language}'[wanted language]: :_language_codes ISO-639-1' \
+ '(-f --force)'{-f,--force}'[replace existing subtitle file]' \
+ '(-q --query)'{-q,--query}'[query to send to the subtitles website]:queries' \
+ '--list-plugins[list all plugins supported by periscope]' \
+ '--list-active-plugins[list all plugins used to search subtitles]' \
+ '--cache-folder[cache/config directory to use]: :_files -/' \
+ '--quiet[run in quiet mode (only show warn and error messages)]' \
+ '--debug[set the logging level to debug]' \
+ '*: :_files'
diff --git a/src/_pgsql_utils b/src/_pgsql_utils
new file mode 100644
index 0000000..899e6f7
--- /dev/null
+++ b/src/_pgsql_utils
@@ -0,0 +1,266 @@
+#compdef psql pg_dump createdb dropdb vacuumdb
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for PostgreSQL utils (http://postgresql.org).
+#
+# Source: http://www.zsh.org/mla/users/2004/msg01006.html
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Dominic Mitchell <dom+zsh@happygiraffe.net>
+#
+# * Johann 'Myrkraverk' Oskarsson <johann@2ndquadrant.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_pgsql_get_identity () {
+ _pgsql_user=${(v)opt_args[(i)-U|--username]}
+ _pgsql_port=${(v)opt_args[(i)-p|--port]}
+ _pgsql_host=${(v)opt_args[(i)-h|--host]}
+
+ _pgsql_params=(
+ ${_pgsql_user:+"--username=$_pgsql_user"}
+ ${_pgsql_port:+"--port=$_pgsql_port"}
+ ${_pgsql_host:+"--host=$_pgsql_host"}
+ )
+}
+
+# Postgres Allows specifying the path to the directory containing the
+# socket as well as a hostname.
+_pgsql_host_or_dir() {
+ _alternative \
+ 'hosts:host:_hosts' \
+ 'directories:directory:_directories'
+}
+
+# This creates a port completion list based on socket files on the
+# local computer. Be default, Postgres puts them in /tmp/ but Debian
+# changed that to /var/run/postgresql/ in their packages.
+_pgsql_ports() {
+ compadd "$@" - /tmp/.s.PGSQL.<->(N:e) /var/run/postgresql/.s.PGSQL.<->(N:e)
+}
+
+_pgsql_users () {
+ local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
+ local _pgsql_user_sql
+ _pgsql_get_identity
+
+ # We use _pgsql_port and _pgsql_host directly here instead of
+ # _pgsql_params so as to not pick up a partially completed
+ # username.
+ _pgsql_params=(
+ ${_pgsql_port:+"--port=$_pgsql_port"}
+ ${_pgsql_host:+"--host=$_pgsql_host"}
+ )
+
+ _pgsql_user_sql='select r.rolname from pg_catalog.pg_roles r where r.rolcanlogin = true'
+
+ compadd "$@" - $( psql $_pgsql_params[@] -Aqt -c $_pgsql_user_sql template1 2>/dev/null )
+
+}
+
+_pgsql_tables () {
+ local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
+ _pgsql_get_identity
+
+ # Need to pull out the database name from the existing arguments.
+ # This is going to vary between commands. Thankfully, it's only
+ # used by pg_dump, which always has the dbname in arg1. If it's
+ # not present it defaults to ${PGDATABASE:-$LOGNAME}, which
+ # matches (I think) the PostgreSQL behaviour.
+
+ local db
+ db=${line[1]:-${PGDATABASE:-$LOGNAME}}
+
+ ## Instead of parsing the output of the psql \ commands, we look
+ ## up the tables ourselves. The following query has been tested
+ ## with Postgres 8.2 - 9.2.
+
+ local _pgsql_table_sql
+ _pgsql_table_sql="select n.nspname || '.' || c.relname \
+ from pg_catalog.pg_class c \
+ left join pg_catalog.pg_namespace n on n.oin = c.relnamespace \
+ where c.relkind in ('r', '') \
+ and n.nspname <> 'pg_catalog' \
+ and n.nspname <> 'information_schema' \
+ and n.nspname !~ '^pg_toast' \
+ and pg_catalog.pg_table_is_visible( c.oid ) \
+ order by 1"
+
+ compadd "$@" - \
+ $( psql $_pgsql_params[@] -Aqt -c $_pgsql_table_sql $db 2>/dev/null )
+}
+
+_pgsql_databases () {
+ local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
+ _pgsql_get_identity
+
+ local _pgsql_db_sql
+ _pgsql_db_sql="select d.datname from pg_catalog.pg_database d \
+ where d.datname <> 'template0'"
+
+ compadd "$@" - $( psql $_pgsql_params[@] -Atq -c $_pgsql_db_sql 2>/dev/null )
+}
+
+
+##
+## The actual completion code for the commands
+##
+
+_psql () {
+ local curcontext="$curcontext" state line expl
+ typeset -A opt_args
+
+ _arguments -C -s "-*" \
+ "$_pgsql_common_opts[@]" \
+ {-V,--version}'[display client version]' \
+ {-a,--echo-all}'[print commands read]' \
+ {-A,--no-align}'[unaligned output mode]' \
+ {-c+,--command=}':execute SQL command:' \
+ {-d+,--dbname=}':database to connect to:_pgsql_databases' \
+ {-e,--echo-queries}'[display queries submitted]' \
+ {-E,--echo-hidden}'[display hidden queries]' \
+ {-f+,--file=}':SQL file to read:_files' \
+ {-F+,--field-separator=}':field separator char:' \
+ {-H,--html}'[HTML output]' \
+ {-l,--list}'[list databases]' \
+ {-o+,--output=}':query output:_files' \
+ {-P+,--pset=}':set psql variable:' \
+ {-q,--quiet}'[non verbose mode]' \
+ {-R+,--record-separator=}':record separator char:' \
+ {-s,--single-step}'[prompt before each query]' \
+ {-S,--single-line}'[newline sends query]' \
+ {-t,--tuples-only}'[dont display header/footer]' \
+ {-T+,--table-attr=}':HTML table options:' \
+ -u'[prompt for username/password]' \
+ {-v+,--set=,--variable=}':set SQL variable:' \
+ {-x,--expanded}'[one column per line]' \
+ {-X,--no-psqlrc}'[dont read ~/.psqlrc]' \
+ ':PostgreSQL database:_pgsql_databases' \
+ ':PostgreSQL user:_pgsql_users'
+}
+
+_pg_dump () {
+ local curcontext="$curcontext" state line expl
+ typeset -A opt_args
+
+ _arguments -C -s \
+ "$_pgsql_common_opts[@]" \
+ {-a,--data-only}'[dump only data]' \
+ {-b,--blobs}'[dump blobs as well]' \
+ {-c,--clean}'[include clean cmds in dump]' \
+ {-C,--create}'[include createdb cmds in dump]' \
+ {-d,--inserts}'[use INSERT not COPY]' \
+ {-D,--{attribute,column}-inserts}'[use INSERT (cols) not COPY]' \
+ {-f+,--file=}':output file:_files' \
+ {-F+,--format=}':output format:_values "format" "p[plain text]" "t[tar]" "c[custom]"' \
+ {-i,--ignore-version}'[ignore version mismatch]' \
+ {-n+,--schema=}':schema to dump:' \
+ {-o,--oids}'[dump objects identifiers for every table]' \
+ {-O,--no-owner}'[dont recreate as same owner]' \
+ {-R,--no-reconnect}'[dont output connect]' \
+ {-s,--schema-only}'[no data, only schema]' \
+ {-S+,--superuser=}':superuser name:_pgsql_users' \
+ {-t+,--table=}':table to dump:_pgsql_tables' \
+ {-v,--verbose}'[verbose mode]' \
+ {-V,--version}'[display client version]' \
+ {-x,--no-{acl,privileges}}'[dont dump ACLs]' \
+ -X+':option:_values "option" use-set-session-authorization disable-triggers' \
+ {-Z+,--compress=}':compression level:_values "level" 9 8 7 6 5 4 3 2 1 0' \
+ ':PostgreSQL database:_pgsql_databases'
+}
+
+_createdb () {
+ local curcontext="$curcontext" state line expl
+ typeset -A opt_args
+
+ _arguments -C -s \
+ "$_pgsql_common_opts[@]" \
+ {-e,--echo}'[display SQL queries]' \
+ {-q,--quiet}'[non verbose mode]' \
+ {-D+,--location=}':database location:_directories' \
+ {-T+,--template=}':database template:_pgsql_databases' \
+ {-E+,--encoding=}':database encoding:_values "encoding" $_pgsql_encodings[@]' \
+ ':PostgreSQL database:' \
+ ':comment:'
+}
+
+_dropdb () {
+ local curcontext="$curcontext" state line expl
+ typeset -A opt_args
+
+ _arguments -C -s \
+ "$_pgsql_common_opts[@]" \
+ {-e,--echo}'[display SQL queries]' \
+ {-q,--quiet}'[non verbose mode]' \
+ {-i,--interactive}'[confirm before drop]' \
+ ':PostgreSQL database:_pgsql_databases'
+}
+
+_vacuumdb () {
+ local curcontext="$curcontext" state line expl
+ typeset -A opt_args
+
+ _arguments -C -s \
+ "$_pgsql_common_opts[@]" \
+ {-a,--all}'[vacuum all databases]' \
+ {-d+,--dbname=}':database to connect to:_pgsql_databases' \
+ {-t+,--table=}':table to dump:_pgsql_tables' \
+ {-f,--full}'[do full vacuuming]' \
+ {-z,--analyze}'[update optimizer hints]' \
+ {-e,--echo}'[show the commands being sent to the server]' \
+ {-q,--quiet}'[do not write any messages]' \
+ {-v,--verbose}'[write a lot of output]' \
+ '--help[show this help, then exit]' \
+ '--version[output version information, then exit]' \
+ '1:PostgreSQL database:_pgsql_databases'
+}
+
+_pgsql_utils () {
+ local _pgsql_common_opts _pgsql_encodings
+
+ _pgsql_common_opts=(
+ {-\?,--help}'[display help]'
+ {-h+,--host=}':database host:_pgsql_host_or_dir'
+ {-p+,--port=}':database port number:_pgsql_ports'
+ {-U+,--username=}':connect as user:_pgsql_users'
+ {-W,--password}'[prompt for password]'
+ )
+
+ # Taken from
+ # <http://www.postgresql.org/docs/7.4/static/multibyte.html#CHARSET-TABLE>.
+ # It'd be real nice if postgres could tell us these...
+ _pgsql_encodings=(
+ SQL_ASCII
+ EUC_{JP,CN,KR,TW}
+ JOHAB
+ UNICODE
+ MULE_INTERNAL
+ LATIN{1,2,3,4,5,6,7,8,9,10}
+ ISO_8859_{5,6,7,8}
+ KOI8
+ WIN
+ ALT
+ WIN1256
+ TCVN
+ WIN874
+ )
+
+ case "$service" in
+ psql) _psql "$@" ;;
+ pg_dump) _pg_dump "$@" ;;
+ createdb) _createdb "$@" ;;
+ dropdb) _dropdb "$@" ;;
+ vacuumdb) _vacuumdb "$@" ;;
+ esac
+}
+
+_pgsql_utils "$@"
diff --git a/src/_pip b/src/_pip
new file mode 100644
index 0000000..46fc486
--- /dev/null
+++ b/src/_pip
@@ -0,0 +1,120 @@
+#compdef pip
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for pip (http://pypi.python.org/pypi/pip).
+#
+# Source: https://github.com/technolize/zsh-completion-funcs
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * technolize (https://github.com/technolize)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local ret=1 state
+
+local -a common_ops
+common_ops=(
+ "--version[display version number]"
+ {-h,--help}"[show help]"
+ {-E,--environment=}"[virtualenv environment to run pip]:environment:_directories"
+ {-s,--enable-site-packages}"[include site-packages in virtualenv]"
+ {-v,--verbose}"[give more output]"
+ {-q,--quiet}"[give less output]"
+ "--log=[log file where a complete record will be kept]"
+ "--proxy=[specify a proxy in the form user:passwd@proxy.server:port]:proxy"
+ "--timeout=[set the socket timeout (default 15 seconds)]:second"
+)
+
+_directories () {
+ _wanted directories expl directory _path_files -/ "$@" -
+}
+
+typeset -A opt_args
+_arguments \
+ ':subcommand:->subcommand' \
+ $common_ops \
+ '*::options:->options' && ret=0
+
+case $state in
+ subcommand)
+ local -a subcommands
+ subcommands=(
+ "bundle:create pybundle"
+ "freeze:put all currently installed packages"
+ "help:show available commands"
+ "install:install packages"
+ "search:search pypi"
+ "uninstall:uninstall packages"
+ "unzip:unzip undividual packages"
+ "zip:zip dividual packages"
+ )
+
+ _describe -t subcommands 'pip subcommand' subcommands && ret=0
+ ;;
+
+ options)
+ local -a args
+ args=(
+ $common_ops
+ )
+
+ local -a requirement
+ requirement=(
+ {-r,--requirement=}"[install all the packages listed in the given requirements file]:filename:_files"
+ )
+
+ local -a findlink
+ findlink=(
+ {-f,--find-links=}"[URL to look for packages at]:url"
+ )
+
+ case $words[1] in
+ bundle | install)
+ args+=(
+ {-e,--editable=}"[install a package directly from a checkout]:VCS+REPOS_URL[@REV]#egg=PACKAGE"
+ $requirement
+ $findlink
+ {-i,--index-url=,--pypi-url=}"[base URL of Python Package Index]:URL"
+ "--extra-index-url=[extra URLs of package indexes to use]:URL"
+ {-b,--build=,--build-dir=}"[unpack packages into DIR]:directory:_directories"
+ {--src=,--source=}"[check out --editable packages into DIR]:directory:_directories"
+ {-U,--upgrade}"[upgrade all packages to the newest available version]"
+ {-I,--ignore-installed}"[ignore the installed packages]"
+ "--noinstall[download and unpack all packages, but don't actually install them]"
+ "--install-option=[extra arguments to be supplied to the setup.py install command]"
+ )
+ ;;
+
+ freeze)
+ args+=(
+ $requirement
+ $findlink
+ )
+ ;;
+
+ unzip | zip)
+ args+=(
+ "--unzip[unzip a package]"
+ "--no-pyc[do not include .pyc files in zip files]"
+ {-l,--list}"[list the packages available, and their zip status]"
+ "--sort-files[with --list, sort packages according to how many files they contain]"
+ "--path=[restrict operation to the given paths]:paths"
+ {-n,--simulate}"[do not actually perform the zip/unzip operation]"
+ )
+ ;;
+ esac
+
+ _arguments $args && ret=0
+ ;;
+esac
+
+return ret
diff --git a/src/_pkcon b/src/_pkcon
new file mode 100644
index 0000000..5f2235a
--- /dev/null
+++ b/src/_pkcon
@@ -0,0 +1,132 @@
+#compdef pkcon
+# ------------------------------------------------------------------------------
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for pkcon (http://www.packagekit.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local -a options
+options=(
+ '--version[Show the program version and exit]'
+ '--filter[Set the filter, e.g. installed]'
+ "--root[Set the install root, e.g. '/' or '/mnt/ltsp']"
+ '(-n --nowait)'{-n,--nowait}'[Exit without waiting for actions to complete]'
+ '(-y --noninteractive)'{-g,--noninteractive}'[Install the packages without asking for confirmation]'
+ '--background[Run the command using idle network bandwidth and also using less power]'
+ '(-p --plain)'{-p,--plain}'[Print to screen a machine readable output, rather than using animated widgets]'
+ '(-c --cache-age)'{-c,--cache-age}"[The maximum metadata cache age. Use -1 for 'never'.]"
+ '(-h --help)'{-h,--help}'[Show help options.]'
+ '(-v --verbose)'{-v,--verbose}'[Show debugging information for all files]'
+)
+
+local -a actions
+actions=(
+ 'accept-eula'
+ 'get-roles'
+ 'get-distro-upgrades'
+ 'get-categories'
+ 'get-actions'
+ 'get-groups'
+ 'get-filters'
+ 'get-transactions'
+ 'get-time'
+ 'search'
+ 'install'
+ 'install-local'
+ 'download'
+ 'remove'
+ 'update'
+ 'refresh'
+ 'resolve'
+ 'get-updates'
+ 'get-depends'
+ 'get-requires'
+ 'get-details'
+ 'get-files'
+ 'get-update-detail'
+ 'get-packages'
+ 'repo-list'
+ 'repo-enable'
+ 'repo-disable'
+ 'repo-set-data'
+ 'what-provides'
+ 'upgrade-system'
+)
+
+local context state line expl cmd
+local -A opt_args
+
+integer i=2
+while (( i < $#words )); do
+ case "$words[$i]" in
+ -*)
+ # skip option
+ (( i++ ))
+ continue
+ ;;
+ esac
+
+ if [[ -z "$cmd" ]]; then
+ cmd="$words[$i]"
+ words[$i]=()
+ (( CURRENT-- ))
+ fi
+ (( i++ ))
+done
+
+if [[ -z "$cmd" ]]
+then
+ _arguments -s -w : $options \
+ ":action:($actions)"
+ return
+fi
+
+case "$cmd" in
+ search)
+ _arguments : $options \
+ ':type:(name details group file)' \
+ ':data: :'
+ ;;
+ refresh)
+ _arguments -s -w : $options \
+ '--force'
+ ;;
+ *)
+ _arguments -s -w : $options
+ ;;
+esac
+return 1
diff --git a/src/_play b/src/_play
new file mode 100644
index 0000000..d2f2951
--- /dev/null
+++ b/src/_play
@@ -0,0 +1,210 @@
+#compdef play
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Play! framework 1.2.2 (http://www.playframework.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+# * Mario Fernandez (https://github.com/sirech)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_play() {
+ local context curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ local ret=1
+
+ _arguments -C \
+ '1: :_play_cmds' \
+ '*::arg:->args' \
+ && ret=0
+
+ case $state in
+ (args)
+ curcontext="${curcontext%:*:*}:play-cmd-$words[1]:"
+ case $line[1] in
+ (build-module|list-modules|lm|check|id)
+ _message 'no more arguments' && ret=0
+ ;;
+ (dependencies|deps)
+ _arguments \
+ '1:: :_play_apps' \
+ '(--debug)--debug[Debug mode (even more informations logged than in verbose mode)]' \
+ '(--jpda)--jpda[Listen for JPDA connection. The process will suspended until a client is plugged to the JPDA port.]' \
+ '(--sync)--sync[Keep lib/ and modules/ directory synced. Delete unknow dependencies.]' \
+ '(--verbose)--verbose[Verbose Mode]' \
+ && ret=0
+ ;;
+ (clean|javadoc|jd|out|pid|secret|stop)
+ _arguments '1:: :_play_apps' && ret=0
+ ;;
+ (help)
+ _arguments '1: :_play_cmds -F "(cp deps ec idea jd st lm nb nm help antify evolutions evolutions:apply evolutions:markApplied evolutions:resolve)"' && ret=0
+ ;;
+ (status|st)
+ _arguments \
+ '1:: :_play_apps' \
+ '(--url)--url[If you want to monitor an application running on a remote server, specify the application URL using this option]:URL:_urls' \
+ '(--secret)--secret[You can provide your own secret key using this option]:Secret key' \
+ && ret=0
+ ;;
+ (new)
+ _arguments \
+ '1: :_play_apps' \
+ '(--with)--with[Automatically enable this set of module for the newly created application]:Modules list:_play_modules_list' \
+ && ret=0
+ ;;
+ (install)
+ _arguments '1:Play! module:_play_modules_dash_versions' && ret=0
+ ;;
+ (new-module)
+ _arguments '1:Module directory:_files -/' && ret=0
+ ;;
+ (test|precompile|run|start|war|auto-test|classpath|cp|eclipsify|ec|idealize|idea|modules|netbeansify|nb)
+ local cmd_args; cmd_args=(
+ '1:: :_play_apps'
+ '(--deps)--deps[Resolve and install dependencies before running the command]'
+ )
+ case $line[1] in
+ (precompile|run|start|restart|war)
+ local app_dir="$line[2]"
+ [[ -d "$app_dir" ]] || app_dir=.
+ [[ -f "$app_dir/conf/application.conf" ]] && cmd_args+=('--'${(u)${(M)$(<$app_dir/conf/application.conf):#%*}%%.*}'[Use this ID to run the application (override the default framework ID)]')
+ ;|
+ (test|run)
+ cmd_args+=('(-f)-f[Disable the JPDA port checking and force the jpda.port value]')
+ ;|
+ (war)
+ cmd_args+=(
+ '(-o --output)'{-o,--output}'[The path where the WAR directory will be created. The contents of this directory will first be deleted]:output directory:_files -/'
+ '(--zip)--zip[By default, the script creates an exploded WAR. If you want a zipped archive, specify the --zip option]'
+ '(--exclude)--exclude[Excludes a list of colon separated directories]:excluded directories list:_play_colon_dirs_list'
+ )
+ ;|
+ (test|run|start|restart|war)
+ cmd_args+=('*:Java option')
+ ;;
+ esac
+ _arguments "$cmd_args[@]" && ret=0
+ ;;
+ *)
+ _call_function ret _play_cmd_$words[1] && ret=0
+ (( ret )) && _message 'no more arguments'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# FIXME Completes only core commands, some modules add commands too (eg Maven). Where do we get them ?
+# FIXME Parse 'play help' and 'play help <command>' (for aliases) instead of hard-coding.
+(( $+functions[_play_cmds] )) ||
+_play_cmds() {
+ local commands; commands=(
+ 'antify:Create a build.xml file for this project'
+ 'auto-test:Automatically run all application tests'
+ 'build-module:Build and package a module'
+ 'check:Check for a release newer than the current one'
+ {classpath,cp}':Display the computed classpath'
+ 'clean:Delete temporary files (including the bytecode cache)'
+ {dependencies,deps}':Resolve and retrieve project dependencies'
+ {eclipsify,ec}':Create all Eclipse configuration files'
+ 'evolutions:Run the evolution check'
+ 'evolutions\:apply:Automatically apply pending evolutions'
+ 'evolutions\:mark:AppliedMark pending evolutions as manually applied'
+ 'evolutions\:resolve:Resolve partially applied evolution'
+ 'help:Display help on a specific command'
+ 'id:Define the framework ID'
+ {idealize,idea}':Create all IntelliJ Idea configuration files'
+ 'install:Install a module'
+ {javadoc,jd}':Generate your application Javadoc'
+ {list-modules,lm}':List modules available from the central modules repository'
+ 'modules:Display the computed modules list'
+ {netbeansify,nb}':Create all NetBeans configuration files'
+ 'new:Create a new application'
+ {new-module,nm}':Create a module'
+ 'out:Follow logs/system.out file'
+ 'pid:Show the PID of the running application'
+ 'precompile:Precompile all Java sources and templates to speed up application start-up'
+ 'restart:Restart the running application'
+ 'run:Run the application in the current shell'
+ 'secret:Generate a new secret key'
+ 'start:Start the application in the background'
+ {status,st}':Display the running application status'
+ 'stop:Stop the running application'
+ 'test:Run the application in test mode in the current shell'
+ 'war:Export the application as a standalone WAR archive'
+ )
+ _describe -t commands 'Play! command' commands "$@"
+}
+
+(( $+functions[_play_apps] )) ||
+_play_apps() {
+ _wanted application expl 'Play! application directory' _files -/
+}
+
+(( $+functions[_play_modules] )) ||
+_play_modules() {
+ local modules; modules=(${(ps:,:)${${${(S)${(f)$(_call_program modules $service list-modules)}//\]*\[/,}%%\]*}##*\[}})
+ _describe -t modules 'Play! module' modules "$@"
+}
+
+(( $+functions[_play_modules_dash_versions] )) ||
+_play_modules_dash_versions() {
+ local ret=1
+ if compset -P '*-'; then
+ local versions; versions=(${(ps:,:)${${${${${(f)$(_call_program versions $service list-modules)}##*${IPREFIX%-}\]}#*Versions:}%%"~"*}//[[:space:]]/}})
+ _describe -t module-versions "${IPREFIX%-} module versions" versions && ret=0
+ else
+ _wanted modules expl 'Play! module' _play_modules -qS- && ret=0
+ fi
+}
+
+(( $+functions[_play_modules_list] )) ||
+_play_modules_list() {
+ compset -P '*,'; compset -S ',*'
+ _wanted module-list expl 'Play! modules list' _play_modules -qS,
+}
+
+(( $+functions[_play_colon_dirs_list] )) ||
+_play_colon_dirs_list() {
+ compset -P '*:'; compset -S ':*'
+ _wanted directories-list expl 'Directories list' _files -/ -qS:
+}
+
+_play "$@"
diff --git a/src/_port b/src/_port
new file mode 100644
index 0000000..9053f53
--- /dev/null
+++ b/src/_port
@@ -0,0 +1,102 @@
+#compdef port
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for MacPorts (http://www.macports.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Matt Cable <wozz@wookie.net>
+# * Sorin Ionescu <sorin.ionescu@gmail.com>
+#
+# ------------------------------------------------------------------------------
+
+local subcmds
+
+subcmds=(
+ 'activate'
+ 'archive'
+ 'build'
+ 'cat'
+ 'clean'
+ 'configure'
+ 'contents'
+ 'deactivate'
+ 'dependents'
+ 'deps'
+ 'destroot'
+ 'dir'
+ 'distcheck'
+ 'distclean'
+ 'dmg'
+ 'echo'
+ 'edit'
+ 'extract'
+ 'fetch'
+ 'file'
+ 'help'
+ 'info'
+ 'install'
+ 'installed'
+ 'list'
+ 'livecheck'
+ 'location'
+ 'mpkg'
+ 'outdated'
+ 'patch'
+ 'pkg'
+ 'provides'
+ 'rpmpackage'
+ 'search'
+ 'selfupdate'
+ 'sync'
+ 'test'
+ 'unarchive'
+ 'uninstall'
+ 'upgrade'
+ 'variants'
+ 'version'
+)
+
+_arguments -C \
+ '-v[verbose mode (generate verbose messages)]' \
+ '-d[debug mode (generate debugging messages)]' \
+ '-q[quiet mode (suppress messages)]' \
+ '-D[specify portdir]' \
+ '-k[keep mode (do not autoclean after install)]' \
+ '-n[dont follow dependencies in upgrade (only for upgrading)]' \
+ '-a[upgrade all installed ports (only for upgrading)]' \
+ '-u[uninstall non-active ports when upgrading and uninstalling]' \
+ '-f[force mode (ignore state file)]' \
+ '-s[source-only mode]' \
+ '-b[binary-only mode]' \
+ '-o[honor state files older than Portfile]' \
+ '*::command:->command' \
+ && return 0
+
+case "$state" in
+ (command)
+ if (( CURRENT == 1 )); then
+ state='subcommands'
+ else
+ state='portname'
+ fi
+ ;;
+esac
+
+case "$state" in
+ (subcommands)
+ _describe -t commands 'port commands' subcmds
+ ;;
+ (portname)
+ # Cache the list of ports.
+ if (( ! $+_port_list )); then
+ _port_list=($(port echo all; echo "all current active inactive installed uninstalled outdated"))
+ fi
+
+ _describe -t commands 'available ports' _port_list
+ ;;
+esac
diff --git a/src/_portage b/src/_portage
new file mode 100644
index 0000000..e03f095
--- /dev/null
+++ b/src/_portage
@@ -0,0 +1,353 @@
+#compdef emerge ebuild quickpkg emaint env-update portageq repoman tbz2tool
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Portage (Gentoo source packages manager) utils.
+# TODO: Entropy (binary portage-compatible packages manager) support.
+# (equo, entropy-server, administrative scripts)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Vadim A. Misbakh-Soloviev <mva@mva.name>
+# * Bapt <bapt@tuxfamily.org>
+# * kaworu <kaworu@kaworu.ch>
+# * David Durrleman <dualmoo@gmail.com>
+# * oberyno <oberyno@gmail.com>
+# * Mamoru Komachi <usata@usata.org>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+#<sys-apps/portage-2.1.4.4>
+# TODO: <sys-apps/portage-2.2_aplha*> (sets, some other candies)
+#
+# Status:
+# emerge (fully done)
+# ebuild (fully done)
+# emaint (fully done)
+# env-update (fully done)
+# portageq (fully done)
+# repoman (fully done)
+# tbz2tool (fully done)
+# xpak (nothing todo)
+
+
+# Stuff for ebuild
+_ebuild () {
+ if (( CURRENT == 2 ));then
+ _files -g \*.ebuild
+ elif (( CURRENT > 2 ));then
+ _values "ebuild command" \
+ 'clean[Cleans the temporary build directory]' \
+ 'help[Show help]' \
+ 'setup[Run all package specific setup actions and exotic system checks]' \
+ 'fetch[Fetch all necessary files]' \
+ 'digest[Creates a digest file for the package]' \
+ 'unpack[Extracts the sources to a subdirectory in the build directory]' \
+ 'compile[Compiles the extracted sources by running the src_compile()]' \
+ 'preinst[Run specific actions that need to be done before installation]' \
+ 'install[Installs the package to the temporary install directory]' \
+ 'postinst[Run specific actions that need to be done after installation]' \
+ 'qmerge[Installs the package to the filesystem]' \
+ 'merge[perform the following actions: fetch, unpack, compile, install and qmerge]' \
+ 'unmerge[Remove the installed files of the packages]' \
+ 'prerm[Run specific actions that need to be executed before unmerge]' \
+ 'postrm[Run specific actions that need to be executed after unmerge]' \
+ 'config[Run specific actions needed to be executed after the emerge process has completed]' \
+ 'package[This command is a lot like the merge command, but creates a .tbz2 package instead of installing]' \
+ 'manifest[Updates the manifest file for the package]' \
+ 'rpm[Builds a RedHat RPM package]'
+ fi
+
+}
+
+
+# Stuff for quickpkg
+
+_quickpkg () {
+ if compset -P '(\\|)(>=|<=|<|>|=)'; then
+ _arguments -s \
+ '*:installed package:_gentoo_packages installed_versions'
+ elif compset -P '(\\|)[/]'; then
+ _path_files -W / -/
+ else
+ _arguments \
+ '*:installed package:_gentoo_packages installed'
+ fi
+}
+
+# Stuff for emerge
+
+_emerge () {
+ local nopkg_opts all noask_opts bopts install_args common_args profiles
+
+ noask_opts=(-p -a --pretend --ask --regen --info --search -s --searchdesc \
+ -S --version -V --help -h --metadata)
+
+ nopkg_opts=(--resume --skipfirst -c --clean -h --help --depclean --info \
+ --metadata -P --prune --regen -s --search -S --searchdesc --sync -C \
+ --unmerge -V --version -i --inject)
+
+ bopts=($nopkg_opts -b --buildpkg -B --buildpkgonly -G --getbinpkgonly -g \
+ --getbinpkg -k --usepkg -K --usepkgonly --fetch-all-uri -f -F --fetchonly)
+
+ all=($bopts -l --changelog --columns --deep -D --emptytree -e --newuse \
+ --noconfmem --nodeps -O --noreplace -n --oneshot -1 -o --onlydeps --tree -t \
+ -u --update -U --upgradeonly)
+
+ common_args=(
+ "($noask_opts --sync)"{-p,--pretend}'[Simply display what would be done]'
+ "($noask_opts)"{-a,--ask}'[Ask what would be done]'
+ '(-d --debug --help -h --version -V)'{-d,--debug}'[Tells emerge to run the emerge command in debug mode]'
+ '(--quiet -q --verbose -v)'{-q,--quiet}'[General outcome is a reduced or condensed output]'
+ '(--verbose -v --quiet -q)'{-v,--verbose}'[Tell emerge to run in verbose mode]'
+ '--nospinner[Disables the spinner for the session]'
+ )
+ install_args=(
+ "($bopts)"{-b,--buildpkg}'[Tells emerge to build binary packages]'
+ "($bopts)"{-B,--buildpkgonly}'[Tells emerge to only build binary packages]'
+ "($nopkg_opts --emptytree -e -l --changelog --usepkgonly -K)"{-l,--changelog}'[This will show the ChangeLog]'
+ "($nopkg_opts -t --tree)--columns[Displays versions in aligned format]"
+ "($nopkg_opts -D --deep)"{-D,--deep}'[Consider the entire dependency tree of packages]'
+ "($nopkg_opts -e -l --changelog --emptytree)"{-e,--emptytree}'[Only consider glibc as installed packages]'
+ "($all --nospinner --pretend -p)"{-i,--inject}'[Portage thinks that this package is installed]'
+ "($nopkg_opts $bopts)"{-f,--fetchonly}'[Just perform fetches for all packages]'
+ "($nopkg_opts $bopts)"{-F,--fetch-all-uri}'[Fetch all possible files for all packages]'
+ "($bopts)"{-g,--getbinpkg}'[Tells emerge to download binary package]'
+ "($bopts)"{-G,--getbinpkgonly}'[As --getbinpkg, but does not use local info]'
+ "($nopkg_opts)--noconfmem[Causes portage to disregard merge records]"
+ "($nopkg_opts -O --nodeps)"{-O,--nodeps}'[Merges specified packages without merging dependencies]'
+ "($nopkg_opts -n --noreplace)"{-n,--noreplace}'[Skip packages already installed]'
+ "($nopkg_opts)"{-1,--oneshot}'[Do not add package to the world profile]'
+ "($nopkg_opts --onlydeps -o)"{-o,--onlydeps}'[Only merge (or pretend to merge) the dependencies]'
+ "($nopkg_opts --columns -t --tree)"{-t,--tree}'[Show dependency tree]'
+ "($nopkg_opts --update -u)"{-u,--update}'[Updates packages to the most recent version available]'
+ "($nopkg_opts --upgradeonly -U)"{-U,--upgradeonly}'[Do not update packages to a lower version]'
+ "($bopts)"{-k,--usepkg}'[Tells emerge to use binary packages if available]'
+ "($bopts --changelog -l)"{-K,--usepkgonly}'[Tells emerge to use binary packages only]'
+ "($all)"{-c,--clean}'[Cleans the system by removing packages]'
+ '(: -)'{-h,--help}'[Displays help]:subject:(sync config system)'
+ "(: $all)--depclean[Clean all packages that have no reason for being installed]"
+ "(: $all $noask_opts --nospinner --quiet -q)--info[This is a list of information to include in bug reports]"
+ '(: -)--metadata[Generate metadata]'
+ "($nopkg_opts --usepkgonly -K)--newuse[Include installed packages which have changed USE flags]"
+ "($all)"{-P,--prune}'[Removes all but the latest versions of matching packages]'
+ "(: $all $noask_opts --verbose -v)--regen[Causes portage to check and update the dependency cache]"
+ "(: $all $noask_opts --verbose -v)"{-s,--search}'[Searches for matches]'
+ "(: $all $noask_opts --verbose -v)"{-S,--searchdesc}'[Matches the seachdesc string against the description field]'
+ "(: $all --pretend -p)--sync[Initiates a portage tree update]"
+ "($all)"{-C,--unmerge}'[Removes all matching packages]'
+ '(: -)'{-V,--version}'[Display version info]'
+ "(: $all[3,-1])--resume[Resumes the last merge operation]"
+ "(: $all[3,-1])--skipfirst[Removes the first package in the resume list]"
+ )
+ profiles=(
+ 'world[All packages in the world profile]'
+ 'system[All packages in the system profile]'
+ )
+
+
+ # Dispatch
+ if (( $words[(I)(--(unmerge|clean|prune)|-[[:alpha:]]#(C|c|P)[[:alpha:]]#)] )) ; then
+ if compset -P '(\\|)(>=|<=|<|>|=)'; then
+ _arguments -s \
+ '*:installed package:_gentoo_packages installed_versions' && return 0
+ else
+ _arguments -s \
+ "$common_args[@]" "$install_args[@]" \
+ "*:installed package:_gentoo_packages installed" && return 0
+ fi
+
+ elif (( $words[(I)(world|system)] )) ; then
+ _arguments -s \
+ "$common_args[@]" "$install_args[@]" \
+ "($nopkg_opts[1,-2] --inject -i --oneshot -1):" && return 0
+
+ elif (( $words[(I)(--usepkgonly|-[[:alnum:]]#K[[:alnum:]]#)] )) ; then
+ _arguments -s \
+ "$common_args[@]" "$install_args[@]" \
+ '*:binary package:_gentoo_packages binary' && return 0
+
+ elif [[ $words[-3] == (--help|-h) ]] ; then
+ _message "No more arguments" && return 0
+
+ else
+ if compset -P '(\\|)(>=|<=|<|>|=)'; then
+ _arguments \
+ "*:portage:_gentoo_packages available_versions" && return 0
+
+ elif (( $words[(I)(--inject|-i)] )) ; then
+ _arguments -s \
+ "$common_args[@]" "$install_args[@]" \
+ "*:portage:_gentoo_packages available_versions" && return 0
+ else
+ _arguments -s \
+ "$common_args[@]" "$install_args[@]" \
+ "($nopkg_opts)::portage: _values 'profile' \$profiles[@] " \
+ "($nopkg_opts)::portage:_gentoo_packages sets " \
+ "($nopkg_opts)*:portage:_gentoo_packages available" && return 0
+ fi
+ fi
+}
+
+
+_emaint () {
+ _arguments -s \
+ '(: -)'{-h,--help}'[show help message and exit]' \
+ '(: -)'--version"[show program's version number and exit]" \
+ '(-c --check -f --fix)'{-c,--check}"[Check for any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))" \
+ '(-c --check -f --fix)'{-f,--fix}"[Fix any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))"
+}
+
+
+_env-update () {
+ _arguments -s '(: -)--no-ldconfig[Do not run ldconfig]'
+}
+
+
+_portageq () {
+ local action
+
+ action="$words[2]"
+
+ if (( CURRENT == 2 )); then
+ _values 'command' \
+ '--help[Show help]' \
+ 'config_protect_mask[Returns the CONFIG_PROTECT_MASK paths]' \
+ 'config_protect[Returns the CONFIG_PROTECT paths]' \
+ 'portdir[Returns PORTDIR paths]' \
+ 'contents[List the files that are installed for a given package]' \
+ 'vdb_path[Returns the path used for the var(installed) package database]' \
+ 'gentoo_mirrors[Returns the mirrors set to use in the portage configuration]' \
+ 'exithandler[MISSING DOCUMENTATION!]' \
+ 'all_best_visible[Returns all best_visible packages (without .ebuild)]' \
+ 'match[Returns a \n separated list of category/package-version]' \
+ 'metadata[Returns metadata values for the specified package]' \
+ 'best_visible[Returns category/package-version (without .ebuild)]' \
+ 'mass_best_visible[Returns category/package-version (without .ebuild)]' \
+ "has_version[Return code 0 if it's available, 1 otherwise]" \
+ 'envvar[Returns a specific environment variable as exists prior to ebuild.sh]' \
+ 'pkgdir[Returns the PKGDIR path]' \
+ 'best_version[Returns category/package-version (without .ebuild)]' \
+ 'mass_best_version[Returns category/package-version (without .ebuild)]' \
+ 'portdir_overlay[Returns the PORTDIR_OVERLAY path]' \
+ 'distdir[Returns the DISTDIR path]' \
+ 'owners[print the packages that own the files and which files belong to each package]'
+ elif (( CURRENT == 3 )); then
+ if [[ "$action" =~ (contents|(all_|mass_|)best_visible|match|metadata|(has|best)_version|owners|mass_best_version) ]]; then
+ _arguments -s '*:root:_files'
+ fi
+ elif (( CURRENT > 3 )); then
+ if [[ "$action" =~ ((mass_|)best_(visible|version)|has_version) ]]; then
+ _arguments -s '*:package:_gentoo_packages available'
+ elif [[ "$action" == owners ]]; then
+ _arguments -s '*:root:_files'
+ fi
+ fi
+}
+
+
+_repoman () {
+ local previous
+
+ previous="$words[CURRENT-1]"
+
+ _arguments -s \
+ '(--force)'--force'[Force commit to proceed, regardless of QA issues]' \
+ '(-q --quiet -v --verbose)'{-q,--quiet}'[Be less verbose about extraneous info]' \
+ '(-p --pretend -m --commitmsg -M --commitmsgfile)'{-p,--pretend}'[Don’t commit or fix anything; just show what would be done]' \
+ '(-i --include-masked)'{-i,--include-masked}'[Include masked packages in scans at category or tree level]' \
+ '(-x --xmlparse)'{-x,--xmlparse}'[Forces the metadata.xml parse check to be carried out]' \
+ '(-q --quiet -v --verbose)'{-v,--verbose}'[Displays every package name while checking]' \
+ '(-I --ignore-arches)'{-I,--ignore-arches}'[Ignore arch-specific failures (where arch != host)]' \
+ '(-m --commitmsg -M --commitmsgfile)'{-m,--commitmsg}'[Adds a commit message via the command line]:message:' \
+ '(-m --commitmsg -M --commitmsgfile)'{-M,--commitmsgfile}'[Adds a commit message from the specified file]:commit_file:_files' \
+ '(: -)'{-V,--version}'[Show version info]' \
+ '(: -)'{-h,--help}'[Show this screen]'
+
+ # if we don't have an option that cancel action, or if we don't already have an action.
+ if ! [[ "$previous" =~ (-h|-V|-m|-M|--version|--help|--commitmsg|--commitmsgfile) ]] &&
+ ! (( $words[(I)(full|last|help|scan|fix|lfull|manifest|commit)] )); then
+ _values 'action' \
+ 'full[Scan directory tree for QA issues (full listing)]' \
+ 'last[Remember report from last run]' \
+ 'help[Show this screen]' \
+ 'scan[Scan directory tree for QA issues (short listing)]' \
+ 'fix[Fix simple QA issues (stray digests, missing digests)]' \
+ 'lfull[Remember report from last run (full listing)]' \
+ 'manifest[Generate a Manifest (fetches files if necessary)]' \
+ 'commit[Scan directory tree for QA issues; if OK, commit via cvs]'
+ fi
+}
+
+
+_tbz2tool () {
+ if (( CURRENT == 2 )); then
+ _values 'action' 'join' 'split'
+ elif (( CURRENT > 2 )) && (( CURRENT < 6 )); then
+ _arguments -s '*:file:_files'
+ fi
+}
+
+
+local -A Args
+zparseopts -D -E -A Args -- -emerge
+if (( ${+Args[--emerge]} ));then
+ _emerge "$@" && return 0
+fi
+
+case "$service" in
+ emerge)
+ _emerge "$@" && return 0
+ ;;
+ ebuild)
+ _ebuild "$@" && return 0
+ ;;
+ quickpkg)
+ _quickpkg "$@" && return 0
+ ;;
+ emaint)
+ _emaint "$@" && return 0
+ ;;
+ env-update)
+ _env-update "$@" && return 0
+ ;;
+ portageq)
+ _portageq "$@" && return 0
+ ;;
+ repoman)
+ _repoman "$@" && return 0
+ ;;
+ tbz2tool)
+ _tbz2tool "$@" && return 0
+ ;;
+esac
diff --git a/src/_portage_utils b/src/_portage_utils
new file mode 100644
index 0000000..6d892c3
--- /dev/null
+++ b/src/_portage_utils
@@ -0,0 +1,189 @@
+#compdef qatom qcheck qdepends qfile qgrep qcache qlist qlop qsearch qsize quse qtbz2 qpkg qxpak
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Portage Utils (small and faster portage helper tools,
+# writen in C, partially — Gentoolkit analog).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Vadim A. Misbakh-Soloviev <mva@mva.name>
+# * Bapt <bapt@tuxfamily.org>
+# * kaworu <kaworu@kaworu.ch>
+# * David Durrleman <dualmoo@gmail.com>
+# * oberyno <oberyno@gmail.com>
+# * Mamoru Komachi <usata@usata.org>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+#<app-portage/portage-utils-0.19>
+#
+
+local common_args PORTDIR var
+var=PORTDIR
+[[ -z ${(P)var} && -r /etc/make.conf ]] &&
+local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
+[[ -z ${(P)var} && -r /etc/make.globals ]] &&
+local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
+common_args=(
+ {'(--verbose)-v','(-v)--verbose'}'[Make a lot of noise]' \
+ {'(--quiet)-q','(-q)--quiet'}'[Tighter output; suppress warnings]' \
+ {'(--nocolor)-C','(-C)--nocolor'}'[Do not output color]' \
+ {'(--help)-h','(-h)--help'}'[Print this help and exit]' \
+ {'(--version)-V','(-V)--version'}'[Print version and exit]' \
+)
+case $service in
+qcheck)
+ _arguments -s $common_args \
+ {'(--all)-a','(-a)--all'}'[List all packages]' \
+ {'(--update)-u','(-u)--update'}'[Update chksum and mtimes for packages]' \
+ '*:packages:_gentoo_packages installed'
+;;
+qdepends)
+ _arguments -s $common_args \
+ {'(--depend)-d','(-d)--depend'}'[Show DEPEND info (default)]' \
+ {'(--rdepend)-r','(-r)--rdepend'}'[Show RDEPEND info]' \
+ {'(--pdepend)-p','(-p)--pdepend'}'[Show PDEPEND info]' \
+ {'(--key)-k','(-k)--key'}'[User defined vdb key]' \
+ {'(--query)-Q','(-Q)--query'}'[Query reverse deps]' \
+ {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
+ {'(--all)-a','(-a)--all'}'[Show all DEPEND info]' \
+ '*:packages:_gentoo_packages installed'
+;;
+qfile)
+ _arguments -s $common_args \
+ {'(--exact)-e','(-e)--exact'}'[Exact match]' \
+ '*:filename:_files'
+;;
+qgrep)
+ _arguments -s $common_args \
+ {'(--invert-match)-I','(-I)--invert-match'}'[Select non-matching lines]' \
+ {'(--ignore-case)-i','(-i)--ignore-case'}'[Ignore case distinctions]' \
+ {'(--with-filename)-H','(-H)--with-filename'}'[Print the filename for each match]' \
+ {'(--count)-c','(-c)--count'}'[Only print a count of matching lines per FILE]' \
+ {'(--regexp)-e','(-e)--regexp'}'[Use PATTERN as a regular expression]' \
+ '*:pattern::'
+;;
+qcache)
+ local arches allarches arch
+ show_archs(){
+ arches=(${(f)"$(<$PORTDIR/profiles/arch.list)"})
+ allarches=($archs)
+ for arch in $arches;do
+ allarches=($allarches $arch)
+ done
+ _describe -t available-arches "arch" allarches
+ }
+ _arguments -s $common_args \
+ '*:arch:show_archs'
+;;
+qlist)
+ _arguments -s $common_args \
+ {'(--installed)-I','(-I)--installed'}'[Just show installed packages]' \
+ {'(--slots)-S','(-S)--slots'}'[Display installed packages with slots]' \
+ {'(--umap)-U','(-U)--umap'}'[Display installed packages with flags used]' \
+ {'(--dups)-D','(-D)--dups'}'[Only show package dups]' \
+ {'(--exact)-e','(-e)--exact'}'[Exact match (only CAT/PN or PN without PV)]' \
+ {'(--all)-a','(-a)--all'}'[Show every installed package]' \
+ {'(--dir)-d','(-d)--dir'}'[Only show directories]' \
+ {'(--obj)-o','(-o)--obj'}'[Only show objects]' \
+ {'(--sym)-s','(-s)--sy'}'[Only show symlinks]' \
+ '*:packages:_gentoo_packages installed'
+;;
+qlop)
+ _arguments -s $common_args \
+ {'(--guage)-g','(-g)--guage'}'[Guage number of times a package has been merged]' \
+ {'(--time)-t','(-t)--time'}'[Calculate merge time for a specific package]' \
+ {'(--human)-H','(-H)--human'}'[Print seconds in human readable format (needs -t)]' \
+ {'(--list)-l','(-l)--list'}'[Show merge history]' \
+ {'(--unlist)-u','(-u)--unlist'}'[Show unmerge history]' \
+ {'(--sync)-s','(-s)--sync'}'[Show sync history]' \
+ {'(--current)-c','(-c)--current'}'[Show current emerging packages]' \
+ {'(--logfile)-f','(-f)--logfile'}'[Read emerge logfile instead of /var/log/emerge.log]:log:_files' \
+ '*:packages:_gentoo_packages available'
+;;
+qsearch)
+ _arguments -s $common_args \
+ {'(--all)-a','(-a)--all'}'[List the descriptions of every package in the cache]' \
+ {'(--cache)-c','(-c)--cache'}'[Use the portage cache]' \
+ {'(--search)-s','(-s)--search'}'[Regex search package basenames]' \
+ {'(--desc)-S','(-S)--desc'}'[Regex search package descriptions]' \
+ {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
+ {'(--homepage)-H','(-H)--homepage'}'[Show homepage info]' \
+ '*:pattern::'
+;;
+qsize)
+ _arguments -s $common_args \
+ {'(--filesystem)-f','(-f)--filesystem'}'[Show size used on disk]' \
+ {'(--all)-a','(-a)--all'}'[Size all installed packages]' \
+ {'(--sum)-s','(-s)--sum'}'[Include a summary]' \
+ {'(--sum-only)-S','(-S)--sum-only'}'[Show just the summary]' \
+ {'(--megabyte)-m','(-m)--megabyte'}'[Display size in megabytes]' \
+ {'(--kilobyte)-k','(-k)--kilobyte'}'[Display size in kilobytes]' \
+ {'(--byte)-b','(-b)--byte'}'[Display size in bytes]' \
+ '*:packages:_gentoo_packages installed'
+;;
+quse)
+ _arguments -s $common_args \
+ {'(--exact)-e','(-e)--exact'}'[Show exact non regexp matching using strcmp]' \
+ {'(--all)-a','(-a)--all'}'[Show annoying things in IUSE]' \
+ {'(--keywords)-K','(-K)--keywords'}'[Use the KEYWORDS vs IUSE]' \
+ {'(--license)-L','(-L)--license'}'[Use the LICENSE vs IUSE]' \
+ {'(--describe)-D','(-D)--describe'}'[Describe the USE flag]' \
+ {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
+ '*:use flag:_gentoo_packages useflag'
+;;
+qtbz2)
+ _arguments -s $common_args \
+ {'(--join -s --split -t --tarbz2 -x --xpak)-j','(-t --tarbz2 -j -s --split -x --xpak)--join'}'[Join tar.bz2 + xpak into a tbz2]:*:tar.bz2 file and xpak file:_files -g \*.\(tar.bz2\|xpak\)' \
+ {'(--join -j --split -t --tarbz2 -x --xpak)-s','(-t --tarbz2 -j --join -s -x --xpak)--split'}'[Split a tbz2 into a tar.bz2 + xpak]:tbz2 file:_files -g \*.tbz2' \
+ {'(--join -j -s --split --tarbz2 -x --xpak)-t','(--join -j -s --split -t -x --xpak)--tarbz2'}'[Just split the tar.bz2]:tbz2 file:_files -g \*.tbz2' \
+ {'(--join -j -s --split -t --tarbz2 --xpak)-x','(--join -j -s --split -t --tarbz2 -x)--xpak'}'[Just split the xpak]:tbz2 file:_files -g \*.tbz2' \
+ {'(--stdout)-O','(-O)--stdout'}'[Write files to stdout]'
+;;
+qpkg)
+ _arguments -s $common_args \
+ {'(--pretend)-p','(-p)--pretend'}'[pretend only]' \
+ {'(--pkgdir)-P','(-P)--pkgdir'}'[alternate package directory]:alternate pkgdir:_files -/' \
+ '*:Installed packages:_gentoo_packages installed_versions'
+;;
+qxpak)
+ _arguments -s $common_args \
+ {'(--list --extract -x --create -c)-l','(-l --extract -x --create -c)--list'}'[List the contents of an archive]:xpak archive:_files -g \*.xpak' \
+ {'(--list -l --extract --create -c)-x','(--list -l -x --create -c)--extract'}'[Extract the contents of an archive]:xpak archive:_files -g \*.xpak' \
+ {'(--list -l --extract -x --create)-c','(--list -l --extract -x -c)--create'}'[Create an archive of a directory/files]:*:archive name and files to archive:_files' \
+ {'(--dir)-d','(-d)--dir'}'[Change to specified directory]:directory:_files -/' \
+ {'(--stdout)-O','(-O)--stdout'}'[Write files to stdout]'
+
+;;
+esac
diff --git a/src/_pygmentize b/src/_pygmentize
new file mode 100644
index 0000000..6d2594f
--- /dev/null
+++ b/src/_pygmentize
@@ -0,0 +1,142 @@
+#compdef pygmentize
+# ------------------------------------------------------------------------------
+# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for pygmentize.
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Hideo Hattori <hhatto.jp@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+_pygmentize() {
+ local context state line
+
+ _arguments -s -S \
+ '-h[prints help]:' \
+ '-V[prints the package version]:' \
+ '-L[lists lexers, formatters, styles or filters]:args:(lexers formatters styles filters):' \
+ '-f[formatter]:FORMATTER:_get_formatters' \
+ '-o[output file]:FILENAME:_gnu_generic' \
+ '(-h -V -L -f -o -S -F -H -g -l)-N[guesses and prints out a lexer name based solely on given filename]:FILENAME:_files:' \
+ '(-h -V -L -o -F -H -g -l -N)-S[style]:STYLE:_get_styles' \
+ '-F[filter]:STYLE:_get_filters' \
+ '-H[prints detailed help for the object <name> of type <type>]:' \
+ '(-g)-l[lexer]::LEXER:_get_lexers:' \
+ '(-l)-g[attempt to guess the lexer from the file contents]' \
+ '*:args:_gnu_generic'
+}
+
+
+_get_filters() {
+ local cache_policy
+ zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
+ if [[ -z "$cache_policy" ]]; then
+ zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy
+ fi
+
+ if ( [[ ${+_pygmentize_filters} -eq 0 ]] || _cache_invalid pygmentize_filters ) \
+ && ! _retrieve_cache pygmentize_filters; then
+ _pygmentize_filters=(${${(f)"$(pygmentize -L filters | grep '* ' | cut -c3- | sed -e 's/:$//')"}})
+ _store_cache pygmentize_filters _pygmentize_filters
+ fi
+
+ local expl
+ _wanted pygmentize_filters expl 'pygmentize filters' compadd -a _pygmentize_filters
+}
+
+
+(( $+functions[_pygmentize_get_formatters] )) ||
+_get_formatters() {
+ local cache_policy
+ zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
+ if [[ -z "$cache_policy" ]]; then
+ zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy
+ fi
+
+ if ( [[ ${+_pygmentize_formatter} -eq 0 ]] || _cache_invalid pygmentize_formatter ) \
+ && ! _retrieve_cache pygmentize_formatter; then
+ _pygmentize_formatter=(${${(f)"$(pygmentize -L formatters | grep '* ' | cut -c3- | sed -e 's/, /\n/g' -e 's/:$//')"}})
+ _store_cache pygmentize_formatter _pygmentize_formatter
+ fi
+
+ local expl
+ _wanted pygmentize_formatter expl 'pygmentize formatters' compadd -a _pygmentize_formatter
+}
+
+
+_get_lexers() {
+ local cache_policy
+ zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
+ if [[ -z "$cache_policy" ]]; then
+ zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy
+ fi
+
+ if ( [[ ${+_pygmentize_lexer} -eq 0 ]] || _cache_invalid pygmentize_lexer ) \
+ && ! _retrieve_cache pygmentize_lexer; then
+ _pygmentize_lexer=(${${(f)"$(pygmentize -L lexers | grep '* ' | cut -c3- | sed -e 's/, /\n/g' -e 's/:$//')"}})
+ _store_cache pygmentize_lexer _pygmentize_lexer
+ fi
+
+ local expl
+ _wanted pygmentize_lexer expl 'pygmentize lexers' compadd -a _pygmentize_lexer
+}
+
+
+_get_styles() {
+ local cache_policy
+ zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
+ if [[ -z "$cache_policy" ]]; then
+ zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy
+ fi
+
+ if ( [[ ${+_pygmentize_style} -eq 0 ]] || _cache_invalid pygmentize_style ) \
+ && ! _retrieve_cache pygmentize_style; then
+ _pygmentize_style=(${${(f)"$(pygmentize -L styles | grep '* ' | cut -c3- | sed -e 's/:$//')"}})
+ _store_cache pygmentize_style _pygmentize_style
+ fi
+
+ local expl
+ _wanted pygmentize_style expl 'pygmentize styles' compadd -a _pygmentize_style
+}
+
+
+_pygmentize_caching_policy() {
+ local -a oldp
+ oldp=( "$1"(Nmh+24) ) # 24 hour
+ (( $#oldp ))
+}
+
+_pygmentize "$@"
diff --git a/src/_redis-cli b/src/_redis-cli
new file mode 100644
index 0000000..c3657e6
--- /dev/null
+++ b/src/_redis-cli
@@ -0,0 +1,158 @@
+#compdef redis-cli rec
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Redis (http://redis.io).
+#
+# Source: https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/redis-cli
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Alexandru Totolici (https://github.com/totolici)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'append:append a value to a key'
+ 'auth:authenticate to the server'
+ 'bgrewriteeaof:asynchronously rewrite the append-only file'
+ 'bgsave:asynchornously save the dataset to disk'
+ 'blpop:remove and get the first element in a list, or block until one is available'
+ 'brpop:remove and get the last element in a list, or block until one is available'
+ 'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available'
+ # 'config get:get the value of a configuration parameter'
+ # 'config set:set a configuration parameter to the given value'
+ # 'config resetstat: reset the stats returned by INFO'
+ 'dbsize:return the number of keys in the selected database'
+ # 'debug object:get debugging information about a key'
+ # 'debug setgfault:make the server crash'
+ 'decr:decrement the integer value of a key by one'
+ 'decrby:decrement the integet value of a key by the given number'
+ 'del:delete a key'
+ 'discard:discard all commands issued after MULTI'
+ 'echo:echo the given string'
+ 'exec:execute all commands issued after a MULTI'
+ 'exists:determine if a key exists'
+ 'expire:set the time to live for a key, in seconds'
+ 'expireat:set the expiration for a key as a UNIX timestamp'
+ 'flushall:remove all keys from all databases'
+ 'flushdb:remove all keys from the current database'
+ 'get:get the value of a key'
+ 'getbit:returns the bit value at offset in the string value stored at key'
+ 'getrange:get a substring of the string stored at a key'
+ 'getset:set the string value of a key and return its old value'
+ 'hdel:delete a hash field'
+ 'hexists:determine if a hash field exists'
+ 'hget:get the value of a hash field'
+ 'hgetall:get all the fields and values in a hash'
+ 'hincrby:increment the integer value of a hash field by the given number'
+ 'hkeys:get all the fields in a hash'
+ 'hlen:get the number of fields in a hash'
+ 'hmget:get the values of all the given hash fields'
+ 'hmset:set multiple hash fields to multiple values'
+ 'hset:set the string value of a hash field'
+ 'hsetnx:set the value of a hash field, only if the field does not exist'
+ 'hvals:get all the values in a hash'
+ 'incr:increment the integer value of a key by one'
+ 'incrby:increment the integer value of a key by the given number'
+ 'info:get information and statistics about the server'
+ 'keys:find all keys matching the given pattern'
+ 'lastsave:get the UNIX timestamp of the last successful save to disk'
+ 'lindex:get an element from a list by its index'
+ 'linsert:insert an element before or after another element in a list'
+ 'llen:get the length of a list'
+ 'lpop:remove and get the first element in a list'
+ 'lpush:prepend a value to a list'
+ 'lpushx:prepend a value to a list, only if the list exists'
+ 'lrange:get a range of elements from a list'
+ 'lrem:remove elements from a list'
+ 'lset:set the value of an element in a list by its index'
+ 'ltrim:trim a list to the specified range'
+ 'mget:get the values of all the given keys'
+ 'monitor:listen for all requests received by the server in real time'
+ 'move:move a key to another database'
+ 'mset:set multiple keys to muliple values'
+ 'msetnx:set multiple keys tom ultiple values, only if none of the keys exist'
+ 'multi:mark the start of a transaction block'
+ 'object:inspect the internals of Redis objects'
+ 'persist:remove the expiration from a key'
+ 'ping:ping the server'
+ 'psubscribe:listen for messages published to channels matching the given patterns'
+ 'publish:post a message to a channel'
+ 'punsubscribe:stop listening for messages posted to channels matching the given patterns'
+ 'quit:close the connection'
+ 'randomkey:return a random key from the keyspace'
+ 'rename:rename a key'
+ 'renamenx:rename a key, only if the new key does not exist'
+ 'rpop:remove and get the last element in a list'
+ 'rpoplpush:remove the last element in a list, append it to another list and return it'
+ 'rpush:append a value to a list'
+ 'rpushx:append a value to a list, only if the list exists'
+ 'sadd:add a member to a set'
+ 'save:synchronously save the dataset to disk'
+ 'scard:get the number of members in a set'
+ 'sdiff:subtract multiple sets'
+ 'sdiffstore:subtract multiple sets and store the resulting set in a key'
+ 'select:change the selected database for the current connection'
+ 'set:set the string value of a key'
+ 'setbit:sets or clears the bit at offset in the string value stored at key'
+ 'setex:set the value and expiration of a key'
+ 'setnx:set the value of a key, only if the key does not exist'
+ 'setrange:overwrite part of a string at key starting at the specified offset'
+ 'shutdown:synchronously save the dataset to disk and then shut down the server'
+ 'sinter:intersect multiple sets'
+ 'sinterstore:intersect multiple sets and store the resulting set in a key'
+ 'sismember:determine if a given value is a member of a set'
+ 'slaveof:make the server a slave of another instance, or promote it as master'
+ 'smembers:get all the members in a set'
+ 'smove:move a member from one set to another'
+ 'sort:sort the elements in a list, set or sorted set'
+ 'spop:remove and return a random member from a set'
+ 'srandmember:get a random member from a set'
+ 'srem:remove a member from a set'
+ 'strlen:get the length of the value stored in a key'
+ 'subscribe:listen for messages published to the given channels'
+ 'sunion:add multiple sets'
+ 'sunionstore:add multiple sets and store the resulting set in a key'
+ 'ttl:get the time to live for a key'
+ 'type:determine the type stored at key'
+ 'unsubscribe:stop listening for messages posted to the given channels'
+ 'unwatch:forget about all watched keys'
+ 'watch:watch the given keys to determine execution of the MULTI/EXEC block'
+ 'zadd:add a member to a sorted set, or update its score if it already exists'
+ 'zcard:get the number of members in a sorted set'
+ 'zcount:count the members in a sorted set with scores within the given values'
+ 'zincrby:increment the score of a member in a sorted set'
+ 'zinterstore:intersect multiple sorted sets and store the resulting sorted set in a new key'
+ 'zrange:return a range of members in a sorted set, by index'
+ 'zrangebyscore:return a range of members in a sorted set, by score'
+ 'zrank:determine the index of a member in a sorted set'
+ 'zrem:remove a member from a sorted set'
+ 'zremrangebyrank:remove all members in a sorted set within the given indexes'
+ 'zremrangebyscore:remove all members in a sorted set within the given scores'
+ 'zrevrange:return a range of membrs in a sorted set, by index, with scores ordered from high to low'
+ 'zrevrangebyscore:return a range of members in a sorted set, by score, with scores ordered from high to low'
+ 'zrevrank:determine the index of a member in a sorted set, with scores ordered from high to low'
+ 'zscore:get the score associated with the given member in a sorted set'
+ 'zunionstore:add multiple sorted sets and store te resulting sorted set in a new key'
+)
+
+local expl
+
+_arguments \
+ '(-v --version)'{-v,--version}'[show version]' \
+ '(-h --help)'{-h,--help}'[show help]' \
+ '*:: :->subcmds' && return 0
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "redis-cli subcommand" _1st_arguments
+ return
+fi
diff --git a/src/_rvm b/src/_rvm
new file mode 100644
index 0000000..a252786
--- /dev/null
+++ b/src/_rvm
@@ -0,0 +1,118 @@
+#compdef rvm
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for rvm (https://rvm.beginrescueend.com/).
+#
+# Source: https://github.com/wayneeseguin/rvm/blob/master/scripts/zsh/Completion/_rvm
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Bruno Michel (https://github.com/nono)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local curcontext="$curcontext" state line cmds ret=1
+
+_arguments -C \
+ '(- 1 *)'{-v,--version}'[display version information]' \
+ '(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \
+ '(--prefix)--prefix[path for all rvm files (~/.rvm/), with trailing slash!]:path:_files' \
+ '(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \
+ '(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \
+ '(--archives)--archives[directory for downladed files (~/.rvm/archives/)]:path:_files' \
+ '-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \
+ '-e[Execute code from the command line]:code' \
+ '(-G)-G[root gem path to use]:path:_files' \
+ '(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \
+ '(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \
+ '(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \
+ '(-C|--configure)'{-C,--configure}'=[custom configure options]' \
+ '(--nice)--nice[process niceness (for slow computers, default 0)]:number' \
+ '(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \
+ '(--head)--head[with update, updates rvm to git head version]' \
+ '(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \
+ '(--default)--default[with ruby select, sets a default ruby for new shells]' \
+ '(--debug)--debug[Toggle debug mode on for very verbose output]' \
+ '(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \
+ '(--force)--force[Force install, removes old install & source before install]' \
+ '(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \
+ '(--latest)--latest[with gemset --dump skips version strings for latest gem]' \
+ '(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \
+ '(--docs)--docs[with install, attempt to generate ri after installation]' \
+ '(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \
+ '1: :->cmds' \
+ '*: :->args' && ret=0
+
+case $state in
+
+ cmds)
+
+ cmds=( ${(f)"$(_call_program commands rvm help 2> /dev/null | sed -e '/^== Action/,/^== Implementation/!d; / - /!d; s/^[ *]*\([^ ]*\) *\- *\(.*\)/\1:\2/')"} )
+ cmds+=( $(rvm list strings) )
+ _describe -t commands 'rvm command' cmds && ret=0
+ ;;
+
+ args)
+
+ case $line[1] in
+
+ (use|uninstall|remove|list)
+
+ if (( CURRENT == 3 )); then
+ # See if we’ve made it to the ‘@’; eg, 1.9.2@
+ if ! \grep -q '@' <<< "${line[CURRENT-1]}" ; then
+ _values -S , 'rubies' \
+ $(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') \
+ default system $(rvm alias list | cut -d' ' -f1) && ret=0
+ else
+ # Construct a full version string for each of the gemsets.
+ # Eg, 1.9.2@min 1.9.2@rail3 …
+ _values -S , 'gemsets' \
+ $(rvm ${line[CURRENT-1]%%@*} gemset list | awk '/^[ -_[:alnum:]]+$/ {print "'${line[CURRENT-1]%%@*}'@"$1}')
+ fi
+ fi
+ ;;
+
+ (install|fetch)
+
+ _values -S , 'rubies' $(rvm list known_strings) && ret=0
+ ;;
+
+ gemset)
+
+ if (( CURRENT == 3 )); then
+ _values 'gemset_commands' $(rvm gemset | sed -e '/create/!d; s/^.*[{]\(.*\)[}].*$/\1/; s/,/ /g')
+ else
+ #_values -S , 'gemsets' $(rvm gemset list | \grep -v gemset 2>/dev/null)
+ _values -S , 'gemsets' $(rvm gemset list | \grep -Ev '(gemset|info)' 2>/dev/null | awk '/^[ -_[:alnum:]]+$/ {print '$1'}')
+ fi
+ ret=0
+ ;;
+
+ package)
+
+ if (( CURRENT == 3 )); then
+ _values 'package_commands' $(rvm package | sed -e '/Usage/!d; s/^.*[{]\(.*\)[}] [{].*$/\1/; s/,/ /g')
+ else
+ _values 'packages' $(rvm package | sed -e '/Usage/!d; s/^.*[}] [{]\(.*\)[}].*$/\1/; s/,/ /g')
+ fi
+ ret=0
+ ;;
+
+ *)
+ (( ret )) && _message 'no more arguments'
+ ;;
+
+ esac
+ ;;
+esac
+
+return ret
diff --git a/src/_sbt b/src/_sbt
new file mode 100644
index 0000000..1d1b50e
--- /dev/null
+++ b/src/_sbt
@@ -0,0 +1,49 @@
+#compdef sbt
+# ------------------------------------------------------------------------------
+# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for sbt 0.10+ (https://github.com/harrah/xsbt).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Tony Sloane <inkytonik@gmail.com>
+#
+# ------------------------------------------------------------------------------
+
+function _sbt_tasks () {
+ compadd clean compile console console-project console-quick doc package \
+ package-doc package-src publish publish-local run run-main test test-only \
+ test:compile test:package test:package-doc test:package-src update
+}
+
+_arguments "*:task:_sbt_tasks"
+
+return 0
diff --git a/src/_scala b/src/_scala
new file mode 100644
index 0000000..73f82f6
--- /dev/null
+++ b/src/_scala
@@ -0,0 +1,212 @@
+#compdef scala scalac
+# ------------------------------------------------------------------------------
+# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for scala and scalac (http://www.scala-lang.org/).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Tony Sloane <inkytonik@gmail.com>
+#
+# ------------------------------------------------------------------------------
+
+typeset -A opt_args
+local context state line
+
+_scala_phases () {
+ compadd "parser" "namer" "packageobjects" "typer" "superaccessors" \
+ "pickler" "refchecks" "selectiveanf" "liftcode" "selectivecps" "uncurry" \
+ "tailcalls" "specialize" "explicitouter" "erasure" "lazyvals" "lambdalift" \
+ "constructors" "flatten" "mixin" "cleanup" "icode" "inliner" "closelim" \
+ "dce" "jvm" "terminal"
+}
+
+local -a shared_opts
+shared_opts=(
+ "-bootclasspath+[Override location of bootstrap class files]:bootstrap class directory:_files -/"
+ "-classpath+[Specify where to find user class files]:directory:_files -/"
+ "-D-[Pass -Dproperty=value directly to the runtime system]"
+ "-d+[Destination for generated classfiles]: directory or jar file:_files"
+ "-dependencyfile+[Set dependency tracking file]:dependency tracking file:_files"
+ "-deprecation[Emit warning and location for usages of deprecated APIs]"
+ "-encoding+[Specify character encoding used by source files]:encoding:"
+ "-explaintypes[Explain type errors in more detail]"
+ "-extdirs+[Override location of installed extensions]:extensions directory:_files -/"
+ "-g\:-[Set level of generated debugging info (default\: vars)]:debugging info level:(none source line vars notailcalls)"
+ "-help[Print a synopsis of standard options]"
+ "-J-[pass argument directly to Java runtime system]:JVM argument:"
+ "-javabootclasspath+[Override java boot classpath]:Java boot class path directory]:_files -/"
+ "-javaextdirs+[Override java extdirs classpath]:Java extdirs directory:_files -/"
+ "-no-specialization[Ignore @specialize annotations]"
+ "-nobootcp[Do not use the boot classpath for the scala jars]"
+ "-nowarn[Generate no warnings]"
+ "-optimise[Generate faster bytecode by applying optimisations to the program]"
+ "-P\:-[Pass an option to a plugin (written <plugin>:<opt>)]"
+ "-print[Print program with Scala-specific features removed]"
+ "-sourcepath+[Specify location(s) of source files]:source file directory:_files -/"
+ "-target\:-[Target platform for object files (default\: jvm-1.5)]:platform name:(jvm-1.5 msil)"
+ "-toolcp+[Add to the runner classpath]:directory:_files -/"
+ "-unchecked[Enable detailed unchecked (erasure) warnings]"
+ "-uniqid[Uniquely tag all identifiers in debugging output]"
+ "-usejavacp[Utilize the java.class.path in classpath resolution]"
+ "-verbose[Output messages about what the compiler is doing]"
+ "-version[Print product version and exit]"
+ "-X[Print a synopsis of advanced options]"
+ "-Y[Print a synopsis of private options]"
+)
+
+local -a X_opts
+X_opts=(
+ "-Xcheck-null[Warn upon selection of nullable reference]"
+ "-Xcheckinit[Wrap field accessors to throw an exception on uninitialized access]"
+ "-Xdisable-assertions[Generate no assertions or assumptions]"
+ "-Xelide-below+[Calls to @elidable methods are omitted if method priority is lower than integer argument]"
+ "-Xexperimental[Enable experimental extensions]"
+ "-Xfatal-warnings[Fail the compilation if there are any warnings]"
+ "-Xfuture[Turn on future language features]"
+ "-Xgenerate-phase-graph+[Generate the phase graphs (outputs .dot files) to fileX.dot]:output file:_files"
+ "-Xlint[Enable recommended additional warnings]"
+ "-Xlog-implicits[Show more detail on why some implicits are not applicable]"
+ "-Xmax-classfile-name+[Maximum filename length for generated classes]"
+ "-Xmigration[Warn about constructs whose behavior may have changed]"
+ "-Xno-forwarders[Do not generate static forwarders in mirror classes]"
+ "-Xno-uescape[Disable handling of \u unicode escapes]"
+ "-Xnojline[Do not use JLine for editing]"
+ "-Xprint\:-[Print out program after <phase>]:phase name:_scala_phases"
+ "-Xprint-icode[Log internal icode to *.icode files]"
+ "-Xprint-pos[Print tree positions, as offsets]"
+ "-Xprint-types[Print tree types (debugging option)]"
+ "-Xprompt[Display a prompt after each error (debugging option)]"
+ "-Xresident[Compiler stays resident: read source filenames from standard input]"
+ "-Xscript+[Treat the source file as a script and wrap it in a main method]:main object name"
+ "-Xshow-class+[Show internal representation of class]:class name"
+ "-Xshow-object+[Show internal representation of object]:object name"
+ "-Xshow-phases[Print a synopsis of compiler phases]"
+ "-Xsource-reader+[Specify a class name for a custom method of reading source files]:class name"
+ "-Xverify[Verify generic signatures in generated bytecode]"
+
+ "-Xassem-extdirs+[List of directories containing assemblies (requires -target:msil) (default\: lib)]:assembly directory:_files -/"
+ "-Xassem-name+[Name of the output assembly (requires -target:msil)]:assembly name:_files"
+ "-Xassem-path+[List of assemblies referenced by the program (requires -target:msil)]:assembly path:_files"
+ "-Xsourcedir+[Mirror source folder structure in output directory (requires -target:msil)]:source directory:_files -/".
+
+ "-Xplugin\:-[Load one or more plugins from file]:plugin file:_files"
+ "-Xpluginsdir+[Path to search compiler plugins]:plugin directory:_files -/"
+ "-Xplugin-list[Print a synopsis of loaded plugins]"
+ "-Xplugin-disable\:-[Disable the given plugin(s)]"
+ "-Xplugin-require\:-[Abort unless the given plugin(s) are available]"
+)
+
+local -a Y_opts
+Y_opts=(
+ "-Y[Print a synopsis of private options]"
+ "-Ybuild-manager-debug[Generate debug information for the Refined Build Manager compiler]"
+ "-Ybuilder-debug\:-[Compile using the specified build manager (default\: none)]:build manager:(none refined simple)"
+ "-Yclosure-elim[Perform closure elimination]"
+ "-Ycompact-trees[Use compact tree printer when displaying trees]"
+ "-Ydead-code[Perform dead code elimination]"
+ "-Ydependent-method-types[Allow dependent method types]"
+ "-Ygen-javap+[Generate a parallel output directory of .javap files]:output directory:_files -/"
+ "-Yinfer-argument-types[Infer types for arguments of overriden methods]"
+ "-Yinline[Perform inlining when possible]"
+ "-Ylinearizer\:-[Linearizer to use (default\: rpo)]:linearizer:(normal dfs rpo dump)"
+ "-Ylog-classpath[Output information about what classpath is being applied]"
+ "-Yno-completion[Disable tab-completion in the REPL]"
+ "-Yno-generic-signatures[Suppress generation of generic signatures for Java]"
+ "-Yno-imports[Compile without any implicit imports]"
+ "-Yno-self-type-checks[Suppress check for self-type conformance among inherited members]"
+ "-Yno-squeeze[Disable creation of compact code in matching]"
+ "-Ynotnull[Enable (experimental and incomplete) scala.NotNull]"
+ "-Ypmat-naive[Desugar matches as naively as possible]"
+ "-Ypresentation-delay+[Wait number of ms after typing before starting typechecking]"
+ "-Ypresentation-log+[Log presentation compiler events into file]:log file:_files"
+ "-Ypresentation-replay+[Replay presentation compiler events from file]:log file:_files"
+ "-Yprofile-class+[Specify name of profiler class]:profiler class name"
+ "-Yprofile-memory[Heap snapshot after compiler run (requires jgpagent on JVM -agentpath)]"
+ "-Yrangepos[Use range positions for syntax trees]"
+ "-Yrecursion+[Set recursion depth used when locking symbols]"
+ "-Yrepl-sync[Do not use asynchronous code for REPL startup]"
+ "-Ypresentation-verbose[Print information about presentation compiler tasks]"
+ "-Yresolve-term-conflict\:-[Resolve term conflicts (default\: error)]:resolution strategy:(package object error)"
+ "-Yrich-exceptions[Fancier exceptions. Set source search path with -Dscala.control.sourcepath]"
+ "-Yself-in-annots[Include a \"self\" identifier inside of annotations]"
+ "-Yshow\:-[Show after <phase> (requires -Xshow-class or -Xshow-object)]:phase name:_scala_phases"
+ "-Yshow-syms[Print the AST symbol hierarchy after each phase]"
+ "-Yshow-trees[Print detailed ASTs (requires -Xprint:phase)]"
+ "-Ystatistics[Print compiler statistics]"
+ "-Ystruct-dispatch\:-[Structural method dispatch policy (default\: poly-cache)]:policy name:(no-cache mono-cache poly-cache invoke-dynamic)"
+
+ "-Ybrowse\:-[Browse the abstract syntax tree after <phase>]:phase name:_scala_phases"
+ "-Ycheck\:-[Check the tree at the end of <phase>]:phase name:_scala_phases"
+ "-Ylog\:-[Log operations during <phase>]:phase name:_scala_phases"
+ "-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:_scala_phases"
+ "-Yskip\:-[Skip <phase>]:phase name:_scala_phases"
+ "-Ystop-after\:-[Stop after given phase <phase>]:phase name:_scala_phases"
+ "-Ystop-before\:-[Stop before given phase <phase>]:phase name:_scala_phases"
+
+ "-Ywarn-all[Enable all -Y warnings]"
+ "-Ywarn-dead-code[Warn when dead code is identified]"
+ "-Ywarn-inaccessible[Warn about inaccessible types in method signatures]"
+ "-Ywarn-nullary-override[Warn when non-nullary overrides nullary, e.g. def foo() over def foo]"
+ "-Ywarn-nullary-unit[Warn when nullary methods return Unit]"
+ "-Ywarn-numeric-widen[Warn when numerics are widened]"
+ "-Ywarn-value-discard[Warn when non-Unit expression results are unused]"
+
+ "-Ycompletion-debug[Trace all tab completion activity]"
+ "-Ydebug[Increase the quantity of debugging output]"
+ "-Ydoc-debug[Trace all scaladoc activity]"
+ "-Yide-debug[Generate, validate and output trees using the interactive compiler]"
+ "-Yinfer-debug[Trace type inference and implicit search]"
+ "-Ypmat-debug[Trace all pattern matcher activity]"
+ "-Ypresentation-debug[Enable debugging output for the presentation compiler]"
+ "-Yrepl-debug[Trace all REPL activity]"
+ "-Ytyper-debug[Trace all type assignments]"
+)
+
+local -a scala_opts
+scala_opts=(
+ "-e+[execute <string> as if entered in the repl]:string" \
+ "-howtorun+[what to run (default\: guess)]:execution mode:(script object jar guess)" \
+ "-i+[preload <file> before starting the repl]:file to preload:_files" \
+ "-nc[no compilation daemon\: do not use the fsc offline compiler]" \
+ "-save[save the compiled script in a jar for future use]"
+)
+
+case $words[$CURRENT] in
+ -X*) _arguments $X_opts;;
+ -Y*) _arguments $Y_opts;;
+ *) case $service in
+ scala) _arguments $scala_opts $shared_opts "*::filename:_files";;
+ scalac) _arguments $shared_opts "*::filename:_files";;
+ esac
+esac
+
+return 0
diff --git a/src/_setup.py b/src/_setup.py
new file mode 100644
index 0000000..e5bbbda
--- /dev/null
+++ b/src/_setup.py
@@ -0,0 +1,703 @@
+#compdef setup.py
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for setup.py (http://docs.python.org/distutils/).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Hideo Hattori (https://github.com/hhatto)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+_setup.py() {
+ typeset -A opt_args
+ local context state line
+
+ _arguments -s -S \
+ "--verbose[run verbosely (default)]" \
+ "-v[run verbosely (default)]" \
+ "--quiet[run quietly (turns verbosity off)]" \
+ "-q[run quietly (turns verbosity off)]" \
+ "--dry-run[don't actually do anything]" \
+ "-n[don't actually do anything]" \
+ "--help[show detailed help message]" \
+ "-h[show detailed help message]" \
+ "--no-user-cfg[ignore pydistutils.cfg in your home directory]" \
+ "--command-packages=[list of packages that provide distutils commands]" \
+ "--help-commands[list all available commands]" \
+ "--name[print package name]" \
+ "--version[print package version]" \
+ "-V[print package version]" \
+ "--fullname[print <package name>-<version>]" \
+ "--author[print the author's name]" \
+ "--author-email[print the author's email address]" \
+ "--maintainer[print the maintainer's name]" \
+ "--maintainer-email[print the maintainer's email address]" \
+ "--contact[print the maintainer's name if known, else the author's]" \
+ "--contact-email[print the maintainer's email address if known, else the author's]" \
+ "--url[print the URL for this package]" \
+ "--license[print the license of the package]" \
+ "--licence[alias for --license]" \
+ "--description[print the package description]" \
+ "--long-description[print the long package description]" \
+ "--platforms[print the list of platforms]" \
+ "--classifiers[print the list of classifiers]" \
+ "--keywords[print the list of keywords]" \
+ "--provides[print the list of packages/modules provided]" \
+ "--requires[print the list of packages/modules required]" \
+ "--obsoletes[print the list of packages/modules made obsolete]" \
+ "*::setup.py commands:_setuppy_command"
+}
+
+(( $+functions[_setuppy_command] )) ||
+_setuppy_command() {
+ local cmd ret=1
+
+ (( $+setuppy_cmds )) || _setuppy_cmds=(
+ "build:build everything needed to install" \
+ "build_py:\"build\" pure Python modules (copy to build directory)" \
+ "build_ext:build C/C++ extensions (compile/link to build directory)" \
+ "build_clib:build C/C++ libraries used by Python extensions" \
+ "build_scripts:\"build\" scripts (copy and fixup #! line)" \
+ "clean:clean up temporary files from 'build' command" \
+ "install:install everything from build directory" \
+ "install_lib:install all Python modules (extensions and pure Python)" \
+ "install_headers:install C/C++ header files" \
+ "install_scripts:install scripts (Python or otherwise)" \
+ "install_data:install data files" \
+ "sdist:create a source distribution (tarball, zip file, etc.)" \
+ "register:register the distribution with the Python package index" \
+ "bdist:create a built (binary) distribution" \
+ "bdist_dumb:create a \"dumb\" built distribution" \
+ "bdist_rpm:create an RPM distribution" \
+ "bdist_wininst:create an executable installer for MS Windows" \
+ "upload:upload binary package to PyPI" \
+ "check:perform some checks on the package" \
+ "alias:define a shortcut to invoke one or more commands" \
+ "bdist_egg:create an \"egg\" distribution" \
+ "develop:install package in 'development mode'" \
+ "easy_install:Find/get/install Python packages" \
+ "egg_info:create a distribution's .egg-info directory" \
+ "rotate:delete older distributions, keeping N newest files" \
+ "saveopts:save supplied options to setup.cfg or other config file" \
+ "setopt:set an option in setup.cfg or another config file" \
+ "test:run unit tests after in-place build" \
+ "install_egg_info:Install an .egg-info directory for the package" \
+ "upload_docs:Upload documentation to PyPI" \
+ )
+
+ if (( CURRENT == 1 )); then
+ _describe -t commands 'setup.py subcommand' _setuppy_cmds || compadd "$@" - ${(s.:.)${(j.:.)_setuppy_syns}}
+ else
+ local curcontext="$curcontext"
+
+ cmd="${${_setuppy_cmds[(r)$words[1]:*]%%:*}:-${(k)_setuppy_syns[(r)(*:|)$words[1](:*|)]}}"
+ if (( $#cmd )); then
+ curcontext="${curcontext%:*:*}:setuppy-${cmd}:"
+ _call_function ret _setuppy_$cmd || _message 'no more arguments'
+ else
+ _message "unknown setup.py command: $words[1]"
+ fi
+ return ret
+ fi
+}
+
+(( $+functions[_setuppy_build] )) ||
+_setuppy_build() {
+ _arguments -s \
+ "--build-base=[base directory for build library]" \
+ "-b[base directory for build library]" \
+ "--build-purelib=[build directory for platform-neutral distributions]" \
+ "--build-platlib=[build directory for platform-specific distributions]" \
+ "--build-lib=[build directory for all distribution (defaults to either build-purelib or build-platlib]" \
+ "--build-scripts=[build directory for scripts]" \
+ "--build-temp=[temporary build directory]" \
+ "-t[temporary build directory]" \
+ "--plat-name=[platform name to build for, if supported (default: linux-i686)]" \
+ "-p[platform name to build for, if supported (default: linux-i686)]" \
+ "--compiler=[specify the compiler type]" \
+ "-c[specify the compiler type]" \
+ "--debug[compile extensions and libraries with debugging information]" \
+ "-g[compile extensions and libraries with debugging information]" \
+ "--force[forcibly build everything (ignore file timestamps)]" \
+ "-f[forcibly build everything (ignore file timestamps)]" \
+ "--executable=[specify final destination interpreter path (build.py)]" \
+ "-e[specify final destination interpreter path (build.py)]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_build_py] )) ||
+_setuppy_build_py() {
+ _arguments -s \
+ "--build-lib=[directory to \"build\" (copy) to]" \
+ "-d[directory to \"build\" (copy) to]" \
+ "--compile[compile .py to .pyc]" \
+ "-c[compile .py to .pyc]" \
+ "--no-compile[don't compile .py files \[default\]]" \
+ "--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
+ "-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
+ "--force[forcibly build everything (ignore file timestamps)]" \
+ "-f[forcibly build everything (ignore file timestamps)]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_build_ext] )) ||
+_setuppy_build_ext() {
+ _arguments -s \
+ "--build-lib=[directory for compiled extension modules]" \
+ "-b[directory for compiled extension modules]" \
+ "--build-temp=[directory for temporary files (build by-products)]" \
+ "-t[directory for temporary files (build by-products)]" \
+ "--plat-name=[platform name to cross-compile for, if supported (default: linux-i686)]" \
+ "-p[platform name to cross-compile for, if supported (default: linux-i686)]" \
+ "--inplace[ignore build-lib and put compiled extensions into the source directory alongside your pure Python modules]" \
+ "-i[ignore build-lib and put compiled extensions into the source directory alongside your pure Python modules]" \
+ "--include-dirs=[list of directories to search for header files (separated by ':')]" \
+ "-I[list of directories to search for header files (separated by ':')]" \
+ "--define=[C preprocessor macros to define]" \
+ "-D[C preprocessor macros to define]" \
+ "--undef=[C preprocessor macros to undefine]" \
+ "-U[C preprocessor macros to undefine]" \
+ "--libraries=[external C libraries to link with]" \
+ "-l[external C libraries to link with]" \
+ "--library-dirs=[directories to search for external C libraries (separated by ':')]" \
+ "-L[directories to search for external C libraries (separated by ':')]" \
+ "--rpath=[directories to search for shared C libraries at runtime]" \
+ "-R[directories to search for shared C libraries at runtime]" \
+ "--link-objects=[extra explicit link objects to include in the link]" \
+ "-O[extra explicit link objects to include in the link]" \
+ "--debug[compile/link with debugging information]" \
+ "-g[compile/link with debugging information]" \
+ "--force[forcibly build everything (ignore file timestamps)]" \
+ "-f[forcibly build everything (ignore file timestamps)]" \
+ "--compiler=[specify the compiler type]" \
+ "-c[specify the compiler type]" \
+ "--swig-cpp[make SWIG create C++ files (default is C)]" \
+ "--swig-opts=[list of SWIG command line options]" \
+ "--swig=[path to the SWIG executable]" \
+ "--user[add user include, library and rpath]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_build_clib] )) ||
+_setuppy_build_clib() {
+ _arguments -s \
+ "--build-clib=[directory to build C/C++ libraries to]" \
+ "-b[directory to build C/C++ libraries to]" \
+ "--build-temp=[directory to put temporary build by-products]" \
+ "-t[directory to put temporary build by-products]" \
+ "--debug[compile with debugging information]" \
+ "-g[compile with debugging information]" \
+ "--force[forcibly build everything (ignore file timestamps)]" \
+ "-f[forcibly build everything (ignore file timestamps)]" \
+ "--compiler=[specify the compiler type]" \
+ "-c[specify the compiler type]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_build_scripts] )) ||
+_setuppy_build_scripts() {
+ _arguments -s \
+ "--build-dir=[directory to \"build\" (copy) to]" \
+ "-d[directory to \"build\" (copy) to]" \
+ "--force[forcibly build everything (ignore file timestamps]" \
+ "-f[forcibly build everything (ignore file timestamps]" \
+ "--executable=[specify final destination interpreter path]" \
+ "-e[specify final destination interpreter path]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_clean] )) ||
+_setuppy_clean() {
+ _arguments -s \
+ "--build-base=[base build directory (default: 'build.build-base')]" \
+ "-b[base build directory (default: 'build.build-base')]" \
+ "--build-lib=[build directory for all modules (default: 'build.build-lib')]" \
+ "--build-temp=[temporary build directory (default: 'build.build-temp')]" \
+ "-t[temporary build directory (default: 'build.build-temp')]" \
+ "--build-scripts=[build directory for scripts (default: 'build.build-scripts')]" \
+ "--bdist-base=[temporary directory for built distributions]" \
+ "--all[remove all build output, not just temporary by-products]" \
+ "-a[remove all build output, not just temporary by-products]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_install] )) ||
+_setuppy_install() {
+ _arguments -s \
+ "--prefix=[installation prefix]" \
+ "--exec-prefix=[(Unix only) prefix for platform-specific files]" \
+ "--home=[(Unix only) home directory to install under]" \
+ "--user[install in user site-package '/home/hattori/.local/lib/python2.7/site-packages']" \
+ "--install-base=[base installation directory (instead of --prefix or --home)]" \
+ "--install-platbase=[base installation directory for platform-specific files (instead of --exec-prefix or --home)]" \
+ "--root=[install everything relative to this alternate root directory]" \
+ "--install-purelib=[installation directory for pure Python module distributions]" \
+ "--install-platlib=[installation directory for non-pure module distributions]" \
+ "--install-lib=[installation directory for all module distributions (overrides --install-purelib and --install-platlib)]" \
+ "--install-headers=[installation directory for C/C++ headers]" \
+ "--install-scripts=[installation directory for Python scripts]" \
+ "--install-data=[installation directory for data files]" \
+ "--compile[compile .py to .pyc \[default\]]" \
+ "-c[compile .py to .pyc \[default\]]" \
+ "--no-compile[don't compile .py files]" \
+ "--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
+ "-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
+ "--force[force installation (overwrite any existing files)]" \
+ "-f[force installation (overwrite any existing files)]" \
+ "--skip-build[skip rebuilding everything (for testing/debugging)]" \
+ "--record=[filename in which to record list of installed files]" \
+ "--install-layout=[installation layout to choose (known values: deb, unix)]" \
+ "--old-and-unmanageable[Try not to use this!]" \
+ "--single-version-externally-managed[used by system package builders to create 'flat' eggs]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_install_lib] )) ||
+_setuppy_install_lib() {
+ _arguments -s \
+ "--install-dir=[directory to install to]" \
+ "-d[directory to install to]" \
+ "--build-dir=[build directory (where to install from)]" \
+ "-b[build directory (where to install from)]" \
+ "--force[force installation (overwrite existing files)]" \
+ "-f[force installation (overwrite existing files)]" \
+ "--compile[compile .py to .pyc \[default\]]" \
+ "-c[compile .py to .pyc \[default\]]" \
+ "--no-compile[don't compile .py files]" \
+ "--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
+ "-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
+ "--skip-build[skip the build steps]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_install_headers] )) ||
+_setuppy_install_headers() {
+ _arguments -s \
+ "--install-dir=[directory to install header files to]" \
+ "-d[directory to install header files to]" \
+ "--force[force installation (overwrite existing files)]" \
+ "-f[force installation (overwrite existing files)]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_install_scripts] )) ||
+_setuppy_install_scripts() {
+ _arguments -s \
+ "--install-dir=[directory to install scripts to]" \
+ "-d[directory to install scripts to]" \
+ "--build-dir=[build directory (where to install from)]" \
+ "-b[build directory (where to install from)]" \
+ "--force[force installation (overwrite existing files)]" \
+ "-f[force installation (overwrite existing files)]" \
+ "--skip-build[skip the build steps]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_install_data] )) ||
+_setuppy_install_data() {
+ _arguments -s \
+ "--install-dir=[base directory for installing data files (default: installation base dir)]" \
+ "-d[base directory for installing data files (default: installation base dir)]" \
+ "--root=[install everything relative to this alternate root directory]" \
+ "--force[force installation (overwrite existing files)]" \
+ "-f[force installation (overwrite existing files)]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_sdist] )) ||
+_setuppy_sdist() {
+ _arguments -s \
+ "--formats=[formats for source distribution (comma-separated list)]" \
+ "--keep-temp[keep the distribution tree around after creating archive file(s)]" \
+ "-k[keep the distribution tree around after creating archive file(s)]" \
+ "--dist-dir=[directory to put the source distribution archive(s) in \[default: dist\]]" \
+ "-d[directory to put the source distribution archive(s) in \[default: dist\]]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_register] )) ||
+_setuppy_register() {
+ _arguments -s \
+ "--repository=[url of repository \[default: http://pypi.python.org/pypi\]]" \
+ "-r[url of repository \[default: http://pypi.python.org/pypi\]]" \
+ "--show-response[display full response text from server]" \
+ "--list-classifiers[list the valid Trove classifiers]" \
+ "--strict[Will stop the registering if the meta-data are not fully compliant]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_bdist] )) ||
+_setuppy_bdist() {
+ _arguments -s \
+ "--bdist-base=[temporary directory for creating built distributions]" \
+ "-b[temporary directory for creating built distributions]" \
+ "--plat-name=[platform name to embed in generated filenames (default: linux-i686)]" \
+ "-p[platform name to embed in generated filenames (default: linux-i686)]" \
+ "--formats=[formats for distribution (comma-separated list)]" \
+ "--dist-dir=[directory to put final built distributions in \[default: dist\]]" \
+ "-d[directory to put final built distributions in \[default: dist\]]" \
+ "--skip-build[skip rebuilding everything (for testing/debugging)]" \
+ "--owner=[Owner name used when creating a tar file \[default: current user\]]" \
+ "-u[Owner name used when creating a tar file \[default: current user\]]" \
+ "--group=[Group name used when creating a tar file \[default: current group\]]" \
+ "-g[Group name used when creating a tar file \[default: current group\]]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_bdist_dumb] )) ||
+_setuppy_bdist_dumb() {
+ _arguments -s \
+ "--bdist-dir=[temporary directory for creating the distribution]" \
+ "-d[temporary directory for creating the distribution]" \
+ "--plat-name=[platform name to embed in generated filenames (default: linux-i686)]" \
+ "-p[platform name to embed in generated filenames (default: linux-i686)]" \
+ "--format=[archive format to create (tar, ztar, gztar, zip)]" \
+ "-f[archive format to create (tar, ztar, gztar, zip)]" \
+ "--keep-temp[keep the pseudo-installation tree around after creating the distribution archive]" \
+ "-k[keep the pseudo-installation tree around after creating the distribution archive]" \
+ "--dist-dir=[directory to put final built distributions in]" \
+ "-d[directory to put final built distributions in]" \
+ "--skip-build[skip rebuilding everything (for testing/debugging)]" \
+ "--relative[build the archive using relative paths(default: false)]" \
+ "--owner=[Owner name used when creating a tar file \[default: current user\]]" \
+ "-u[Owner name used when creating a tar file \[default: current user\]]" \
+ "--group=[Group name used when creating a tar file \[default: current group\]]" \
+ "-g[Group name used when creating a tar file \[default: current group\]]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_bdist_rpm] )) ||
+_setuppy_bdist_rpm() {
+ _arguments -s \
+ "--bdist-base=[base directory for creating built distributions]" \
+ "--rpm-base=[base directory for creating RPMs (defaults to \"rpm\" under --bdist-base; must be specified for RPM 2)]" \
+ "--dist-dir=[directory to put final RPM files in (and .spec files if --spec-only)]" \
+ "-d[directory to put final RPM files in (and .spec files if --spec-only)]" \
+ "--python=[path to Python interpreter to hard-code in the .spec file (default: \"python\")]" \
+ "--fix-python[hard-code the exact path to the current Python interpreter in the .spec file]" \
+ "--spec-only[only regenerate spec file]" \
+ "--source-only[only generate source RPM]" \
+ "--binary-only[only generate binary RPM]" \
+ "--use-bzip2[use bzip2 instead of gzip to create source distribution]" \
+ "--distribution-name=[name of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!)]" \
+ "--group=[package classification \[default: \"Development/Libraries\"\]]" \
+ "--release=[RPM release number]" \
+ "--serial=[RPM serial number]" \
+ "--vendor=[RPM \"vendor\" (eg. \"Joe Blow <joe@example.com>\") \[default: maintainer or author from setup script\]]" \
+ "--packager=[RPM packager (eg. \"Jane Doe <jane@example.net>\")\[default: vendor\]]" \
+ "--doc-files=[list of documentation files (space or comma-separated)]" \
+ "--changelog=[RPM changelog]" \
+ "--icon=[name of icon file]" \
+ "--provides=[capabilities provided by this package]" \
+ "--requires=[capabilities required by this package]" \
+ "--conflicts=[capabilities which conflict with this package]" \
+ "--build-requires=[capabilities required to build this package]" \
+ "--obsoletes=[capabilities made obsolete by this package]" \
+ "--no-autoreq[do not automatically calculate dependencies]" \
+ "--keep-temp[don't clean up RPM build directory]" \
+ "-k[don't clean up RPM build directory]" \
+ "--no-keep-temp[clean up RPM build directory \[default\]]" \
+ "--use-rpm-opt-flags[compile with RPM_OPT_FLAGS when building from source RPM]" \
+ "--no-rpm-opt-flags[do not pass any RPM CFLAGS to compiler]" \
+ "--rpm3-mode[RPM 3 compatibility mode (default)]" \
+ "--rpm2-mode[RPM 2 compatibility mode]" \
+ "--prep-script=[Specify a script for the PREP phase of RPM building]" \
+ "--build-script=[Specify a script for the BUILD phase of RPM building]" \
+ "--pre-install=[Specify a script for the pre-INSTALL phase of RPM building]" \
+ "--install-script=[Specify a script for the INSTALL phase of RPM building]" \
+ "--post-install=[Specify a script for the post-INSTALL phase of RPM building]" \
+ "--pre-uninstall=[Specify a script for the pre-UNINSTALL phase of RPM building]" \
+ "--post-uninstall=[Specify a script for the post-UNINSTALL phase of RPM building]" \
+ "--clean-script=[Specify a script for the CLEAN phase of RPM building]" \
+ "--verify-script=[Specify a script for the VERIFY phase of the RPM build]" \
+ "--force-arch=[Force an architecture onto the RPM build process]" \
+ "--quiet[Run the INSTALL phase of RPM building in quiet mode]" \
+ "-q[Run the INSTALL phase of RPM building in quiet mode]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_bdist_wininst] )) ||
+_setuppy_bdist_wininst() {
+ _arguments -s \
+ "--bdist-dir=[temporary directory for creating the distribution]" \
+ "--plat-name=[platform name to embed in generated filenames (default: linux-i686)]" \
+ "-p[platform name to embed in generated filenames (default: linux-i686)]" \
+ "--keep-temp[keep the pseudo-installation tree around after creating the distribution archive]" \
+ "-k[keep the pseudo-installation tree around after creating the distribution archive]" \
+ "--target-version=[require a specific python version on the target system]" \
+ "--no-target-compile[do not compile .py to .pyc on the target system]" \
+ "-c[do not compile .py to .pyc on the target system]" \
+ "--no-target-optimize[do not compile .py to .pyo (optimized)on the target system]" \
+ "-o[do not compile .py to .pyo (optimized)on the target system]" \
+ "--dist-dir=[directory to put final built distributions in]" \
+ "-d[directory to put final built distributions in]" \
+ "--bitmap=[bitmap to use for the installer instead of python-powered logo]" \
+ "-b[bitmap to use for the installer instead of python-powered logo]" \
+ "--title=[title to display on the installer background instead of default]" \
+ "-t[title to display on the installer background instead of default]" \
+ "--skip-build[skip rebuilding everything (for testing/debugging)]" \
+ "--install-script=[basename of installation script to be run afterinstallation or before deinstallation]" \
+ "--pre-install-script=[Fully qualified filename of a script to be run before any files are installed. This script need not be in the distribution]" \
+ "--user-access-control=[specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UAC]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_upload] )) ||
+_setuppy_upload() {
+ _arguments -s \
+ "--repository=[url of repository \[default: http://pypi.python.org/pypi\]]" \
+ "-r[url of repository \[default: http://pypi.python.org/pypi\]]" \
+ "--show-response[display full response text from server]" \
+ "--sign[sign files to upload using gpg]" \
+ "-s[sign files to upload using gpg]" \
+ "--identity=[GPG identity used to sign files]" \
+ "-i[GPG identity used to sign files]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_check] )) ||
+_setuppy_check() {
+ _arguments -s \
+ "--metadata[Verify meta-data]" \
+ "-m[Verify meta-data]" \
+ "--restructuredtext[Checks if long string meta-data syntax are reStructuredText-compliant]" \
+ "-r[Checks if long string meta-data syntax are reStructuredText-compliant]" \
+ "--strict[Will exit with an error if a check fails]" \
+ "-s[Will exit with an error if a check fails]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_alias] )) ||
+_setuppy_alias() {
+ _arguments -s \
+ "--remove[remove (unset) the alias]" \
+ "-r[remove (unset) the alias]" \
+ "--global-config[save options to the site-wide distutils.cfg file]" \
+ "-g[save options to the site-wide distutils.cfg file]" \
+ "--user-config[save options to the current user's pydistutils.cfg file]" \
+ "-u[save options to the current user's pydistutils.cfg file]" \
+ "--filename=[configuration file to use (default=setup.cfg)]" \
+ "-f[configuration file to use (default=setup.cfg)]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_bdist_egg] )) ||
+_setuppy_bdist_egg() {
+ _arguments -s \
+ "--bdist-dir=[temporary directory for creating the distribution]" \
+ "-b[temporary directory for creating the distribution]" \
+ "--plat-name=[platform name to embed in generated filenames (default: linux-i686)]" \
+ "-p[platform name to embed in generated filenames (default: linux-i686)]" \
+ "--exclude-source-files[remove all .py files from the generated egg]" \
+ "--keep-temp[keep the pseudo-installation tree around after creating the distribution archive]" \
+ "-k[keep the pseudo-installation tree around after creating the distribution archive]" \
+ "--dist-dir=[directory to put final built distributions in]" \
+ "-d[directory to put final built distributions in]" \
+ "--skip-build[skip rebuilding everything (for testing/debugging)]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_develop] )) ||
+_setuppy_develop() {
+ _arguments -s \
+ "--prefix=[installation prefix]" \
+ "--zip-ok[install package as a zipfile]" \
+ "-z[install package as a zipfile]" \
+ "--multi-version[make apps have to require() a version]" \
+ "-m[make apps have to require() a version]" \
+ "--upgrade[force upgrade (searches PyPI for latest versions)]" \
+ "-U[force upgrade (searches PyPI for latest versions)]" \
+ "--install-dir=[install package to DIR]" \
+ "-d[install package to DIR]" \
+ "--script-dir=[install scripts to DIR]" \
+ "-s[install scripts to DIR]" \
+ "--exclude-scripts[Don't install scripts]" \
+ "-x[Don't install scripts]" \
+ "--always-copy[Copy all needed packages to install dir]" \
+ "-a[Copy all needed packages to install dir]" \
+ "--index-url=[base URL of Python Package Index]" \
+ "-i[base URL of Python Package Index]" \
+ "--find-links=[additional URL(s) to search for packages]" \
+ "-f[additional URL(s) to search for packages]" \
+ "--delete-conflicting[no longer needed; don't use this]" \
+ "-D[no longer needed; don't use this]" \
+ "--ignore-conflicts-at-my-risk[no longer needed; don't use this]" \
+ "--build-directory=[download/extract/build in DIR; keep the results]" \
+ "-b[download/extract/build in DIR; keep the results]" \
+ "--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
+ "-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
+ "--record=[filename in which to record list of installed files]" \
+ "--always-unzip[don't install as a zipfile, no matter what]" \
+ "-Z[don't install as a zipfile, no matter what]" \
+ "--site-dirs=[list of directories where .pth files work]" \
+ "-S[list of directories where .pth files work]" \
+ "--editable[Install specified packages in editable form]" \
+ "-e[Install specified packages in editable form]" \
+ "--no-deps[don't install dependencies]" \
+ "-N[don't install dependencies]" \
+ "--allow-hosts=[pattern(s) that hostnames must match]" \
+ "-H[pattern(s) that hostnames must match]" \
+ "--local-snapshots-ok[allow building eggs from local checkouts]" \
+ "-l[allow building eggs from local checkouts]" \
+ "--version[print version information and exit]" \
+ "--install-layout=[installation layout to choose (known values: deb)]" \
+ "--force-installation-into-system-dir[force installation into /usr]" \
+ "-0[force installation into /usr]" \
+ "--no-find-links[Don't load find-links defined in packages being installed]" \
+ "--user[install in user site-package '/home/hattori/.local/lib/python2.7/site-packages']" \
+ "--uninstall[Uninstall this source package]" \
+ "-u[Uninstall this source package]" \
+ "--egg-path=[Set the path to be used in the .egg-link file]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_easy_install] )) ||
+_setuppy_easy_install() {
+ _arguments -s \
+ "--prefix=[installation prefix]" \
+ "--zip-ok[install package as a zipfile]" \
+ "-z[install package as a zipfile]" \
+ "--multi-version[make apps have to require() a version]" \
+ "-m[make apps have to require() a version]" \
+ "--upgrade[force upgrade (searches PyPI for latest versions)]" \
+ "-U[force upgrade (searches PyPI for latest versions)]" \
+ "--install-dir=[install package to DIR]" \
+ "-d[install package to DIR]" \
+ "--script-dir=[install scripts to DIR]" \
+ "-s[install scripts to DIR]" \
+ "--exclude-scripts[Don't install scripts]" \
+ "-x[Don't install scripts]" \
+ "--always-copy[Copy all needed packages to install dir]" \
+ "-a[Copy all needed packages to install dir]" \
+ "--index-url=[base URL of Python Package Index]" \
+ "-i[base URL of Python Package Index]" \
+ "--find-links=[additional URL(s) to search for packages]" \
+ "-f[additional URL(s) to search for packages]" \
+ "--delete-conflicting[no longer needed; don't use this]" \
+ "-D[no longer needed; don't use this]" \
+ "--ignore-conflicts-at-my-risk[no longer needed; don't use this]" \
+ "--build-directory=[download/extract/build in DIR; keep the results]" \
+ "-b[download/extract/build in DIR; keep the results]" \
+ "--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
+ "-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
+ "--record=[filename in which to record list of installed files]" \
+ "--always-unzip[don't install as a zipfile, no matter what]" \
+ "-Z[don't install as a zipfile, no matter what]" \
+ "--site-dirs=[list of directories where .pth files work]" \
+ "-S[list of directories where .pth files work]" \
+ "--editable[Install specified packages in editable form]" \
+ "-e[Install specified packages in editable form]" \
+ "--no-deps[don't install dependencies]" \
+ "-N[don't install dependencies]" \
+ "--allow-hosts=[pattern(s) that hostnames must match]" \
+ "-H[pattern(s) that hostnames must match]" \
+ "--local-snapshots-ok[allow building eggs from local checkouts]" \
+ "-l[allow building eggs from local checkouts]" \
+ "--version[print version information and exit]" \
+ "--install-layout=[installation layout to choose (known values: deb)]" \
+ "--force-installation-into-system-dir[force installation into /usr]" \
+ "-0[force installation into /usr]" \
+ "--no-find-links[Don't load find-links defined in packages being installed]" \
+ "--user[install in user site-package '/home/hattori/.local/lib/python2.7/site-packages']" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_egg_info] )) ||
+_setuppy_egg_info() {
+ _arguments -s \
+ "--egg-base=[directory containing .egg-info directories (default: top of the source tree)]" \
+ "-e[directory containing .egg-info directories (default: top of the source tree)]" \
+ "--tag-svn-revision[Add subversion revision ID to version number]" \
+ "-r[Add subversion revision ID to version number]" \
+ "--tag-date[Add date stamp (e.g. 20050528) to version number]" \
+ "-d[Add date stamp (e.g. 20050528) to version number]" \
+ "--tag-build=[Specify explicit tag to add to version number]" \
+ "-b[Specify explicit tag to add to version number]" \
+ "--no-svn-revision[Don't add subversion revision ID \[default\]]" \
+ "-R[Don't add subversion revision ID \[default\]]" \
+ "--no-date[Don't include date stamp \[default\]]" \
+ "-D[Don't include date stamp \[default\]]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_rotate] )) ||
+_setuppy_rotate() {
+ _arguments -s \
+ "--match=[patterns to match (required)]" \
+ "-m[patterns to match (required)]" \
+ "--dist-dir=[directory where the distributions are]" \
+ "-d[directory where the distributions are]" \
+ "--keep=[number of matching distributions to keep]" \
+ "-k[number of matching distributions to keep]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_saveopts] )) ||
+_setuppy_saveopts() {
+ _arguments -s \
+ "--global-config[save options to the site-wide distutils.cfg file]" \
+ "-g[save options to the site-wide distutils.cfg file]" \
+ "--user-config[save options to the current user's pydistutils.cfg file]" \
+ "-u[save options to the current user's pydistutils.cfg file]" \
+ "--filename=[configuration file to use (default=setup.cfg)]" \
+ "-f[configuration file to use (default=setup.cfg)]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_setopt] )) ||
+_setuppy_setopt() {
+ _arguments -s \
+ "--command=[command to set an option for]" \
+ "-c[command to set an option for]" \
+ "--option=[option to set]" \
+ "-o[option to set]" \
+ "--set-value=[value of the option]" \
+ "-s[value of the option]" \
+ "--remove[remove (unset) the value]" \
+ "-r[remove (unset) the value]" \
+ "--global-config[save options to the site-wide distutils.cfg file]" \
+ "-g[save options to the site-wide distutils.cfg file]" \
+ "--user-config[save options to the current user's pydistutils.cfg file]" \
+ "-u[save options to the current user's pydistutils.cfg file]" \
+ "--filename=[configuration file to use (default=setup.cfg)]" \
+ "-f[configuration file to use (default=setup.cfg)]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_test] )) ||
+_setuppy_test() {
+ _arguments -s \
+ "--test-module=[Run 'test_suite' in specified module]" \
+ "-m[Run 'test_suite' in specified module]" \
+ "--test-suite=[Test suite to run (e.g. 'some_module.test_suite')]" \
+ "-s[Test suite to run (e.g. 'some_module.test_suite')]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_install_egg_info] )) ||
+_setuppy_install_egg_info() {
+ _arguments -s \
+ "--install-dir=[directory to install to]" \
+ "-d[directory to install to]" \
+ "*::setup.py commands:_setuppy"
+}
+
+(( $+functions[_setuppy_upload_docs] )) ||
+_setuppy_upload_docs() {
+ _arguments -s \
+ "--repository=[url of repository \[default: http://pypi.python.org/pypi\]]" \
+ "-r[url of repository \[default: http://pypi.python.org/pypi\]]" \
+ "--show-response[display full response text from server]" \
+ "--upload-dir=[directory to upload]" \
+ "*::setup.py commands:_setuppy"
+}
+
+_setup.py "$@"
diff --git a/src/_showoff b/src/_showoff
new file mode 100644
index 0000000..0ba0f36
--- /dev/null
+++ b/src/_showoff
@@ -0,0 +1,79 @@
+#compdef showoff
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Showoff (https://github.com/schacon/showoff).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Bruno Michel (https://github.com/nono)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local curcontext="$curcontext" state line cmds ret=1
+
+_arguments -C \
+ '1: :->cmds' \
+ '*: :->args' && ret=0
+
+case $state in
+ cmds)
+ cmds=(
+ 'add:Add a new slide at the end in a given dir'
+ 'new:Add a new slide at the end in a given dir'
+ 'create:Create new showoff presentation'
+ 'init:Create new showoff presentation'
+ 'help:Shows list of commands or help for one command'
+ 'heroku:Setup your presentation to serve on Heroku'
+ 'serve:Serves the showoff presentation in the current directory'
+ 'static:Generate static version of presentation'
+ )
+ _describe -t commands 'showoff command' cmds && ret=0
+ ;;
+ args)
+ case $line[1] in
+ (add|new)
+ _arguments \
+ '(-d --dir)'{-d,--dir}'=[Slide dir (where to put a new slide file)]:directory:_files' \
+ '(-n --name)'{-n,--name}'=[Slide name (name of the new slide file)]:basename' \
+ {-s,--source}'=[Include code from the given file as the slide body]:file:_files' \
+ '(-t --style --type)'{-t,--style,--type}'=[Slide Type/Style (default: title)]:style' \
+ '(-u --no-number)'{-u,--no-number}'[Dont number the slide, use the given name verbatim]' \
+ '1:title' && ret=0
+ ;;
+ (create|init)
+ _arguments \
+ '(-d --slidedir)'{-d,--slidedir}'=[Sample slide directory name (default: one)]:arg' \
+ '(-n --nosamples)'{-n,--nosamples}'=[Dont create sample slides]' \
+ '1:dir_name' && ret=0
+ ;;
+ help)
+ _values 'commands' add new create init help heroku serve static && ret=0
+ ;;
+ heroku)
+ _message 'please entrer an heroku_name' && ret=0
+ ;;
+ serve)
+ _arguments \
+ '(-h --host)'{-h,--host}'=[Host or ip to run on (default: localhost)]:host' \
+ '(-p --port)'{-p,--port}'=[Port on which to run (default: 9090)]:port' \
+ '1:title' && ret=0
+ ;;
+ static)
+ _message 'please entrer a name' && ret=0
+ ;;
+ *)
+ (( ret )) && _message 'no more arguments'
+ ;;
+ esac
+ ;;
+esac
+
+return ret
diff --git a/src/_smartmontools b/src/_smartmontools
new file mode 100644
index 0000000..ccebcaf
--- /dev/null
+++ b/src/_smartmontools
@@ -0,0 +1,110 @@
+#compdef smartctl smartd
+# ------------------------------------------------------------------------------
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for smartmontools (http://smartmontools.sourceforge.net).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+_smartctl() {
+ local context state line expl
+ local -A opt_args
+
+ _arguments -A "-*" \
+ '(-h --help --usage)'{-h,--help,--usage}'[Show help message]' \
+ '(-V --version --copyright --license)'{-v,--version,--copyright,--license}'[Print license, copyright, and version information and exit]' \
+ '(-i --info)'{-i,--info}'[Show identity information for device]' \
+ '(-a --all)'{-a,--all}"[Show all SMART information for device]" \
+ '(-x --xall)'{-xa,--xall}"[Show all information for device]" \
+ '--scan[Scan for devices]' \
+ '--scan-open[Scan for devices and try to open each device]' \
+ \
+ '(-q --quietmode)'{-q,--quietmode}'[Set smartctl quiet mode]:TYPE:(errorsonly silent noserial)' \
+ '(-d --device)'{-d,--device}'[Specify device type]:TYPE:(ata scsi sat usbcypress usbjmicron usbsunplus marvell areca 3ware hpt megaraid cciss auto test)' \
+ '(-T --tolerance)'{-T,--tolerance}'[Set tolerance]:TOLERANCE:(normal conservative permissive verypermissive)' \
+ '(-b --badsum)'{-q,--badsum}'[Set action on bad checksum]:TYPE:(warn exit ignore)' \
+ '(-r --report)'{-r,--report}'[Report transactions]:TYPE:' \
+ '(-n --nocheck)'{-n,--nocheck}'[No check if MODE]:MODE:(never sleep standby idle)' \
+ \
+ '(-s --smart)'{-s,--smart}'[Enable/disable SMART on device]:VALUE:(on off)' \
+ '(-o --offlineauto)'{-s,--smart}'[Enable/disable automatic offline testing on device]:VALUE:(on off)' \
+ '(-S --saveauto)'{-S,--saveauto}'[Enable/disable attribute autosave on device]:VALUE:(on off)' \
+ \
+ '(-H --health)'{-h,--health}'[Show device SMART health status]' \
+ '(-c --capabilities)'{-c,--capabilities}'[Show device SMART capabilities]' \
+ '(-A --attributes)'{-A,--attributes}'[Show device SMART vendor-specific attributes and values]' \
+ '(-f --format)'{-f,--format}'[Set output format for attributes]:FORMAT:(old brief)' \
+ '(-l --log)'{-l,--log}'[Show device log]:TYPE:(error selftest selective directory background sasphy sataphy scttemp scterc gplog smartlog xerror xselftest)' \
+ '(-v --vendorattribute)'{-v,--vendorattribute}'[Set display option for vendor attribute]:N,OPTION:' \
+ '(-F --firmwarebug)'{-F,--firmwarebug}'[Use firmware bug workaround]:TYPE:(none samsung samsung2 samsung3 swapid)' \
+ '(-P --presets)'{-P,--presets}'[Drive-specific presets]:TYPE:(use ignore show showall)' \
+ '(-B --drivedb)'{-B,--drivedb}'[Read and replace drive database from file]:FILE:_files' \
+ \
+ '(-t --test)'{-t,--test}'[Run test]:TEST:(offline short long conveyance vendor select pending afterselect,on afterselect,off scttempint)' \
+ '(-C --captive)'{-C,--captive}'[Do test in captive mode]' \
+ '(-X --abort)'{-X,--abort}'[Abort any non-captive test on device]' \
+ \
+ '1:Device:_files'
+}
+
+_smartd() {
+ local context state line expl
+ local -A opt_args
+
+ _arguments -A "-*" \
+ '(-h --help --usage)'{-h,--help,--usage}'[Show help message]' \
+ '(-V --version --copyright --license)'{-v,--version,--copyright,--license}'[Print license, copyright, and version information and exit]' \
+ \
+ '(-A --attributelog)'{-A,--attributelog}'[Log ATA attribute information to {PREFIX}MODEL-SERIAL.ata.csv]:PREFIX:' \
+ '(-B --drivedb)'{-B,--drivedb}'[Read and replace drive database from file]:FILE:_files' \
+ '(-c --configfile)'{-c,--configfile}'[Read configuration file or stdin]:FILE:_files' \
+ '(-d --debug)'{-d,--debug}'[Start smartd in debug mode]' \
+ '(-D --showdirectives)'{-D,--showdirectives}'[Print the configuration file directives and exit]' \
+ '(-i --interval)'{-i,--interval}'[Set interval between disk checks to N seconds, where N >= 10]:Seconds >= 10:' \
+ '(-l --logfacility)'{-l,--logfacility}'[Use syslogfacility local0 - local7 or daemon]:FACILITY:(local0 local1 local2 local3 local4 local5 local6 local7)' \
+ '(-n --no-fork)'{-n,--no-fork}'[Do not fork into background]' \
+ '(-p --pidfile)'{-p,--pidfile}'[Write PID file]:FILE:_files' \
+ '(-q --quit)'{-q,--quit}'[Quit on...]:WHEN:(nodev errors nodevstartup never onecheck showtests)' \
+ '(-r --report)'{-r,--report}'[Report transactions for...]:TYPE:(ioctl ataioctl scsiioctl)' \
+ '(-s --savestates)'{-s,--savestates}'[Save disk states to {PREFIX}MODEL-SERIAL.TYPE.state]:TYPE:'
+}
+
+_smartmontools() {
+ local ret=1
+ _call_function ret _$service
+ return ret
+}
+
+_smartmontools "$@" \ No newline at end of file
diff --git a/src/_srm b/src/_srm
new file mode 100644
index 0000000..49e6579
--- /dev/null
+++ b/src/_srm
@@ -0,0 +1,63 @@
+#compdef srm
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for srm.
+#
+# It is based on the rm completion script from Zsh.
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Sorin Ionescu <sorin.ionescu@gmail.com>
+#
+# ------------------------------------------------------------------------------
+
+local -a opts args
+args=(
+ '(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]'
+ '(-r --interactive)'{-i,--interactive}'[prompt before any removal]'
+ '(-r -R --recursive)'{-r,-R,--recursive}'[remove the contents of directories recursively]'
+ '(-s --simple)'{-s,--simple}'[only overwrite with a single pass of random data]'
+ '(-v --verbose)'{-v,--verbose}'[explain what is being done]'
+ '(- *)--help[display help message and exit]'
+ '(- *)--version[output version information and exit]'
+ '*::files:->file'
+)
+
+if _pick_variant gnu=gnu unix --help; then
+ args+=(
+ '(-x --one-file-system)'{-x,--one-file-system}'[stay within filesystems of files given as arguments]'
+ '(-P --openbsd)'{-P,--openbsd}'[overwrite the file 3 times (0xff, 0x00, 0xff)]'
+ '(-D --dod)'{-D,--dod}'[overwrite the file with 7 US DoD compliant passes (0xF6, 0x00, 0xFF, random, 0x00, 0xFF, random)]'
+ '(-E --doe)'{-E,--doe}'[overwrite the file with 3 US DoE compliant passes (random, random, DoE)]'
+ )
+else
+ args+=(
+ '(-m --medium)'{-m,--medium}'[overwrite the file with 7 US DoD compliant passes (0xF6, 0x00, 0xFF, random, 0x00, 0xFF, random)]'
+ '(-z --zero)'{-z,--zero}'[after overwriting, zero blocks used by file]'
+ '(-n --nounlink)'{-n,--nounlink}'[overwrite file, but do not rename or unlink it]'
+ )
+fi
+
+local curcontext=$curcontext state line ret=1
+local -A opt_args
+
+_arguments -s -S -C $opts \
+ $args && ret=0
+
+case $state in
+ (file)
+ local -a ignored
+ ignored=()
+ ((CURRENT > 1)) &&
+ ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
+ ((CURRENT < $#line)) &&
+ ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
+ _files -F ignored && ret=0
+ ;;
+esac
+
+return $ret
diff --git a/src/_ssh-copy-id b/src/_ssh-copy-id
new file mode 100644
index 0000000..bea9225
--- /dev/null
+++ b/src/_ssh-copy-id
@@ -0,0 +1,50 @@
+#compdef ssh-copy-id
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for ssh-copy-id.
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+# FIXME This completes "user@host" and not "[user@]host" ("user@" is optional),
+# should be merged in _ssh.
+
+_arguments -A "-*" \
+ '-i+[use identity file]:SSH identity file:_files' \
+ '1: :_user_at_host'
diff --git a/src/_subliminal b/src/_subliminal
new file mode 100644
index 0000000..e67acd9
--- /dev/null
+++ b/src/_subliminal
@@ -0,0 +1,58 @@
+#compdef subliminal
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Subliminal (https://github.com/Diaoul/subliminal).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_arguments \
+ '(- : *)'{-h,--help}'[show help message and exit]' \
+ '(- : *)--version[show version number and exit]' \
+ '*'{-l,--language}'[wanted language]: :_language_codes ISO-639-1' \
+ '*'{-p,--plugin}'[plugin to use]:plugin name:((OpenSubtitles BierDopje TheSubDB SubsWiki Subtitulos))' \
+ '(-m --multi)'{-m,--multi}'[download multiple subtitle languages]' \
+ '(-f --force)'{-f,--force}'[replace existing subtitle file]' \
+ '(-w --workers)'{-w,--workers}'[number of threads to use]:number' \
+ '(-c --compatibility)'{-c,--compatibility}'[try not to use unicode]' \
+ '(-q --quiet -v --verbose)'{-q,--quiet}'[disable output]' \
+ '(-v --verbose -q --quiet)'{-v,--verbose}'[verbose output]' \
+ '(--no-cache-dir)--cache-dir[cache directory to use]: :_files -/' \
+ '(--cache-dir)--no-cache-dir[do not use cache directory]' \
+ '*: :_files'
diff --git a/src/_symfony b/src/_symfony
new file mode 100644
index 0000000..994a874
--- /dev/null
+++ b/src/_symfony
@@ -0,0 +1,451 @@
+#compdef symfony
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Symfony (http://www.symfony-project.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * aki77 (https://github.com/aki77)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_symfony () {
+ local curcontext="$curcontext" state line expl ret=1 cache_version
+
+ cache_version=$(_get_sf_cache_var version)
+ (( ${(P)+cache_version} == 0 )) && {
+ eval $cache_version=${${${(z)$($service -V)}[3]}%.*}
+ }
+
+ if [ ${(P)cache_version} = "1.0" ] ; then
+ _symfony10
+ return
+ fi
+
+ _arguments -C \
+ '(-T --tasks)'{-T,--tasks}'[list of the symfony tasks]' \
+ '(-V --version)'{-V,--version}'[version]' \
+ '1: :->tasks' \
+ '*:: :->args' && ret=0
+
+ case $state in
+ tasks)
+ _sf_tasks
+ ;;
+ args)
+ local task args
+
+ task=$words[1]
+ args=(
+ ${${${${${(M)${${${(z)${${"$($service help $task)"#*Usage:}#[[:cntrl:]]}%%[[:cntrl:]]*}//\[/}//\]/}:#--*}%%\"*}/=/"=-"}/(#b)--(app|application)=-/--$match[1]=-:application:_sf_apps}//(#b)--(env|environment)=-/--$match[1]=-:environment:_sf_environments}
+ )
+
+ case $task in
+ help)
+ args+=(
+ ':task:_sf_tasks'
+ )
+ ;;
+
+ app:routes)
+ args+=(
+ ':application:_sf_apps'
+ ':"route name":'
+ )
+ ;;
+
+ configure:author)
+ _message 'project author'
+ ;;
+
+ configure:database)
+ _message 'database dsn'
+ ;;
+
+ generate:app)
+ _message 'new application name'
+ ;;
+
+ generate:module)
+ args+=(
+ ':application:_sf_apps'
+ ':"new module name":'
+ )
+ ;;
+
+ generate:project)
+ _message 'new project name'
+ ;;
+
+ generate:task)
+ _message 'new task name'
+ ;;
+
+ i18n:extract)
+ args+=(
+ ':application:_sf_apps'
+ ':"target culture":'
+ )
+ ;;
+
+ i18n:find)
+ args+=(
+ ':application:_sf_apps'
+ )
+ ;;
+
+ log:rotate)
+ args+=(
+ ':application:_sf_apps'
+ ':environment:_sf_environments'
+ )
+ ;;
+
+ plugin:add-channel)
+ _message 'channel name'
+ ;;
+
+ plugin:install)
+ _message 'plugin name'
+ ;;
+
+ plugin:publish-assets)
+ args+=(
+ ':plugin:_sf_plugins'
+ )
+ ;;
+
+ plugin:uninstall)
+ _message 'plugin name'
+ ;;
+
+ plugin:upgrade)
+ _message 'plugin name'
+ ;;
+
+ project:deploy)
+ _message 'server name'
+ ;;
+
+ project:disable|project:enable)
+ args+=(
+ ':environment:_sf_environments'
+ '*:application:_sf_apps'
+ )
+ ;;
+
+ project:optimize)
+ args+=(
+ ':application:_sf_apps'
+ ':environment:_sf_environments'
+ )
+ ;;
+
+ propel:data-dump|doctrine:data-dump)
+ _message 'target filename'
+ ;;
+
+ propel:data-load|doctrine:data-load)
+ args+=(
+ '*:file:_files'
+ )
+ ;;
+
+ propel:generate-admin)
+ args+=(
+ ':application:_sf_apps'
+ ':model:_sf_models'
+ )
+ ;;
+
+ propel:generate-module|propel:init-admin)
+ args+=(
+ ':application:_sf_apps'
+ ':module:_sf_modules_candidate'
+ ':model:_sf_models'
+ )
+ ;;
+
+ propel:generate-module-for-route|doctrine:generate-module-for-route)
+ args+=(
+ ':application:_sf_apps'
+ ':"route name":'
+ )
+ ;;
+
+ doctrine:create-model-tables|doctrine:delete-model-files)
+ args+=(
+ '*:model:_sf_doctrine_models'
+ )
+ ;;
+
+ doctrine:generate-admin)
+ args+=(
+ ':application:_sf_apps'
+ '*:model:_sf_doctrine_models'
+ )
+ ;;
+
+ doctrine:generate-module)
+ args+=(
+ ':application:_sf_apps'
+ ':module:_sf_doctrine_modules_candidate'
+ ':model:_sf_doctrine_models'
+ )
+ ;;
+
+ test:coverage)
+ args+=(
+ '*:file:_files'
+ )
+ ;;
+
+ test:functional)
+ args+=(
+ ':application:_sf_apps'
+ '*:test:_sf_functionaltests'
+ )
+ ;;
+
+ test:unit)
+ args+=(
+ '*:test:_sf_unittests'
+ )
+ ;;
+
+ esac
+
+ _arguments "$args[@]" && ret=0
+ return
+ ;;
+ esac
+ return ret
+}
+
+_symfony10 () {
+ local curcontext="$curcontext" state line expl ret=1
+
+ _arguments -C \
+ '(-T --tasks)'{-T,--tasks}'[list of the symfony tasks]' \
+ '(-V --version)'{-V,--version}'[version]' \
+ '1: :->tasks' \
+ '*:: :->args' && ret=0
+
+ case $state in
+ tasks)
+ _sf10_tasks
+ ;;
+ args)
+ local task args
+
+ task=$words[1]
+ args=()
+
+ case $task in
+ init-project)
+ _message 'new project name'
+ ;;
+
+ init-app)
+ _message 'application name'
+ ;;
+
+ init-module)
+ args+=(
+ ':application:_sf_apps'
+ )
+ ;;
+
+ init-batch)
+ args+=(
+ ':skeleton name:compadd default rotate'
+ ':"script name":'
+ ':application:_sf_apps'
+ )
+ ;;
+
+ init-controller)
+ args+=(
+ ':application:_sf_apps'
+ ':environment:_sf_environments'
+ ':"script name":'
+ ':"debug?":compadd true false'
+ )
+ ;;
+
+ log-rotate)
+ args+=(
+ ':application:_sf_apps'
+ ':environment:_sf_environments'
+ )
+ ;;
+
+ propel-load-data|propel-build-all-load)
+ args+=(
+ ':application:_sf_apps'
+ ':environment:_sf_environments'
+ ':fixtures:_sf_fixtures'
+ )
+ ;;
+
+ clear-cache|cc)
+ args+=(
+ ':application:_sf_apps'
+ ':what:compadd template config'
+ )
+ ;;
+
+ sync)
+ args+=(
+ ':environment:_sf_environments'
+ ':"real run?":compadd go'
+ )
+ ;;
+
+ propel-init-crud|propel*-init-admin|propel-generate-crud)
+ args+=(
+ ':application:_sf_apps'
+ ':module:_sf_modules_candidate'
+ ':model:_sf_models'
+ )
+ ;;
+
+ doctrine-init-admin|doctrine-generate-crud)
+ args+=(
+ ':application:_sf_apps'
+ ':module:_sf_doctrine_modules_candidate'
+ ':model:_sf_doctrine_models'
+ )
+ ;;
+
+ test-unit)
+ args+=(
+ ':test:_sf_unittests'
+ )
+ ;;
+
+ test-functional)
+ args+=(
+ ':application:_sf_apps'
+ ':test:_sf_functionaltests'
+ )
+ ;;
+
+ esac
+
+ _arguments "$args[@]" && ret=0
+ return
+ ;;
+ esac
+ return ret
+}
+
+_sf_tasks () {
+ local tmp ns line cache_task
+
+ cache_task=$(_get_sf_cache_var task)
+ (( ${(P)+cache_task} == 0 )) && {
+ tmp=(
+ ${${${(f)${"$($service -T)"##*Available tasks:}}##[[:blank:]][[:blank:]]}%%[[:blank:]]*}
+ )
+ eval "$cache_task=()"
+ ns=''
+
+ for line in $tmp; do
+ if [ $line[1] = ":" ] ; then
+ eval "$cache_task+=( ${ns}${line#:} )"
+ else
+ ns="${line}:"
+ fi
+ done
+ }
+
+ _wanted symfony-task expl 'Symfony task' compadd -a $cache_task
+}
+
+_sf10_tasks () {
+ local sf_tasks
+
+ sf_tasks=(
+ ${${${(f)${"$($service -T)"#available pake tasks:}%%task aliases:*}#[[:blank:]][[:blank:]]}/[[:blank:]]*>[[:blank:]]/:}
+ )
+
+ _describe -t symfony-tasks 'Symfony task' sf_tasks
+}
+
+_sf_apps () {
+ _wanted application expl 'application' compadd \
+ ${$(echo apps/*):t}
+}
+
+_sf_environments () {
+ local app
+
+ app=$([ -f apps/"$words[2]"/config/settings.yml ] && echo $words[2] || echo frontend)
+ if [ -r apps/$app/config/settings.yml ] ; then
+ _wanted environment expl 'environment' compadd \
+ ${${${(M)${(@f)"$(<apps/$app/config/settings.yml)"}:#[[:alpha:]]*}%%:*}:#all}
+ fi
+}
+
+_sf_plugins () {
+ _wanted application expl 'plugin' compadd \
+ ${$(echo plugins/*):t}
+}
+
+_sf_models () {
+ _wanted application expl 'model' compadd \
+ $(_get_sfmodels)
+}
+
+_sf_doctrine_models () {
+ _wanted model expl 'model' compadd \
+ $(_get_sf_doctrine_models)
+}
+
+
+_sf_modules_candidate () {
+ _wanted module expl 'module' compadd \
+ ${$(_get_sfmodels):l}
+}
+
+_sf_doctrine_modules_candidate () {
+ _wanted module expl 'module' compadd \
+ ${$(_get_sf_doctrine_models):l}
+}
+
+_sf_unittests () {
+ _wanted test expl 'test' compadd \
+ ${${${$(echo test/unit/**/*Test.php):r}#test/unit/}%Test}
+}
+
+_sf_functionaltests () {
+ _wanted test expl 'test' compadd \
+ ${${$(echo test/functional/$words[2]/*ActionsTest.php):t:r}%Test}
+}
+
+_sf_fixtures () {
+ _files -W $(pwd)/data
+}
+
+_get_sfmodels () {
+ echo ${${$(echo lib/model/*Peer.php):t:r}%Peer}
+}
+
+_get_sf_doctrine_models () {
+ echo ${${$(echo lib/model/doctrine/*Table.class.php):t:r:r}%Table}
+}
+
+_get_sf_cache_var () {
+ echo ${$(echo "_sf_cache_${(j:_:)@}$(pwd)")//[^[:alnum:]]/_}
+}
+
+_symfony "$@"
diff --git a/src/_teamocil b/src/_teamocil
new file mode 100644
index 0000000..d333402
--- /dev/null
+++ b/src/_teamocil
@@ -0,0 +1,50 @@
+#compdef teamocil
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Teamocil (https://github.com/remiprev/teamocil)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Grigory V. <floatboth@me.com>
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_arguments \
+ '--here[open the session from the current window]' \
+ '--layout[specify a custom file path to a YAML layout file]:teamocil layout file:_files -g "*.yml"' \
+ '--edit[open the layout file (whether or not --layout is used) with $EDITOR]' \
+ '1:teamocil layout:_files -W ~/.teamocil -g "*.yml(:r)"'
diff --git a/src/_thor b/src/_thor
new file mode 100644
index 0000000..7a07732
--- /dev/null
+++ b/src/_thor
@@ -0,0 +1,23 @@
+#compdef thor
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for thor (https://github.com/wycats/thor).
+#
+# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/thor
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Andrew Hodges (https://github.com/betawaffle)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+# FIXME This should be rewritten using up-to-date ZSH completion API.
+compadd `thor list | grep thor | cut -d " " -f 2`
diff --git a/src/_tmuxinator b/src/_tmuxinator
new file mode 100644
index 0000000..75d6ab3
--- /dev/null
+++ b/src/_tmuxinator
@@ -0,0 +1,55 @@
+#compdef tmuxinator mux
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for tmuxinator (https://github.com/aziz/tmuxinator).
+#
+# Source: https://gist.github.com/2242920
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * ser1zw (https://github.com/ser1zw)
+# * Ben O'Hara (https://github.com/benohara)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+_tmuxinator() {
+ local -a projects
+ projects=(`find $HOME/.tmuxinator/ -name \*.yml| awk -F/ '{print $NF}' | sed s:.yml::g`)
+
+ local -a commands
+ commands=(
+ 'start:start a tmux session using project'\''s tmuxinator config'
+ 'open:create a new project file and open it in your editor'
+ 'copy:copy source_project project file to a new project called new_project'
+ 'delete:deletes the project called project_name'
+ 'implode:deletes all existing projects!'
+ 'list:list all existing projects'
+ 'doctor:look for problems in your configuration'
+ 'help:shows this help document'
+ 'version:shows tmuxinator version number'
+ )
+
+ if (( CURRENT == 2 )); then
+ _describe -t commands 'commands' commands
+ elif (( CURRENT == 3 )); then
+ case $words[2] in
+ copy|delete|open|start)
+ _arguments '*:projects:($projects)'
+ ;;
+ list)
+ _arguments '-v[verbose]' # FIXME: doesn't work well
+ ;;
+ esac
+ fi
+
+ return 0
+}
+
+_tmuxinator \ No newline at end of file
diff --git a/src/_vagrant b/src/_vagrant
new file mode 100644
index 0000000..af4f3dd
--- /dev/null
+++ b/src/_vagrant
@@ -0,0 +1,127 @@
+#compdef vagrant
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Vagrant (http://vagrantup.com).
+#
+# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/vagrant
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Nikita Fedyashev (https://github.com/nfedyashev)
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'box:Box commands'
+ 'destroy:Destroys the vagrant environment'
+ 'halt:Halts the currently running vagrant environment'
+ 'help:[TASK] Describe available tasks or one specific task'
+ 'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
+ 'package:Packages a vagrant environment for distribution'
+ 'provision:Run the provisioner'
+ 'reload:Reload the vagrant environment'
+ 'resume:Resumes a suspend vagrant environment'
+ 'ssh:SSH into the currently running environment'
+ 'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.'
+ 'status:Shows the status of the current Vagrant environment.'
+ 'suspend:Suspends the currently running vagrant environment'
+ 'up:Creates the vagrant environment'
+ 'version:Prints the Vagrant version information'
+)
+
+local -a _box_arguments
+_box_arguments=(
+ 'add:NAME URI Add a box to the system'
+ 'help:COMMAND Describe subcommands or one specific subcommand'
+ 'list:Lists all installed boxes'
+ 'remove:NAME Remove a box from the system'
+ 'repackage:NAME Repackage an installed box into a `.box` file.'
+)
+
+__task_list ()
+{
+ local expl
+ local -a tasks
+
+ tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version)
+
+ _wanted tasks expl 'help' compadd $tasks
+}
+
+__box_list ()
+{
+ _wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g')
+}
+
+__vm_list ()
+{
+ _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *:\([a-zA-Z0-9]\+\)' 2>/dev/null | cut -d: -f2)
+}
+
+__vagrant-box ()
+{
+ local curcontext="$curcontext" state line
+ local -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+ _describe -t commands "gem subcommand" _box_arguments
+ return
+ ;;
+
+ (options)
+ case $line[1] in
+ (repackage|remove)
+ _arguments ':feature:__box_list'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+
+
+
+local expl
+local -a boxes installed_boxes
+
+local curcontext="$curcontext" state line
+local -A opt_args
+
+_arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+case $state in
+ (command)
+ _describe -t commands "gem subcommand" _1st_arguments
+ return
+ ;;
+
+ (options)
+ case $line[1] in
+ (help)
+ _arguments ':feature:__task_list'
+ ;;
+
+ (box)
+ __vagrant-box
+ ;;
+ (up|provision|package|destroy|reload|ssh|halt|resume|status)
+ _arguments ':feature:__vm_list'
+ esac
+ ;;
+esac
diff --git a/src/_virtualbox b/src/_virtualbox
new file mode 100644
index 0000000..f360bcd
--- /dev/null
+++ b/src/_virtualbox
@@ -0,0 +1,312 @@
+#compdef VBoxManage=vboxmanage VBoxHeadless=vboxheadless
+# ------------------------------------------------------------------------------
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for VirtualBox (http://www.virtualbox.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+_vboxmachines() {
+ VBoxManage list vms | egrep -o '^"[^"]+"' 2>/dev/null | sed -e 's|"||g' | while read machine; do
+ _wanted 'machine' expl 'machine' compadd $machine
+ done
+}
+
+# Roughly guess command options
+_vboxcommandoptions() {
+ cmd="$1"
+ cmdoutput=$(VBoxManage "$cmd" 2>/dev/null | tail -n +2 | grep -v 'Syntax error:' | grep -v '<uuid>|<name>' | sed 's|<[^>]\+>||g' | sed 's|VBoxManage [^ ]\+ | |')
+
+ optcount=0
+ option=""
+ optlines=()
+ echo "$cmdoutput" | egrep -o ' [\[A-Za-z0-9\-\<].*' | while read line; do
+ option="${option}${line}"
+ if [[ $line[-1] != '|' ]]; then
+ optcount=$(($optcount+1))
+ optlines[$optcount]="$option"
+ option=""
+ fi
+ done
+
+ # optionals ([abc])
+ for line in $optlines; do
+ echo "$line" | egrep -o '\[[^]]+\]' | while read option; do
+ option=$(echo $option | sed 's|[]\[]||g' | cut -d ' ' -f 1)
+ _options=(${(s:|:)option})
+ for option in $_options; do
+ _wanted "${cmd}_option" expl "${cmd} option" compadd -- $option
+ done
+ done
+ done
+
+ # mandatory
+ for line in $optlines; do
+ echo "$line" | sed 's|\[[^]]\+\]|\n|g' | while read option; do
+ if [[ "$option" != "" ]]; then
+ _option=$(echo $option | cut -d ' ' -f 1)
+ _options=(${(s:|:)option})
+ for option in $_options; do
+ _wanted "${cmd}_option" expl "${cmd} option" compadd -- $option
+ done
+ fi
+ done
+ done
+}
+
+# List possible mediums
+_vboxmediums() {
+ _wanted "mediums" expl "mediums" compadd -- "none"
+ _wanted "mediums" expl "mediums" compadd -- "emptydrive"
+ _wanted "mediums" expl "mediums" compadd -- "iscsi"
+
+ _files -g '*.{iso,vmdk,vdi}'
+
+ for CD in /dev/cd/*; do
+ readlink -f $CD
+ done | uniq | while read CD; do
+ _wanted "host drives" expl "host drives" compadd -- "host:$CD"
+ done
+}
+
+# List available os types
+_vboxostypes() {
+ VBoxManage list ostypes | grep '^ID' | awk '{print $2}' | while read OSTYPE; do
+ _wanted 'ostype' expl 'os type' compadd -- $OSTYPE
+ done
+}
+
+# Guess options for this commands
+_vboxopts_controlvm() { _vboxcommandoptions controlvm }
+_vboxopts_modifyvm() { _vboxcommandoptions modifyvm }
+_vboxopts_export() { _vboxcommandoptions export }
+
+_vboxmanage() {
+ local -a _1st_arguments
+ _1st_arguments=(
+ "list:gives information about VirtualBox's current settings"
+ 'showvminfo:shows information about a particular virtual machine'
+ 'registervm:import a virtual machine definition in an XML file into VirtualBox'
+ 'unregistervm:unregisters a virtual machine'
+ 'createvm:creates a new XML virtual machine definition file'
+ 'modifyvm:changes the properties of a registered virtual machine which is not running'
+ 'import:imports a virtual appliance in OVF format by copying the virtual disk images and creating virtual machines in VirtualBox'
+ 'export:exports one or more virtual machines from VirtualBox into a virtual appliance in OVF format'
+ 'startvm:starts a virtual machine that is currently in the "Powered off" or "Saved" states'
+ 'controlvm:change the state of a virtual machine that is currently running'
+ 'discardstate:discards the saved state of a virtual machine which is not currently running'
+ 'adoptstate:adopt a saved state file (.sav)'
+ 'snapshot:control snapshots'
+ 'closemedium:removes a hard disk, DVD or floppy image from a VirtualBox media registry'
+ 'storageattach:attaches/modifies/removes a storage medium connected to a storage controller'
+ 'storagectl:attaches/modifies/removes a storage controller'
+ 'bandwidthctl:creates/deletes/modifies bandwidth groups'
+ 'showhdinfo:shows information about a virtual hard disk image'
+ 'createhd:creates a new virtual hard disk image'
+ 'modifyhd:change the characteristics of a disk image after it has been created'
+ 'clonehd:duplicates a registered virtual hard disk image to a new image file with a new unique identifier'
+ 'convertfromraw:converts a raw disk image to a VirtualBox Disk Image (VDI) file'
+ 'getextradata:retrieve string data to a virtual machine or to a VirtualBox configuration'
+ 'setextradata:attach string data to a virtual machine or to a VirtualBox configuration'
+ 'setproperty:change global settings which affect the entire VirtualBox installation'
+ 'usbfilter:used for working with USB filters in virtual machines, or global filters'
+ 'sharedfolder:share folders on the host computer with guest operating systems'
+ 'guestproperty:get or set properties of a running virtual machine'
+ 'guestcontrol:control certain things inside a guest from the host'
+ 'debugvm:for experts who want to tinker with the exact details of virtual machine execution'
+ 'metrics:monitor the usage of system resources'
+ 'hostonlyif:change the IP configuration of a host-only network interface'
+ 'dhcpserver:control the DHCP server that is built into VirtualBox'
+ 'extpack:add or remove VirtualBox extension packs'
+ )
+
+ local context state line expl
+ local -A opt_args
+
+ _arguments '*:: :->subcmds' && return 0
+
+ if (( CURRENT == 1 )); then
+ _describe -t commands "VBoxManage commands" _1st_arguments -V1
+ return
+ fi
+
+ case "$words[1]" in
+ list)
+ _arguments \
+ '--long' \
+ ':list option:(vms runningvms ostypes hostdvds hostfloppies bridgedifs hostonlyifs dhcpservers hostinfo hostcpuids hddbackends hdds dvds floppies usbhost usbfilters systemproperties extpacks)'
+ ;;
+ showvminfo)
+ _arguments \
+ :machine:_vboxmachines \
+ '--details' \
+ '--machinereadable' \
+ '--log: :'
+ ;;
+ unregistervm)
+ _arguments \
+ :machine:_vboxmachines \
+ '--delete'
+ ;;
+ createvm)
+ _arguments \
+ '--name: :' \
+ '--ostype:os type:_vboxostypes' \
+ '--register' \
+ '--basefolder:folder:_files -/' \
+ '--settingsfile:file:_files' \
+ '--uuid: :'
+ ;;
+ modifyvm)
+ _arguments \
+ :machine:_vboxmachines \
+ :modifyvm_option:_vboxopts_modifyvm
+ ;;
+ import)
+ _arguments \
+ ':ovf file:_files -g \*.{ovf,ova}' \
+ '--dry-run'
+ ;;
+ export)
+ _arguments \
+ :machine:_vboxmachines \
+ :export_option:_vboxopts_export
+ ;;
+ startvm)
+ _arguments \
+ :machine:_vboxmachines \
+ '--type:running mode:(gui sdl headless)'
+ ;;
+ controlvm)
+ _arguments \
+ :machine:_vboxmachines \
+ :controlvm_option:_vboxopts_controlvm
+ ;;
+ adoptstate)
+ _arguments \
+ :machine:_vboxmachines \
+ ':sav file:_files -g \*.sav'
+ ;;
+ closemedium)
+ _arguments \
+ ':type:(disk dvd floppy)' \
+ ':file:_files' \
+ '--delete'
+ ;;
+ discardstate|bandwidthctl|getextradata|setextradata|debugvm)
+ _arguments \
+ :machine:_vboxmachines
+ ;;
+ storagectl)
+ _arguments \
+ :machine:_vboxmachines \
+ '--name: :' \
+ '--add:type:(ide scsi floppy sas)' \
+ '--controller:type:(LSILogic|LSILogicSAS|BusLogic|IntelAHCI|PIIX3|PIIX4|ICH6|I82078)' \
+ --sataideemulation{1..4}":port:({1..30})" \
+ "--sataportcount:num:({1..30})" \
+ '--hostiocache:bool:(on off)' \
+ '--bootable:bool:(on off)' \
+ '--remove' #"
+ ;;
+ storageattach)
+ _arguments \
+ :machine:_vboxmachines\
+ '--storagectl:storage ctl:("IDE Controller" "SATA Controller")' \
+ '--port: :' \
+ '--device: :' \
+ '--type:drive type:(dvddrive hdd fdd)' \
+ '--medium:mediums:_vboxmediums' \
+ '--mtype:behaviour:(normal writethrough immutable shareable)' \
+ '--comment: :' \
+ '--passthrough:enabled?:(on off)' \
+ '--bandwidthgroup: :' \
+ '--forceunmount' '--server: :' \
+ '--target: :' \
+ '--lun: :' \
+ '--encodedlun: :' \
+ '--username: :' \
+ '--password: :' \
+ '--intnet: :'
+ ;;
+ createhd)
+ _arguments \
+ '--filename:filename:_files -g \*.{vdi,vmdk,vhd}' \
+ '--size:megabytes:' \
+ '--sizebyte:bytes:' \
+ '--format:type:(VDI VMDK VHD)' \
+ '--variant:type:(Standard Fixed Split2G Stream ESX)'
+ ;;
+ sharedfolder)
+ _arguments \
+ ':action:(add remove)' \
+ :machine:_vboxmachines \
+ '--name: :' \
+ '--hostpath:path:_files -/' \
+ '--transient' \
+ '--readonly' \
+ '--automount'
+ ;;
+ esac
+ return 1
+}
+
+_vboxheadless() {
+ local context state line expl
+ local -A opt_args
+
+ _arguments \
+ '(-s -startvm --startvm)'{-s,-startvm,--startvm}'[Start given VM]:machine:_vboxmachines' \
+ '(-n --vnc)'{-n,--vnc}'[Enable the built in VNC server]' \
+ '(-m --vncport)'{-m,--vncport}'[TCP port number to use for the VNC server]:port:' \
+ '(-o --vncpass)'{-o,--vncpass}'[Set the VNC server password]:pw:' \
+ '(-v -vrde --vrde)'{-v,-vrde,--vrde}"[Enable (default) or disable the VRDE server or don't change the setting]::(on off config)" \
+ '(-e -vrdeproperty --vrdeproperty)'{-e,-vrdeproperty,--vrdeproperty}'[Set a VRDE property]: :' \
+ '(-c -capture --capture)'{-c,-capture,--capture}'[Record the VM screen output to a file]' \
+ '(-w --width)'{-w,--width}'[Frame width when recording]:width:' \
+ '(-h --height)'{-h,--height}'[Frame height when recording]:height:' \
+ '(-r --bitrate)'{-r,--bitrate}'[Recording bit rate when recording]:bitrate:' \
+ '(-f --filename)'{-f,--filename}'[File name when recording. The codec used will be chosen based on the file extension]:filename:_files'
+}
+
+_virtualbox() {
+ local ret=1
+ _call_function ret _$service
+ return ret
+}
+
+_virtualbox "$@"
diff --git a/src/_vpnc b/src/_vpnc
new file mode 100644
index 0000000..62222b1
--- /dev/null
+++ b/src/_vpnc
@@ -0,0 +1,202 @@
+#compdef vpnc vpnc-connect vpnc-disconnect
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for vpnc.
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et
+# ------------------------------------------------------------------------------
+
+
+(( $+functions[_vpnc-connect] )) ||
+_vpnc-connect() {
+ _arguments \
+ '(- : *)--version[display version information]' \
+ '(- : *)--'{,long-}'help[display help information]' \
+ '--gateway[IP/name of your IPSec gateway]: :_hosts' \
+ '--id[your group name]: :_groups' \
+ '--username[your username]: :_users' \
+ '--domain[domain name for authentication]: :_domains' \
+ '--xauth-inter[enable interactive extended authentication]' \
+ '--vendor[vendor of your IPSec gateway]: :_vpnc_gateway_vendors' \
+ '--natt-mode[NAT-Traversal method]: :_vpnc_nat_traversal_methods' \
+ '--script[command executed using system() to configure the interface, routing and so on]:command path:_files' \
+ '--dh[name of the IKE DH Group]: :_vpnc_ike_diffie_hellman_groups' \
+ '--pfs[Diffie-Hellman group to use for PFS]: :_vpnc_pfs_diffie_hellman_groups' \
+ '--enable-1des[enable weak single DES encryption]' \
+ '--enable-no-encryption[enable using no encryption for data traffic (key exchanged must be encrypted)]' \
+ '--application-version[application version to report]:application version' \
+ '--ifname[visible name of the TUN/TAP interface]:name' \
+ '--ifmode[mode of TUN/TAP interface]: :_vpnc_tun_tap_modes' \
+ '--debug[show verbose debug messages]: :_vpnc_debug_levels' \
+ '--no-detach[Don'\''t detach from the console after login]' \
+ '--pid-file[store the pid of background process in the file]:pid file:_files' \
+ '--local-addr[local IP to use for ISAKMP/ESP/...]: :_hosts' \
+ '--local-port[local ISAKMP port number to use]: :_vpnc_isakmp_port_numbers' \
+ '--udp-port[local UDP port number to use]: :_vpnc_udp_port_numbers' \
+ '--dpd-idle[send DPD packet after not receiving anything for X seconds]: :_vpnc_dpd_idle_times' \
+ '--non-inter[Don'\''t ask anything, exit on missing options]' \
+ '--auth-mode[authentication mode]: :_vpnc_authentication_modes' \
+ '--ca-file[filename and path to the CA-PEM-File]:CA-PEM file:_files' \
+ '--ca-dir[path of the trusted CA-Directory]:CA directory:_files -/' \
+ '--target-network[target network in dotted decimal or CIDR notation]:target network/netmask' \
+ '--print-config[print your configuration; output can be used as vpnc.conf]' \
+ '*: :_vpnc_confs'
+}
+
+(( $+functions[_vpnc-disconnect] )) ||
+_vpnc-disconnect() {
+ _message 'no more arguments'
+}
+
+(( $+functions[_vpnc_confs] )) ||
+_vpnc_confs() {
+ # FIXME /etc/vpnc/ is only accessible to root, how do we deal with this ?
+ local confs; confs=(/etc/vpnc/*.conf(:t:s/\.conf/))
+ _describe -t confs 'VPNC conf' confs "$@"
+}
+
+(( $+functions[_vpnc_gateway_vendors] )) ||
+_vpnc_gateway_vendors() {
+ local vendors; vendors=(
+ 'cisco'
+ 'netscreen'
+ )
+ _describe -t vendors 'vendor' vendors "$@"
+}
+
+(( $+functions[_vpnc_nat_traversal_methods] )) ||
+_vpnc_nat_traversal_methods() {
+ local methods; methods=(
+ 'natt:NAT-T as defined in RFC3947 (default)'
+ 'none:disable use of any NAT-T method'
+ 'force-natt:always use NAT-T encapsulation even without presence of a NAT device'
+ 'cisco-udp:Cisco proprietary UDP encapsulation, commonly over Port 10000'
+ )
+ _describe -t methods 'NAT traversal method' methods "$@"
+}
+
+(( $+functions[_vpnc_ike_diffie_hellman_groups] )) ||
+_vpnc_ike_diffie_hellman_groups() {
+ local groups; groups=(
+ 'dh1'
+ 'dh2'
+ 'dh5'
+ )
+ _describe -t groups 'IKE Diffie Hellman group' groups "$@"
+}
+
+(( $+functions[_vpnc_pfs_diffie_hellman_groups] )) ||
+_vpnc_pfs_diffie_hellman_groups() {
+ local groups; groups=(
+ 'nopfs'
+ 'dh1'
+ 'dh2'
+ 'dh5'
+ 'server'
+ )
+ _describe -t groups 'PFS Diffie Hellman group' groups "$@"
+}
+
+(( $+functions[_vpnc_tun_tap_modes] )) ||
+_vpnc_tun_tap_modes() {
+ local modes; modes=(
+ 'tun:virtual point to point interface (default)'
+ 'tap:virtual ethernet interface'
+ )
+ _describe -t modes 'TUN/TAP interface mode' modes "$@"
+}
+
+(( $+functions[_vpnc_debug_levels] )) ||
+_vpnc_debug_levels() {
+ local levels; levels=(
+ '0:do not print debug information'
+ '1:print minimal debug information'
+ '2:show statemachine and packet/payload type information'
+ '3:dump everything exluding authentication data'
+ '99:dump everything INCLUDING AUTHENTICATION data (e.g. PASSWORDS)'
+ )
+ _describe -t levels 'debug level' levels "$@"
+}
+
+(( $+functions[_vpnc_isakmp_port_numbers] )) ||
+_vpnc_isakmp_port_numbers() {
+ local ports; ports=(
+ '0:use random port'
+ '1:minimum port number'
+ '500:default port number'
+ '65535:maximum port number'
+ )
+ _describe -t ports 'ISAKMP port number' ports "$@"
+}
+
+(( $+functions[_vpnc_udp_port_numbers] )) ||
+_vpnc_udp_port_numbers() {
+ local ports; ports=(
+ '0:use random port'
+ '1:minimum port number'
+ '10000:default port number'
+ '65535:maximum port number'
+ )
+ _describe -t ports 'UDP port number' ports "$@"
+}
+
+(( $+functions[_vpnc_dpd_idle_times] )) ||
+_vpnc_dpd_idle_times() {
+ local times; times=(
+ '0:completely disable DPD'
+ '10:minimum value'
+ '300:default value'
+ '86400:maximum value'
+ )
+ _describe -t times 'DPD idle wait time (seconds)' times "$@"
+}
+
+(( $+functions[_vpnc_authentication_modes] )) ||
+_vpnc_authentication_modes() {
+ local modes; modes=(
+ 'psk:pre-shared key (default)'
+ 'cert:server + client certificate'
+ 'hybrid:server certificate + xauth'
+ )
+ _describe -t modes 'authentication mode' modes "$@"
+}
+
+case $service in
+ vpnc|vpnc-connect) _call_function ret _vpnc-connect && return ret ;;
+ vpnc-disconnect) _call_function ret _vpnc-disconnect && return ret ;;
+esac
diff --git a/src/_yaourt b/src/_yaourt
new file mode 100644
index 0000000..ae5fcbf
--- /dev/null
+++ b/src/_yaourt
@@ -0,0 +1,346 @@
+#compdef yaourt yaourt.static=yaourt
+
+# Completion file for yaourt, based on pacman's
+
+# copy this file to /usr/share/zsh/site-functions/_pacman
+
+# handles --help subcommand
+_yaourt_action_help() {
+ _arguments -s : \
+ "$_yaourt_opts_commands[@]"
+}
+
+# handles cases where no subcommand has yet been given
+_yaourt_action_none() {
+ _arguments -s : \
+ "$_yaourt_opts_commands[@]"
+}
+
+# handles --query subcommand
+_yaourt_action_query() {
+ local context state line
+ typeset -A opt_args
+
+# _arguments -s : \
+# "$_yaourt_opts_common[@]" \
+# "$_yaourt_opts_query_actions[@]" \
+# "$_yaourt_opts_query_modifiers[@]"
+
+ case $state in
+ query_file)
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_query_modifiers[@]" \
+ '*:package file:_files -g "*.pkg.tar.*"'
+ ;;
+ query_group)
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_query_modifiers[@]" \
+ '*:groups:_yaourt_completions_installed_groups'
+ ;;
+ query_owner)
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_query_modifiers[@]" \
+ '*:file:_files'
+ ;;
+ query_search)
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_query_modifiers[@]" \
+ '*:search text: '
+ ;;
+ *)
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_query_actions[@]" \
+ "$_yaourt_opts_query_modifiers[@]" \
+ '*:package:_yaourt_completions_installed_packages'
+ ;;
+ esac
+}
+
+# handles --remove subcommand
+_yaourt_action_remove() {
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_remove[@]"
+}
+
+# handles --sync subcommand
+_yaourt_action_sync() {
+ local context state line
+ typeset -A opt_args
+
+# _arguments -s : \
+# "$_yaourt_opts_common[@]" \
+# "$_yaourt_opts_sync_actions[@]" #\
+# #"$_yaourt_opts_sync_modifiers[@]"
+
+ case $state in
+ sync_clean)
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_sync_modifiers[@]" \
+ '*-c[Remove old packages from cache]' \
+ ;;
+ sync_group)
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_sync_modifiers[@]" \
+ '*:package group:_yaourt_completions_all_groups'
+ ;;
+ sync_search)
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_sync_modifiers[@]" \
+ '*:search text: '
+ ;;
+ *)
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_sync_modifiers[@]" \
+ '*:package:_yaourt_completions_all_packages'
+ ;;
+ esac
+}
+
+# handles --upgrade subcommand
+_yaourt_action_upgrade() {
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_pkgfile[@]"
+}
+
+# handles --version subcommand
+_yaourt_action_version() {
+ # no further arguments
+ return 0
+}
+
+# provides completions for package groups
+_yaourt_completions_all_groups() {
+ local -a cmd groups
+ _yaourt_get_command
+ groups=( $(_call_program groups $cmd[@] -Sg) )
+ typeset -U groups
+ compadd "$@" -a groups
+}
+
+# provides completions for packages available from repositories
+# these can be specified as either 'package' or 'repository/package'
+_yaourt_completions_all_packages() {
+ local -a cmd packages repositories packages_long
+ _yaourt_get_command
+
+ if compset -P1 '*/*'; then
+ packages=( $(_call_program packages $cmd[@] -Sql ${words[CURRENT]%/*}) )
+ typeset -U packages
+ _wanted repo_packages expl "repository/package" compadd ${(@)packages}
+ else
+ packages=( $(_call_program packages $cmd[@] -Sql) )
+ typeset -U packages
+ _wanted packages expl "packages" compadd - "${(@)packages}"
+
+ repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
+ typeset -U repositories
+ _wanted repo_packages expl "repository/package" compadd -S "/" $repositories
+ fi
+}
+
+# provides completions for package groups
+_yaourt_completions_installed_groups() {
+ local -a cmd groups
+ _yaourt_get_command
+ groups=(${(o)${(f)"$(_call_program groups $cmd[@] -Qg)"}% *})
+ typeset -U groups
+ compadd "$@" -a groups
+}
+
+# provides completions for installed packages
+_yaourt_completions_installed_packages() {
+ local -a cmd packages packages_long
+ packages_long=(/var/lib/pacman/local/*(/))
+ packages=( ${${packages_long#/var/lib/pacman/local/}%-*-*} )
+ compadd "$@" -a packages
+}
+
+# provides completions for repository names
+_yaourt_completions_repositories() {
+ local -a cmd repositories
+ repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
+ # Uniq the array
+ typeset -U repositories
+ compadd "$@" -a repositories
+}
+
+# builds command for invoking pacman in a _call_program command - extracts
+# relevant options already specified (config file, etc)
+# $cmd must be declared by calling function
+_yaourt_get_command() {
+ # this is mostly nicked from _perforce
+ cmd=( "pacman" )
+ integer i
+ for (( i = 2; i < CURRENT - 1; i++ )); do
+ if [[ ${words[i]} = "--config" || ${words[i]} = "--root" ]]; then
+ cmd+=( ${words[i,i+1]} )
+ fi
+ done
+}
+
+# main dispatcher
+_yaourt() {
+ typeset -A opt_args
+
+ # options for passing to _arguments: main pacman commands
+ typeset -a _yaourt_opts_commands
+ _yaourt_opts_commands=(
+ '-Q[Query the package database]'
+ '-R[Remove a package from the system]'
+ '-S[Synchronize packages]'
+ '-U[Upgrade a package]'
+ '-V[Display version and exit]'
+ '-h[Display usage]'
+ '-B[backup pacman database]'
+ '-G[Get PKGBUILD]'
+ '-C[Clean backup files]'
+ '--stats[Package Statistics]'
+ )
+
+ # options for passing to _arguments: options common to all commands
+ typeset -a _yaourt_opts_common
+ _yaourt_opts_common=(
+ '-b[Alternate database location]:database_location:_files -/'
+ '-h[Display syntax for the given operation]'
+ '-r[Set alternate installation root]:installation root:_files -/'
+ '-v[Be more verbose]'
+ '--cachedir[Alternate package cache location]:cache_location:_files -/'
+ '--config[An alternate configuration file]:config file:_files'
+ '--logfile[An alternate log file]:config file:_files'
+ '--noconfirm[Do not ask for confirmation]'
+ '--noprogressbar[Do not show a progress bar when downloading files]'
+ '--noscriptlet[Do not execute the install scriptlet if one exists]'
+ '--print[Only print the targets instead of performing the operation]'
+ )
+
+ # options for passing to _arguments: options for --upgrade commands
+ typeset -a _yaourt_opts_pkgfile
+ _yaourt_opts_pkgfile=(
+ '-d[Skip dependency checks]'
+ '-f[Overwrite conflicting files]'
+ '*:package file:_files -g "*.pkg.tar.*(.)"'
+ )
+
+ # options for passing to _arguments: subactions for --query command
+ typeset -a _yaourt_opts_query_actions
+ _yaourt_opts_query_actions=(
+ '-g[View all members of a package group]:*:package groups:->query_group'
+ '-o[Query the package that owns a file]:file:_files'
+ '-p[Package file to query]:*:package file:->query_file'
+ '-s[Search package names and descriptions]:*:search text:->query_search'
+ )
+
+ # options for passing to _arguments: options for --query and subcommands
+ typeset -a _yaourt_opts_query_modifiers
+ _yaourt_opts_query_modifiers=(
+ '-c[List package changelog]'
+ '-d[List packages installed as dependencies]'
+ '-e[List packages explicitly installed]'
+ '-i[View package information]'
+ '-ii[View package information including backup files]'
+ '-k[Check package files]'
+ '-l[List package contents]'
+ '-m[List installed packages not found in sync db(s)]'
+ '-t[List packages not required by any package]'
+ '-u[List packages that can be upgraded]'
+ '--aur[Install packages from aur, even if they are in community, or, with the -u option, update packages installed from aur]'
+ '--devel[Used with -u updates all cvs/svn/git/hg/bzr packages]'
+ )
+
+ # options for passing to _arguments: options for --remove command
+ typeset -a _yaourt_opts_remove
+ _yaourt_opts_remove=(
+ '-c[Remove all dependent packages]'
+ '-d[Skip dependency checks]'
+ '-k[Only remove database entry, do not remove files]'
+ '-n[Remove protected configuration files]'
+ '-s[Remove dependencies not required by other packages]'
+ '*:installed package:_yaourt_completions_installed_packages'
+ )
+
+ # options for passing to _arguments: options for --sync command
+ typeset -a _yaourt_opts_sync_actions
+ _yaourt_opts_sync_actions=(
+ '*-c[Remove old packages from cache]:*:clean:->sync_clean'
+ '*-cc[Remove all packages from cache]:*:clean:->sync_clean'
+ '-g[View all members of a package group]:*:package groups:->sync_group'
+ '-s[Search package names and descriptions]:*:search text:->sync_search'
+ )
+
+ # options for passing to _arguments: options for --sync command
+ typeset -a _yaourt_opts_sync_modifiers
+ _yaourt_opts_sync_modifiers=(
+ '-d[Skip dependency checks]'
+ '-f[Overwrite conflicting files]'
+ '-i[View package information]'
+ '-l[List all packages in a repository]'
+ '-p[Print download URIs for each package to be installed]'
+ '-u[Upgrade all out-of-date packages]'
+ '-w[Download packages only]'
+ '-y[Download fresh package databases]'
+ '*--ignore[Ignore a package upgrade]:package:
+ _yaourt_completions_all_packages'
+ '*--ignoregroup[Ignore a group upgrade]:package group:
+ _yaourt_completions_all_groups'
+ '--asdeps[Install packages as non-explicitly installed]'
+ '--asexplicit[Install packages as explicitly installed]'
+ )
+
+ case $words[2] in
+ -Q*g*) # ipkg groups
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_query_modifiers[@]" \
+ '*:groups:_yaourt_completions_installed_groups'
+ ;;
+ -Q*o*) # file
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_query_modifiers[@]" \
+ '*:package file:_files'
+ ;;
+ -Q*p*) # file *.pkg.tar.*
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_query_modifiers[@]" \
+ '*:package file:_files -g "*.pkg.tar.*"'
+ ;;
+ -Q*) _yaourt_action_query ;;
+ -R*) _yaourt_action_remove ;;
+ -S*c*) # no completion
+ return 0
+ ;;
+ -S*l*) # repos
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_sync_modifiers[@]" \
+ '*:package repo:_yaourt_completions_repositories' \
+ ;;
+ -S*g*) # pkg groups
+ _arguments -s : \
+ "$_yaourt_opts_common[@]" \
+ "$_yaourt_opts_sync_modifiers[@]" \
+ '*:package group:_yaourt_completions_all_groups'
+ ;;
+ -S*) _yaourt_action_sync ;;
+ -U*) _yaourt_action_upgrade ;;
+ -V*) _yaourt_action_version ;;
+ -h*) _yaourt_action_help ;;
+ - ) _yaourt_action_none ;;
+ * ) return 1 ;;
+ esac
+}
+
+# run the main dispatcher
+_yaourt "$@"