abra zsh config 2.0

This commit is contained in:
Andrey Anurin
2018-08-12 15:26:21 +03:00
parent 201abd09c4
commit 6b114440e2
1195 changed files with 68948 additions and 10539 deletions

View File

@@ -1,30 +1,5 @@
#compdef ack ack2 ack-grep ack-standalone
# ------------------------------------------------------------------------------
# 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
# -----------
#

View File

@@ -1,422 +0,0 @@
#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>
#
# ------------------------------------------------------------------------------
_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
;;
(sideload)
_arguments \
'1: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 "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -0,0 +1,72 @@
#compdef afew
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 afew an initial tagging script for notmuch mail. (https://github.com/teythoon/afew)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
_afew() {
_arguments -C \
'(- 1 *)'-h"[Show help and exit]" \
"(-c --classify -l --learn= -t --tag -u --update -U --update-reference -m --move-mails)"{-w,--watch}"[Continuously monitor the mailbox for new messages matching the given query]" \
"(-c --classify -l --learn= -u --update -U --update-reference -m --move-mails -w --watch)"{-t,--tag}"[Run the tag filters]" \
"(-c --classify -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-l,--learn=}"[Train category with the messages matching query]" \
"(-c --classify -l --learn= -t --tag -U --update-reference -m --move-mails -w --watch)"{-u,--update}"[Update the categories (requires no query)]" \
"(-c --classify -l --learn= -t --tag -u --update -m --move-mails -w --watch)"{-U,--update-reference}"[Update the reference category (takes quite some time) (requires no query)]" \
"(-l --learn= -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-c,--classify}"[Classify each message matching the iven query]" \
"(-c --classify -l --learn= -t --tag -u --update -U --update-reference -w --watch)"{-m,--move-mails}"[Move mail files between maildir folders]" \
"(-n --all)"{-a,--all}"[Operate on all email]" \
"(-a --new)"{-n,--new}"[Operate on all new email]" \
{-C,--notmuch-config=}"[Path to notmuch configuration file]:files:_files" \
{-e,--enable-filters=}"[Flter classes to use]:filters" \
{-d,--dry-run}"[Dont change the DB]" \
{-R,--reference-set-size=}"[Size of the reference set (default: 1000)]:size:" \
{-T,--reference-set-timeframe-days=}"[Do not use emails older than DAYS days (default: 30)]:days:" \
{--verbose,-v}"[Be more verbose]" \
'*:Query:' \
}
_afew
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,217 +0,0 @@
#compdef ag
# ------------------------------------------------------------------------------
# Copyright (c) 2015 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 ag (https://github.com/ggreer/the_silver_searcher)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Akira Maeda <https://github.com/glidenote>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_ag_version() {
local version
version=( $($words[1] --version) )
version=${version[@]:2:1}
version=( "${(@s/./)version}" )
echo "${version[2]}"
}
# Dynamically build the file type completion
# Modifies the global $AG_OPTS array
_ag_add_file_types() {
local typ exts
for i in $($words[1] --list-file-types); do
if [[ "${i:0:2}" = '--' ]]; then
if [[ "${typ}x" != "x" ]]; then
AG_OPTS+="${typ}[${exts}]"
fi
typ=$i
exts=
else
exts+=$i
fi
done
AG_OPTS+="${typ}[${exts}]"
}
# Add version appropriate options above base
# Modifies the global $AG_OPTS array
_ag_add_version_opts() {
local minor=$(_ag_version)
if [[ $minor -gt 21 ]];then
_ag_add_file_types
AG_OPTS+=(
'(- 1 *)--list-file-types[list supported filetypes to search]'
'--silent[suppress all log messages, including errors]'
)
fi
if [[ $minor -gt 22 ]];then
AG_OPTS+=(
'(-z --search-zip)'{-z,--search-zip}'[search contents of compressed files]'
)
fi
if [[ $minor -le 24 ]];then
AG_OPTS+=(
'(-s --case-sensitive)'{-s,--case-sensitive}'[match case sensitively]'
'(--noheading --heading)'{--noheading,--heading}'[print file names above matching contents]'
)
fi
if [[ $minor -gt 24 ]];then
AG_OPTS+=(
'(-s --case-sensitive)'{-s,--case-sensitive}'[Match case sensitively. Default on.]'
'(-H --noheading --heading)'{-H,--noheading,--heading}'[print file names above matching contents]'
'--vimgrep[output results like vim''s, :vimgrep /pattern/g would (report every match on the line)]'
)
fi
if [[ $minor -gt 26 ]];then
AG_OPTS+=(
'(-0 --null --print0)'{-0,--null,--print0}'[separate the filenames with \\0, rather than \\n]'
)
fi
if [[ $minor -le 27 ]];then
AG_OPTS+=(
'--depth[Search up to NUM directories deep. Default is 25.]:number'
)
fi
if [[ $minor -gt 27 ]];then
AG_OPTS+=(
'(-c --count)'{-c,--count}'[only print the number of matches in each file]'
'--depth[Search up to NUM directories deep, -1 for unlimited. Default is 25.]:number'
'(-F --fixed-strings)'{-F,--fixed-strings}'[alias for --literal for compatibility with grep]'
)
fi
if [[ $minor -le 28 ]];then
AG_OPTS+=(
'(--no-numbers)--no-numbers[don´t show line numbers]'
)
fi
if [[ $minor -gt 28 ]];then
AG_OPTS+=(
'(--nofilename --filename)'{--nofilename,--filename}'[Print file names. Default on, except when searching a single file.]'
'(--nonumbers --numbers)'{--nonumbers,--numbers}'[Print line numbers. Default is to omit line numbers when searching streams]'
'(-o --only-matching)'{-o,--only-matching}'[print only the matching part of the lines]'
)
fi
}
_ag() {
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 _ag_types_caching_policy
# Don't complete if command doesn't exist
[[ ${+commands[${words[1]}]} -eq 0 ]] && return 0
if ( [[ ${+AG_OPTS} -eq 0 ]] || _cache_invalid "_AG_OPTS" ) && ! _retrieve_cache "_AG_OPTS"; then
# Base opts starts at ag version 0.20
AG_OPTS=(
'(- 1 *)--help[print a short help statement]'
'(- 1 *)--man[print the manual page]'
'(- 1 *)--version[display version and copyright information]'
'--ackmate[output results in a format parseable by AckMate]'
'(-A --after)'{-A,--after}'[Print NUM lines before match. Default is 2]:number'
'(-t --all-text -a --all-types -u --unrestricted)'{-t,--all-text}"[search all text files, excluding hidden ones]"
'(-a --all-types -t --all-text -u --unrestricted)'{-a,--all-types}"[search all text files, excluding hidden ones and not obeying ignore files (.agignore, .gitignore...)]"
'(-B --before)'{-B,--before}'[Print NUM lines after match. Defaults is 2]:number'
'(--nobreak --break)'{--nobreak,--break}'[Print a newline between matches in different files. Default on.]'
'(--color --nocolor)--color[Print color codes in results. Default on.]'
'(--nocolor --color --color-line-number --color-match --color-path)--nocolor[Do not print color codes in results. Default on.]'
'(--nocolor)--color-line-number[Color codes for line numbers. Default is 1;33.]'
'(--nocolor)--color-match[Color codes for result match numbers. Default is 30;43.]'
'(--nocolor)--color-path[Color codes for path names. Default is 1;32.]'
'--column[print column numbers in results]'
'(-C --context)'{-C,--context}'[Print NUM lines before and after matches. Default is 2.]:number'
'(-D --debug)'{-D,--debug}'[enable debug logging]'
'(-G --file-search-regex)'{-G,--file-search-regex}'[only search file names matching PATTERN]:pattern'
'(-l --files-with-matches)'{-l,--files-with-matches}'[only print filenames containing matches, not matching lines]'
'(-L --files-without-matches)'{-L,--files-without-matches}"[only print filenames that don't contain matches]"
'(-f --follow)'{-f,--follow}'[follow symlinks]'
'(-g)-g[print filenames that match PATTERN]:pattern'
'(--nogroup --group)'{--nogroup,--group}'[same as --\[no\]break --\[no\]heading]'
'--hidden[search hidden files, still obeys ignore files.]'
'*--ignore[Ignore files/directories matching this pattern. Literal file and directory names are also allowed.]:files:_files'
'(-i --ignore-case)'{-i,--ignore-case}'[match case insensitively]:pattern'
'*--ignore-dir[alias for --ignore for compatibility with ack]:files:_files'
'(-v --invert-match)'{-v,--invert-match}'[invert match]'
'(-Q --literal)'{-Q,--literal}'[match PATTERN literally, no regular expression]'
'(-m --max-count)'{-m,--max-count}'[Skip the rest of a file after NUM matches. Default is 10,000.]:number'
'(--pager --nopager)'{--pager,--nopager}'[Display results with PAGER. Disabled by default.]:pager program:_command_names'
'(--passthrough)--passthrough[when searching a stream, print all lines even if they don''t match]'
'(-p --path-to-agignore)'{-p,--path-to-agignore}'[provide a path to a specific .agignore file]:files:_files'
'--print-long-lines[print matches on very long lines, > 2k characters by default]'
'--search-binary[search binary files]'
'(-U --skip-vcs-ignores)'{-U,--skip-vcs-ignores}'[ignore VCS ignore files (.gitigore, .hgignore, svn:ignore), but still use .agignore]'
'(-S --smart-case)'{-S,--smart-case}'[match case sensitively if PATTERN contains any uppercase letters, else match case insensitively]'
'--stats[print stats (files scanned, time taken, etc)]'
'(-u --unrestricted -t --all-text -a --all-types)'{-u,--unrestricted}'[search ALL files, includes: hidden, binary & ignored files (.agignore, .gitignore...)]'
'(-w --word-regexp)'{-w,--word-regexp}'[only match whole words]'
)
_ag_add_version_opts
AG_OPTS+=(
'*: :_files'
)
[[ $#AG_OPTS -gt 0 ]] && _store_cache '_AG_OPTS' AG_OPTS
fi
_arguments -C -s -S ${AG_OPTS} && ret=0
unset AG_OPTS
case $state in
# placeholder
esac
return ret
}
_ag_types_caching_policy() {
# Rebuild if .agignore more recent than cache.
[[ -f $HOME/.agignore && $$HOME/.agignore -nt "$1" ]] && return 0
# Rebuild if cache is older than one week.
local -a oldp
oldp=( "$1"(Nmw+1) )
(( $#oldp )) && return 0
return 1
}
_ag "$@"

View File

@@ -1,30 +1,5 @@
#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
# -----------
#
@@ -238,6 +213,8 @@ _android_cmds() {
'update:update a virtual device, project, SDK or adb'
'move:move a virtual device'
'delete:delete a virtual device'
'avd:displays the AVD Manager window'
'sdk:displays the SDK Manager window'
'display:display manager windows'
)
_describe -t commands 'command' commands "$@"

View File

@@ -28,13 +28,14 @@
# Description
# -----------
#
# Completion script for ansible v1.8.4 (http://ansible.org)
# Completion script for ansible v2.0.0.2 (http://ansible.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Romain Bossart (https://github.com/bosr)
# * Adam Stevko (https://github.com/xen0l)
#
# ------------------------------------------------------------------------------
#
@@ -61,6 +62,7 @@ __host_file_location () {
[[ "$OSTYPE" == darwin* ]] && FALLBACK="/usr/local/etc/ansible/hosts"
[[ "$OSTYPE" == linux* ]] && FALLBACK="/etc/ansible/hosts"
HOST_FILE=${ANSIBLE_HOSTS:=${FALLBACK}}
[[ -f ${HOST_FILE} ]] || HOST_FILE="$PWD/ansible/inventory/hosts"
[[ -f ${HOST_FILE} ]] || HOST_FILE=/dev/null
echo ${HOST_FILE}
@@ -91,7 +93,7 @@ __host_list ()
local -a mixed_host_list
mixed_host_list=$(command \
cat ${HOST_FILE} \
| awk 'NF && $1 !~ /[\[:=]/ { print $1 }' \
| awk 'NF && $1 !~ /^[[:space:]]*#|[\[:=]/ { print $1 }' \
| sort | uniq)
# compute set difference h1 - h2
@@ -120,15 +122,16 @@ __group_list ()
_modules=(
'a10_server:(E) Manage A10 Networks AX/SoftAX/Thunder/vThunder devices'
'a10_service_group:(E) Manage A10 Networks AX/SoftAX/Thunder/vThunder devices'
'a10_virtual_server:(E) Manage A10 Networks AX/SoftAX/Thunder/vThunder devices'
'a10_server:Manage A10 Networks AX/SoftAX/Thunder/vThunder devices'
'a10_service_group:Manage A10 Networks devices service groups'
'a10_virtual_server:Manage A10 Networks devices virtual servers'
'accelerate:Enable accelerated mode on remote node'
'acl:Sets and retrieves file ACL information.'
'add_host:add a host (and alternatively a group) to the ansible-playbook in-memory inventory'
'airbrake_deployment:(E) Notify airbrake about app deployments'
'alternatives:(E) Manages alternative programs for common commands'
'airbrake_deployment:Notify airbrake about app deployments'
'alternatives:Manages alternative programs for common commands'
'apache2_module:enables/disables a module of the Apache2 webserver'
'apk:Manages apk packages'
'apt:Manages apt-packages'
'apt_key:Add or remove an apt key'
'apt_repository:Add and remove APT repositories'
@@ -136,165 +139,334 @@ _modules=(
'assemble:Assembles a configuration file from fragments'
'assert:Fail with custom message'
'async_status:Obtain status of asynchronous task'
'at:(E) Schedule the execution of a command or script file via the at command.'
'at:Schedule the execution of a command or script file via the at command.'
'authorized_key:Adds or removes an SSH authorized key'
'azure:create or terminate a virtual machine in azure'
'bigip_facts:(E) Collect facts from F5 BIG-IP devices'
'bigip_monitor_http:(E) Manages F5 BIG-IP LTM http monitors'
'bigip_monitor_tcp:(E) Manages F5 BIG-IP LTM tcp monitors'
'bigip_node:(E) Manages F5 BIG-IP LTM nodes'
'bigip_pool:(E) Manages F5 BIG-IP LTM pools'
'bigip_pool_member:(E) Manages F5 BIG-IP LTM pool members'
'bigpanda:(E) Notify BigPanda about deployments'
'boundary_meter:(E) Manage boundary meters'
'bower:(E) Manage bower packages with bower'
'bzr:(E) Deploy software (or files) from bzr branches'
'campfire:(E) Send a message to Campfire'
'capabilities:(E) Manage Linux capabilities'
'cloudformation:create a AWS CloudFormation stack'
'bigip_facts:Collect facts from F5 BIG-IP devices'
'bigip_gtm_wide_ip:Manages F5 BIG-IP GTM wide ip'
'bigip_monitor_http:Manages F5 BIG-IP LTM http monitors'
'bigip_monitor_tcp:Manages F5 BIG-IP LTM tcp monitors'
'bigip_node:Manages F5 BIG-IP LTM nodes'
'bigip_pool:Manages F5 BIG-IP LTM pools'
'bigip_pool_member:Manages F5 BIG-IP LTM pool members'
'bigip_virtual_server:Manages F5 BIG-IP LTM virtual servers'
'bigpanda:Notify BigPanda about deployments'
'blockinfile:Insert/update/remove a text block surrounded by marker lines.'
'boundary_meter:Manage boundary meters'
'bower:Manage bower packages with bower'
'bundler:Manage Ruby Gem dependencies with Bundler'
'bzr:Deploy software (or files) from bzr branches'
'campfire:Send a message to Campfire'
'capabilities:Manage Linux capabilities'
'circonus_annotation:create an annotation in circonus'
'cl_bond:Configures a bond port on Cumulus Linux'
'cl_bridge:Configures a bridge port on Cumulus Linux'
'cl_img_install:Install a different Cumulus Linux version.'
'cl_interface:Configures a front panel port, loopback or management port on Cumulus Linux.'
'cl_interface_policy:Configure interface enforcement policy on Cumulus Linux'
'cl_license:Install Cumulus Linux license'
'cl_ports:Configure Cumulus Switch port attributes (ports.conf)'
'clc_aa_policy:Create or Delete Anti Affinity Policies at CenturyLink Cloud.'
'clc_alert_policy:Create or Delete Alert Policies at CenturyLink Cloud.'
'clc_blueprint_package:deploys a blue print package on a set of servers in CenturyLink Cloud.'
'clc_firewall_policy:Create/delete/update firewall policies'
'clc_group:Create/delete Server Groups at Centurylink Cloud'
'clc_loadbalancer:Create, Delete shared loadbalancers in CenturyLink Cloud.'
'clc_modify_server:modify servers in CenturyLink Cloud.'
'clc_publicip:Add and Delete public ips on servers in CenturyLink Cloud.'
'clc_server:Create, Delete, Start and Stop servers in CenturyLink Cloud.'
'clc_server_snapshot:Create, Delete and Restore server snapshots in CenturyLink Cloud.'
'cloudflare_dns:manage Cloudflare DNS records'
'cloudformation:Create or delete an AWS CloudFormation stack'
'cloudtrail:manage CloudTrail creation and deletion'
'command:Executes a command on a remote node'
'composer:(E) Dependency Manager for PHP'
'composer:Dependency Manager for PHP'
'consul:Add, modify & delete services within a consul cluster.'
'consul_acl:manipulate consul acl keys and rules'
'consul_kv:Manipulate entries in the key/value store of a consul cluster.'
'consul_session:manipulate consul sessions'
'copy:Copies files to remote locations.'
'cpanm:(E) Manages Perl library dependencies.'
'cpanm:Manages Perl library dependencies.'
'cron:Manage cron.d and crontab entries.'
'crypttab:(E) Encrypted Linux block devices'
'datadog_event:(E) Posts events to DataDog service'
'debconf:(E) Configure a .deb package'
'cronvar:Manage variables in crontabs'
'crypttab:Encrypted Linux block devices'
'cs_account:Manages accounts on Apache CloudStack based clouds.'
'cs_affinitygroup:Manages affinity groups on Apache CloudStack based clouds.'
'cs_cluster:Manages host clusters on Apache CloudStack based clouds.'
'cs_configuration:Manages configuration on Apache CloudStack based clouds.'
'cs_domain:Manages domains on Apache CloudStack based clouds.'
'cs_facts:Gather facts on instances of Apache CloudStack based clouds.'
'cs_firewall:Manages firewall rules on Apache CloudStack based clouds.'
'cs_instance:Manages instances and virtual machines on Apache CloudStack based clouds.'
'cs_instance_facts:Gathering facts from the API of instances from Apache CloudStack based clouds.'
'cs_instancegroup:Manages instance groups on Apache CloudStack based clouds.'
'cs_ip_address:Manages public IP address associations on Apache CloudStack based clouds.'
'cs_iso:Manages ISO images on Apache CloudStack based clouds.'
'cs_loadbalancer_rule:Manages load balancer rules on Apache CloudStack based clouds.'
'cs_loadbalancer_rule_member:Manages load balancer rule members on Apache CloudStack based clouds.'
'cs_network:Manages networks on Apache CloudStack based clouds.'
'cs_pod:Manages pods on Apache CloudStack based clouds.'
'cs_portforward:Manages port forwarding rules on Apache CloudStack based clouds.'
'cs_project:Manages projects on Apache CloudStack based clouds.'
'cs_resourcelimit:Manages resource limits on Apache CloudStack based clouds.'
'cs_securitygroup:Manages security groups on Apache CloudStack based clouds.'
'cs_securitygroup_rule:Manages security group rules on Apache CloudStack based clouds.'
'cs_sshkeypair:Manages SSH keys on Apache CloudStack based clouds.'
'cs_staticnat:Manages static NATs on Apache CloudStack based clouds.'
'cs_template:Manages templates on Apache CloudStack based clouds.'
'cs_user:Manages users on Apache CloudStack based clouds.'
'cs_vmsnapshot:Manages VM snapshots on Apache CloudStack based clouds.'
'cs_volume:Manages volumes on Apache CloudStack based clouds.'
'cs_zone:Manages zones on Apache CloudStack based clouds.'
'cs_zone_facts:Gathering facts of zones from Apache CloudStack based clouds.'
'datadog_event:Posts events to DataDog service'
'datadog_monitor:Manages Datadog monitors'
'debconf:Configure a .deb package'
'debug:Print statements during execution'
'deploy_helper:Manages some of the steps common in deploying projects.'
'digital_ocean:Create/delete a droplet/SSH_key in DigitalOcean'
'digital_ocean_domain:Create/delete a DNS record in DigitalOcean'
'digital_ocean_sshkey:Create/delete an SSH key in DigitalOcean'
'django_manage:Manages a Django application.'
'dnf:(E) Manages packages with the I(dnf) package manager'
'dnsimple:(E) Interface with dnsimple.com (a DNS hosting service).'
'dnsmadeeasy:(E) Interface with dnsmadeeasy.com (a DNS hosting service).'
'dnf:Manages packages with the *dnf* package manager'
'dnsimple:Interface with dnsimple.com (a DNS hosting service).'
'dnsmadeeasy:Interface with dnsmadeeasy.com (a DNS hosting service).'
'docker:manage docker containers'
'docker_image (D):manage docker images'
'docker_image:manage docker images'
'docker_login:Manage Docker registry logins'
'dpkg_selections:Dpkg package selection selections'
'dynamodb_table:Create, update or delete AWS Dynamo DB tables.'
'easy_install:Installs Python libraries'
'ec2:create, terminate, start or stop an instance in ec2'
'ec2_ami:create or destroy an image in ec2'
'ec2_ami_search:Retrieve AWS AMI information for a given operating system.'
'ec2_ami_copy:copies AMI between AWS regions, return new image id'
'ec2_ami_find:Searches for AMIs to obtain the AMI ID and other information'
'ec2_ami_search(D):Retrieve AWS AMI information for a given operating system.'
'ec2_asg:Create or delete AWS Autoscaling Groups'
'ec2_eip:associate an EC2 elastic IP with an instance.'
'ec2_elb:De-registers or registers instances from EC2 ELBs'
'ec2_elb_facts:Gather facts about EC2 Elastic Load Balancers in AWS'
'ec2_elb_lb:Creates or destroys Amazon ELB.'
'ec2_eni:Create and optionally attach an Elastic Network Interface (ENI) to an instance'
'ec2_eni_facts:Gather facts about ec2 ENI interfaces in AWS'
'ec2_facts:Gathers facts about remote hosts within ec2 (aws)'
'ec2_group:maintain an ec2 VPC security group.'
'ec2_key:maintain an ec2 key pair.'
'ec2_lc:Create or delete AWS Autoscaling Launch Configurations'
'ec2_metric_alarm:Create/update or delete AWS Cloudwatch metric alarms'
'ec2_remote_facts:Gather facts about ec2 instances in AWS'
'ec2_scaling_policy:Create or delete AWS scaling policies for Autoscaling groups'
'ec2_snapshot:creates a snapshot from an existing volume'
'ec2_tag:create and remove tag(s) to ec2 resources.'
'ec2_vol:create and attach a volume, return volume id and device map'
'ec2_vol_facts:Gather facts about ec2 volumes in AWS'
'ec2_vpc:configure AWS virtual private clouds'
'ejabberd_user:(E) Manages users for ejabberd servers'
'ec2_vpc_dhcp_options:Manages DHCP Options, and can ensure the DHCP options for the given VPC match whats requested'
'ec2_vpc_igw:Manage an AWS VPC Internet gateway'
'ec2_vpc_net:Configure AWS virtual private clouds'
'ec2_vpc_net_facts:Gather facts about ec2 VPCs in AWS'
'ec2_vpc_route_table:Manage route tables for AWS virtual private clouds'
'ec2_vpc_route_table_facts:Gather facts about ec2 VPC route tables in AWS'
'ec2_vpc_subnet:Manage subnets in AWS virtual private clouds'
'ec2_vpc_subnet_facts:Gather facts about ec2 VPC subnets in AWS'
'ec2_win_password:gets the default administrator password for ec2 windows instances'
'ecs_cluster:create or terminate ecs clusters'
'ecs_service:create, terminate, start or stop a service in ecs'
'ecs_service_facts:list or describe services in ecs'
'ecs_task:run, start or stop a task in ecs'
'ecs_taskdefinition:register a task definition in ecs'
'ejabberd_user:Manages users for ejabberd servers'
'elasticache:Manage cache clusters in Amazon Elasticache.'
'facter:(E) Runs the discovery program I(facter) on the remote system'
'elasticache_subnet_group:manage Elasticache subnet groups'
'elasticsearch_plugin:Manage Elasticsearch plugins'
'eos_command:Run arbitrary command on EOS device'
'eos_config:Manage Arista EOS configuration sections'
'eos_eapi:Manage and configure EAPI. Requires EOS v4.12 or greater.'
'eos_template:Manage Arista EOS device configurations'
'expect:Executes a command and responds to prompts'
'facter:Runs the discovery program *facter* on the remote system'
'fail:Fail with custom message'
'fetch:Fetches a file from remote nodes'
'file:Sets attributes of files'
'filesystem:(E) Makes file system on block device'
'fireball:Enable fireball mode on remote node'
'firewalld:(E) Manage arbitrary ports/services with firewalld'
'flowdock:(E) Send a message to a flowdock'
'filesystem:Makes file system on block device'
'find:return a list of files based on specific criteria'
'fireball(D):Enable fireball mode on remote node'
'firewalld:Manage arbitrary ports/services with firewalld'
'flowdock:Send a message to a flowdock'
'gc_storage:This module manages objects/buckets in Google Cloud Storage.'
'gce:create or terminate GCE instances'
'gce_img:(E) utilize GCE image resources'
'gce_img:utilize GCE image resources'
'gce_lb:create/destroy GCE load-balancer resources'
'gce_net:create/destroy GCE networks and firewall rules'
'gce_pd:utilize GCE persistent disk resources'
'gce_tag:add or remove tag(s) to/from GCE instance'
'gem:Manage Ruby gems'
'get_url:Downloads files from HTTP, HTTPS, or FTP to node'
'getent:(E) a wrapper to the unix getent utility'
'getent:a wrapper to the unix getent utility'
'git:Deploy software (or files) from git checkouts'
'github_hooks:(E) Manages github service hooks.'
'glance_image:Add/Delete images from glance'
'gluster_volume:(E) Manage GlusterFS volumes'
'github_hooks:Manages github service hooks.'
'glance_image(D):Add/Delete images from glance'
'gluster_volume:Manage GlusterFS volumes'
'group:Add or remove groups'
'group_by:Create Ansible groups based on facts'
'grove:(E) Sends a notification to a grove.io channel'
'haproxy:(E) An Ansible module to handle states enable/disable server and set weight to backend host in haproxy using socket commands.'
'grove:Sends a notification to a grove.io channel'
'hall:Send notification to Hall'
'haproxy:Enable, disable, and set weights for HAProxy backend servers using socket commands.'
'hg:Manages Mercurial (hg) repositories.'
'hipchat:(E) Send a message to hipchat'
'homebrew:(E) Package manager for Homebrew'
'homebrew_cask:(E) Install/uninstall homebrew casks.'
'homebrew_tap:(E) Tap a Homebrew repository.'
'hipchat:Send a message to hipchat.'
'homebrew:Package manager for Homebrew'
'homebrew_cask:Install/uninstall homebrew casks.'
'homebrew_tap:Tap a Homebrew repository.'
'hostname:Manage hostname'
'htpasswd:manage user files for basic authentication'
'iam:Manage IAM users, groups, roles and keys'
'iam_cert:Manage server certificates for use on ELBs and CloudFront'
'iam_policy:Manage IAM policies for users, groups, and roles'
'include_vars:Load variables from files, dynamically within a task.'
'ini_file:Tweak settings in INI files'
'irc:(E) Send a message to an IRC channel'
'jabber:(E) Send a message to jabber user or chat room'
'jboss:(E) deploy applications to JBoss'
'jira:(E) create and modify issues in a JIRA instance'
'kernel_blacklist:(E) Blacklist kernel modules'
'keystone_user:Manage OpenStack Identity (keystone) users, tenants and roles'
'layman:(E) Manage Gentoo overlays'
'librato_annotation:(E) create an annotation in librato'
'ios_command:Run arbitrary commands on ios devices.'
'ios_config:Manage Cisco IOS configuration sections'
'ios_template:Manage Cisco IOS device configurations over SSH'
'iosxr_command:Run arbitrary commands on ios devices.'
'iosxr_config:Manage Cisco IOS XR configuration sections'
'iosxr_template:Manage Cisco IOS device configurations over SSH'
'ipify_facts:Retrieve the public IP of your internet gateway.'
'iptables:Modify the systems iptables'
'irc:Send a message to an IRC channel'
'jabber:Send a message to jabber user or chat room'
'jboss:deploy applications to JBoss'
'jira:create and modify issues in a JIRA instance'
'junos_command:Execute arbitrary commands on Juniper JUNOS devices'
'junos_config:Manage Juniper JUNOS configuration sections'
'junos_template:Manage Juniper JUNOS device configurations'
'kernel_blacklist:Blacklist kernel modules'
'keystone_user(D):Manage OpenStack Identity (keystone) users, tenants and roles'
'known_hosts:Add or remove a host from the ``known_hosts`` file'
'layman:Manage Gentoo overlays'
'librato_annotation:create an annotation in librato'
'lineinfile:Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression.'
'linode:create / delete / stop / restart an instance in Linode Public Cloud'
'lldp:(E) get details reported by lldp'
'locale_gen:(E) Creates or removes locales.'
'logentries:(E) Module for tracking logs via logentries.com'
'lvg:(E) Configure LVM volume groups'
'lvol:(E) Configure LVM logical volumes'
'macports:(E) Package manager for MacPorts'
'mail:(E) Send an email'
'modprobe:(E) Add or remove kernel modules'
'mongodb_user:(E) Adds or removes a user from a MongoDB database.'
'monit:(E) Manage the state of a program monitored via Monit'
'lldp:get details reported by lldp'
'locale_gen:Creates or removes locales.'
'logentries:Module for tracking logs via logentries.com'
'lvg:Configure LVM volume groups'
'lvol:Configure LVM logical volumes'
'lxc_container:Manage LXC Containers'
'macports:Package manager for MacPorts'
'mail:Send an email'
'maven_artifact:Downloads an Artifact from a Maven Repository'
'modprobe:Add or remove kernel modules'
'mongodb_user:Adds or removes a user from a MongoDB database.'
'monit:Manage the state of a program monitored via Monit'
'mount:Control active and configured mount points'
'mqtt:(E) Publish a message on an MQTT topic for the IoT'
'mqtt:Publish a message on an MQTT topic for the IoT'
'mysql_db:Add or remove MySQL databases from a remote host.'
'mysql_replication:(E) Manage MySQL replication'
'mysql_replication:Manage MySQL replication'
'mysql_user:Adds or removes a user from a MySQL database.'
'mysql_variables:Manage MySQL global variables'
'nagios:(E) Perform common tasks in Nagios related to downtime and notifications.'
'netscaler:(E) Manages Citrix NetScaler entities'
'newrelic_deployment:(E) Notify newrelic about app deployments'
'nexmo:(E) Send a SMS via nexmo'
'nova_compute:Create/Delete VMs from OpenStack'
'nova_keypair:Add/Delete key pair from nova'
'npm:(E) Manage node.js packages with npm'
'ohai:(E) Returns inventory data from I(Ohai)'
'open_iscsi:(E) Manage iscsi targets with open-iscsi'
'openbsd_pkg:(E) Manage packages on OpenBSD.'
'openvswitch_bridge:(E) Manage Open vSwitch bridges'
'openvswitch_port:(E) Manage Open vSwitch ports'
'opkg:(E) Package manager for OpenWrt'
'osx_say:(E) Makes an OSX computer to speak.'
'ovirt:(E) oVirt/RHEV platform management'
'pacman:(E) Manage packages with I(pacman)'
'pagerduty:(E) Create PagerDuty maintenance windows'
'patch:(E) Apply patch files using the GNU patch tool.'
'nagios:Perform common tasks in Nagios related to downtime and notifications.'
'netscaler:Manages Citrix NetScaler entities'
'newrelic_deployment:Notify newrelic about app deployments'
'nexmo:Send a SMS via nexmo'
'nmcli:Manage Networking'
'nova_compute(D):Create/Delete VMs from OpenStack'
'nova_keypair(D):Add/Delete key pair from nova'
'npm:Manage node.js packages with npm'
'nxos_command:Run arbitrary command on Cisco NXOS devices'
'nxos_config:Manage Cisco NXOS configuration sections'
'nxos_nxapi:Manage NXAPI configuration on an NXOS device.'
'nxos_template:Manage Cisco NXOS device configurations'
'ohai:Returns inventory data from *Ohai*'
'open_iscsi:Manage iscsi targets with open-iscsi'
'openbsd_pkg:Manage packages on OpenBSD.'
'openvswitch_bridge:Manage Open vSwitch bridges'
'openvswitch_db:Configure open vswitch database.'
'openvswitch_port:Manage Open vSwitch ports'
'opkg:Package manager for OpenWrt'
'ops_command:Run arbitrary commands on OpenSwitch devices.'
'ops_config:Manage OpenSwitch configuration using CLI'
'ops_template:Push configuration to OpenSwitch'
'os_auth:Retrieve an auth token'
'os_client_config:Get OpenStack Client config'
'os_flavor_facts:Retrieve facts about one or more flavors'
'os_floating_ip:Add/Remove floating IP from an instance'
'os_group:Manage OpenStack Identity Groups'
'os_image:Add/Delete images from OpenStack Cloud'
'os_image_facts:Retrieve facts about an image within OpenStack.'
'os_ironic:Create/Delete Bare Metal Resources from OpenStack'
'os_ironic_node:Activate/Deactivate Bare Metal Resources from OpenStack'
'os_keypair:Add/Delete a keypair from OpenStack'
'os_keystone_domain:Manage OpenStack Identity Domains'
'os_keystone_role:Manage OpenStack Identity Roles'
'os_network:Creates/removes networks from OpenStack'
'os_networks_facts:Retrieve facts about one or more OpenStack networks.'
'os_nova_flavor:Manage OpenStack compute flavors'
'os_object:Create or Delete objects and containers from OpenStack'
'os_port:Add/Update/Delete ports from an OpenStack cloud.'
'os_project:Manage OpenStack Projects'
'os_router:Create or delete routers from OpenStack'
'os_security_group:Add/Delete security groups from an OpenStack cloud.'
'os_security_group_rule:Add/Delete rule from an existing security group'
'os_server:Create/Delete Compute Instances from OpenStack'
'os_server_actions:Perform actions on Compute Instances from OpenStack'
'os_server_facts:Retrieve facts about one or more compute instances'
'os_server_volume:Attach/Detach Volumes from OpenStack VMs'
'os_subnet:Add/Remove subnet to an OpenStack network'
'os_subnets_facts:Retrieve facts about one or more OpenStack subnets.'
'os_user:Manage OpenStack Identity Users'
'os_user_group:Associate OpenStack Identity users and groups'
'os_volume:Create/Delete Cinder Volumes'
'osx_defaults:osx_defaults allows users to read, write, and delete Mac OS X user defaults from Ansible'
'osx_say:Makes an OSX computer to speak.'
'ovirt:oVirt/RHEV platform management'
'package:Generic OS package manager'
'pacman:Manage packages with *pacman*'
'pagerduty:Create PagerDuty maintenance windows'
'pagerduty_alert:Trigger, acknowledge or resolve PagerDuty incidents'
'pam_limits:Modify Linux PAM limits'
'patch:Apply patch files using the GNU patch tool.'
'pause:Pause playbook execution'
'ping:Try to connect to host and return C(pong) on success.'
'pingdom:(E) Pause/unpause Pingdom alerts'
'pear:Manage pear/pecl packages'
'ping:Try to connect to host, verify a usable python and return ``pong`` on success.'
'pingdom:Pause/unpause Pingdom alerts'
'pip:Manages Python library dependencies.'
'pkg5:(E) Manages packages with the Solaris 11 Image Packaging System'
'pkg5_publisher:(E) Manages Solaris 11 Image Packaging System publishers'
'pkgin:(E) Package manager for SmartOS'
'pkgng:(E) Package manager for FreeBSD >= 9.0'
'pkgutil:(E) Manage CSW-Packages on Solaris'
'portage:(E) Package manager for Gentoo'
'portinstall:(E) Installing packages from FreeBSDs ports system'
'pkg5:Manages packages with the Solaris 11 Image Packaging System'
'pkg5_publisher:Manages Solaris 11 Image Packaging System publishers'
'pkgin:Package manager for SmartOS, NetBSD, et al.'
'pkgng:Package manager for FreeBSD >= 9.0'
'pkgutil:Manage CSW-Packages on Solaris'
'portage:Package manager for Gentoo'
'portinstall:Installing packages from FreeBSDs ports system'
'postgresql_db:Add or remove PostgreSQL databases from a remote host.'
'postgresql_lang:(E) Adds, removes or changes procedural languages with a PostgreSQL database.'
'postgresql_ext:Add or remove PostgreSQL extensions from a database.'
'postgresql_lang:Adds, removes or changes procedural languages with a PostgreSQL database.'
'postgresql_privs:Grant or revoke privileges on PostgreSQL database objects.'
'postgresql_user:Adds or removes a users (roles) from a PostgreSQL database.'
'quantum_floating_ip:Add/Remove floating IP from an instance'
'quantum_floating_ip_associate:Associate or disassociate a particular floating IP with an instance'
'quantum_network:Creates/Removes networks from OpenStack'
'quantum_router:Create or Remove router from openstack'
'quantum_router_gateway:set/unset a gateway interface for the router with the specified external network'
'quantum_router_interface:Attach/Dettach a subnets interface to a router'
'quantum_subnet:Add/remove subnet from a network'
'rabbitmq_parameter:(E) Adds or removes parameters to RabbitMQ'
'rabbitmq_plugin:(E) Adds or removes plugins to RabbitMQ'
'rabbitmq_policy:(E) Manage the state of policies in RabbitMQ.'
'rabbitmq_user:(E) Adds or removes users to RabbitMQ'
'rabbitmq_vhost:(E) Manage the state of a virtual host in RabbitMQ'
'profitbricks:Create, destroy, start, stop, and reboot a ProfitBricks virtual machine.'
'profitbricks_datacenter:Create or destroy a ProfitBricks Virtual Datacenter.'
'profitbricks_nic:Create or Remove a NIC.'
'profitbricks_volume:Create or destroy a volume.'
'profitbricks_volume_attachments:Attach or detach a volume.'
'proxmox:management of instances in Proxmox VE cluster'
'proxmox_template:management of OS templates in Proxmox VE cluster'
'puppet:Runs puppet'
'pushbullet:Sends notifications to Pushbullet'
'pushover:Send notifications via https'
'quantum_floating_ip(D):Add/Remove floating IP from an instance'
'quantum_floating_ip_associate(D):Associate or disassociate a particular floating IP with an instance'
'quantum_network(D):Creates/Removes networks from OpenStack'
'quantum_router(D):Create or Remove router from openstack'
'quantum_router_gateway(D):set/unset a gateway interface for the router with the specified external network'
'quantum_router_interface(D):Attach/Dettach a subnets interface to a router'
'quantum_subnet(D):Add/remove subnet from a network'
'rabbitmq_binding:This module manages rabbitMQ bindings'
'rabbitmq_exchange:This module manages rabbitMQ exchanges'
'rabbitmq_parameter:Adds or removes parameters to RabbitMQ'
'rabbitmq_plugin:Adds or removes plugins to RabbitMQ'
'rabbitmq_policy:Manage the state of policies in RabbitMQ.'
'rabbitmq_queue:This module manages rabbitMQ queues'
'rabbitmq_user:Adds or removes users to RabbitMQ'
'rabbitmq_vhost:Manage the state of a virtual host in RabbitMQ'
'raw:Executes a low-down and dirty SSH command'
'rax:create / delete an instance in Rackspace Public Cloud'
'rax_cbs:Manipulate Rackspace Cloud Block Storage Volumes'
@@ -304,6 +476,7 @@ _modules=(
'rax_cdb_user:create / delete a Rackspace Cloud Database'
'rax_clb:create / delete a load balancer in Rackspace Public Cloud'
'rax_clb_nodes:add, modify and remove nodes from a Rackspace Cloud Load Balancer'
'rax_clb_ssl:Manage SSL termination for a Rackspace Cloud Load Balancer.'
'rax_dns:Manage domains on Rackspace Cloud DNS'
'rax_dns_record:Manage DNS records on Rackspace Cloud DNS'
'rax_facts:Gather facts for Rackspace Cloud Servers'
@@ -312,6 +485,11 @@ _modules=(
'rax_identity:Load Rackspace Cloud Identity'
'rax_keypair:Create a keypair for use with Rackspace Cloud Servers'
'rax_meta:Manipulate metadata for Rackspace Cloud Servers'
'rax_mon_alarm:Create or delete a Rackspace Cloud Monitoring alarm.'
'rax_mon_check:Create or delete a Rackspace Cloud Monitoring check for an existing entity.'
'rax_mon_entity:Create or delete a Rackspace Cloud Monitoring entity'
'rax_mon_notification:Create or delete a Rackspace Cloud Monitoring notification.'
'rax_mon_notification_plan:Create or delete a Rackspace Cloud Monitoring notification plan.'
'rax_network:create / delete an isolated network in Rackspace Public Cloud'
'rax_queue:create / delete a queue in Rackspace Public Cloud'
'rax_scaling_group:Manipulate Rackspace Cloud Autoscale Groups'
@@ -319,65 +497,144 @@ _modules=(
'rds:create, delete, or modify an Amazon rds instance'
'rds_param_group:manage RDS parameter groups'
'rds_subnet_group:manage RDS database subnet groups'
'redhat_subscription:Manage Red Hat Network registration and subscriptions using the C(subscription-manager) command'
'redis:(E) Various redis commands, slave and flush'
'redhat_subscription:Manage Red Hat Network registration and subscriptions using the ``subscription-manager`` command'
'redis:Various redis commands, slave and flush'
'replace:Replace all instances of a particular string in a file using a back-referenced regular expression.'
'rhn_channel:Adds or removes Red Hat software channels'
'rhn_register:Manage Red Hat Network registration using the C(rhnreg_ks) command'
'riak:(E) This module handles some common Riak operations'
'rollbar_deployment:(E) Notify Rollbar about app deployments'
'rhn_register:Manage Red Hat Network registration using the ``rhnreg_ks`` command'
'riak:This module handles some common Riak operations'
'rollbar_deployment:Notify Rollbar about app deployments'
'route53:add or delete entries in Amazons Route53 DNS service'
'route53_facts:Retrieves route53 details using AWS methods'
'route53_health_check:add or delete health-checks in Amazons Route53 DNS service'
'route53_zone:add or delete Route53 zones'
'rpm_key:Adds or removes a gpg key from the rpm db'
's3:S3 module putting a file into S3.'
's3:manage objects in S3.'
's3_bucket:Manage s3 buckets in AWS'
's3_lifecycle:Manage s3 bucket lifecycle rules in AWS'
's3_logging:Manage logging facility of an s3 bucket in AWS'
'script:Runs a local script on a remote node after transferring it'
'seboolean:Toggles SELinux booleans.'
'selinux:Change policy and state of SELinux'
'selinux_permissive:Change permissive domain in SELinux policy'
'sendgrid:Sends an email with the SendGrid API'
'sensu_check:Manage Sensu checks'
'seport:Manages SELinux network port type definitions'
'service:Manage services.'
'set_fact:Set host facts from a task'
'setup:Gathers facts about remote hosts'
'shell:Execute commands in nodes.'
'slack:(E) Send Slack notifications'
'slack:Send Slack notifications'
'slackpkg:Package manager for Slackware >= 12.2'
'slurp:Slurps a file from remote nodes'
'snmp_facts:(E) Retrieve facts for a device using SNMP.'
'sns:(E) Send Amazon Simple Notification Service (SNS) messages'
'stackdriver:(E) Send code deploy and annotation events to stackdriver'
'snmp_facts:Retrieve facts for a device using SNMP.'
'sns:Send Amazon Simple Notification Service (SNS) messages'
'sns_topic:Manages AWS SNS topics and subscriptions'
'solaris_zone:Manage Solaris zones'
'sqs_queue:Creates or deletes AWS SQS queues.'
'stackdriver:Send code deploy and annotation events to stackdriver'
'stat:retrieve file or file system status'
'sts_assume_role:Assume a role using AWS Security Token Service and obtain temporary credentials'
'subversion:Deploys a subversion repository.'
'supervisorctl:Manage the state of a program or group of programs running via supervisord'
'svc:(E) Manage daemontools services.'
'svr4pkg:(E) Manage Solaris SVR4 packages'
'swdepot:(E) Manage packages with swdepot package manager (HP-UX)'
'svc:Manage daemontools services.'
'svr4pkg:Manage Solaris SVR4 packages'
'swdepot:Manage packages with swdepot package manager (HP-UX)'
'synchronize:Uses rsync to make synchronizing file paths in your playbooks quick and easy.'
'sysctl:Manage entries in sysctl.conf.'
'taiga_issue:Creates/deletes an issue in a Taiga Project Management Platform'
'template:Templates a file out to a remote server.'
'twilio:(E) Sends a text message to a mobile phone through Twilio.'
'typetalk:(E) Send a message to typetalk'
'ufw:(E) Manage firewall with UFW'
'unarchive:Copies an archive to a remote location and unpack it'
'uptimerobot:(E) Pause and start Uptime Robot monitoring'
'twilio:Sends a text message to a mobile phone through Twilio.'
'typetalk:Send a message to typetalk'
'ufw:Manage firewall with UFW'
'unarchive:Unpacks an archive after (optionally) copying it from the local machine.'
'uptimerobot:Pause and start Uptime Robot monitoring'
'uri:Interacts with webservices'
'urpmi:(E) Urpmi manager'
'urpmi:Urpmi manager'
'user:Manage user accounts'
'virt:(E) Manages virtual machines supported by libvirt'
'vca_fw:add remove firewall rules in a gateway in a vca'
'vca_nat:add remove nat rules in a gateway in a vca'
'vca_vapp:Manages vCloud Air vApp instances.'
'vertica_configuration:Updates Vertica configuration parameters.'
'vertica_facts:Gathers Vertica database facts.'
'vertica_role:Adds or removes Vertica database roles and assigns roles to them.'
'vertica_schema:Adds or removes Vertica database schema and roles.'
'vertica_user:Adds or removes Vertica database users and assigns roles.'
'virt:Manages virtual machines supported by libvirt'
'virt_net:Manage libvirt network configuration'
'virt_pool:Manage libvirt storage pools'
'vmware_cluster:Create VMware vSphere Cluster'
'vmware_datacenter:Manage VMware vSphere Datacenters'
'vmware_dns_config:Manage VMware ESXi DNS Configuration'
'vmware_dvs_host:Add or remove a host from distributed virtual switch'
'vmware_dvs_portgroup:Create or remove a Distributed vSwitch portgroup'
'vmware_dvswitch:Create or remove a distributed vSwitch'
'vmware_host:Add/remove ESXi host to/from vCenter'
'vmware_migrate_vmk:Migrate a VMK interface from VSS to VDS'
'vmware_portgroup:Create a VMware portgroup'
'vmware_target_canonical_facts:Return canonical (NAA) from an ESXi host'
'vmware_vm_facts:Return basic facts pertaining to a vSphere virtual machine guest'
'vmware_vm_shell:Execute a process in VM'
'vmware_vm_vss_dvs_migrate:Migrates a virtual machine from a standard vswitch to distributed'
'vmware_vmkernel:Create a VMware VMkernel Interface'
'vmware_vmkernel_ip_config:Configure the VMkernel IP Address'
'vmware_vsan_cluster:Configure VSAN clustering on an ESXi host'
'vmware_vswitch:Add a VMware Standard Switch to an ESXi host'
'vsphere_copy:Copy a file to a vCenter datastore'
'vsphere_guest:Create/delete/manage a guest VM through VMware vSphere.'
'wait_for:Waits for a condition before continuing.'
'win_chocolatey:(E) Installs packages using chocolatey'
'webfaction_app:Add or remove applications on a Webfaction host'
'webfaction_db:Add or remove a database on Webfaction'
'webfaction_domain:Add or remove domains and subdomains on Webfaction'
'webfaction_mailbox:Add or remove mailboxes on Webfaction'
'webfaction_site:Add or remove a website on a Webfaction host'
'win_acl:Set file/directory permissions for a system user or group.'
'win_chocolatey:Installs packages using chocolatey'
'win_copy:Copies files to remote locations on windows hosts.'
'win_dotnet_ngen:Runs ngen to recompile DLLs after .NET updates'
'win_environment:Modifies environment variables on windows hosts.'
'win_feature:Installs and uninstalls Windows Features'
'win_file:Creates, touches or removes files or directories.'
'win_file_version:Get DLL or EXE file build version'
'win_firewall_rule:Windows firewall automation'
'win_get_url:Fetches a file from a given URL'
'win_group:Add and remove local groups'
'win_iis_virtualdirectory:Configures a virtual directory in IIS.'
'win_iis_webapplication:Configures a IIS Web application.'
'win_iis_webapppool:Configures a IIS Web Application Pool.'
'win_iis_webbinding:Configures a IIS Web site.'
'win_iis_website:Configures a IIS Web site.'
'win_lineinfile:Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression.'
'win_msi:Installs and uninstalls Windows MSI files'
'win_nssm:NSSM '
'win_package:Installs/Uninstalls a installable package, either from local file system or url'
'win_ping:A windows version of the classic ping module.'
'win_regedit:Add, Edit, or Remove Registry Keys and Values'
'win_regmerge:Merges the contents of a registry file into the windows registry'
'win_scheduled_task:Manage scheduled tasks'
'win_service:Manages Windows services'
'win_share:Manage Windows shares'
'win_stat:returns information about a Windows file'
'win_updates:(E) Lists / Installs windows updates'
'win_template:Templates a file out to a remote server.'
'win_timezone:Sets Windows machine timezone'
'win_unzip:Unzips compressed files and archives on the Windows node'
'win_updates:Download and install Windows updates'
'win_uri:Interacts with webservices.'
'win_user:Manages local Windows user accounts'
'win_webpicmd:Installs packages using Web Platform Installer command-line'
'xattr:set/retrieve extended attributes'
'yum:Manages packages with the I(yum) package manager'
'zabbix_group:(E) Add or remove a host group to Zabbix.'
'zabbix_maintenance:(E) Create Zabbix maintenance windows'
'zfs:(E) Manage zfs'
'zypper:(E) Manage packages on SUSE and openSUSE'
'zypper_repository:(E) Add and remove Zypper repositories'
'xenserver_facts:get facts reported on xenserver'
'yum:Manages packages with the *yum* package manager'
'yum_repository:Add and remove YUM repositories'
'zabbix_group:Zabbix host groups creates/deletes'
'zabbix_host:Zabbix host creates/updates/deletes'
'zabbix_hostmacro:Zabbix host macro creates/updates/deletes'
'zabbix_maintenance:Create Zabbix maintenance windows'
'zabbix_screen:Zabbix screen creates/updates/deletes'
'zfs:Manage zfs'
'znode:Create, delete, retrieve, and update znodes using ZooKeeper.'
'zypper:Manage packages on SUSE and openSUSE'
'zypper_repository:Add and remove Zypper repositories'
)
@@ -389,13 +646,19 @@ _ansible ()
_arguments -C -W \
'1:pattern:->pattern'\
"(-a --args)"{-a,--args}"[ARGS module arguments]:arguments:(ARG)"\
"(-k --ask-pass)"{-k,--ask-pass}"[ask for SSH password]"\
'--ask-su-pass[ask for su password]'\
"(-K --ask-sudo-pass)"{-K,--ask-sudo-pass}"[ask for sudo password]"\
'--ask-become-pass[ask for privilege escalation password]'\
"(-k --ask-pass)"{-k,--ask-pass}"[ask for connection password]"\
'--ask-su-pass[ask for su password (deprecated, use become)]'\
"(-K --ask-sudo-pass)"{-K,--ask-sudo-pass}"[ask for sudo password (deprecated, use become)]"\
'--ask-vault-pass[ask for vault password]'\
"(-B --background)"{-B,--background}"[DURATION run asynchronously for DURATION (s)]:duration:(DURATION)"\
"(-b --become)"{-b,--become}"[run operations with become (nopasswd implied)]"\
'--become-method[privilege escalation method to use (default=sudo)]:method:(sudo su pbrun pfexec runas doas)'\
'--become-user[run operations as this user (default=root)]:user:(USER)'\
"(-C --check)"{-C,--check}"[don't make any changes]"\
"(-c --connection)"{-c,--connection}"[CONNECTION connection type to use (default=smart)]:connection type:(smart ssh local chroot)"\
"(-D --diff)"{-D,--diff}"[show differences when changing (small) files and templates]"\
"(-e --extra-vars)"{-e,--extra-vars}"[set additional variables as key=value or YAML/JSON]"\
"(-f --forks)"{-f,--forks}"[FORKS number of parallel processes to use (default=5)]:forks:(5)"\
"(-h --help)"{-h,--help}"[help message]"\
"(-i --inventory-file)"{-i,--inventory-file}"[INVENTORY specify inventory host file]:inventory file:_files"\
@@ -403,13 +666,20 @@ _ansible ()
'--list-hosts[outputs a list of matching hosts. Does not execute anything else]'\
"(-m --module-name)"{-m,--module-name}"[MODULE_NAME module name (default=command)]:module name:->module"\
"(-M --module-path)"{-M,--module-path}"[MODULE_PATH specify path to module library (default=None)]:module path:_files -/"\
'--new-vault-password-file[new vault password file for rekey]:new vault password file:_files'\
"(-o --one-line)"{-o,--one-line}"[condense output]"\
'--output[output file name for encrypt or decrypt; use - for stdout]:output file:_files'\
"(-P --poll)"{-P,--poll}"[POLL_INTERVAL set the poll interval (s) if using -B (default=15)]:poll interval:(15)"\
"--private-key[PRIVATE_KEY_FILE use this file to authenticate the connection]:private key file:_files"\
"(-S --su)"{-S,--su}"[run operations with su]"\
"(-R --su-user)"{-R,--su-user}"[SU_USER run operations with su as this user (default=root)]:su user:(root)"\
"(-s --sudo)"{-s,--sudo}"[run operations with sudo (nopasswd)]"\
"(-U --sudo-user)"{-U,--sudo-user}"[SUDO_USER desired sudo user (default=root)]:su user:(root)"\
'--private-key[PRIVATE_KEY_FILE use this file to authenticate the connection]:private key file:_files'\
'--scp-extra-args[specify extra arguments to pass to scp only]'\
'--sftp-extra-args[specify extra arguments to pass to sftp only]'\
'--ssh-common-args[specify common arguments to pass to sftp/scp/ssh]'\
'--ssh-extra-args[specify extra arguments to pass to ssh only]'\
"(-S --su)"{-S,--su}"[run operations with su (deprecated, use become)]"\
"(-R --su-user)"{-R,--su-user}"[SU_USER run operations with su as this user (default=root) (deprecated, use become)]:su user:(root)"\
"(-s --sudo)"{-s,--sudo}"[run operations with sudo (nopasswd) (deprecated, use become)]"\
"(-U --sudo-user)"{-U,--sudo-user}"[SUDO_USER desired sudo user (default=root) (deprecated, use become)]:su user:(root)"\
'--syntax-check[perform a syntax check on the playbook, but do not execute it]'\
"(-T --timeout)"{-T,--timeout}"[TIMEOUT override the SSH timeout (s) (default=10)]:ssh timeout:(10)"\
"(-t --tree)"{-t,--tree}"[OUTPUT_DIRECTORY log output to this directory]:output directory:_files -/"\
"(-u --user)"{-u,--user}"[REMOTE_USER connect as this user (default=${USER})]:connect as user:(${USER})"\

View File

@@ -28,13 +28,14 @@
# Description
# -----------
#
# Completion script for ansible-galaxy v1.8.4 (http://ansible.org)
# Completion script for ansible-galaxy v2.0.0.2 (http://ansible.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Romain Bossart (https://github.com/bosr)
# * Adam Stevko (https://github.com/xen0l)
#
# ------------------------------------------------------------------------------
#
@@ -50,51 +51,122 @@ _ansible-galaxy ()
typeset -A opt_args
_arguments -C \
"1:command:(init info install list remove)" \
"1:command:(delete import info init install list login remove search setup)" \
"*::option:->option"
case $state in
option)
case $line[1] in
init)
_arguments \
delete)
_arguments \
"(-h --help)"{-h,--help}"[help message]" \
"(-p --init-path)"{-p,--init-path}"[INIT_PATH path in which the skeleton role will be created (default=./)]:init path:(./)" \
"(--offline)--offline[Don't query the galaxy API when creating roles]" \
"(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
"(-f --force)"{-f,--force}"[Force overwriting an existing role]" \
":role name:(ROLE)"
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]" \
":github_user:(GITHUB_USER)" \
":github_repo:(GITHUB_REPO)"
;;
import)
_arguments \
"--branch[REFERENCE The name of a branch to import.]:reference:(master)" \
"(-h --help)"{-h,--help}"[help message]" \
"(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
"--no-wait[Don't wait for import results.]" \
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
"--status[Check the status of the most recent import request forgiven github_user/github_repo.]" \
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]" \
":github_user:(GITHUB_USER)" \
":github_repo:(GITHUB_REPO)"
;;
info)
_arguments \
"(-h --help)"{-h,--help}"[help message]" \
"(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
"(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]" \
":role name:(ROLE,version)"
;;
init)
_arguments \
"(-f --force)"{-f,--force}"[ Force overwriting an existing role]" \
"(-h --help)"{-h,--help}"[help message]" \
"(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
"(-p --init-path)"{-p,--init-path}"[INIT_PATH path in which the skeleton role will be created (default=./)]:init path:(./)" \
"(--offline)--offline[Don't query the galaxy API when creating roles]" \
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]" \
":role name:(ROLE)"
;;
install)
_arguments \
"(-f --force)"{-f,--force}"[Force overwriting an existing role]" \
"(-h --help)"{-h,--help}"[help message]" \
"(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
"(-i --ignore-errors)"{-i,--ignore-errors}"[Ignore errors and continue with the next specified role]" \
"(-n --no-deps)"{-n,--no-deps}"[Don't download roles listed as dependencies]" \
"(-r --role-file)"{-r,--role-file}"[ROLE_FILE A file containing a list of roles to be imported]:role file:_files" \
"(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
"(-f --force)"{-f,--force}"[Force overwriting an existing role]" \
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]" \
":role name:(ROLE)"
;;
list)
_arguments \
"(-h --help)"{-h,--help}"[help message]" \
"(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]" \
":role name:(ROLE)"
;;
login)
_arguments \
"--github_token[TOKEN Identify with github token rather than username and password.]:token:(TOKEN)" \
"(-h --help)"{-h,--help}"[help message]" \
"(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]"
;;
remove)
_arguments \
"(-h --help)"{-h,--help}"[help message]" \
"(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]" \
"*:role name:(ROLE)"
;;
search)
_arguments \
"--author[AUTHOR GitHub username]:author:(AUTHOR)" \
"--galaxy-tags[TAGS list of galaxy tags to filter by]:tags:(TAGS)" \
"(-h --help)"{-h,--help}"[help message]" \
"(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
"--platforms[PLATFORMS list of OS platforms to filter by" \
"(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]"
;;
setup)
_arguments \
"(-h --help)"{-h,--help}"[help message]" \
"(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
"--list[List all of your integrations.]" \
"--remove[REMOVE_ID Remove the integration matching the provided ID value.]:id:(REMOVE_ID)" \
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]" \
":source:(travis)" \
":github_user:(GITHUB_USER)" \
":github_repo:(GITHUB_REPO)" \
":secret:(SECRET)"
;;
esac
;;
esac

View File

@@ -28,13 +28,14 @@
# Description
# -----------
#
# Completion script for ansible-playbook v1.8.4 (http://ansible.org)
# Completion script for ansible-playbook v2.0.0.2 (http://ansible.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Romain Bossart (https://github.com/bosr)
# * Adam Stevko (https://github.com/xen0l)
#
# ------------------------------------------------------------------------------
#
@@ -60,6 +61,7 @@ __host_file_location () {
[[ "$OSTYPE" == darwin* ]] && FALLBACK="/usr/local/etc/ansible/hosts"
[[ "$OSTYPE" == linux* ]] && FALLBACK="/etc/ansible/hosts"
HOST_FILE=${ANSIBLE_HOSTS:=${FALLBACK}}
[[ -f ${HOST_FILE} ]] || HOST_FILE="$PWD/ansible/inventory/hosts"
[[ -f ${HOST_FILE} ]] || HOST_FILE=/dev/null
echo ${HOST_FILE}
@@ -125,11 +127,15 @@ _ansible-playbook ()
typeset -A opt_args
_arguments -C -W \
"1:playbook yml file:_files -g '*.yml'"\
"(-k --ask-pass)"{-k,--ask-pass}"[ask for SSH password]"\
'--ask-su-pass[ask for su password]'\
"(-K --ask-sudo-pass)"{-K,--ask-sudo-pass}"[ask for sudo password]"\
"1:playbook yml file:_files -g '*.yml|*.yaml'"\
'--ask-become-pass[ask for privilege escalation password]'\
"(-k --ask-pass)"{-k,--ask-pass}"[ask for connection password]"\
'--ask-su-pass[ask for su password (deprecated, use become)]'\
"(-K --ask-sudo-pass)"{-K,--ask-sudo-pass}"[ask for sudo password (deprecated, use become)]"\
'--ask-vault-pass[ask for vault password]'\
"(-b --become)"{-b,--become}"[run operations with become (nopasswd implied)]"\
'--become-method[privilege escalation method to use (default=sudo)]:method:(sudo su pbrun pfexec runas doas)'\
'--become-user[run operations as this user (default=root)]:user:(USER)'\
"(-C --check)"{-C,--check}"[don't make any changes]"\
"(-c --connection)"{-c,--connection}"[CONNECTION connection type to use (default=smart)]:connection type:(smart ssh local chroot)"\
"(-D --diff)"{-D,--diff}"[when changing (small files and templates, show the diff in those. Works great with --check)]"\
@@ -141,15 +147,23 @@ _ansible-playbook ()
"(-i --inventory-file)"{-i,--inventory-file}"[INVENTORY specify inventory host file]:inventory file:_files"\
"(-l --limit)"{-l,--limit}"[SUBSET further limit selected hosts to an additional pattern]:subset pattern:->pattern"\
'--list-hosts[outputs a list of matching hosts. Does not execute anything else]'\
'--list-tags[list all available tags]'\
'--list-tasks[list all tasks that would be executed]'\
"(-M --module-path)"{-M,--module-path}"[MODULE_PATH specify path to module library (default=None)]:module path:_files -/"\
"--private-key[PRIVATE_KEY_FILE use this file to authenticate the connection]:private key file:_files"\
'--new-vault-password-file[new vault password file for rekey]:new vault password file:_files'\
'--output[output file name for encrypt or decrypt; use - for stdout]:output file:_files'\
'--private-key[PRIVATE_KEY_FILE use this file to authenticate the connection]:private key file:_files'\
'--scp-extra-args[specify extra arguments to pass to scp only]'\
'--sftp-extra-args[specify extra arguments to pass to sftp only]'\
"--skip-tags[SKIP_TAGS only run plays and tasks whose tags do not match these values]:skip tags:(SKIP_TAGS)"\
'--ssh-common-args[specify common arguments to pass to sftp/scp/ssh]'\
'--ssh-extra-args[specify extra arguments to pass to ssh only]'\
"--start-at-task[START_AT start the playbook at the task matching this name]:name:(TASK_NAME)"\
'--step[one-step-at-a-time: confirm each task before running]'\
"(-S --su)"{-S,--su}"[run operations with su]"\
"(-R --su-user)"{-R,--su-user}"[SU_USER run operations with su as this user (default=root)]:su user:(root)"\
"(-s --sudo)"{-s,--sudo}"[run operations with sudo (nopasswd)]"\
"(-U --sudo-user)"{-U,--sudo-user}"[SUDO_USER desired sudo user (default=root)]:su user:(root)"\
"(-S --su)"{-S,--su}"[run operations with su (deprecated, use become)]"\
"(-R --su-user)"{-R,--su-user}"[SU_USER run operations with su as this user (default=root) (deprecated, use become)]:su user:(root)"\
"(-s --sudo)"{-s,--sudo}"[run operations with sudo (nopasswd) (deprecated, use become)]"\
"(-U --sudo-user)"{-U,--sudo-user}"[SUDO_USER desired sudo user (default=root) (deprecated, use become)]:su user:(root)"\
'--syntax-check[perform a syntax check on the playbook, but do not execute it]'\
"(-t --tags)"{-t,--tags}"[TAGS only run plays and tasks gagged with these values]:task tags:(TAGS)"\
"(-T --timeout)"{-T,--timeout}"[TIMEOUT override the SSH timeout (s) (default=10)]:ssh timeout:(10)"\

View File

@@ -0,0 +1,94 @@
#compdef ansible-vault
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 ansible v1.9.2 (http://ansible.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Rick van Hattem (https://github.com/wolph)
#
# ------------------------------------------------------------------------------
#
_ansible-vault-commands() {
local -a commands
commands=(
'create:Create new encrypted file'
'decrypt:Decrypt encrypted file'
'edit:Edit encrypted file'
'encrypt:Encrypt unencrypted file'
'rekey:Change password for encrypted file'
'view:View encrypted file'
)
_arguments -s : $nul_args && ret=0
_describe -t commands 'ansible-vault command' commands && ret=0
}
_ansible-vault-command(){
args=(
'--debug[enable debugging]' \
'--vault-password-file[vault password file]:password_file:_files'
$nul_args
"1::file_name:_files"
)
_arguments -s : $args && ret=0
}
_ansible-vault() {
local -a nul_args
nul_args=(
'(-h --help)'{-h,--help}'[show help message and exit.]'
)
local curcontext=$curcontext ret=1
if ((CURRENT == 2)); then
_ansible-vault-commands
else
shift words
(( CURRENT -- ))
curcontext="${curcontext%:*:*}:ansible-vault-$words[1]:"
_call_function ret _ansible-vault-command
fi
}
_ansible-vault "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -0,0 +1,85 @@
#compdef archlinux-java
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 archlinux-java a tool for selecting default Java runtime (https://wiki.archlinux.org/index.php/java).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
_archlinux-java_command_arguments() {
case $words[1] in
(set)
local java_versions=("${(@f)$(archlinux-java status | tail -n +2 | tr -s ' ' | cut -d ' ' -f2)}")
_describe -t output 'Downloads to delete' java_versions
;;
esac
}
_archlinux-java() {
local -a commands
commands=(
"status:List installed Java environments and enabled one"
"get:Return the short name of the Java environment set as default"
"set:Force <JAVA_ENV> as default"
"unset:Unset current default Java environment"
"fix:Fix an invalid/broken default Java environment configuration"
"help:Show help"
)
_arguments -C \
'1:cmd:->cmds' \
'*:: :->args' \
case "$state" in
(cmds)
_describe -t commands 'commands' commands
;;
(*)
_archlinux-java_command_arguments
;;
esac
}
_archlinux-java
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -35,17 +35,27 @@
# -------
#
# * loranger (https://github.com/loranger)
# * Yohan Tambè (https://github.com/Cronos87)
#
# ------------------------------------------------------------------------------
_artisan_get_command_list () {
php artisan --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }'
IFS=" "
php artisan --no-ansi | \
sed "1,/Available commands/d" | \
awk '/ [a-z]+/ { print $1 }' | \
sed -E 's/^[ ]+//g' | \
sed -E 's/[:]+/\\:/g' | \
sed -E 's/[ ]{2,}/\:/g'
}
_artisan () {
if [ -f artisan ]; then
compadd `_artisan_get_command_list`
local -a commands
IFS=$'\n'
commands=(`_artisan_get_command_list`)
_describe 'commands' commands
fi
}

View File

@@ -1,5 +1,26 @@
#compdef atach
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#

View File

@@ -0,0 +1,182 @@
#compdef bitcoin-cli
# ------------------------------------------------------------------------------
# Copyright (c) 2017 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 bitcoin-cli (https://bitcoin.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ian Ker-Seymer (https://github.com/ianks)
#
# ------------------------------------------------------------------------------
_bitcoin-cli() {
local context state line curcontext="$curcontext"
_arguments -C \
-?'[This help message]' \
-conf='[Specify configuration file (default: bitcoin.conf)]:PATH:_files' \
-datadir='[Specify data directory]:PATH:_directories' \
-testnet'[Use the test chain]' \
-regtest'[Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.]' \
-named'[Pass named instead of positional arguments (default: false)]' \
-stdin'[Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases)]' \
-rpcport='[Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332)]: :_guard "[[\:digit\:]]#" "PORT"' \
-rpcwait'[Wait for RPC server to start]' \
-rpcuser='[Username for JSON-RPC connections]:RPCUSER:()' \
-rpcpassword='[Password for JSON-RPC connections]:RPCPASSWORD:()' \
-rpcconnect='[Send commands to node running on <ip> (default: 127.0.0.1)]:RPCCONNECT:_hosts' \
-rpcclienttimeout='[Timeout during HTTP requests (default: 900)]: :_guard "[[\:digit\:]]#" "RPCCLIENTTIMEOUT"' \
':subcommand:->subcommand' && ret=0
case $state in
subcommand)
subcommands=(
'getbestblockhash'
'getblock'
'getblockchaininfo'
'getblockcount'
'getblockhash'
'getblockheader'
'getchaintips'
'getdifficulty'
'getmempoolancestors'
'getmempooldescendants'
'getmempoolentry'
'getmempoolinfo'
'getrawmempool'
'gettxout'
'gettxoutproof'
'gettxoutsetinfo'
'preciousblock'
'pruneblockchain'
'verifychain'
'verifytxoutproof'
'getinfo'
'getmemoryinfo'
'help'
'stop'
'generate'
'generatetoaddress'
'getblocktemplate'
'getmininginfo'
'getnetworkhashps'
'prioritisetransaction'
'submitblock'
'addnode'
'clearbanned'
'disconnectnode'
'getaddednodeinfo'
'getconnectioncount'
'getnettotals'
'getnetworkinfo'
'getpeerinfo'
'listbanned'
'ping'
'setban'
'setnetworkactive'
'createrawtransaction'
'decoderawtransaction'
'decodescript'
'fundrawtransaction'
'getrawtransaction'
'sendrawtransaction'
'signrawtransaction'
'createmultisig'
'estimatefee'
'estimatepriority'
'estimatesmartfee'
'estimatesmartpriority'
'signmessagewithprivkey'
'validateaddress'
'verifymessage'
'abandontransaction'
'addmultisigaddress'
'addwitnessaddress'
'backupwallet'
'bumpfee'
'dumpprivkey'
'dumpwallet'
'getaccount'
'getaccountaddress'
'getaddressesbyaccount'
'getbalance'
'getnewaddress'
'getrawchangeaddress'
'getreceivedbyaccount'
'getreceivedbyaddress'
'gettransaction'
'getunconfirmedbalance'
'getwalletinfo'
'importaddress'
'importmulti'
'importprivkey'
'importprunedfunds'
'importpubkey'
'importwallet'
'keypoolrefill'
'listaccounts'
'listaddressgroupings'
'listlockunspent'
'listreceivedbyaccount'
'listreceivedbyaddress'
'listsinceblock'
'listtransactions'
'listunspent'
'lockunspent'
'move'
'removeprunedfunds'
'sendfrom'
'sendmany'
'sendtoaddress'
'setaccount'
'settxfee'
'signmessage'
'walletlock'
'walletpassphrase'
'walletpassphrasechange'
)
_describe -t subcommands 'bitcoin-cli subcommands' subcommands && ret=0
esac
return ret
}
_bitcoin-cli "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,87 +0,0 @@
#compdef boot2docker
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for boot2docker (https://github.com/boot2docker/boot2docker-cli).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * hhatto (https://github.com/hhatto)
#
# ------------------------------------------------------------------------------
_boot2docker() {
local context state line
_arguments -C \
--basevmdk'[Path to VMDK to use as base for persistent partition]:vmdk:' \
--dhcp'[enable VirtualBox host-only network DHCP. default=true]' \
--dhcpip'[VirtualBox host-only network DHCP server address. default=192.168.59.99]' \
'(-s --disksize)'{-s,--disksize}'[boot2docker disk image size (in MB). default=20000.]:disksize:' \
--dockerport'[host Docker port (forward to port 2375 in VM).]:PORT:' \
--hostip'[VirtualBox host-only network IP address.]:IP:' \
--iso'[path to boot2docker ISO image.]:FILE:_files' \
--lowerip'[VirtualBox host-only network DHCP lower bound.]:IP:' \
'(-m --memory)'{-m,--memory}'[virtual machine memory size (in MB). default=2048]' \
--netmask'[VirtualBox host-only network mask.]' \
--serial'[try serial console to get IP address (experimental) default=false]' \
--serialfile'[path to the serial socket/pipe.]:FILE:_files' \
--ssh'[path to SSH client utility. default="ssh"]:SSH:' \
--ssh-keygen'[path to ssh-keygen utility. default="ssh-keygen"]:KEYGEN:' \
--sshkey'[path to SSH key to use.]:FILE:_files' \
--sshport'[host SSH port (forward to port 22 in VM). default=2022]:PORT:' \
--upperip'[VirtualBox host-only network DHCP upper bound. default=192.168.59.254]:IP:' \
--vbm'[path to VirtualBox management utility. default="VBoxManage"]' \
'(-v --verbose)'{-v,--verbose}'[display verbose command invocations. default=false]' \
--vm'[virtual machine name. default="boot2docker-vm"]' \
'*::boot2docker commands:_boot2docker_command'
}
(( $+functions[_boot2docker_command] )) ||
_boot2docker_command() {
local _boot2docker_cmds
_boot2docker_cmds=(
'init:Create a new boot2docker VM.' \
'up:Start VM from any states.' \
'start:Start VM from any states.' \
'boot:Start VM from any states.' \
'ssh:Login to VM via SSH.' \
'save:Suspend VM and save state to disk.' \
'suspend:Suspend VM and save state to disk.' \
"down:Gracefully shutdown the VM." \
"stop:Gracefully shutdown the VM." \
"halt:Gracefully shutdown the VM." \
"restart:Gracefully reboot the VM." \
"poweroff:Forcefully power off the VM (might corrupt disk image)." \
"reset:Forcefully power cycle the VM (might corrupt disk image)." \
"delete:Delete boot2docker VM and its disk image." \
"destroy:Delete boot2docker VM and its disk image." \
"config:Show selected profile file settings." \
"cfg:Show selected profile file settings." \
"info:Display detailed information of VM." \
"ip:Display the IP address of the VM's Host-only network." \
"status:Display current state of VM." \
"download:Download boot2docker ISO image." \
"upgrade:Upgrade the boot2docker ISO image (if vm is running it will be stopped and started)." \
"version:Display version information."
)
if (( CURRENT == 1 )); then
_describe -t commands 'boot2docker subcommand' _boot2docker_cmds
fi
}
_boot2docker "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,5 +1,30 @@
#compdef bower
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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
# -----------
#

View File

@@ -1,215 +0,0 @@
#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)
# * Katsunori Kanda (https://github.com/potix2)
#
# ------------------------------------------------------------------------------
_brew_all_formulae() {
formulae=(${(f)"$(_call_program formulae brew search 2>/dev/null)"})
}
_brew_installed_formulae() {
installed_formulae=(${(f)"$(_call_program formulae brew list 2>/dev/null)"})
}
_brew_installed_taps() {
installed_taps=(${(f)"$(_call_program formulae brew tap 2>/dev/null)"})
}
_brew_outdated_formulae() {
outdated_formulae=(${(f)"$(_call_program formulae brew outdated 2>/dev/null)"})
}
_brew_cask() {
local -a _1st_arguments
_1st_arguments=(
"alfred:displays note about new built-in alfred support"
"audit:verifies installability of Casks"
"cat:dump raw source of the given Cask to the standard output"
"cleanup:cleans up cached downloads and tracker symlinks"
"create:creates the given Cask and opens it in an editor"
"doctor:checks for configuration issues"
"edit:edits the given Cask"
"fetch:downloads Cask resources to local cache"
"home:opens the homepage of the given Cask"
"info:displays information about the given Cask"
"install:installs the given Cask"
"list:with no args, lists installed Casks; given installed Casks, lists staged files"
"search:searches all known Casks"
"uninstall:uninstalls the given Cask"
"update:a synonym for 'brew update'"
"zap:zaps all files associated with the given Cask"
)
if (( CURRENT == 2 )); then
_describe -t commands "brew cask subcommand" _1st_arguments
return
fi
local expl
local -a all_cask_formulae installed_cask_formulae
case "$words[2]" in
audit|cat|edit|info|install|search)
all_cask_formulae=( $(brew cask search 2>/dev/null) )
_wanted all_cask_formulae expl 'all cask formulae' compadd -a all_cask_formulae ;;
uninstall|zap)
installed_cask_formulae=( $(brew cask list 2>/dev/null) )
_wanted installed_cask_formulae expl 'installed cask formulae' compadd -a installed_cask_formulae ;;
*) ;;
esac
}
local -a _1st_arguments
_1st_arguments=(
'audit:check formulae for Homebrew coding style'
'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'
'diy:automatically determine the installation prefix for non-Homebrew software'
'edit:edit a formula'
'fetch:download the source packages for the given formulae'
'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.'
'options:display install options specific to formula'
'outdated:list formulae for which a newer version is available'
'prune:remove dead links'
'reinstall:install a formula anew; re-using its current options'
'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)'
'services:manage background services via launchctl'
'tap:tap a new formula repository from GitHub, or list existing taps'
'test:a few formulae provide a test method'
'unlink:unlink a formula'
'untap:remove a tapped repository'
'unpin:unpin specified formulae'
'update:freshen up links'
'upgrade:upgrade outdated formulae'
'uses:show formulae which depend on a formula'
'versions:list previous versions of formulae'
)
local expl
local -a formulae installed_formulae installed_taps outdated_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 \
'(--debian)--debian[search the Debian repository]' \
'(--fedora)--fedora[search the Fedora repository]' \
'(--fink)--fink[search the Fink repository]' \
'(--macports)--macports[search the Macports repository]' \
'(--opensuse)--opensuse[search the OpenSuse repository]' \
'(--ubuntu)--ubuntu[search the Ubuntu repository]' \
'1: :->forms' && return 0
if [[ "$state" == forms ]]; then
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae
fi ;;
link|ln)
_arguments \
'(-n --dry-run)'{-n,--dry-run}'[All files would be linked or be deleted will be listed, but no real linking or deletion will be done]' \
'(--force)--force[Allow keg-only formulae to be linked]' \
'(--overwrite)--overwrite[Also delete files which already exist in the prefix while linking]' \
'1: :->forms' && return 0
if [[ "$state" == forms ]]; then
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
fi ;;
list|ls)
_arguments \
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
'(--pinned)--pinned[list all versions of pinned formulae]' \
'(--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|reinstall)
_arguments \
'(--devel)--devel[install the development version]' \
'(--env=std)--env=std[use the standard build environment instead of superenv]' \
'(--env=super)--env=super[use superenv even if the formula specifies the standard build environment]' \
'(--fresh)--fresh[the installation process will not re-use any options from previous installs]' \
'(--ignore-dependencies)--ignore-dependencies[skip any dependencies installation]' \
'(--use-clang)--use-clang[attempt to compile using clang]' \
'(--use-gcc)--use-gcc[attempt to compile using GCC]' \
'(--use-llvm)--use-llvm[attempt to compile using the LLVM front-end to GCC]' \
'1: :->forms' && return 0
if [[ "$state" == forms ]]; then
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae
fi ;;
audit|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|pin|unpin|test)
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
tap)
_arguments \
'(--repair)--repair[repair all tap formula, i.e. symlinks and dead formula]' && return 0 ;;
upgrade)
_brew_outdated_formulae
_wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;
untap)
_brew_installed_taps
_wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
cask)
_brew_cask ;;
esac
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,5 +1,30 @@
#compdef bundle
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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
# -----------
#
@@ -48,6 +73,7 @@ case $state in
_values 'commands' 'install' 'update' 'package' 'exec' 'config' 'check' 'list' 'show' 'console' 'open' 'viz' 'init' 'gem' 'help' 'platform' 'outdated' && ret=0
;;
install)
_policies=('HighSecurity' 'MediumSecurity' 'LowSecurity' 'AlmostNoSecurity' 'NoSecurity')
_arguments \
'(--no-color)--no-color[disable colorization in output]' \
'(--local)--local[do not attempt to connect to rubygems.org]' \
@@ -58,7 +84,18 @@ case $state in
'(--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'
'(--without)--without=-[exclude gems that are part of the specified named group]:groups' \
'(--with)--with=-[include gems that are part of the specified named group]:groups' \
'(--clean)--clean[remove any gems not present in the current Gemfile]' \
'(--full-index)--full-index[download and cache the index file of all gems]' \
'(--jobs)--jobs=-[install gems parallely]:number' \
'(--force)--force[force download every gem]' \
'(--no-cache)--no-cache[do not update the cache in vendor/cache with newly installed gems]' \
'(--no-prune)--no-prune[do not remove stale gem from cache after installation]' \
'(--retry)--retry=-[number of times to retry failed network or git requests]:number' \
'(--sheband)--shebang=-[specify ruby executable to execute scripts]:ruby' \
'(--standalone)--standalone=-[create standalone bundles]:groups' \
"(--trust-policy)--trust-policy=-[apply the Rubygems security policy]:arg:($_policies)"
ret=0
;;
exec)

View File

@@ -1,648 +0,0 @@
#compdef cabal
# ------------------------------------------------------------------------------
# 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 cabal-install (http://hackage.haskell.org/trac/hackage/wiki/CabalInstall)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Gérard Milmeister
# * Matvey Aksenov <matvey.aksenov@gmail.com>
#
# ------------------------------------------------------------------------------
local WORDS
_cabal ()
{
WORDS=()
for w in $words[1,(($CURRENT - 1))]; do
if [[ $w != -* ]]; then WORDS+=$w; fi
done
if (( $#WORDS == 1 )); then
_arguments \
{-h,--help}'[show help]' \
{-V,--version}'[print version information]' \
'--numeric-version[print just the version number]' \
'--config-file=[set an alternate location for the config file]:config file:_files' \
'--sandbox-config-file=[set an alternate location for the sandbox config file]:config file:_files' \
'--require-sandbox[enable requiring the presence of a sandbox for sandbox-aware commands]' \
'--no-require-sandbox[disable requiring the presence of a sandbox for sandbox-aware commands]' \
'--ignore-sandbox[ignore any existing sandbox]' \
'*::command:_cabal_command'
else
_arguments '*::command:_cabal_command'
fi
}
_cabal_command ()
{
local -a _cabal_cmds
_cabal_cmds=(
'install:installs a list of packages'
'update:updates list of known packages'
'list:list packages matching a search string'
'info:display detailed information about a particular package'
'fetch:downloads packages for later installation'
'freeze:freeze dependencies'
"get:get a package's source code"
'check:check the package for common mistakes'
'sdist:generate a source distribution file (.tar.gz)'
'upload:uploads source packages to Hackage'
'report:upload build reports to a remote server'
'run:runs the compiled executable'
'init:interactively create a .cabal file'
'configure:prepare to build the package'
'build:compile all targets or specific targets'
'repl:open an interpreter session for the given target'
'sandbox:create/modify/delete a sandbox'
'haddock:generate Haddock HTML documentation'
'exec:run a command with the cabal environment'
'copy:copy the files into the install locations'
'clean:clean up after a build'
'hscolour:generate HsColour colourised code, in HTML format'
'register:register this package with the compiler'
'test:run the test suite, if any (configure with UserHooks)'
'bench:run the benchmark, if any (configure with UserHooks)'
'help:help about commands'
)
local -a _cabal_programs
_cabal_programs=()
programs=(alex ar c2hs cpphs ffihugs gcc ghc ghc-pkg greencard haddock
happy hmake hpc hsc2hs hscolour hugs jhc ld lhc lhc-pkg nhc98 pkg-config
ranlib strip tar uhc)
for program in $programs; do
_cabal_programs+=(
"--with-${program}=[give the path to ${program}]:file:_files"
"--${program}-options=[give extra options to ${program}]"
"--${program}-option=[give an extra option to ${program}]"
)
done
if (( CURRENT == 1 )) then
_describe -t commands 'command' _cabal_cmds || compadd "$@"
else
local curcontext="$curcontext"
cmd="${${_cabal_cmds[(r)$WORDS[2]:*]%%:*}}"
if (( $#cmd )); then
_call_function ret _cabal_$cmd
else
_message "unknown cabal command: $WORDS[2]"
fi
fi
}
_cabal_bench ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
'--benchmark-options=[give extra options to benchmark executables]' \
'--benchmark-option=[give an extra option to benchmark executables (no need to quote options containing spaces)]' \
{-j,--jobs=}'[run NUM jobs simultaneously]' \
$_cabal_programs \
"--only[don't reinstall add-source dependencies (sandbox-only)]"
}
_cabal_build ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
$_cabal_programs \
{-j,--jobs=}'[run NUM jobs simultaneously]' \
"--only[don't reinstall add-source dependencies (sandbox-only)]"
}
_cabal_check ()
{
_arguments {-h,--help}'[show help]'
}
_cabal_clean ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
{-s,--save-configure}'[do not remove the configuration file]'
}
_cabal_configure ()
{
local context state state_descr line
typeset -A opt_args
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
{-g,--ghc}'[compile with GHC]' \
'--nhc98[compile with NHC]' \
'--jhc[compile with JHC]' \
'--lhc[compile with LHC]' \
'--hugs[compile with Hugs]' \
'--uhc[compile with UHC]' \
'--haskell-suite[compile with a haskell-suite compiler]' \
{-w,--with-compiler=}'[give the path to a particular compiler]:file:_files' \
'--with-hc-pkg=[give the path to the package tool]:file:_files' \
'--prefix=[take this prefix in preparation of installation]:directory:_files -/' \
'--bindir=[installation directory for executables]:directory:_files -/' \
'--libdir=[installation directory for libraries]:directory:_files -/' \
'--libsubdir=[subdirectory of libdir in which libs are installed]:directory:_files -/' \
'--libexecdir=[installation directory for program executables]:directory:_files -/' \
'--datadir=[installation directory for read-only data]:directory:_files -/' \
'--datasubdir=[subdirectory of datadir in which data files are installed]:directory:_files -/' \
'--docdir=[installation directory for documentation]:directory:_files -/' \
'--htmldir=[installation directory for HTML]:directory:_files -/' \
'--haddockdir=[installation directory for haddock interfaces]:directory:_files -/' \
'--sysconfdir=[installation directory for configuration files]:directory:_files -/' \
{-b,--scratchdir=}'[directory to receive the built package]:directory:_files -/' \
'--program-prefix=[prefix to be applied to installed executables]' \
'--program-suffix=[suffix to be applied to installed executables]' \
'--enable-library-vanilla[enable Vanilla libraries]' \
'--disable-library-vanilla[disable Vanilla libraries]' \
{-p,--enable-library-profiling}'[enable Library profiling]' \
'--disable-library-profiling[disable Library profiling]' \
'--enable-shared[enable Shared library]' \
'--disable-shared[disable Shared library]' \
'--enable-executable-dynamic[enable Executable dynamic linking]' \
'--disable-executable-dynamic[disable Executable dynamic linking]' \
'--enable-executable-profiling[enable Executable profiling]' \
'--disable-executable-profiling[disable Executable profiling]' \
{-O-,--enable-optimization=}'[build with optimization]:level:(0 1 2)' \
'--disable-optimization[build without optimization]' \
'--enable-library-for-ghci[enable compile library for use with GHCi]' \
'--disable-library-for-ghci[disable compile library for use with GHCi]' \
'--enable-split-objs[enable split library into smaller objects]' \
'--disable-split-objs[disable split library into smaller objects]' \
'--enable-executable-stripping[enable strip executables upon installation]' \
'--disable-executable-stripping[disable strip executables upon installation]' \
'--configure-option=[extra option for configure]' \
'--user[enable doing a per-user installation]' \
'--global[disable doing a per-user installation]' \
'--package-db=[use a given package database]:: :->default-db-or-filepath' \
{-f,--flags=}'[force values for the given flags]:flags:' \
'--extra-include-dirs=[a list of directories to search for header files]:directory:_files -/' \
'--extra-lib-dirs=[a list of directories to search for externallibraries]:directory:_files -/' \
'--extra-prog-path=[A list of directories to search for required programs]:directory:_files -/' \
'--enable-tests[enable dependency checking and compilation for test suites listed in the package description file]' \
'--disable-tests[disable dependency checking and compilation for test suites listed in the package description file]' \
'--enable-library-coverage[enable build library and test suites with, Haskell Program Coverage enabled. (GHC only)]' \
'--disable-library-coverage[disable build library and test suites with, Haskell Program Coverage enabled. (GHC only)]' \
'--enable-benchmarks[enable dependency checking and compilation, for benchmarks listed in the package]' \
'--disable-benchmarks[disable dependency checking and compilation, for benchmarks listed in the package]' \
$_cabal_programs \
'--cabal-lib-version=[select which version of the Cabal lib to use]' \
'--constraint=[a list of additional constraints on the dependencies]' \
'--preference=[specify preferences on the version of a package]' \
'--solver=[select dependency solver to use]:solver:(topdown modular choose)' \
'--allow-newer=[ignore upper bounds in dependencies on some or all packages]'
case $state in
(default-db-or-filepath)
_alternative \
':default db:(global user clear)' \
':filepath:_files'
;;
esac
}
_cabal_copy ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated build]:directory:_files -/' \
'--destdir=[directory to copy files to]:directory:_files -/'
}
_cabal_exec ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)'
}
_cabal_fetch ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--dependencies[resolve and fetch dependencies]' \
'--no-dependencies[ignore dependencies]' \
'--dry-run[do not install anything, only print what would be installed]' \
'--solver=[select dependency solver to use]:solver:(topdown modular choose)]' \
'--max-backjumps=[maximum number of backjumps allowed while solving dependencies]' \
'--reorder-goals[try to reorder goals according to certain heuristics]' \
'--shadow-installed-packages[if multiple package instances of the same version are installed, treat all but one as shadowed]' \
'*:package:_cabal_list_packages'
}
_cabal_freeze ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--dry-run[do not freeze anything, only print what would be frozen]' \
'--solver=[select dependency solver to use]:solver:(topdown modular choose)]' \
'--max-backjumps=[maximum number of backjumps allowed while solving dependencies]' \
'--reorder-goals[try to reorder goals according to certain heuristics]' \
'--shadow-installed-packages[if multiple package instances of the same version are installed, treat all but one as shadowed]'
}
_cabal_get ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
{-d-,--destdir=}'[where to unpack the packages]:directory:_files -/' \
{-s,--source-repository=}"[copy the package's source repository]" \
'--pristine[unpack the original pristine tarball, rather than updating the .cabal file with the latest revision from the package archive.]' \
'*:package:_cabal_list_packages'
}
_cabal_haddock ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated files]:directory:_files -/' \
'--keep-temp-files[keep temporary files]' \
'--hoogle[generate a hoogle database]' \
'--html[generate HTML documentation]' \
'--html-location=[location of HTML documentation]:url:' \
'--executables[run haddock for Executables targets]' \
'--tests[run haddock for Test Suite targets]' \
'--benchmarks[run haddock for Benchmark targets]' \
'--all[run haddock for all targets]' \
'--internal[run haddock for internal modules]' \
'--css=[path to the haddock stylesheet]:file:_files' \
'--hyperlink-source[hyperlink the documentation to the source code]' \
'--hscolour-css=[path to the HsColour stylesheet]:file:_files' \
'--contents-location=[bake URL in as the location for the contents page]:url:' \
'--with-ghc=[path to ghc]:file:_files' \
'--with-haddock=[path to haddock]:file:_files' \
'--PROG-option=[give an extra option to PROG (no need to quote options containing spaces)]:option:' \
'--ghc-options=[give extra options to ghc]:option:' \
'--haddock-options=[give extra options to haddock]:option:' \
}
_cabal_help ()
{
local -a cmds
cmds=(install update list info fetch freeze get check sdist upload report run init
configure build repl sandbox haddock exec copy clean hscolour register test bench help)
_arguments \
{-h,--help}'[Show help]' \
'*::command:( $cmds )'
}
_cabal_hscolour ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated files]:directory:_files -/' \
'--executables[run hscolour for Executables targets]' \
'--tests[run hscolour for Test Suite targets]' \
'--benchmarks[run hscolour for Benchmarks targets]' \
'--all[run hscolour for all targets]' \
'--css=[path to stylesheet]:file:_files'
}
_cabal_info ()
{
local context state state_descr line
typeset -A opt_args
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--package-db=[use a given package database]:: :->default-db-or-filepath' \
'*:package:_cabal_list_packages'
case $state in
(default-db-or-filepath)
_alternative \
':default db:(global user clear)' \
':filepath:_files'
;;
esac
}
_cabal_install ()
{
local context state state_descr line
typeset -A opt_args
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
{-g,--ghc}'[compile with GHC]' \
'--nhc98[compile with NHC]' \
'--jhc[compile with JHC]' \
'--lhc[compile with LHC]' \
'--hugs[compile with Hugs]' \
'--uhc[compile with UHC]' \
'--haskell-suite[compile with a haskell-suite compiler]' \
{-w,--with-compiler=}'[give the path to a particular compiler]:file:_files' \
'--with-hc-pkg=[give the path to the package tool]:file:_files' \
'--prefix=[take this prefix in preparation of installation]:directory:_files -/' \
'--bindir=[installation directory for executables]:directory:_files -/' \
'--libdir=[installation directory for libraries]:directory:_files -/' \
'--libsubdir=[subdirectory of libdir in which libs are installed]:directory:_files -/' \
'--libexecdir=[installation directory for program executables]:directory:_files -/' \
'--datadir=[installation directory for read-only data]:directory:_files -/' \
'--datasubdir=[subdirectory of datadir in which data files are installed]:directory:_files -/' \
'--docdir=[installation directory for documentation]:directory:_files -/' \
'--htmldir=[installation directory for HTML]:directory:_files -/' \
'--haddockdir=[installation directory for haddock interfaces]:directory:_files -/' \
'--sysconfdir=[installation directory for configuration files]:directory:_files -/' \
{-b,--scratchdir=}'[directory to receive the built package]:directory:_files -/' \
'--program-prefix=[prefix to be applied to installed executables]' \
'--program-suffix=[suffix to be applied to installed executables]' \
'--enable-library-vanilla[enable Vanilla libraries]' \
'--disable-library-vanilla[disable Vanilla libraries]' \
{-p,--enable-library-profiling}'[enable Library profiling]' \
'--disable-library-profiling[disable Library profiling]' \
'--enable-shared[enable Shared library]' \
'--disable-shared[disable Shared library]' \
'--enable-executable-dynamic[enable Executable dynamic linking]' \
'--disable-executable-dynamic[disable Executable dynamic linking]' \
'--enable-executable-profiling[enable Executable profiling]' \
'--disable-executable-profiling[disable Executable profiling]' \
{-O-,--enable-optimization=}'[build with optimization]:level:(0 1 2)' \
'--disable-optimization[build without optimization]' \
'--enable-library-for-ghci[enable compile library for use with GHCi]' \
'--disable-library-for-ghci[disable compile library for use with GHCi]' \
'--enable-split-objs[enable split library into smaller objects]' \
'--disable-split-objs[disable split library into smaller objects]' \
'--enable-executable-stripping[enable strip executables upon installation]' \
'--disable-executable-stripping[disable strip executables upon installation]' \
'--configure-option=[extra option for configure]' \
'--user[enable doing a per-user installation]' \
'--global[disable doing a per-user installation]' \
'--package-db=[use a given package database]:: :->default-db-or-filepath' \
{-f,--flags=}'[force values for the given flags]:flags:' \
'--extra-include-dirs=[a list of directories to search for header files]:directory:_files -/' \
'--extra-lib-dirs=[a list of directories to search for external libraries]:directory:_files -/' \
'--extra-prog-path=[a list of directories to search for required programs]:directory:_files -/' \
'--enable-tests[enable dependency checking and compilation for test suites listed in the package description file]' \
'--disable-tests[disable dependency checking and compilation for test suites listed in the package description file]' \
'--enable-library-coverage[enable build library and test suites with, Haskell Program Coverage enabled. (GHC only)]' \
'--disable-library-coverage[disable build library and test suites with, Haskell Program Coverage enabled. (GHC only)]' \
'--enable-benchmarks[enable dependency checking and compilation, for benchmarks listed in the package]' \
'--disable-benchmarks[disable dependency checking and compilation, for benchmarks listed in the package]' \
$_cabal_programs \
'--cabal-lib-version=[select which version of the Cabal lib to use]' \
'--constraint=[a list of additional constraints on the dependencies]' \
'--preference=[specify preferences on the version of a package]' \
'--solver=[select dependency solver to use]:solver:(topdown modular choose)' \
'--allow-newer=[ignore upper bounds in dependencies on some or all packages]' \
'--enable-documentation[enable building of documentation]' \
'--disable-documentation[disable building of documentation]' \
'--doc-index-file=[a central index of haddock API documentation]:file:_files' \
'--dry-run[do not install anything]' \
'--max-backjumps=[maximum number of backjumps allowed while solving dependencies]' \
'--reorder-goals[try to reorder goals according to certain heuristics]' \
'--shadow-installed-packages[if multiple package instances of the same version are installed, treat all but one as shadowed]' \
'--reinstall[always install]' \
'--avoid-reinstalls[do not select versions that would destructively overwrite installed packages]' \
'--force-reinstalls[reinstall packages even if they will most likely break other installed packages]' \
'--upgrade-dependencies[pick the latest version for all dependencies, rather than trying to pick an installed version]' \
{--only-dependencies,--dependencies-only}'[install only the dependencies necessary to build the given packages]' \
'--root-cmd=[command used to gain root privileges]::' \
'--symlink-bindir=[add symlinks into this directory]:directory:_files -/' \
'--build-summary=[save build summaries to file]:file:_files' \
'--build-log=[log all builds to file]:file:_files' \
'--remote-build-reporting=[generate build reports to send to a remote]:level:(none anonymous detailed)' \
'--one-shot[do not record the packages in the world file]' \
'--run-tests[run package test suites during installation]' \
{-j,--jobs=}'[run NUM jobs simultaneously]' \
'--haddock-hoogle[generate a hoogle database]' \
'--haddock-html[generate HTML documentation]' \
'--haddock-html-location=[location of HTML documentation]:url:' \
'--haddock-executables[run haddock for Executables targets]' \
'--haddock-tests[run haddock for Test Suite targets]' \
'--haddock-benchmarks[run haddock for Benchmarks targets]' \
'--haddock-all[run haddock for all targets]' \
'--haddock-internal[run haddock for internal modules]' \
'--haddock-css=[path to the haddock stylesheet]:file:_files' \
'--haddock-hyperlink-source[hyperlink the documentation to the source code]' \
'--haddock-hscolour-css=[path to the HsColour stylesheet]:file:_files' \
'--haddock-contents-location=[bake URL in as the location for the contents page]:url:' \
'*:: :->package-or-cabal-file'
case $state in
(default-db-or-filepath)
_alternative \
':default db:(global user clear)' \
':filepath:_files'
;;
(package-or-cabal-file)
_alternative \
':package:_cabal_list_packages' \
':files:_files -g "*.cabal"'
;;
esac
}
_cabal_list ()
{
local context state state_descr line
typeset -A opt_args
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--installed[only print installed packages]' \
'--simple-output[print in a easy-to-parse format]' \
'--package-db=[use a given package database]:: :->default-db-or-filepath' \
'*:package:_cabal_list_packages'
case $state in
(default-db-or-filepath)
_alternative \
':default db:(global user clear)' \
':filepath:_files'
;;
esac
}
_cabal_register ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated files]:directory:_files -/' \
"--user[register in user's local package database]" \
"--global[register in the system-wide package database]" \
'--inplace[register in build location]' \
'--gen-script[generate a script to register later]' \
'--gen-pkg-config=[generate package registration file]'
}
_cabal_repl ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
$_cabal_programs
}
_cabal_report ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
{-u,--username=}'[hackage username]' \
{-p,--password=}'[hackage password]'
}
_cabal_run ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
{-j,--jobs=}'[run NUM jobs simultaneously]' \
$_cabal_programs \
"--only[don't reinstall add-source dependencies (sandbox-only)]"
}
_cabal_sandbox ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--sandbox=[Sandbox location]:sandbox:_files -/'
if (( CURRENT == 2 )); then
local -a _cabal_sandbox_cmds
_cabal_sandbox_cmds=(
'init:initialize the sandbox'
'delete:delete the sandbox'
'add-source:add sources path to sandbox'
'hc-pkg:call sandbox related haskell compiler package database'
'list-sources:list added sources paths'
)
_describe -t sandbox-commands 'sandbox-command' _cabal_sandbox_cmds || compadd "$@"
else
case $WORDS[3] in
add-source)
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--snapshot[take a snapshot instead of creating a link]' \
'--sandbox=[Sandbox location]:sandbox:_files -/' \
'*:sources:_files -/'
;;
*)
_message "unknown cabal sandbox command: $WORDS[3]"
;;
esac
fi
}
_cabal_sdist ()
{
_arguments \
{-h,--help}'[show help]' \
{-v,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated files]:directory:_files -/' \
"--list-sources=[just write a list of the package's sources to a file]:directory:_files -/" \
'--snapshot[produce a snapshot source distribution]' \
'--output-directory=[generate a source distribution in the given directory]:directory:_files -/' \
'--targz[produce a .tar.gz format archive]' \
'--zip[produce a .zip format archive]'
}
_cabal_test ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
'--builddir=[the directory where Cabal puts generated files]:directory:_files -/' \
'--log=[log all test suite results to file]:file:_files' \
'--machine-log=[produce a machine-readable log file]:file:_files' \
'--show-details=[when to show results of individual test cases?]:filter:(always never failures)' \
'--keep-tix-files[keep .tix files for HPC between test runs]' \
'--test-options=[give extra options to test executables]' \
'--test-option=[give an extra option to test executables]' \
{-j,--jobs=}'[run NUM jobs simultaneously]' \
$_cabal_programs \
"--only[don't reinstall add-source dependencies (sandbox-only)]"
}
_cabal_update ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)'
}
_cabal_upload ()
{
_arguments \
{-h,--help}'[show help]' \
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
{-c,--check}'[do not upload, just do QA checks]' \
{-u-,--username=}'[hackage username]' \
{-p-,--password=}'[hackage password]' \
'*:file:_files -g "*.tar.gz"'
}
_cabal_list_packages () {
_cabal_get_available_packages
_cabal_get_available_files=(*.cabal)
compadd "$@" -a -- _cabal_available_packages _cabal_get_available_files
}
_cabal_get_available_packages ()
{
if ( [[ ${+_cabal_available_packages} -eq 0 ]] || _cache_invalid CABAL_AVAILABLE_PACKAGES ) &&
! _retrieve_cache CABAL_AVAILABLE_PACKAGES;
then
_cabal_available_packages=( $(cabal list --simple-output | cut -d' ' -f1 | uniq) )
_store_cache CABAL_AVAILABLE_PACKAGES _cabal_available_packages
fi
}
_cabal "$@"

View File

@@ -0,0 +1,50 @@
#compdef caffeinate
# ------------------------------------------------------------------------------
# Copyright (c) 2017 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 OSX 'caffeinate' tool (man 8 caffeinate).
#
# -------------------------------------------------------------------------
# Authors
# -------
#
# * Nicolas Despres <nicolas.despres@gmail.com> (initial version)
#
# -------------------------------------------------------------------------
_arguments -s \
'-d[prevent the display from sleeping]' \
'-i[prevent the system from idle sleeping]' \
'-m[prevent the disk from idle sleeping]' \
'-s[prevent the system from sleeping but only when running on AC power]' \
'-u[declare that user is active]' \
'-t+[assertion timeout value]:delay in seconds' \
'-w+[waits for process to exit]:pid:_pids' \
'(-):command: _command_names -e' \
'*::args: _normal'

View File

@@ -1,5 +1,30 @@
#compdef cap
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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
# -----------
#

View File

@@ -1,139 +0,0 @@
#compdef celery
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for celery (https://github.com/celery/celery).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Dong weiming (https://github.com/dongweiming)
#
# ------------------------------------------------------------------------------
_celery () {
local -a _1st_arguments ifargs dopts controlargs
typeset -A opt_args
_1st_arguments=('worker' 'events' 'beat' 'shell' 'multi' 'amqp' 'status' 'inspect' \
'control' 'purge' 'list' 'migrate' 'call' 'result' 'report')
ifargs=('--app=' '--broker=' '--loader=' '--config=' '--version')
dopts=('--detach' '--umask=' '--gid=' '--uid=' '--pidfile=' '--logfile=' '--loglevel=')
controlargs=('--timeout' '--destination')
_arguments \
'(-A --app=)'{-A,--app}'[app instance to use (e.g. module.attr_name):APP]' \
'(-b --broker=)'{-b,--broker}'[url to broker. default is "amqp://guest@localhost//":BROKER]' \
'(--loader)--loader[name of custom loader class to use.:LOADER]' \
'(--config)--config[Name of the configuration module:CONFIG]' \
'(--workdir)--workdir[Optional directory to change to after detaching.:WORKING_DIRECTORY]' \
'(-q --quiet)'{-q,--quiet}'[Don"t show as much output.]' \
'(-C --no-color)'{-C,--no-color}'[Don"t display colors.]' \
'(--version)--version[show program"s version number and exit]' \
'(- : *)'{-h,--help}'[show this help message and exit]' \
'*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "celery subcommand" _1st_arguments
return
fi
case "$words[1]" in
worker)
_arguments \
'(-C --concurrency=)'{-C,--concurrency=}'[Number of child processes processing the queue. The default is the number of CPUs.]' \
'(--pool)--pool=:::(processes eventlet gevent threads solo)' \
'(--purge --discard)'{--discard,--purge}'[Purges all waiting tasks before the daemon is started.]' \
'(-f --logfile=)'{-f,--logfile=}'[Path to log file. If no logfile is specified, stderr is used.]' \
'(--loglevel=)--loglevel=:::(critical error warning info debug)' \
'(-N --hostname=)'{-N,--hostname=}'[Set custom hostname, e.g. "foo.example.com".]' \
'(-B --beat)'{-B,--beat}'[Also run the celerybeat periodic task scheduler.]' \
'(-s --schedule=)'{-s,--schedule=}'[Path to the schedule database if running with the -B option. Defaults to celerybeat-schedule.]' \
'(-S --statedb=)'{-S,--statedb=}'[Path to the state database.Default: None]' \
'(-E --events)'{-E,--events}'[Send events that can be captured by monitors like celeryev, celerymon, and others.]' \
'(--time-limit=)--time-limit=[nables a hard time limit (in seconds int/float) for tasks]' \
'(--soft-time-limit=)--soft-time-limit=[Enables a soft time limit (in seconds int/float) for tasks]' \
'(--maxtasksperchild=)--maxtasksperchild=[Maximum number of tasks a pool worker can execute before it"s terminated and replaced by a new worker.]' \
'(-Q --queues=)'{-Q,--queues=}'[List of queues to enable for this worker, separated by comma. By default all configured queues are enabled.]' \
'(-I --include=)'{-I,--include=}'[Comma separated list of additional modules to import.]' \
'(--pidfile=)--pidfile=[Optional file used to store the process pid.]' \
'(--autoscale=)--autoscale=[Enable autoscaling by providing max_concurrency, min_concurrency.]' \
'(--autoreload)--autoreload[Enable autoreloading.]' \
'(--no-execv)--no-execv[Don"t do execv after multiprocessing child fork.]'
compadd -a ifargs
;;
inspect)
_values -s \
'active[dump active tasks (being processed)]' \
'active_queues[dump queues being consumed from]' \
'ping[ping worker(s)]' \
'registered[dump of registered tasks]' \
'report[get bugreport info]' \
'reserved[dump reserved tasks (waiting to be processed)]' \
'revoked[dump of revoked task ids]' \
'scheduled[dump scheduled tasks (eta/countdown/retry)]' \
'stats[dump worker statistics]'
compadd -a controlargs ifargs
;;
control)
_values -s \
'add_consumer[tell worker(s) to start consuming a queue]' \
'autoscale[change autoscale settings]' \
'cancel_consumer[tell worker(s) to stop consuming a queue]' \
'disable_events[tell worker(s) to disable events]' \
'enable_events[tell worker(s) to enable events]' \
'pool_grow[start more pool processes]' \
'pool_shrink[use less pool processes]' \
'rate_limit[tell worker(s) to modify the rate limit for a task type]' \
'time_limit[tell worker(s) to modify the time limit for a task type.]'
compadd -a controlargs ifargs
;;
multi)
_values -s \
'--nosplash[Don"t display program info.]' \
'--verbose[Show more output.]' \
'--no-color[Don"t display colors.]' \
'--quiet[Don"t show as much output.]' \
'start' 'restart' 'stopwait' 'stop' 'show' \
'names' 'expand' 'get' 'kill'
compadd -a ifargs
;;
amqp)
_values -s \
'queue.declare' 'queue.purge' 'exchange.delete' 'basic.publish' \
'exchange.declare' 'queue.delete' 'queue.bind' 'basic.get'
;;
list)
_values -s, 'bindings'
;;
shell)
_values -s \
'--ipython[force iPython.]' \
'--bpython[force bpython.]' \
'--python[force default Python shell.]' \
'--without-tasks[don"t add tasks to locals.]' \
'--eventlet[use eventlet.]' \
'--gevent[use gevent.]'
compadd -a ifargs
;;
beat)
_arguments \
'(-s --schedule=)'{-s,--schedule=}'[Path to the schedule database. Defaults to celerybeat-schedule.]' \
'(-S --scheduler=)'{-S,--scheduler=}'[Scheduler class to use. Default is celery.beat.PersistentScheduler.]' \
'(--max-interval)--max-interval[]'
compadd -a dopts fargs
;;
events)
_arguments \
'(-d --dump)'{-d,--dump}'[Dump events to stdout.]' \
'(-c --camera=)'{-c,--camera=}'[Take snapshots of events using this camera.]' \
'(-F --frequency=)'{-F,--frequency=}'[Camera: Shutter frequency. Default is every 1.0 seconds.]' \
'(-r --maxrate=)'{-r,--maxrate=}'[Camera: Optional shutter rate limit (e.g. 10/m).]'
compadd -a dopts fargs
;;
*)
;;
esac
}

View File

@@ -0,0 +1,994 @@
#compdef cf
# ------------------------------------------------------------------------------
#
# Copyright 2015 Ferran Rodenas & Danny Rosen
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ------------------------------------------------------------------------------
#
# Description
# -----------
#
# Completion script for Cloud Foundry CLI (https://github.com/cloudfoundry/cli#downloads)
#
# ------------------------------------------------------------------------------
#
# Authors
# -------
#
# * Ferran Rodenas (https://github.com/frodenas)
# * Danny Rosen (https://github.com/dannyzen)
#
# ------------------------------------------------------------------------------
# ----------------------
# ----- Helper functions
# ----------------------
# Output a selectable list of organizations
__cf_orgs() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf orgs | awk 'NR>3{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'ORG' cont_cmd
}
# Output a selectable list of spaces
__cf_spaces() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf spaces | awk 'NR>3{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'SPACE' cont_cmd
}
# Output a selectable list of applications
__cf_apps() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf apps | awk 'NR>4{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'APP' cont_cmd
}
# Output a selectable list of stacks
__cf_stacks() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf stacks | awk 'NR>4{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'STACK' cont_cmd
}
# Output a selectable list of services
__cf_marketplace_services() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf marketplace | awk 'NR>4{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'SERVICE' cont_cmd
}
# Output a selectable list of services
__cf_services() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf services | awk 'NR>4{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'SERVICE' cont_cmd
}
# Output a selectable list of domains
__cf_domains() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf domains | grep -v shared | awk 'NR>2{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'DOMAIN' cont_cmd
}
# Output a selectable list of shared domains
__cf_shared_domains() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf domains | grep -v owned | awk 'NR>2{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'SHARED-DOMAIN' cont_cmd
}
# Output a selectable list of hostnames
__cf_hostnames() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf routes | awk 'NR>3{print $2}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'ROUTE' cont_cmd
}
# Output a selectable list of buildpacks
__cf_buildpacks() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf buildpacks | awk 'NR>3{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'BUILDPACK' cont_cmd
}
# Output a selectable list of feature flags
__cf_feature_flags() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf feature-flags | awk 'NR>4{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'FEATURE-FLAG' cont_cmd
}
# Output a selectable list of plugin repos
__cf_repo_plugins() {
declare -a cont_cmd
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf list-plugin-repos | awk 'NR>3{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'REPO-PLUGIN' cont_cmd
}
# Output a selectable list of plugins
__cf_plugins() {
declare -a cont_cmd
cont_cmd=($(cf plugins | awk 'NR>4{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'PLUGIN' cont_cmd
}
# Output a selectable list of targets (requires cf-targets plugin)
__cf_targets() {
declare -a cont_cmd
cont_cmd=($(cf targets | awk '{print $1}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'TARGET' cont_cmd
}
# --------------------------
# ----- end Helper functions
# --------------------------
# --------------
# ----- Commands
# --------------
__login() {
_arguments \
'-a=[API endpoint (e.g. https://api.example.com)]:api endpoint:' \
'-u=[Username]:username:' \
'-p=[Password]:password:' \
'-o=[Organization]:organization name:__cf_orgs' \
'-s=[Space]:space name:__cf_spaces' \
'--sso[Use a one-time password to login]' \
'--skip-ssl-validation[Skip SSL validation]'
}
__logout() {
# no arguments
}
__passwd() {
_arguments \
'1:password:'
}
__target() {
_arguments \
'-o=[Organization]:organization name:__cf_orgs' \
'-s=[Space]:space name:__cf_spaces'
}
__api() {
_arguments \
'1:API url:' \
'--unset[Remove all api endpoint targeting]' \
'--skip-ssl-validation[Skip SSL validation]'
}
__auth() {
# no arguments
}
__apps() {
# no arguments
}
__app() {
_arguments \
'1:application name:__cf_apps' \
'--guid[Retrieve and display the given app guid. All other health and status output for the app is suppressed]'
}
__push() {
_arguments \
'1:application name:__cf_apps' \
'-b=[Custom buildpack by name (e.g. my-buildpack) or GIT URL or GIT BRANCH URL]:buildpack name:__cf_buildpacks' \
'-c=[Startup command, set to null to reset to default start command]:startup command:' \
'-d=[Domain (e.g. example.com)]:domain (e.g. example.com):__cf_domains' \
'-f=[Path to manifest]:file:_files:' \
'-i=[Number of instances]:number of instances:' \
'-k=[Disk limit (e.g. 256M, 1024M, 1G)]:disk limit (e.g. 256M, 1024M, 1G):' \
'-m=[Memory limit (e.g. 256M, 1024M, 1G)]:memory limit (e.g. 256M, 1024M, 1G):' \
'-n=[Hostname (e.g. my-subdomain)]:hostname (e.g. my-subdomain):' \
'-p=[Path to app directory or to a zip file of the contents of the app directory]:file:_files' \
'-s=[Stack to use (a stack is a pre-built file system, including an operating system, that can run apps)]:stack name:__cf_stacks:' \
'-t=[Maximum time (in seconds) for CLI to wait for application start, other server side timeouts may apply]:maximum time (in seconds):' \
'--no-hostname[Map the root domain to this app]' \
'--no-manifest[Ignore manifest file]' \
'--no-route[Do not map a route to this app and remove routes from previous pushes of this app]' \
'--no-start[Do not start an app after pushing]' \
'--random-route[Create a random route for this app]'
}
__scale() {
_arguments \
'1:application name:__cf_apps' \
'-i=[Number of instances]:number of instances:' \
'-k=[Disk limit (e.g. 256M, 1024M, 1G)]:disk limit (e.g. 256M, 1024M, 1G):' \
'-m=[Memory limit (e.g. 256M, 1024M, 1G)]:memory limit (e.g. 256M, 1024M, 1G):' \
'-f[Force restart of app without prompt]'
}
__delete() {
_arguments \
'1:application name:__cf_apps' \
'--f[Force deletion without confirmation]' \
'--r[Also delete any mapped routes]'
}
__rename() {
_arguments \
'1:application name:__cf_apps' \
'2:application name:'
}
__start() {
_arguments \
'1:application name:__cf_apps'
}
__stop() {
_arguments \
'1:application name:__cf_apps'
}
__restart() {
_arguments \
'1:application name:__cf_apps'
}
__restage() {
_arguments \
'1:application name:__cf_apps'
}
__restart-app-instance() {
_arguments \
'1:application name:__cf_apps' \
'2:application index:'
}
__events() {
_arguments \
'1:application name:__cf_apps'
}
__files() {
_arguments \
'1:application name:__cf_apps' \
'2::path:' \
'-i=[instance]'
}
__logs() {
_arguments \
'1:application name:__cf_apps' \
'--recent[Dump recent logs instead of tailing]'
}
__env() {
_arguments \
'1:application name:__cf_apps'
}
__set-env() {
_arguments \
'1:application name:__cf_apps' \
'2:env var name:' \
'3:env var value:'
}
__unset-env() {
_arguments \
'1:application name:__cf_apps' \
'2:env var name:'
}
__stacks() {
# no arguments
}
__stack() {
_arguments \
'1:stack name:__cf_stacks' \
'--guid[Retrieve and display the given stack guid. All other output for the stack is suppressed]'
}
__copy-source() {
_arguments \
'1:source application name:__cf_apps' \
'2:target application name:' \
'-o=[Org that contains the target application]:organization name:__cf_orgs' \
'-s=[Space that contains the target application]:space name:__cf_spaces' \
'--no-restart[Override restart of the application in target environment after copy-source completes]'
}
__create-app-manifest() {
_arguments \
'1:application name:__cf_apps' \
'-p=[Specify a path for file creation. If path not specified, manifest file is created in current working directory]:path:_files'
}
__marketplace() {
_arguments \
'-s=[Show plan details for a particular service offering]'
}
__services() {
# no arguments
}
__service() {
_arguments \
'1:service name:__cf_services' \
'--guid[Retrieve and display the given service guid. All other output for the service is suppressed]'
}
__create-service() {
_arguments \
'1:service:__cf_marketplace_services' \
'2:plan:' \
'3:service name:' \
'-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]' \
'-t=[User provided tags]'
}
__update-service() {
_arguments \
'1:service name:__cf_services' \
'-p=[Change service plan for a service instance]' \
'-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]' \
'-t=[User provided tags]'
}
__rename-service() {
_arguments \
'1:service name:__cf_services' \
'2:service name:'
}
__delete-service() {
_arguments \
'1:service name:__cf_services' \
'-f[Force deletion without confirmation]'
}
__create-service-key() {
_arguments \
'1:service name:__cf_services' \
'2:service key:' \
'-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]'
}
__service-keys() {
_arguments \
'1:service name:__cf_services'
}
__service-key() {
_arguments \
'1:service name:__cf_services' \
'2:service key:'
}
__delete-service-key() {
_arguments \
'1:service name:__cf_services' \
'2:service key:' \
'-f[Force deletion without confirmation]'
}
__bind-service() {
_arguments \
'1:application name:__cf_apps' \
'2:service name:__cf_services' \
'-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]'
}
__unbind-service() {
_arguments \
'1:application name:__cf_apps' \
'2:service name:__cf_services'
}
__create-user-provided-service() {
_arguments \
'1:service name:' \
'-p=[Credentials]' \
'-l=[Syslog Drain Url]'
}
__update-user-provided-service() {
_arguments \
'1:service name:__cf_services' \
'-p=[Credentials]' \
'-l=[Syslog Drain Url]'
}
__orgs() {
# no arguments
}
__org() {
_arguments \
'1:organization name:__cf_orgs' \
'--guid[Retrieve and display the given org guid. All other output for the org is suppressed]'
}
__create-org() {
_arguments \
'1:organization name:' \
'-q=[Quota to assign to the newly created org (excluding this option results in assignment of default quota)]'
}
__delete-org() {
_arguments \
'1:organization name:__cf_orgs' \
'-f[Force deletion without confirmation]'
}
__spaces() {
# no arguments
}
__space() {
_arguments \
'1:space name:__cf_spaces' \
'--guid[Retrieve and display the given space guid. All other output for the space is suppressed]' \
'--security-group-rules[Retrive the rules for all the security groups associated with the space]'
}
__create-space() {
_arguments \
'1:space name:' \
'-o=[Org that contains the target application]:organization name:__cf_orgs' \
'-q=[Quota to assign to the newly created space (excluding this option results in assignment of default quota)]'
}
__delete-space() {
_arguments \
'1:space name:__cf_spaces' \
'-f[Force deletion without confirmation]'
}
__domains() {
# no arguments
}
__create-domain() {
_arguments \
'1:organization name:__cf_orgs' \
'2:domain:'
}
__delete-domain() {
_arguments \
'1:domain:__cf_domains' \
'-f[Force deletion without confirmation]'
}
__create-shared-domain() {
_arguments \
'1:domain:'
}
__delete-shared-domain() {
_arguments \
'1:domain:__cf_shared_domains' \
'-f[Force deletion without confirmation]'
}
__routes() {
_arguments \
'--orglevel[List all the routes for all spaces of current organization]'
}
__create-route() {
_arguments \
'1:space name:__cf_spaces' \
'2:domain:__cf_domains' \
'-n=[Hostname]'
}
__check-route() {
_arguments \
'1:hostname:__cf_hostnames' \
'2:domain:__cf_domains'
}
__map-route() {
_arguments \
'1:application name:__cf_apps' \
'2:domain:__cf_domains' \
'-n=[Hostname]:hostname:__cf_hostnames:'
}
__unmap-route() {
_arguments \
'1:application name:__cf_apps' \
'2:domain:__cf_domains' \
'-n=[Hostname]:hostname:__cf_hostnames:'
}
__delete-route() {
_arguments \
'1:domain:__cf_domains' \
'-n=[Hostname]:hostname:__cf_hostnames:' \
'-f[Force deletion without confirmation]'
}
__delete-orphaned-routes() {
_arguments \
'-f[Force deletion without confirmation]'
}
__buildpacks() {
# no arguments
}
__create-buildpack() {
_arguments \
'1:buildpack name:' \
'2:path:_files' \
'3:position:' \
'--enable[Enable the buildpack to be used for staging]' \
'--disable[Disable the buildpack from being used for staging]'
}
__update-buildpack() {
_arguments \
'1:buildpack name:__cf_buildpacks' \
'-p=[Path to directory or zip file]:file:_files' \
'-i=[The order in which the buildpacks are checked during buildpack auto-detection]' \
'--enable[Enable the buildpack to be used for staging]' \
'--disable[Disable the buildpack from being used for staging]' \
'--lock[Lock the buildpack to prevent updates]' \
'--unlock[Unlock the buildpack to enable updates]'
}
__rename-buildpack() {
_arguments \
'1:buildpack name:__cf_buildpacks' \
'2:new buildpack name:'
}
__delete-buildpack() {
_arguments \
'1:buildpack name:__cf_buildpacks' \
'-f[Force deletion without confirmation]'
}
__running-environment-variable-group() {
# no arguments
}
__staging-environment-variable-group() {
# no arguments
}
__set-staging-environment-variable-group() {
# no arguments
}
__set-running-environment-variable-group() {
# no arguments
}
__feature-flags() {
# no arguments
}
__feature-flag() {
_arguments \
'1:feature name:__cf_feature_flags'
}
__enable-feature-flag() {
_arguments \
'1:feature name:__cf_feature_flags'
}
__disable-feature-flag() {
_arguments \
'1:feature name:__cf_feature_flags'
}
__curl() {
_arguments \
'1:path:' \
'-i[Include response headers in the output]' \
'-v[Enable CF_TRACE output for all requests and responses]' \
'-X=[HTTP method]:http method:(GET POST PUT DELETE)' \
'-h=[Custom headers to include in the request, flag can be specified multiple times]' \
'-d=[HTTP data to include in the request body]' \
'--output[Write curl body to FILE instead of stdout]'
}
__config() {
_arguments \
'--async-timeout=[Timeout for async HTTP requests]' \
'--trace=[Trace HTTP requests]:trace:(true false)' \
'--color=[Enable or disable color]:color:(true false)' \
'--locale=[Set default locale. If LOCALE is CLEAR, previous locale is deleted]'
}
__oauth-token() {
# no arguments
}
__add-plugin-repo() {
_arguments \
'1:repo name:' \
'2:url:'
}
__remove-plugin-repo() {
_arguments \
'1:repo name:__cf_repo_plugins' \
'2:url:'
}
__list-plugin-repos() {
# no arguments
}
__repo-plugins() {
_arguments \
'-r=[Repo Name]:repo name:__cf_repo_plugins'
}
__plugins() {
_arguments \
'-checksum[Compute and show the sha1 value of the plugin binary file]'
}
__install-plugin() {
_arguments \
'1:plugin URL or path:_files' \
'-r=[repo name where the plugin binary is located]:repo name:__cf_repo_plugins'
}
__uninstall-plugin() {
_arguments \
'1:plugin name:__cf_plugins'
}
__save-target() {
_arguments \
'1:target-name:' \
'-f[Force save even if current target is already saved under another name]'
}
__set-target() {
_arguments \
'1:target-name:__cf_targets' \
'-f[Force target change even if current target is unsaved]'
}
__delete-target() {
_arguments \
'1:target-name:__cf_targets'
}
# ------------------
# ----- end Commands
# ------------------
# -------------------
# ----- 1st Arguments
# -------------------
local -a _1st_arguments
_1st_arguments=(
"login":"Log user in"
"logout":"Log user out"
"passwd":"Change user password"
"target":"Set or view the targeted org or space"
"api":"Set or view target api url"
"auth":"Authenticate user non-interactively"
"apps":"List all apps in the target space"
"app":"Display health and status for app"
"push":"Push a new app or sync changes to an existing app"
"scale":"Change or view the instance count, disk space limit, and memory limit for an app"
"delete":"Delete an app"
"rename":"Rename an app"
"start":"Start an app"
"stop":"Stop an app"
"restart":"Restart an app"
"restage":"Restage an app"
"restart-app-instance":"Terminate the running application Instance at the given index and instantiate a new instance of the application with the same index"
"events":"Show recent app events"
"files":"Print out a list of files in a directory or the contents of a specific file"
"logs":"Tail or show recent logs for an app"
"env":"Show all env variables for an app"
"set-env":"Set an env variable for an app"
"unset-env":"Remove an env variable"
"stacks":"List all stacks"
"stack":"Show information for a stack"
"copy-source":"Make a copy of app source code from one application to another. Unless overridden, the copy-source command will restart the application"
"create-app-manifest":"Create an app manifest for an app that has been pushed successfully"
"marketplace":"List available offerings in the marketplace"
"services":"List all service instances in the target space"
"service":"Show service instance info"
"create-service":"Create a service instance"
"update-service":"Update a service instance"
"delete-service":"Delete a service instance"
"rename-service":"Rename a service instance"
"create-service-key":"Create key for a service instance"
"service-keys":"List keys for a service instance"
"service-key":"Show service key info"
"delete-service-key":"Delete a service key"
"bind-service":"Bind a service instance to an app"
"unbind-service":"Unbind a service instance from an app"
"create-user-provided-service":"Make a user-provided service instance available to cf apps"
"update-user-provided-service":"Update user-provided service instance name value pairs"
"orgs":"List all orgs"
"org":"Show org info"
"create-org":"Create an org"
"delete-org":"Delete an org"
"rename-org":"Rename an org"
"spaces":"List all spaces in an org"
"space":"Show space info"
"create-space":"Create a space"
"delete-space":"Delete a space"
"rename-space":"Rename a space"
"domains":"List domains in the target org"
"create-domain":"Create a domain in an org for later use"
"delete-domain":"Delete a domain"
"create-shared-domain":"Create a domain that can be used by all orgs (admin-only)"
"delete-shared-domain":"Delete a shared domain"
"routes":"List all routes in the current space or the current organization"
"create-route":"Create a url route in a space for later use"
"check-route":"Perform a simple check to determine whether a route currently exists or not"
"map-route":"Add a url route to an app"
"unmap-route":"Remove a url route from an app"
"delete-route":"Delete a route"
"delete-orphaned-routes":"Delete all orphaned routes (e.g.: those that are not mapped to an app)"
"buildpacks":"List all buildpacks"
"create-buildpack":"Create a buildpack"
"update-buildpack":"Update a buildpack"
"rename-buildpack":"Rename a buildpack"
"delete-buildpack":"Delete a buildpack"
"running-environment-variable-group":"Retrieve the contents of the running environment variable group"
"staging-environment-variable-group":"Retrieve the contents of the staging environment variable group"
"set-staging-environment-variable-group":"Pass parameters as JSON to create a staging environment variable group"
"set-running-environment-variable-group":"Pass parameters as JSON to create a running environment variable group"
"feature-flags":"Retrieve list of feature flags with status of each flag-able feature"
"feature-flag":"Retrieve an individual feature flag with status"
"enable-feature-flag":"Enable the use of a feature so that users have access to and can use the feature"
"disable-feature-flag":"Disable the use of a feature so that users have access to and can use the feature"
"curl":"Executes a raw request, content-type set to application/json by default"
"config":"write default values to the config"
"oauth-token":"Retrieve and display the OAuth token for the current session"
"add-plugin-repo":"Add a new plugin repository"
"remove-plugin-repo":"Remove a plugin repository"
"list-plugin-repos":"list all the added plugin repository"
"repo-plugins":"List all available plugins in all added repositories"
"plugins":"list all available plugin commands"
"install-plugin":"Install the plugin defined in command argument"
"uninstall-plugin":"Uninstall the plugin defined in command argument"
"targets":"List all saved targets (requires cf-targets plugin)"
"save-target":"Save the current target under a given name (requires cf-targets plugin)"
"set-target":"Restore a previously saved target (requires cf-targets plugin)"
"delete-target":"Delete a saved target (requires cf-targets plugin)"
)
# -----------------------
# ----- end 1st Arguments
# -----------------------
# ----------
# ----- Main
# ----------
_arguments '*:: :->command'
if (( CURRENT == 1 )); then
_describe -t commands "cf command" _1st_arguments
return
fi
local -a _command_args
case "$words[1]" in
login)
__login ;;
logout)
__logout ;;
passwd)
__passwd ;;
target)
__target ;;
api)
__api ;;
auth)
__auth ;;
apps)
__apps ;;
app)
__app ;;
push)
__push ;;
scale)
__scale ;;
delete)
__delete ;;
rename)
__rename ;;
start)
__start ;;
stop)
__stop ;;
restart)
__restart ;;
restage)
__restage ;;
restart-app-instance)
__restart-app-instance ;;
events)
__events ;;
files)
__files ;;
logs)
__logs ;;
env)
__env ;;
set-env)
__set-env ;;
unset-env)
__unset-env ;;
stacks)
__stacks ;;
stack)
__stack ;;
copy-source)
__copy-source ;;
create-app-manifest)
__create-app-manifest ;;
marketplace)
__marketplace ;;
services)
__services ;;
service)
__service ;;
create-service)
__create-service ;;
update-service)
__update-service ;;
rename-service)
__rename-service ;;
delete-service)
__delete-service ;;
create-service-key)
__create-service-key ;;
service-keys)
__service-keys ;;
service-key)
__service-key ;;
delete-service-key)
__delete-service-key ;;
bind-service)
__bind-service ;;
unbind-service)
__unbind-service ;;
create-user-provided-service)
__create-user-provided-service ;;
update-user-provided-service)
__update-user-provided-service ;;
orgs)
__orgs ;;
org)
__org ;;
create-org)
__create-org ;;
delete-org)
__delete-org ;;
spaces)
__spaces ;;
space)
__space ;;
create-space)
__create-space ;;
delete-space)
__delete-space ;;
domains)
__domains ;;
create-domain)
__create-domain ;;
delete-domain)
__delete-domain ;;
create-shared-domain)
__create-shared-domain ;;
delete-shared-domain)
__delete-shared-domain ;;
routes)
__routes ;;
create-route)
__create-route ;;
check-route)
__check-route ;;
map-route)
__map-route ;;
unmap-route)
__unmap-route ;;
delete-route)
__delete-route ;;
delete-orphaned-routes)
__delete-orphaned-routes ;;
buildpacks)
__buildpacks ;;
create-buildpack)
__create-buildpack ;;
update-buildpack)
__update-buildpack ;;
rename-buildpack)
__rename-buildpack ;;
delete-buildpack)
__delete-buildpack ;;
running-environment-variable-group)
__running-environment-variable-group ;;
staging-environment-variable-group)
__staging-environment-variable-group ;;
set-staging-environment-variable-group)
__set-staging-environment-variable-group ;;
set-running-environment-variable-group)
__set-running-environment-variable-group ;;
feature-flags)
__feature-flags ;;
feature-flag)
__feature-flag ;;
enable-feature-flag)
__enable-feature-flag ;;
disable-feature-flag)
__disable-feature-flag ;;
curl)
__curl ;;
config)
__config ;;
oauth-token)
__oauth-token ;;
add-plugin-repo)
__add-plugin-repo ;;
remove-plugin-repo)
__remove-plugin-repo ;;
list-plugin-repos)
__list-plugin-repos ;;
repo-plugins)
__repo-plugins ;;
plugins)
__plugins ;;
install-plugin)
__install-plugin ;;
uninstall-plugin)
__uninstall-plugin ;;
save-target)
__save-target ;;
set-target)
__set-target ;;
delete-target)
__delete-target ;;
esac

View File

@@ -0,0 +1,77 @@
#compdef chattr
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 chattr a tool to change file attributes on a Linux second extended file system. (http://e2fsprogs.sourceforge.net/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
_chattr() {
_arguments -C \
"-R[Recursively change attributes of directories and their contents.]" \
"-V[Be verbose with chattr's output and print the program version.]" \
"-f[Suppress most error messages.]" \
"-v[Set the file's version/generation number.]:version:" \
"(-A)+A[Disable atime updates]" \
"(+A)-A[Enable atime updates]" \
"(-a)+a[Enable append only - file cannot be overridden]" \
"(+a)-a[Disable append only - file can be overridden]" \
"(-c)+c[Enable automatic compression]" \
"(+c)-c[Disable automatic compression]" \
"(-D)+D[Enable synchronous directory updates]" \
"(+D)-D[Disable synchronous directory updates]" \
"(-d)+d[Forbid backing file up with dump program]" \
"(+d)-d[Allow backing file up with dump program]" \
"(-i)+i[Mark as immutable]" \
"(+i)-i[Unmark as immutable]" \
"(-j)+j[Enable ext3 journaling]" \
"(+j)-j[Disable ext3 journaling]" \
"(-s)+s[Enable secure deletion - zero all blocks on delete]" \
"(+s)-s[Disable secure deletion - do not zero all blocks on delete]" \
"(-S)+S[Enable synchronous updates]" \
"(+S)-S[Disable synchronous updates]" \
"(-T)+T[Set top of hierarchy - direct subdirectories are allocated independently]" \
"(+T)-T[Unset top of hierarchy]" \
"(-t)+t[Disable tail merging]" \
"(+t)-t[Enable tail merging]" \
"(-u)+u[Mark as undeletable - enable undeletion]" \
"(+u)-u[Unmark as undeletable - disable undeletion]" \
'*:files:_files' \
}
_chattr

View File

@@ -0,0 +1,73 @@
#compdef cheat
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 Cheat an interactive cheatsheets on the command-line. (https://github.com/chrisallenlane/cheat/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
local cheats
_cheat_load_cheats() {
cheats=("${(f)$(cheat -l | cut -d' ' -f1)}")
}
_cheat() {
_arguments -C -s -S -n \
'(- 1 *)'{-d,--directories}'[List directories on CHEATPATH]: :->full' \
'(- 1 *)'{-e,--edit}'[Edit cheatsheet]:cheat:->cheats' \
'(- 1 *)'{-l,--list}'[List cheatsheets]: :->full' \
'(- 1 *)'{-s,--search}'[Search cheatsheets for <keyword>]: :->full' \
'(- 1 *)'{-v,--version}'[display version and copyright information]: :->full' \
case "$state" in
(full)
;;
(cheats)
_cheat_load_cheats
_describe -t cheats 'cheats' cheats
;;
(*)
_cheat_load_cheats
_describe -t cheats 'cheats' cheats
;;
esac
}
_cheat

View File

@@ -1,5 +1,30 @@
#compdef cmake
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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
# -----------
#
@@ -9,7 +34,8 @@
# Authors
# -------
#
# * Scott M. Kroll <skroll@gmail.com>
# * Scott M. Kroll <skroll@gmail.com> (initial version)
# * Paul Seyfert <pseyfert@mathphys.fsk.uni-heidelberg.de> (handling of --build)
#
# -------------------------------------------------------------------------
# Notes
@@ -24,10 +50,133 @@
#
# -------------------------------------------------------------------------
_cmake() {
local context state line curcontext="$curcontext" cmake_args
local context state line curcontext="$curcontext" cmake_args
local cmake_help_actions;cmake_help_actions=(
local cmake_build_options;cmake_build_options=(
'-C[Pre-load a script to populate the cache]:script:_files'
'*-D-[Create a cmake cache entry]:property:_cmake_define_property'
'-U[Remove matching entries from CMake cache]:globbing expression'
'-G[Specify a makefile generator]:generator:_cmake_generators'
'-T[Specify toolset name if supported by generator]:toolset name'
'(-Wno-dev -Wdev)-Wno-dev[Suppress/Enable developer warnings]'
'(-Wno-dev -Wdev)-Wdev[Suppress/Enable developer warnings]'
'(-Wno-deprecated -Wdeprecated)-Wno-deprecated[Suppress/Enable deprecation warnings]'
'(-Wno-deprecated -Wdeprecated)-Wdeprecated[Suppress/Enable deprecation warnings]'
'(-Wno-error=dev -Werror=dev)-Wno-error=dev[Make developer warnings (not) errors]'
'(-Wno-error=dev -Werror=dev)-Werror=dev[Make developer warnings (not) errors]'
'(-Wno-error=deprecated -Werror=deprecated)-Werror=deprecated[Make deprecated macro and function warnings (not) errors]'
'(-Wno-error=deprecated -Werror=deprecated)-Wno-error=deprecated[Make deprecated macro and function warnings (not) errors]'
'--warn-uninitialized[Warn about uninitialized values.]'
'--warn-unused-vars[Warn about unused variables.]'
'--no-warn-unused-cli[Dont warn about command line options.]'
'-i[Run in wizard mode]'
'-L-[List cache variables]::_values "options" "[non-advanced cache variables]" "A[advanced cache variables]" "H[non-advanced cached variables with help]" "AH[advanced cache variables with help]"'
'--trace[Put cmake in trace mode]'
'--find-package[Run in pkg-config like mode.]'
':cmake project:_files -/'
)
# ------------------------
# _cmake_generator_options
# ------------------------
(( $+functions[_cmake_generator_options] )) ||
_cmake_generator_options() {
if [ -f $1/Makefile ]
then
$_comps[make]
elif [ -f $1/build.ninja ]
then
$_comps[ninja]
fi
}
# --------------
# _cmake_targets
# --------------
(( $+functions[_cmake_targets] )) ||
_cmake_targets() {
local -a targets
if [ -f $1/Makefile ]
then
# `make help` doesn't work for Makefiles in general, but for cmake generated makefiles it does.
i=1
for target in $(make help | \grep -e "\.\.\." | sed "s/\.\.\. //" | sed "s/ (the default.*//") ; do
targets[$i]=$target
(( i = $i + 1 ))
done
elif [ -f $1/build.ninja ]
then
# `ninja help` doesn't seem to be the list of targets we're interested in
i=1
for target in $(ninja -C $1 -t targets all 2&>/dev/null | awk -F: '{print $1}') ; do
targets[$i]="$target"
(( i++ ))
done
fi
_describe 'build targets' targets
}
_cmake_on_build() {
local build_extras;build_extras=(
'--[Native build tool options]'
'--target[specify build target]'
'--clean-first[build target clean first]'
'--config[For multi-configuration tools]'
'--use-stderr')
local -a undescribed_build_extras
i=1
for be in $build_extras ; do
undescribed_build_extras[$i]=$(echo $be | sed "s/\[.*//")
(( i++ ))
done
inbuild=false
nativemode=false
for ((i = (($CURRENT - 1)); i > 1 ; i--)); do
if [[ $words[$i] == --build ]] ; then
inbuild=true
buildat=$i
(( difference = $CURRENT - $i ))
elif [[ $words[$i] == -- ]] ; then
nativemode=true
fi
done
# check if build mode has been left
outofbuild=false
for ((i = (($CURRENT - 1)); i > (($buildat + 1)); i--)); do
# don't check the word after --build (should be a directory)
if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]] ; then continue ; fi
if [[ $words[(($i - 1))] == --target ]] ; then continue ; fi
if [[ $words[(($i - 1))] == --config ]] ; then continue ; fi
outofbuild=true
done
if [ "$nativemode" = true ] ; then
_cmake_generator_options $words[(($buildat + 1))] && return 0
fi
if [ "$inbuild" = false ] ; then
_arguments -C -s \
- build_opts \
"$cmake_build_options[@]" \
- build_cmds \
"$cmake_suggest_build[@]" && return 0
elif [ $difference -eq 1 ] ; then
# directly after --build comes the build directory
_alternative ':current directory:(.)' 'directory::_directories' && return 0
elif [[ $words[(($CURRENT - 1))] == --target ]] ; then
# after --build <dir> --target, suggest targets
_cmake_targets $words[(($buildat + 1))] && return 0
elif [[ $words[(($CURRENT - 1))] == --config ]] ; then
# after --build <dir> --config, no idea
return 0
elif [ "$outofbuild" = true ] ; then
# after --build <dir> --<not a --build option>, suggest other cmake_build_options (like -Wno-dev)
_arguments "$cmake_build_options[@]" && return 0
else
# after --build <dir>, suggest other cmake_build_options (like -Wno-dev) or --build options (like --clean-first)
_arguments "$build_extras[@]" "$cmake_build_options[@]" && return 0
fi
}
local cmake_help_actions;cmake_help_actions=(
'(- 1)--help-command[Print help for a single command and exit]:command-name:_cmake_command_names'
'(- 1)--help-command-list[List available listfile commands and exit]'
'(- 1)--help-commands[Print help for all commands and exit]'
@@ -47,33 +196,9 @@ _cmake() {
'(- 1)--help-html[Print full help in HTML format]'
'(- 1)--help-man[Print full help as a UNIX man page and exit]'
'(- 1)'{--version,-version}'[Print full help as a UNIX man page and exit]'
)
local cmake_build_options;cmake_build_options=(
'-C[Pre-load a script to populate the cache]:script:_files'
'*-D-[Create a cmake cache entry]:property:_cmake_define_property'
'-U[Remove matching entries from CMake cache]:globbing expression'
'-G[Specify a makefile generator]:generator:_cmake_generators'
'-T[Specify toolset name if supported by generator]:toolset name'
'(-Wno-dev -Wdev)-Wno-dev[Suppress developer warnings]'
'(-Wno-dev -Wdev)-Wdev[Enable developer warnings]'
'-i[Run in wizard mode]'
'-L-[List cache variables]::_values "options" "[non-advanced cache variables]" "A[advanced cache variables]" "H[non-advanced cached variables with help]" "AH[advanced cache variables with help]"'
'--trace[Put cmake in trace mode]'
':cmake project:_files -/'
)
local cmake_command_actions;cmake_command_actions=(
'-E[CMake command mode]:*:command'
)
_arguments -C -s \
- help \
"$cmake_help_actions[@]" \
- command \
"$cmake_command_actions[@]" \
- build_opts \
"$cmake_build_options[@]" && return 0
)
_cmake_help() {
_arguments -C -s - help "$cmake_help_actions[@]"
}
# -------------------
@@ -163,7 +288,7 @@ _cmake_define_lang_property_names() {
"CMAKE_${cmake_lang}_COMPILER:${cmake_lang_desc} compiler"
"CMAKE_${cmake_lang}_FLAGS:${cmake_lang_desc} compiler flags for all builds"
"CMAKE_${cmake_lang}_FLAGS_DEBUG:${cmake_lang_desc} compiler flags for all Debug build"
"CMAKE_${cmake_lang}_FLAGS_RLEASE:${cmake_lang_desc} compiler flags for all Relase build"
"CMAKE_${cmake_lang}_FLAGS_RELEASE:${cmake_lang_desc} compiler flags for all Relase build"
"CMAKE_${cmake_lang}_FLAGS_MINSIZREL:${cmake_lang_desc} compiler flags for all MinSizRel build"
"CMAKE_${cmake_lang}_FLAGS_RELWITHDEBINFO:${cmake_lang_desc} compiler flags for all RelWithDebInfo build"
)
@@ -177,10 +302,12 @@ _cmake_define_lang_property_names() {
(( $+functions[_cmake_define_common_property_names] )) ||
_cmake_define_common_property_names() {
local properties; properties=(
'CMAKE_MODULE_PATH:Search path for cmake modules'
'CMAKE_BUILD_TYPE:Specifies the build type for make based generators'
'CMAKE_TOOLCHAIN_FILE:Absolute or relative path to a cmake script which sets up toolchain related variables'
'CMAKE_COLOR_MAKEFILE:Enables/disables color output when using the Makefile generator'
'CMAKE_INSTALL_PREFIX:Install directory used by install'
'CMAKE_EXPORT_COMPILE_COMMANDS:Enable/disable output of compilation database during generation'
)
_describe -t 'common-property-names' 'common property name' properties $@
@@ -198,6 +325,7 @@ _cmake_define_property_values() {
(CMAKE_TOOLCHAIN_FILE) _wanted toolchain-files expl 'file' _cmake_toolchain_files && ret=0;;
(CMAKE_COLOR_MAKEFILE) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
(CMAKE_INSTALL_PREFIX) _files -/ && ret=0;;
(CMAKE_EXPORT_COMPILE_COMMANDS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
(CMAKE_*_COMPILER) _wanted compilers expl 'compiler' _cmake_compilers && ret=0;;
(CMAKE_*_FLAGS(|_?*)) _message -e compiler-flags 'compiler flags' && ret=0;;
(*) _files && ret=0;;
@@ -269,6 +397,31 @@ _cmake_compilers() {
_command_names -e
}
local cmake_command_actions;cmake_command_actions=(
'-E[CMake command mode]:*:command'
)
_cmake_command() {
_arguments -C -s - command "$cmake_command_actions[@]"
}
_cmake "$@"
local cmake_suggest_build;cmake_suggest_build=(
'--build[build]'
)
if [ $CURRENT -eq 2 ] ; then
_arguments -C -s \
- help \
"$cmake_help_actions[@]" \
- command \
"$cmake_command_actions[@]" \
- build_opts \
"$cmake_build_options[@]" \
- build_cmds \
"$cmake_suggest_build[@]" && return 0
elif [[ $words[2] = --help* ]] ; then
_cmake_help
elif [[ $words[2] != -E ]] ; then
_cmake_on_build
else
_cmake_command
fi

View File

@@ -0,0 +1,60 @@
#compdef column
#
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 column (from util-linux 2.27.1->)
# (https://git.kernel.org/cgit/utils/util-linux/util-linux.git/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ole Jørgen Brønner <olejorgenb@yahoo.no>
#
# ------------------------------------------------------------------------------
#
# Note: column has upstream bash completions.
#
# Automatically generated with http://github.com/RobSis/zsh-completion-generator
local arguments
arguments=(
'(-c --columns)'{-c,--columns}'[width of output in number of characters]:width:'
'(-t --table)'{-t,--table}'[create a table]'
'(-s --separator)'{-s,--separator}'[possible table delimiters]:separator:'
'(-o --output-separator)'{-o,--output-separator}'[columns separator for table output; default is two spaces]:separator:'
'(-x --fillrows)'{-x,--fillrows}'[fill rows before columns]'
'(-h --help)'{-h,--help}'[display this help and exit]'
'(-V --version)'{-V,--version}'[output version information and exit]'
'*:filename:_files'
)
_arguments -s $arguments

View File

@@ -35,18 +35,29 @@
# -------
#
# * loranger (https://github.com/loranger)
# * Yohan Tambè (https://github.com/Cronos87)
#
# ------------------------------------------------------------------------------
_find_console () {
echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
}
_console_get_command_list () {
php console --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }'
IFS=" "
`_find_console` --no-ansi | \
sed "1,/Available commands/d" | \
awk '/ [a-z]+/ { print $0 }' | \
sed -E 's/^[ ]+//g' | \
sed -E 's/[:]+/\\:/g' | \
sed -E 's/[ ]{2,}/\:/g'
}
_console () {
if [ -f console ]; then
compadd `_console_get_command_list`
fi
local -a commands
IFS=$'\n'
commands=(`_console_get_command_list`)
_describe 'commands' commands
}
compdef _console php console

View File

@@ -1,105 +0,0 @@
#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)
#
# ------------------------------------------------------------------------------
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]'
'(--uninstall -U)'{--uninstall,-U}'[Uninstalls the modules]'
'(- :)'{--help,-h}'[Displays help information]'
'(- :)'{--version,-V}'[Displays software version]'
# Options
{--force,-f}'[Force install]'
{--notest,-n}'[Do not run unit tests]'
'(--test-only)--test-only[Run the test only and do not install the module]'
{--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]'
'(--self-contained)--self-contained[Assume no non-core modules are installed on the system]'
'--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]'
'--mirror-index[Specifies the file path for module search index]:FILES:_files'
'--prompt[Prompt when configure/build/test fails]'
'(--dev)--dev[Search for a newer developer release as well]'
'--reinstall[Reinstall the distribution even if you already have the latest version installed]'
'--interactive[Turn on interactive configure]'
'(--pp --pureperl)'{--pp,--pureperl}'[Prefer Pure perl build of modules]'
'(--with-recommends)--with-recommends[Installs dependencies declared as "recommends"]'
'(--with-suggests)--with-suggests[Installs dependencies declared as "suggests"]'
'(--with-feature)--with-feature[Specifies the feature to enable]'
'(--without-feature)--without-feature[Specifies the feature to disable]'
'(--with-all-features)--with-all-features[Enables all the optional features]'
'(--configure-timeout)--configure-timeout[Specify the timeout length to wait for configure]'
'(--build-timeout)--build-timeout[Specify the timeout length to wait for build]'
'(--test-timeout)--test-timeout[Specify the timeout length to wait for test]'
'(--configure-args)--configure-args[Pass arguments for configure commands]'
'(--build-args)--build-args[Pass arguments for build commands]'
'(--test-args)--test-args[Pass arguments for test commands]'
'(--install-args)--install-args[Pass arguments for install commands]'
'--scandeps[Scan the dependencies 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)--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]'
'(--cascade-search)--cascade-search[Specifies whether to cascade search]'
'(--skip-installed)--skip-installed[Specifies modules which latest version are already installed]'
'(--skip-satisfied)--skip-satisfied[Specifies module and version for skipping installation]'
'(--verify)--verify[Verify the integrity of distribution files]'
'(--no-report-perl-version)--report-perl-version[Report locally installed perl version as part of User-Agent]'
'(--report-perl-version)--no-report-perl-version[Disable --report-perl-version]'
'--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
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -0,0 +1,68 @@
#compdef dad
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 dad a command line manager of aria2 daemon. (https://github.com/baskerville/diana).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
_dad() {
local -a commands
commands=(
"start:Start aria2c daemon"
"stop:Stop aria2c daemon"
)
_arguments -C \
'(- 1 *)'-h"[Show help and exit]" \
"-d[Set download dir]:download_dir:->val" \
"-s[Set secret token]:secret_token:->val" \
"-u[Set aria2c username]:username:->val" \
"-p[Set aria2c password]:password:->val" \
'1:cmd:->cmds' \
'*: : :->args' \
case "$state" in
(cmds)
_describe -t commands 'commands' commands
;;
(*)
;;
esac
}
_dad

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -1,5 +1,30 @@
#compdef dget
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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
# -----------
#
@@ -9,7 +34,7 @@
# Authors
# -------
#
# * Kris Shannon <kris@staff.sisgroup.com.au>
# * Kris Shannon <k.shannon@amaze.com.au>
#
# ------------------------------------------------------------------------------
@@ -18,18 +43,19 @@ _dget() {
local -A opt_args
_arguments -A "-*" \
'(-h --help)'{-h,--help}'[Show help message]' \
'(-V --version)'{-v,--version}'[Print license, copyright, and version information and exit]' \
'(-q --quiet)'{-q,--quiet}'[Suppress wget/curl output]' \
'(-d --download-only --build)'{-d,--download-only}'[Do not extract downloaded source]' \
'(-x --extract)'{-x,--extract}'[Unpack downloaded source]' \
'(-u --allow-unauthenticated)'{-u,--allow-unauthenticated}'[Make no attempt to verify source package signature]' \
'(-d --download-only --build)--build[Build package with dpkg-buildpackage after download]' \
'--path[Check this directory in addition to the apt archive]:DIR:_files -/' \
'(--insecure)--insecure[Do not check SSL certificates when downloading]' \
'(--no-cache)--no-cache[Disable server-side HTTP cache]' \
'(--no-conf -h --help)'{-h,--help}'[Show help message]' \
'(--no-conf -V --version)'{-v,--version}'[Print license, copyright, and version information and exit]' \
'(--no-conf -b --backup)'{-b,--backup}'[Move files that would be overwritten to ./backup]' \
'(--no-conf -q --quiet)'{-q,--quiet}'[Suppress wget/curl output]' \
'(--no-conf -x --extract -d --download-only --build)'{-d,--download-only}'[Do not extract downloaded source]' \
'(--no-conf -x --extract -d --download-only --build)'{-x,--extract}'[Unpack downloaded source]' \
'(--no-conf -x --extract -d --download-only --build)--build[Build package with dpkg-buildpackage after download]' \
'(--no-conf -u --allow-unauthenticated)'{-u,--allow-unauthenticated}'[Make no attempt to verify source package signature]' \
'(--no-conf)--path[Check this directory in addition to the apt archive]:DIR:_files -/' \
'(--no-conf --insecure)--insecure[Do not check SSL certificates when downloading]' \
'(--no-conf --no-cache)--no-cache[Disable server-side HTTP cache]' \
"(--no-conf)--no-conf[Don't read devscripts config files]" \
'1:dsc url:_urls'
'(-)*:debian package urls:_urls'
}
_dget "$@"

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -0,0 +1,150 @@
#compdef diana
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 Diana a command line interface to the aria2 daemon. (https://github.com/baskerville/diana).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
local GIDs PGIDs
_diana_load_gids() {
GIDs=()
local downloads hashArr fileName
downloads=$(diana list | cut -d' ' -f1)
if [ ${#downloads} -eq "0" ]; then
return
fi
hashArr=("${(f)$(echo "$downloads")}")
for ((i=1; i<=${#hashArr[@]}; i++)); do
fileName=$(diana files $hashArr[i] | grep "[X]" | rev | cut -d'/' -f1 | rev);
GIDs+=("$hashArr[i]:$fileName");
done
}
_diana_load_paused_gids() {
PGIDs=()
local downloads hashArr fileName
downloads=$(diana paused | cut -d' ' -f1)
if [ ${#downloads} -eq "0" ]; then
return
fi
hashArr=("${(f)$(echo "$downloads")}")
for ((i=1; i<=${#hashArr[@]}; i++)); do
fileName=$(diana files $hashArr[i] | grep "[X]" | rev | cut -d'/' -f1 | rev);
PGIDs+=("$hashArr[i]:$fileName");
done
}
_diana_command_arguments() {
case $words[1] in
(remove)
_diana_load_gids
_describe -t output 'Downloads to delete' GIDs
;;
(info)
_diana_load_gids
_describe -t output 'Downloads to get info' GIDs
;;
(files)
_diana_load_gids
_describe -t output 'Get files for downloads' GIDs
;;
(forcerm)
_diana_load_gids
_describe -t output 'Downloads to delete' GIDs
;;
(pause)
_diana_load_gids
_describe -t output 'Downloads to pause' GIDs
;;
(resume)
_diana_load_paused_gids
_describe -t output 'Downloads to resume' PGIDs
;;
(preview)
_diana_load_gids
_describe -t output 'Downloads to preview' GIDs
;;
esac
}
_diana() {
local -a commands
commands=(
"list:Output the list of active downloads."
"paused:Output the list of paused downloads."
"stopped:Output the list of stopped downloads."
"info:Output informations regarding the given GIDs."
"files:Output the files owned by the downloads corresponding to the given GIDs."
"errors:Output the list of errors."
"stats:Output download bandwidth statistics."
"add:Download the given items (local or remote URLs to torrents, etc.)."
"remove:Remove the downloads corresponding to the given GIDs."
"forcerm:Forcibly remove the downloads corresponding to the given GIDs."
"pause:Pause the downloads corresponding to the given GIDs."
"resume:Resume the downloads corresponding to the given GIDs."
"preview:Preview all the files from all the downloads corresponding to the given GIDs."
"sleep:Pause all the active downloads."
"wake:Resume all the paused downloads."
"purge:Clear the list of stopped downloads and errors."
"clean:Stop seeding completed downloads."
)
_arguments -C \
'1:cmd:->cmds' \
'*:: :->args' \
case "$state" in
(cmds)
_describe -t commands 'commands' commands
;;
(*)
_diana_command_arguments
;;
esac
}
_diana

View File

@@ -1,53 +0,0 @@
#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)
#
# ------------------------------------------------------------------------------
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
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,483 +0,0 @@
#compdef docker
#
# zsh completion for docker (http://docker.com)
#
# version: 0.3.0
# github: https://github.com/felixr/docker-zsh-completion
#
# contributors:
# - Felix Riedel
# - Vincent Bernat
#
# license:
#
# Copyright (c) 2013, Felix Riedel
# 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 <organization> 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 <COPYRIGHT HOLDER> 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.
#
__docker_get_containers() {
local kind expl
declare -a running stopped lines args
kind=$1
shift
[[ $kind = (stopped|all) ]] && args=($args -a)
lines=(${(f)"$(_call_program commands docker ps ${args})"})
# Parse header line to find columns
local i=1 j=1 k header=${lines[1]}
declare -A begin end
while (( $j < ${#header} - 1 )) {
i=$(( $j + ${${header[$j,-1]}[(i)[^ ]]} - 1))
j=$(( $i + ${${header[$i,-1]}[(i) ]} - 1))
k=$(( $j + ${${header[$j,-1]}[(i)[^ ]]} - 2))
begin[${header[$i,$(($j-1))]}]=$i
end[${header[$i,$(($j-1))]}]=$k
}
lines=(${lines[2,-1]})
# Container ID
local line
local s
for line in $lines; do
s="${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}"
s="$s:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}"
s="$s, ${${${line[$begin[IMAGE],$end[IMAGE]]}/:/\\:}%% ##}"
if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then
stopped=($stopped $s)
else
running=($running $s)
fi
done
# Names
local name
local -a names
for line in $lines; do
names=(${(ps:,:)${${line[${begin[NAMES]},-1]}%% *}})
for name in $names; do
s="${name}:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}"
s="$s, ${${${line[$begin[IMAGE],$end[IMAGE]]}/:/\\:}%% ##}"
if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then
stopped=($stopped $s)
else
running=($running $s)
fi
done
done
[[ $kind = (running|all) ]] && _describe -t containers-running "running containers" running
[[ $kind = (stopped|all) ]] && _describe -t containers-stopped "stopped containers" stopped
}
__docker_stoppedcontainers() {
__docker_get_containers stopped "$@"
}
__docker_runningcontainers() {
__docker_get_containers running "$@"
}
__docker_containers () {
__docker_get_containers all "$@"
}
__docker_images () {
local expl
declare -a images
images=(${${${${(f)"$(_call_program commands docker images)"}[2,-1]}/ ##/\\:}%% *})
images=(${${images%\\:<none>}#<none>} ${${${(f)"$(_call_program commands docker images)"}[2,-1]}/(#b)([^ ]##) ##([^ ]##) ##([^ ]##)*/${match[3]}:${(r:15:: :::)match[2]} in ${match[1]}})
_describe -t docker-images "images" images
}
__docker_tags() {
local expl
declare -a tags
tags=(${${${${${(f)"$(_call_program commands docker images)"}#* }## #}%% *}[2,-1]})
_describe -t docker-tags "tags" tags
}
__docker_repositories_with_tags() {
if compset -P '*:'; then
__docker_tags
else
__docker_repositories -qS ":"
fi
}
__docker_search() {
# declare -a dockersearch
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy __docker_caching_policy
fi
local searchterm cachename
searchterm="${words[$CURRENT]%/}"
cachename=_docker-search-$searchterm
local expl
local -a result
if ( [[ ${(P)+cachename} -eq 0 ]] || _cache_invalid ${cachename#_} ) \
&& ! _retrieve_cache ${cachename#_}; then
_message "Searching for ${searchterm}..."
result=(${${${(f)"$(_call_program commands docker search ${searchterm})"}%% *}[2,-1]})
_store_cache ${cachename#_} result
fi
_wanted dockersearch expl 'available images' compadd -a result
}
__docker_caching_policy()
{
oldp=( "$1"(Nmh+1) ) # 1 hour
(( $#oldp ))
}
__docker_repositories () {
local expl
declare -a repos
repos=(${${${(f)"$(_call_program commands docker images)"}%% *}[2,-1]})
_describe -t docker-repos "repositories" repos "$@"
}
__docker_commands () {
# local -a _docker_subcommands
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy __docker_caching_policy
fi
if ( [[ ${+_docker_subcommands} -eq 0 ]] || _cache_invalid docker_subcommands) \
&& ! _retrieve_cache docker_subcommands;
then
local -a lines
lines=(${(f)"$(_call_program commands docker 2>&1)"})
_docker_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/ ##/:})
_docker_subcommands=($_docker_subcommands 'help:Show help for a command')
_store_cache docker_subcommands _docker_subcommands
fi
_describe -t docker-commands "docker command" _docker_subcommands
}
__docker_subcommand () {
local -a _command_args
case "$words[1]" in
(attach)
_arguments \
'--no-stdin[Do not attach stdin]' \
'--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]' \
':containers:__docker_runningcontainers'
;;
(build)
_arguments \
'--force-rm[Always remove intermediate containers]' \
'--no-cache[Do not use cache when building the image]' \
{-q,--quiet}'[Suppress verbose build output]' \
'--rm[Remove intermediate containers after a successful build]' \
{-t,--tag=-}'[Repository, name and tag to be applied]:repository:__docker_repositories_with_tags' \
':path or URL:_directories'
;;
(commit)
_arguments \
{-a,--author=-}'[Author]:author: ' \
{-m,--message=-}'[Commit message]:message: ' \
{-p,--pause}'[Pause container during commit]' \
'--run=-[Configuration automatically applied when the image is run]:configuration: ' \
':container:__docker_containers' \
':repository:__docker_repositories_with_tags'
;;
(cp)
_arguments \
':container:->container' \
':hostpath:_files'
case $state in
(container)
if compset -P '*:'; then
_files
else
__docker_containers -qS ":"
fi
;;
esac
;;
(diff|export)
_arguments '*:containers:__docker_containers'
;;
(events)
_arguments \
'--since=-[Events created since this timestamp]:timestamp: ' \
'--until=-[Events created until this timestamp]:timestamp: '
;;
(exec)
_arguments \
{-d,--detach}'[Detached mode: leave the container running in the background]' \
{-i,--interactive}'[Keep stdin open even if not attached]' \
{-t,--tty}'[Allocate a pseudo-tty]' \
':containers:__docker_runningcontainers'
;;
(history)
_arguments \
'--no-trunc[Do not truncate output]' \
{-q,--quiet}'[Only show numeric IDs]' \
'*:images:__docker_images'
;;
(images)
_arguments \
{-a,--all}'[Show all images]' \
'*'{-f,--filter=-}'[Filter values]:filter: ' \
'--no-trunc[Do not truncate output]' \
{-q,--quiet}'[Only show numeric IDs]' \
'--tree[Output graph in tree format]' \
'--viz[Output graph in graphviz format]' \
':repository:__docker_repositories'
;;
(inspect)
_arguments \
{-f,--format=-}'[Format the output using the given go template]:template: ' \
'*:containers:__docker_containers'
;;
(import)
_arguments \
':URL:(- http:// file://)' \
':repository:__docker_repositories_with_tags'
;;
(info)
;;
(import)
_arguments \
':URL:(- http:// file://)' \
':repository:__docker_repositories_with_tags'
;;
(insert)
_arguments '1:containers:__docker_containers' \
'2:URL:(http:// file://)' \
'3:file:_files'
;;
(kill)
_arguments \
{-s,--signal=-}'[Signal to send]:signal:_signals' \
'*:containers:__docker_runningcontainers'
;;
(load)
_arguments \
{-i,--input=-}'[Read from tar archive file]:tar:_files'
;;
(login)
_arguments \
{-e,--email=-}'[Email]:email: ' \
{-p,--password=-}'[Password]:password: ' \
{-u,--user=-}'[Username]:username: ' \
':server: '
;;
(logout)
_arguments \
':server: '
;;
(logs)
_arguments \
{-f,--follow}'[Follow log output]' \
{-t,--timestamps}'[Show timestamps]' \
'*:containers:__docker_containers'
;;
(port)
_arguments \
'1:containers:__docker_runningcontainers' \
'2:port:_ports'
;;
(pause|unpause)
_arguments \
'1:containers:__docker_runningcontainers'
;;
(start)
_arguments \
{-a,--attach}'[Attach container'"'"'s stdout/stderr and forward all signals]' \
{-i,--interactive}'[Attach container'"'"'s stding]' \
'*:containers:__docker_stoppedcontainers'
;;
(rm)
_arguments \
{-f,--force}'[Force removal]' \
{-l,--link}'[Remove the specified link and not the underlying container]' \
{-v,--volumes}'[Remove the volumes associated to the container]' \
'*:containers:__docker_stoppedcontainers'
;;
(rmi)
_arguments \
{-f,--force}'[Force removal]' \
'--no-prune[Do not delete untagged parents]' \
'*:images:__docker_images'
;;
(restart|stop)
_arguments \
{-t,--time=-}'[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)' \
'*:containers:__docker_runningcontainers'
;;
(top)
_arguments \
'1:containers:__docker_runningcontainers' \
'(-)*:: :->ps-arguments'
case $state in
(ps-arguments)
_ps
;;
esac
;;
(ps)
_arguments \
{-a,--all}'[Show all containers]' \
'--before=-[Show only container created before...]:containers:__docker_containers' \
'*'{-f,--filter=-}'[Filter values]:filter: ' \
{-l,--latest}'[Show only the latest created container]' \
'-n[Show n last created containers, include non-running one]:n:(1 5 10 25 50)' \
'--no-trunc[Do not truncate output]' \
{-q,--quiet}'[Only show numeric IDs]' \
{-s,--size}'[Display total file sizes]' \
'--since=-[Show only containers created since...]:containers:__docker_containers'
;;
(tag)
_arguments \
{-f,--force}'[force]'\
':image:__docker_images'\
':repository:__docker_repositories_with_tags'
;;
(create|run)
_arguments \
{-a,--attach}'[Attach to stdin, stdout or stderr]' \
'*--add-host=-[Add a custom host-to-IP mapping]:host\:ip mapping: ' \
{-c,--cpu-shares=-}'[CPU shares (relative weight)]:CPU shares:(0 10 100 200 500 800 1000)' \
'*--cap-add=-[Add Linux capabilities]:capability: ' \
'*--cap-drop=-[Drop Linux capabilities]:capability: ' \
'--cidfile=-[Write the container ID to the file]:CID file:_files' \
'--cpuset=-[CPUs in which to allow execution]:CPU set: ' \
{-d,--detach}'[Detached mode: leave the container running in the background]' \
'*--device=-[Add a host device to the container]:device:_files' \
'*--dns=-[Set custom dns servers]:dns server: ' \
'*--dns-search=-[Set custom DNS search domains]:dns domains: ' \
'*'{-e,--environment=-}'[Set environment variables]:environment variable: ' \
'--entrypoint=-[Overwrite the default entrypoint of the image]:entry point: ' \
'*--env-file=-[Read environment variables from a file]:environment file:_files' \
'*--expose=-[Expose a port from the container without publishing it]: ' \
{-h,--hostname=-}'[Container host name]:hostname:_hosts' \
{-i,--interactive}'[Keep stdin open even if not attached]' \
'*--link=-[Add link to another container]:link:->link' \
'*--lxc-conf=-[Add custom lxc options]:lxc options: ' \
'-m[Memory limit (in bytes)]:limit: ' \
'--name=-[Container name]:name: ' \
'--net=-[Network mode]:network mode:(bridge none container: host)' \
{-P,--publish-all}'[Publish all exposed ports]' \
'*'{-p,--publish=-}'[Expose a container'"'"'s port to the host]:port:_ports' \
'--privileged[Give extended privileges to this container]' \
'--restart=-[Restart policy]:restart policy:(no on-failure always)' \
'--rm[Remove intermediate containers when it exits]' \
'*--security-opt=-[Security options]:security option: ' \
'--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]' \
{-t,--tty}'[Allocate a pseudo-tty]' \
{-u,--user=-}'[Username or UID]:user:_users' \
'*-v[Bind mount a volume]:volume: '\
'*--volumes-from=-[Mount volumes from the specified container]:volume: ' \
{-w,--workdir=-}'[Working directory inside the container]:directory:_directories' \
'(-):images:__docker_images' \
'(-):command: _command_names -e' \
'*::arguments: _normal'
case $state in
(link)
if compset -P '*:'; then
_wanted alias expl 'Alias' compadd -E ""
else
__docker_runningcontainers -qS ":"
fi
;;
esac
;;
(pull|search)
_arguments ':name:__docker_search'
;;
(push)
_arguments ':images:__docker_images'
;;
(save)
_arguments \
{-o,--output=-}'[Write to file]:file:_files' \
':images:__docker_images'
;;
(wait)
_arguments ':containers:__docker_runningcontainers'
;;
(help)
_arguments ':subcommand:__docker_commands'
;;
(*)
_message 'Unknown sub command'
esac
}
_docker () {
# Support for subservices, which allows for `compdef _docker docker-shell=_docker_containers`.
# Based on /usr/share/zsh/functions/Completion/Unix/_git without support for `ret`.
if [[ $service != docker ]]; then
_call_function - _$service
return
fi
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
'-H[tcp://host:port to bind/connect to]:socket: ' \
'(-): :->command' \
'(-)*:: :->option-or-argument'
if (( CURRENT == 1 )); then
fi
case $state in
(command)
__docker_commands
;;
(option-or-argument)
curcontext=${curcontext%:*:*}:docker-$words[1]:
__docker_subcommand
;;
esac
}
_docker "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 4
# indent-tabs-mode: nil
# sh-basic-offset: 4
# End:
# vim: ft=zsh sw=4 ts=4 et

View File

@@ -1,197 +0,0 @@
#compdef docker-compose
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Docker Compose (http://docs.docker.com/compose/).
# Adapted from boot2docker completion by hhatto (https://github.com/hhatto)
# and docker completion by @aeonazaan and @bobmaerten.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * ilkka (https://github.com/ilkka)
#
# ------------------------------------------------------------------------------
# helper function for getting *.yml (compose) files
__yml_files_in_current_dir() {
_values 'YAML files' *.yml
}
# helper function for completing services in current project
__services() {
declare -a services_cmd
services_cmd=($(sed -n -E 's/^([^[:space:]][^:]*):/\1/p' docker-compose.yml | tr \\n ' '))
_describe 'services' services_cmd
}
# subcommands
local -a _docker_compose_cmds
_docker_compose_cmds=(
'build:Build or rebuild services' \
'help:Get help on a command' \
'kill:Kill containers' \
'logs:View output from containers' \
'port:Print the public port for a port binding' \
'ps:List containers' \
'pull:Pulls service images' \
'rm:Remove stopped containers' \
'run:Run a one-off command' \
'scale:Set number of containers for a service' \
'start:Start services' \
'stop:Stop services' \
'restart:Restart services' \
'up:Create and start containers'
)
# subcommand completion functions
__build() {
_arguments \
'--no-cache[Do not use cache when building image]'
__services
}
__help() {
_values 'Get help for subcommand' \
'build' \
'help' \
'kill' \
'logs' \
'port' \
'ps' \
'pull' \
'rm' \
'run' \
'scale' \
'start' \
'stop' \
'restart' \
'up'
}
__kill() {
_arguments \
'-s[Signal to send instead of SIGKILL]'
__services
}
__logs() {
_arguments \
'--no-color[Monochrome output]'
__services
}
__port() {
_arguments \
'--protocol:protocol:(tcp udp)' \
'--index[Index of container]:index'
__services
}
__ps() {
_arguments \
'-q[Only display IDs]'
__services
}
__pull() {
_arguments \
'--allow-insecure-ssl[Allow insecure connections to the docker registry]'
__services
}
__rm() {
_arguments \
"--force[Don't ask for confirmation]" \
'-v[Remove volumes]'
__services
}
__run() {
_arguments \
'--allow-insecure-ssl[Allow insecure connections to the docker registry]' \
'-d[Detached mode: Run container in the background, print new container name.]' \
'--entrypoint[Override the entrypoint of the image.]:command:()' \
'-e[Set an environment variable.]:key=val:()' \
"--no-deps[Don't start linked services.]" \
'--rm[Remove container after run. Ignored in detached mode.]' \
"--service-ports[Run command with the service's ports enabled and mapped to the host.]" \
'-T[Disable pseudo-tty allocation.]'
__services
}
__scale() {
__services
}
__start() {
__services
}
__stop() {
__services
}
__restart() {
__services
}
__up() {
_arguments \
'--allow-insecure-ssl[Allow insecure connections to the docker registry]' \
'-d[Detached mode: Run containers in the background, print new container names.]' \
'--no-color[Produce monochrome output.]' \
"--no-deps[Don't start linked services.]" \
"--no-recreate[If containers already exist, don't recreate them.]" \
"--no-build[Don't build an image, even if it's missing]"
__services
}
# common args
_arguments \
'--verbose[Show more output]' \
'--version[Print version and exit]' \
'--file[Specify an alternate compose file]:__yml_files_in_current_dir' \
'--project-name[Specify an alternate project name]:args' \
'*:: :->command'
# start machines!
if (( CURRENT == 1 )); then
_describe -t commands 'docker-compose command' _docker_compose_cmds
fi
local -a _command_args
case "$words[1]" in
build)
__build ;;
help)
__help ;;
kill)
__kill ;;
logs)
__logs ;;
port)
__port ;;
ps)
__ps ;;
pull)
__pull ;;
rm)
__rm ;;
run)
__run ;;
scale)
__scale ;;
start)
__start ;;
stop)
__stop ;;
restart)
__restart ;;
up)
__up ;;
esac

View File

@@ -1,294 +0,0 @@
#compdef docker-machine
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Docker Machine (http://docs.docker.com/machine/).
# Adapted from boot2docker completion by hhatto (https://github.com/hhatto)
# and docker completion by @aeonazaan and @bobmaerten.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * ilkka (https://github.com/ilkka)
#
# ------------------------------------------------------------------------------
# helper function for completing available machines
__machines() {
declare -a machines_cmd
machines_cmd=($(docker-machine ls|tail +2|awk '{print $1":"$3"("$4")"}'))
_describe 'machines' machines_cmd
}
# subcommands
local -a _docker_machine_cmds
_docker_machine_cmds=(
'active:Get or set the active machine' \
'create:Create a machine' \
'config:Print the connection config for machine' \
'inspect:Inspect information about a machine' \
'ip:Get the IP address of a machine' \
'kill:Kill a machine' \
'ls:List machines' \
'restart:Restart a machine' \
'rm:Remove a machine' \
'env:Display the commands to set up the environment for the Docker client' \
'ssh:Log into or run a command on a machine with SSH' \
'start:Start a machine' \
'stop:Stop a machine' \
'upgrade:Upgrade a machine to the latest version of Docker' \
'url:Get the URL of a machine' \
'help:Shows a list of commands or help for one command'
)
# subcommand completion functions
__active() {
__machines
}
__help() {
_values 'Get help for subcommand' \
'active' \
'create' \
'config' \
'inspect' \
'ip' \
'kill' \
'ls' \
'restart' \
'rm' \
'env' \
'ssh' \
'start' \
'stop' \
'upgrade' \
'url' \
'help'
}
__create() {
_arguments \
'--amazonec2-access-key:AWS Access Key:()' \
'--amazonec2-ami:AWS machine image:()' \
'--amazonec2-instance-type:AWS instance type:()' \
'--amazonec2-region:AWS region:()' \
'--amazonec2-root-size:AWS root disk size (in GB):()' \
'--amazonec2-secret-key:AWS Secret Key:()' \
'--amazonec2-security-group:AWS VPC security group:()' \
'--amazonec2-session-token:AWS Session Token:()' \
'--amazonec2-subnet-id:AWS VPC subnet id:()' \
'--amazonec2-vpc-id:AWS VPC id:()' \
'--amazonec2-zone:AWS zone for instance (i.e. a,b,c,d,e):()' \
'--azure-docker-port:Azure Docker port:()' \
'--azure-image:Azure image name. Default is Ubuntu 14.04 LTS x64:()' \
'--azure-location:Azure location:()' \
'--azure-password:Azure user password:()' \
'--azure-publish-settings-file:Azure publish settings file:()' \
'--azure-size:Azure size:()' \
'--azure-ssh-port:Azure SSH port:()' \
'--azure-subscription-cert:Azure subscription cert:()' \
'--azure-subscription-id:Azure subscription ID:()' \
'--azure-username:Azure username:()' \
'--digitalocean-access-token:Digital Ocean access token:()' \
'--digitalocean-image:Digital Ocean Image:()' \
'--digitalocean-region:Digital Ocean region:()' \
'--digitalocean-size:Digital Ocean size:()' \
'--google-disk-size:GCE Instance Disk Size (in GB):()' \
'--google-machine-type:GCE Machine Type:()' \
'--google-project:GCE Project:()' \
'--google-scopes:GCE Scopes (comma-separated if multiple scopes):()' \
'--google-username:GCE User Name:()' \
'--google-zone:GCE Zone:()' \
'--openstack-auth-url:OpenStack authentication URL:()' \
'--openstack-endpoint-type:OpenStack endpoint type (adminURL, internalURL or publicURL):()' \
'--openstack-flavor-id:OpenStack flavor id to use for the instance:()' \
'--openstack-flavor-name:OpenStack flavor name to use for the instance:()' \
'--openstack-floatingip-pool:OpenStack floating IP pool to get an IP from to assign to the instance:()' \
'--openstack-image-id:OpenStack image id to use for the instance:()' \
'--openstack-image-name:OpenStack image name to use for the instance:()' \
'--openstack-net-id:OpenStack image name to use for the instance:()' \
'--openstack-net-name:OpenStack network name the machine will be connected on:()' \
'--openstack-password:OpenStack password:()' \
'--openstack-region:OpenStack region name:()' \
'--openstack-sec-groups:OpenStack comma separated security groups for the machine:()' \
'--openstack-ssh-port:OpenStack SSH port:()' \
'--openstack-ssh-user:OpenStack SSH user:()' \
'--openstack-tenant-id:OpenStack tenant id:()' \
'--openstack-tenant-name:OpenStack tenant name:()' \
'--openstack-username:OpenStack username:()' \
'--rackspace-api-key:Rackspace API key:()' \
'--rackspace-docker-install:Set if docker have to be installed on the machine:()' \
'--rackspace-endpoint-type:Rackspace endpoint type (adminURL, internalURL or the default publicURL):()' \
'--rackspace-flavor-id:Rackspace flavor ID. Default: General Purpose 1GB:()' \
'--rackspace-image-id:Rackspace image ID. Default: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM):()' \
'--rackspace-region:Rackspace region name:()' \
'--rackspace-ssh-port:SSH port for the newly booted machine. Set to 22 by default:()' \
'--rackspace-ssh-user:SSH user for the newly booted machine. Set to root by default:()' \
'--rackspace-username:Rackspace account username:()' \
'--softlayer-api-endpoint:softlayer api endpoint to use:()' \
'--softlayer-api-key:softlayer user API key:()' \
"--softlayer-cpu:number of CPUs for the machine:()" \
'--softlayer-disk-size:Disk size for machine, a value of 0 uses the default size on softlayer:()' \
'--softlayer-domain:domain name for machine:()' \
'--softlayer-hostname:hostname for the machine:()' \
'--softlayer-hourly-billing:set hourly billing for machine - on by default:()' \
'--softlayer-image:OS image for machine:()' \
'--softlayer-local-disk:use machine local disk instead of softlayer SAN:()' \
'--softlayer-memory:Memory in MB for machine:()' \
'--softlayer-private-net-only:Use only private networking:()' \
'--softlayer-region:softlayer region for machine:()' \
'--softlayer-user:softlayer user account name:()' \
'--url:URL of host when no driver is selected:()' \
'--virtualbox-boot2docker-url:The URL of the boot2docker image. Defaults to the latest available version:()' \
'--virtualbox-disk-size:Size of disk for host in MB:()' \
'--virtualbox-memory:Size of memory for host in MB:()' \
'--vmwarefusion-boot2docker-url:Fusion URL for boot2docker image:()' \
'--vmwarefusion-disk-size:Fusion size of disk for host VM (in MB):()' \
'--vmwarefusion-memory-size:Fusion size of memory for host VM (in MB):()' \
'--vmwarevcloudair-catalog:vCloud Air Catalog (default is Public Catalog):()' \
'--vmwarevcloudair-catalogitem:vCloud Air Catalog Item (default is Ubuntu Precise):()' \
'--vmwarevcloudair-computeid:vCloud Air Compute ID (if using Dedicated Cloud):()' \
'--vmwarevcloudair-cpu-count:vCloud Air VM Cpu Count (default 1):()' \
'--vmwarevcloudair-docker-port:vCloud Air Docker port:()' \
'--vmwarevcloudair-edgegateway:vCloud Air Org Edge Gateway (Default is <vdcid>):()' \
'--vmwarevcloudair-memory-size:vCloud Air VM Memory Size in MB (default 2048):()' \
'--vmwarevcloudair-orgvdcnetwork:vCloud Air Org VDC Network (Default is <vdcid>-default-routed):()' \
'--vmwarevcloudair-password:vCloud Air password:()' \
'--vmwarevcloudair-provision:vCloud Air Install Docker binaries (default is true):()' \
'--vmwarevcloudair-publicip:vCloud Air Org Public IP to use:()' \
'--vmwarevcloudair-ssh-port:vCloud Air SSH port:()' \
'--vmwarevcloudair-username:vCloud Air username:()' \
'--vmwarevcloudair-vdcid:vCloud Air VDC ID:()' \
'--vmwarevsphere-boot2docker-url:vSphere URL for boot2docker image:()' \
'--vmwarevsphere-compute-ip:vSphere compute host IP where the docker VM will be instantiated:()' \
'--vmwarevsphere-cpu-count:vSphere CPU number for docker VM:()' \
'--vmwarevsphere-datacenter:vSphere datacenter for docker VM:()' \
'--vmwarevsphere-datastore:vSphere datastore for docker VM:()' \
'--vmwarevsphere-disk-size:vSphere size of disk for docker VM (in MB):()' \
'--vmwarevsphere-memory-size:vSphere size of memory for docker VM (in MB):()' \
'--vmwarevsphere-network:vSphere network where the docker VM will be attached:()' \
'--vmwarevsphere-password:vSphere password:()' \
'--vmwarevsphere-pool:vSphere resource pool for docker VM:()' \
'--vmwarevsphere-username:vSphere username:()' \
'--vmwarevsphere-vcenter:vSphere IP/hostname for vCenter:()' \
'--driver:Driver to create machine with.:(amazonec2 azure digitalocean google none openstack rackspace softlayer virtualbox vmwarefusion vmwarevcloudair vmwarevsphere)' \
'--swarm:Configure Machine with Swarm:()' \
'--swarm-master:Configure Machine to be a Swarm master:()' \
'--swarm-discovery:Discovery service to use with Swarm:()' \
'--swarm-host:ip/socket to listen on for Swarm master:()' \
'--swarm-addr:addr to advertise for Swarm (default: detect and use the machine IP):()'
}
__config() {
_arguments \
'--swarm[Display the Swarm config instead of the Docker daemon]'
__machines
}
__inspect() {
__machines
}
__ip() {
__machines
}
__env() {
_arguments \
'--unset[Unset variables instead of setting them]' \
'--swarm[Display the Swarm config instead of the Docker daemon]'
__machines
}
__kill() {
__machines
}
__ls() {
_arguments \
'--quiet[Enable quiet mode]'
}
__restart() {
__machines
}
__start() {
__machines
}
__stop() {
__machines
}
__rm() {
__machines
}
__ssh() {
__machines
}
__upgrade() {
__machines
}
__url() {
__machines
}
# common args
_arguments \
'--debug[Enable debug mode]' \
'--storage-path[Configures storage path]:_files' \
'--tls-ca-cert[CA to verify remotes against]:_files' \
'--tls-ca-key[Private key to generate certificates]:_files' \
'--tls-client-cert[Client cert to use for TLS]:_files' \
'--tls-client-key[Private key used in client TLS auth]:_files' \
'--help[show help]' \
'--version[print the version]' \
'*:: :->command'
# start machines!
if (( CURRENT == 1 )); then
_describe -t commands 'docker-machine command' _docker_machine_cmds
fi
local -a _command_args
case "$words[1]" in
active)
__active ;;
create)
__create ;;
config)
__config ;;
inspect)
__inspect ;;
ip)
__ip ;;
kill)
__kill ;;
ls)
__ls ;;
restart)
__restart ;;
rm)
__rm ;;
env)
__env ;;
ssh)
__ssh ;;
start)
__start ;;
stop)
__stop ;;
upgrade)
__upgrade ;;
url)
__url ;;
help)
__help ;;
esac

View File

@@ -1,5 +1,30 @@
#compdef docpad
# ------------------------------------------------------------------------------
# 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
# -----------
#
@@ -30,13 +55,13 @@ _1st_arguments=(
)
_arguments -C \
'(-h,--help)'{-h,--help}'[output usage information]'\
'(-V,--version)'{-V,--version}'[output the version number]'\
'(-o,--out)'{-o,--out}'[where to output the rendered directory or files]:path:_files'\
'(-c,--config)'{-c,--config}'[a custom configuration file to load in]:path:_files'\
'(-e,--env)'{-e,--env}'[the environment name to use for this instance, multiple names can be separated with a comma]'\
'(-d,--debug)'{-d,--debug}'+[the level of debug messages you would like to display, if specified defaults to 7, otherwise 6]:number'\
'(-f,--force)'{-f,--force}'[force a re-install of all modules]'\
'(-h --help)'{-h,--help}'[output usage information]'\
'(-V --version)'{-V,--version}'[output the version number]'\
'(-o --out)'{-o,--out}'[where to output the rendered directory or files]:path:_files'\
'(-c --config)'{-c,--config}'[a custom configuration file to load in]:path:_files'\
'(-e --env)'{-e,--env}'[the environment name to use for this instance, multiple names can be separated with a comma]'\
'(-d --debug)'{-d,--debug}'+[the level of debug messages you would like to display, if specified defaults to 7, otherwise 6]:number'\
'(-f --force)'{-f,--force}'[force a re-install of all modules]'\
'1: :->cmds'\
'*: :_files'&& ret=0

View File

@@ -1,5 +1,30 @@
#compdef drush
# ------------------------------------------------------------------------------
# Copyright (c) 2014 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
# -----------
#

View File

@@ -1,44 +0,0 @@
#compdef dzen2
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for dzen2 0.8.5 ( https://github.com/robm/dzen )
# Last updated: 31.03.2013
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Valodim ( https://github.com/Valodim )
#
# ------------------------------------------------------------------------------
# Notes
# -----
#
# the _x_color completer has rather outdated paths, a zstyle like this helps
# get the x colors right (the list is rather long, then)
#
# zstyle ":completion:*:colors" path '/etc/X11/rgb.txt'
#
# ------------------------------------------------------------------------------
_arguments \
'-fg[Set foreground color]:foreground color:_x_color' \
'-bg[Set background color]:background color:_x_color' \
'-fn[Set font]:font:_x_font' \
'-ta[Set alignment of title window content]:alignment:( l c r )' \
'-tw[Set title window width]:width (pixels)' \
'-sa[Set alignment of slave window]:alignment:( l c r )' \
'-l[Number of lines to display in slave window]:lines' \
'-e[Set up events and actions]:event string' \
'-m[Start up in menu mode]' \
'-u[Update contents of title and slave window simultaneously]' \
'-p[Persist EOF]:timeout (seconds)' \
'-x[Set x position on the screen]:x position (pixels)' \
'-y[Set y position on the screen]:y position (pixels)' \
'-h[Set line height]:line height (pixels)' \
'-w[Set window width]:width (pixels)' \
'-xs[Set the Xinerama screen number where dzen should appear]:screen number' \
'-v[Display version information]' && return 0

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -0,0 +1,49 @@
#compdef envdir
# ------------------------------------------------------------------------------
# Copyright (c) 2016, Github zsh-users (https://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 envdir (https://github.com/jezdez/envdir).
# It completes its few options and then a directory and command.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Daniel Hahler <https://daniel.hahler.de/>
#
# ------------------------------------------------------------------------------
args=(
'(-h --help)'{-h+,--help}'[show this help message and exit]'
'(-)'--version'[display version information and exit]'
'(-)1:directory: _path_files -/'
'(-)2:command: _command_names -e'
'*::arguments: _precommand'
)
_arguments -S $args

View File

@@ -1,5 +1,30 @@
#compdef fab
# ------------------------------------------------------------------------------
# Copyright (c) 2015 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
# -----------
#
@@ -57,6 +82,7 @@ _arguments -w -S -C \
"(-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'']: :' \
'(--ssh-config-path=)--ssh-config-path=[ssh config path]: :_files' \
'(--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

View File

@@ -0,0 +1,61 @@
#compdef ffind
# ------------------------------------------------------------------------------
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for ffind (https://github.com/jaimebuelta/ffind).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Sergei Eremenko (https://github.com/SmartFinn)
#
# ------------------------------------------------------------------------------
_arguments -C \
'(-h --help)'{-h,--help}'[show help message and exit]' \
'--version[show version number and exit]' \
'-p[match whole path, not only name of files]' \
'--nocolor[do not display color]' \
'--nosymlinks[do not follow symlinks]' \
'--hidden[do not ignore hidden directories]' \
'-c[force case sensitive]' \
'--delete[delete files found]' \
'--exec[execute the given command with the file found]:command:_command_names' \
'--module[execute the given module with the file found]:module_name args:' \
'--command[execute the given python program with the file found]:program:_files' \
'--ignore-vcs[ignore version control system files and directories]' \
'-f[experimental fuzzy search]' \
'--return-results[for testing purposes only]' \
'1:directory to search:_path_files -/' \
'*:filepattern:'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -0,0 +1,123 @@
#compdef fleetctl
# ------------------------------------------------------------------------------
# Copyright (c) 2009-2015 Robby Russell and contributors (see
# https://github.com/robbyrussell/oh-my-zsh/contributors)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for fleetctl (https://github.com/coreos/fleet).
#
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Remi Paulmier (https://github.com/shtouff)
#
# ------------------------------------------------------------------------------
# fleetctl zsh completion
local -a _1st_arguments
_1st_arguments=(
'cat:Output the contents of a submitted unit'
'destroy:Destroy one or more units in the cluster'
'fd-forward:Proxy stdin and stdout to a unix domain socket'
'help:Show a list of commands or help for one command'
'journal:Print the journal of a unit in the cluster to stdout'
'list-machines:Enumerate the current hosts in the cluster'
'list-unit-files:List the units that exist in the cluster.'
'list-units:List the current state of units in the cluster'
'load:Schedule one or more units in the cluster, first submitting them if necessary.'
'ssh:Open interactive shell on a machine in the cluster'
'start:Instruct systemd to start one or more units in the cluster, first submitting and loading if necessary.'
'status:Output the status of one or more units in the cluster'
'stop:Instruct systemd to stop one or more units in the cluster.'
'submit:Upload one or more units to the cluster without starting them'
'unload:Unschedule one or more units in the cluster.'
'version:Print the version and exit'
)
__task_list ()
{
local expl
declare -a tasks
tasks=(cat destroy fd-forward help journal list-machines list-unit-files \
list-units load ssh start status stop submit unload version)
_wanted tasks expl 'help' compadd $tasks
}
__unit_list ()
{
_wanted application expl 'command' compadd $(command fleetctl list-units | \
tail -n +2 | awk '{print $1}')
}
local expl
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'
;;
(destroy|journal|start|status|stop|unload|cat)
_arguments '*:feature:__unit_list'
;;
(load|submit)
_arguments '*:file:_files -g *.service'
;;
(ssh)
_arguments '*:host:_hosts'
;;
(*)
_arguments '*:file:_files'
;;
esac
;;
esac
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -0,0 +1,221 @@
#compdef force
# ------------------------------------------------------------------------------
# Copyright (c) 2017 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 force CLI 0.22.39 (https://github.com/heroku/force).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Peter Limbach <https://github.com/pelim>
#
# ------------------------------------------------------------------------------
local -a _1st_arguments
_1st_arguments=(
'apiversion:Display/Set current API version'
'login:force login [-i=<instance>] [<-u=username> <-p=password>]'
'logout:Log out from force.com'
'logins:List force.com logins used'
'active:Show or set the active force.com account'
'whoami:Show information about the active account'
'describe:Describe the object or list of available objects'
'sobject:Manage standard & custom objects'
'bigobject:Manage big objects'
'field:Manage sobject fields'
'record:Create, modify, or view records'
'bulk:Load csv file use Bulk API'
'fetch:Export specified artifact(s) to a local directory'
'import:Import metadata from a local directory'
'export:Export metadata to a local directory'
'query:Execute a SOQL statement'
'apex:Execute anonymous Apex code'
'trace:Manage trace flags'
'log:Fetch debug logs'
'eventlogfile:List and fetch event log file'
'oauth:Manage ConnectedApp credentials'
'test:Run apex tests'
'security:Displays the OLS and FLS for a give SObject'
'version:Display current version'
'update:Update to the latest version'
'push:Deploy artifact from a local directory'
'aura:force aura push -f <filepath>'
'password:See password status or reset password'
'notify:Should notifications be used'
'limits:Display current limits'
'help:Show this help'
'datapipe:Manage DataPipes'
)
local -a _field_arguments
_apex_types=(
'string' 'textarea' 'longtextarea' 'richtextarea'
'boolean' 'double' 'number' 'autonumber' 'picklist'
'lookup' 'masterdetail' 'geolocation'
)
_field_arguments=(
'list' 'create' 'delete' 'type'
)
_sobject_arguments=(
'list' 'create' 'delete'
)
_bulk_arguments=(
'insert:upload a .csv file to insert records'
'update:upload a .csv file to update records'
'query:run a SOQL statement to generate a .csv file on the server'
'retrieve:retrieve a query generated .csv file from the server'
'job:get information about a job based on job Id'
'batch:get detailed information about a batch within a job based on job Id and batch Id'
'batches:get a list of batches associated with a job based on job Id'
)
__sobject_list() {
_wanted application expl 'sobjects' compadd $(force sobject list)
}
__log_list() {
_wanted application expl 'logfiles' compadd $(force log | grep -o -e '07\w*')
}
__login_user_list() {
# remove active user string, remove colors & print the username
_wanted application expl 'usernames' compadd $(force logins | sed 's/(active)//' | sed 's,$(printf "\033"")\\[[0-9;]*[a-zA-Z],,g' | awk '{print $1}')
}
__login_instance_list() {
_wanted application expl 'instances' compadd $(force logins | awk '{print $3}' | sed 's/https:\/\///')
}
__sobject_command () {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "sobject commands" _sobject_arguments
return
;;
(options)
case $line[1] in
(delete)
_arguments ':feature:__sobject_list'
;;
esac
;;
esac
}
__field_command () {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "field commands" _field_arguments
return
;;
(options)
case $line[1] in
(list)
_arguments ':feature:__sobject_list'
;;
(type)
_describe -t commands "apex types" _apex_types
return
;;
esac
;;
esac
}
local expl
local -a active logins
local curcontext="$curcontext" state line
local -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "force commands" _1st_arguments
return
;;
(options)
case $line[1] in
(help)
_describe -t commands "command help" _1st_arguments
return
;;
(login)
_arguments \
'-u[salesforce user]:userame:__login_user_list' \
'-i[salesforce instance]:instance:__login_instance_list' \
'-p[salesforce password]'
;;
(bulk)
_arguments \
'-c[bulk command]:_bulk_arguments'
;;
(log)
_arguments ':feature:__log_list'
;;
(field)
__field_command
;;
(sobject)
__sobject_command
;;
esac
;;
esac

View File

@@ -1,5 +1,26 @@
#compdef gas
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -1,499 +0,0 @@
#compdef gem gem1.9 macgem
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for gem (http://rubygems.org).
#
# Source: https://gist.github.com/164465
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Alex Vollmer (https://github.com/alexvollmer)
# * Tim Pope (https://github.com/tpope)
#
# ------------------------------------------------------------------------------
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
)
__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"
"owner"
"pristine"
"push"
"query"
"rdoc"
"search"
"server"
"sources"
"specification"
"stale"
"tumble"
"uninstall"
"unpack"
"update"
"which")
compadd "$@" -k _args
}
__gem_trust_policies() {
_args=("NoSecurity"
"LowSecurity"
"MediumSecurity"
"HighSecurity")
compadd "$@" -k _args
}
_gem_build() {
_arguments \
*:file:_files -f \
$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 \
"*: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]" \
"--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_open() {
_arguments \
"*:gemname:__all_gems" \
"(-v --version)"{-v,--version}"[Specify version of gem to open]"
}
_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_owner() {
_arguments \
"(-a --add)"{-a,--add}"[Add an owner]" \
"(-r --remove)"{-r,--remove}"[Remove an owner]" \
$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_push() {
_arguments \
*:file:_files -f \
"(-p --http-proxy)"{-p,--http-proxy}"[Use HTTP proxy for remote operations]" \
$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_tumble() {
_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
}
_gem_migrate() {
_arguments \
"*:gemname:__all_gems" \
$gem_general_flags && ret=0
}
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]" \
"migrate[Migrate a gem you own from Rubyforge to Gemcutter]" \
"mirror[Mirror a gem repository]" \
"open[Open a gem in your editor]" \
"outdated[Display all gems that need updates]" \
"owner[Manage gem owners on Gemcutter]" \
"pristine[Restores installed gems to pristine condition from files located in the gem cache]" \
"push[Push a gem up to Gemcutter]" \
"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]" \
"tumble[Enable or disable Gemcutter as your primary gem source]" \
"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
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,6 +1,6 @@
#compdef gist
# ------------------------------------------------------------------------------
# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -35,6 +35,7 @@
# -------
#
# * Akira Maeda <https://github.com/glidenote>
# * Patrick Ziegler <https://github.com/patrick96>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
@@ -61,6 +62,58 @@ _arguments -C \
'(-P --paste)'{-P,--paste}'[Paste from the clipboard to gist]' \
'(-h --help)'{-h,--help}'[print options help]' \
'(-v --version)'{-v,--version}'[print version]' \
'(-r --read)'{-r,--read}'[Read a gist and print out the contents]:user gists:user_gists' \
'*: :_files' && ret=0
_user_gists_cache_policy() {
# rebuild if cache is more than a day old
local -a oldp
oldp=( "$1"(mh+1) )
(( $#oldp ))
}
user_gists() {
local update_policy ret=1
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
if [[ -z "$update_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy _user_gists_cache_policy
fi
# stores the gists of the logged in user in the format ID[Description]
_list=()
_cached_gists="user_gists"
# retrieve/Write gists from/to cache
if _cache_invalid $_cached_gists || ! _retrieve_cache $_cached_gists; then
_gists=$(gist -l)
if [ $? -eq 0 ]; then
_store_cache $_cached_gists _gists
else
# some error occurred, the user is probably not logged in
# set _gists to an empty string so that no completion is attempted
_gists=""
fi
else
_retrieve_cache $_cached_gists
fi
if [ -n "$_gists" ]; then
echo "$_gists" | while read -r line; do
# Splitting the gist -l output
url="$(echo "$line" | cut -d " " -f 1 | cut -d "/" -f 4)"
# gists w/o descriptions can have only one column in the output, those
# have their description set to an empty string
description="$(echo "$line" | awk '{if(NF > 1){$1=""; print $0}}')"
_list+=( "${url}[${description}]" )
done
_values "gists" $_list
ret=0
fi
return ret
}
return ret

View File

@@ -1,5 +1,25 @@
#compdef git-flow
# ------------------------------------------------------------------------------
# Copyright (c) 2010-2015 Justin Hileman
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
# OR OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#

View File

@@ -0,0 +1,225 @@
#compdef git-journal
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for git-journal:
# https://github.com/saschagrunert/git-journal
#
# Authors
# -------
#
# * Sascha Grunert <mail@saschagruenrt.de>
# * Nico Wagner <nico@cryptopone.org>
# ------------------------------------------------------------------------------
_git-journal() {
typeset -A opt_args
local ret=1
local context curcontext="$curcontext" state line
_arguments -s -S -C \
"-p+[Sets a custom working path.]" \
"--path+[Sets a custom working path.]" \
"-n+[The number of tags until the parser stops when a single revision is given.]" \
"--tags-count+[The number of tags until the parser stops when a single revision is given.]" \
"-e+[A pattern to exclude git tags from the processing.]" \
"-t+[Use a custom output template.]" \
"--template+[Use a custom output template.]" \
"-o+[The output file for the changelog.]" \
"--output+[The output file for the changelog.]" \
"-a[Do not stop parsing at the first tag when a single revision is given. Overwrites '-n/--tags-count'.]" \
"--all[Do not stop parsing at the first tag when a single revision is given. Overwrites '-n/--tags-count'.]" \
"-g[Generate a fresh output template from a commit range.]" \
"--generate[Generate a fresh output template from a commit range.]" \
"-s[Print only the shortlog (summary) form.]" \
"--short[Print only the shortlog (summary) form.]" \
"-u[Skip entries without any relation to a git TAG.]" \
"--skip-unreleased[Skip entries without any relation to a git TAG.]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"1:: :_git-journal_commands" \
"*:: :->git-journal" \
&& ret=0
case $state in
(git-journal)
curcontext="${curcontext%:*:*}:git-journal-command-$words[1]:"
case $line[1] in
(p)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"1:: :_git-journal_prepare_commands" \
&& ret=0
;;
(prepare)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"1:: :_git-journal_prepare_commands" \
&& ret=0
;;
(s)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
&& ret=0
;;
(setup)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
&& ret=0
;;
(v)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"1:: :_git-journal_verify_commands" \
&& ret=0
;;
(verify)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"1:: :_git-journal_verify_commands" \
&& ret=0
;;
(help)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
&& ret=0
;;
esac
;;
esac
}
(( $+functions[_git-journal_commands] )) ||
_git-journal_commands() {
local commands; commands=(
"prepare:Prepare a commit message before the user can edit it." \
"p:Prepare a commit message before the user can edit it." \
"setup:Creates all necessary git hooks and an initial configuration file. Shell completions for bash and fish will be available inside the current working directory." \
"s:Creates all necessary git hooks and an initial configuration file. Shell completions for bash and fish will be available inside the current working directory." \
"verify:Verify the specified commit message." \
"v:Verify the specified commit message." \
"help:Prints this message or the help of the given subcommand(s)" \
"REVISION_RANGE:Specifies the revision range to be processed. If a single revision is specified, the output will stop at the first following git TAG." \
)
_describe -t commands 'git-journal commands' commands "$@"
}
(( $+functions[_git-journal_help_commands] )) ||
_git-journal_help_commands() {
local commands; commands=(
)
_describe -t commands 'git-journal help commands' commands "$@"
}
(( $+functions[_git-journal_p_commands] )) ||
_git-journal_p_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
"TYPE:The type of the commit. For example "message"." \
)
_describe -t commands 'git-journal p commands' commands "$@"
}
(( $+functions[_p_commands] )) ||
_p_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
"TYPE:The type of the commit. For example "message"." \
)
_describe -t commands 'p commands' commands "$@"
}
(( $+functions[_git-journal_prepare_commands] )) ||
_git-journal_prepare_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
"TYPE:The type of the commit. For example "message"." \
)
_describe -t commands 'git-journal prepare commands' commands "$@"
}
(( $+functions[_git-journal_s_commands] )) ||
_git-journal_s_commands() {
local commands; commands=(
)
_describe -t commands 'git-journal s commands' commands "$@"
}
(( $+functions[_s_commands] )) ||
_s_commands() {
local commands; commands=(
)
_describe -t commands 's commands' commands "$@"
}
(( $+functions[_git-journal_setup_commands] )) ||
_git-journal_setup_commands() {
local commands; commands=(
)
_describe -t commands 'git-journal setup commands' commands "$@"
}
(( $+functions[_git-journal_v_commands] )) ||
_git-journal_v_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
)
_describe -t commands 'git-journal v commands' commands "$@"
}
(( $+functions[_v_commands] )) ||
_v_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
)
_describe -t commands 'v commands' commands "$@"
}
(( $+functions[_git-journal_verify_commands] )) ||
_git-journal_verify_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
)
_describe -t commands 'git-journal verify commands' commands "$@"
}
_git-journal "$@"

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -1,272 +0,0 @@
#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)
#
# ------------------------------------------------------------------------------
_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 "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -0,0 +1,554 @@
#compdef go
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
# Copyright (c) 2013-2015 Robby Russell and contributors (see
# https://github.com/robbyrussell/oh-my-zsh/contributors)
# Copyright (c) 2010-2014 Go authors
#
# 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 go 1.5 (http://golang.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mikkel Oscar Lyderik <mikkeloscar@gmail.com>
# * oh-my-zsh authors:
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/golang/golang.plugin.zsh
# * Go authors
#
# ------------------------------------------------------------------------------
typeset -A opt_args
_go() {
local -a commands build_flags
commands=(
'build:compile packages and dependencies'
'clean:remove object files'
'doc:show documentation for package or symbol'
'env:print Go environment information'
'fix:run go tool fix on packages'
'fmt:run gofmt on package sources'
'generate:generate Go files by processing source'
'get:download and install packages and dependencies'
'install:compile and install packages and dependencies'
'list:list packages'
'run:compile and run Go program'
'test:test packages'
'tool:run specified go tool'
'version:print Go version'
'vet:run go tool vet on packages'
'help:get more information about a command'
)
_arguments \
"1: :{_describe 'command' commands}" \
'*:: :->args'
case $state in
args)
build_flags=(
'-a[force rebuilding of packages that are already up-to-date]'
'-n[print the commands but do not run them]'
'-p[number of builds that can be run in parallel]:number'
'-race[enable data race detection]'
'-v[print the names of packages as they are compiled]'
'-work[print temporary work directory and keep it]'
'-x[print the commands]'
'-asmflags[arguments for each go tool asm invocation]:flags'
'-buildmode[build mode to use]:mode'
'-compiler[name of compiler to use]:name'
'-gccgoflags[arguments for gccgo]:args'
'-gcflags[arguments for each go tool compile invocation]:args'
'-installsuffix[suffix to add to package directory]:suffix'
'-ldflags[arguments to pass on each go tool link invocation.]:flags'
'-linkshared[link against shared libraries]'
'-pkgdir[install and load all packages from dir]:dir'
'-tags[list of build tags to consider satisfied]:tags'
'-toolexec[program to use to invoke toolchain programs]:args'
)
__go_packages() {
local gopaths
declare -a gopaths
gopaths=("${(s/:/)$(go env GOPATH)}")
gopaths+=("$(go env GOROOT)")
for p in $gopaths; do
_path_files -W "$p/src" -/
done
}
case $words[1] in
build)
_arguments \
'-o[force build to write to named output file]:file:_files' \
'-i[installs the packages that are dependencies of the target]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
clean)
_arguments \
'-i[remove corresponding installed archive or binary]' \
'-r[apply clean recursively on all dependencies]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
doc)
_arguments \
'-c[respect case when matching symbols]' \
'-cmd[treat a command (package main) like a regular package]' \
'-u[show docs for unexported and exported symbols and methods]'
;;
fix)
_arguments '*:importpaths:__go_packages'
;;
fmt)
_arguments \
'-n[prints commands that would be executed]' \
'-x[prints commands as they are executed]' \
'*:importpaths:__go_packages'
;;
generate)
_arguments \
'-run=[specifies a regular expression to select directives]:regex' \
'-x[print the commands]' \
'-n[print the commands but do not run them]' \
'-v[print the names of packages as they are compiled]' \
"*:args:{ _alternative ':importpaths:__go_packages' _files }"
;;
get)
_arguments \
'-d[instructs get to stop after downloading the packages]' \
'-f[force get -u not to verify that each package has been checked from vcs]' \
'-fix[run the fix tool on the downloaded packages]' \
'-insecure[permit fetching/resolving custom domains]' \
'-t[also download the packages required to build tests]' \
'-u[use the network to update the named packages]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
install)
_arguments ${build_flags[@]} \
'*:importpaths:__go_packages'
;;
list)
_arguments \
'-e[changes the handling of erroneous packages]' \
'-f[specifies an alternate format for the list]:format' \
'-json[causes package data to be printed in JSON format]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
run)
_arguments \
${build_flags[@]} \
'-exec[invoke the binary using xprog]:xporg' \
'*:file:_files -g "*.go(-.)"'
;;
test)
_arguments \
"-c[compile but don't run test]" \
'-i[install dependencies of the test]' \
'-bench[run benchmarks matching the regular expression]:regexp' \
'-benchmem[print memory allocation statistics for benchmarks]' \
'-benchtime[run benchmarks for t rime]:t' \
'-blockprofile[write a goroutine blocking profile to the specified file]:block' \
'-blockprofilerate[control goroutine blocking profiles]:n' \
'-count[run each test and benchmark n times]:n' \
'-cover[enable coverage analysis]' \
'-covermode[set the mode for coverage analysis]:mode:(set count atomic)' \
'-coverpkg[apply coverage analysis in each test of listed packages]:list' \
'-coverprofile[write a coverage profile to file]:cover' \
'-cpu[specify a list of GOMAXPROCS values]:cpus' \
'-cpuprofile[write a CPU profile to the specified file]:profile' \
'-memprofile[write a memory profile to file]:mem' \
'-memprofilerate[enable more precise memory profiles]:n' \
'-outputdir[place output files from profiling in output dir]:dir' \
'-parallel[allow parallel execution of test functions]:n' \
'-run[run tests and examples matching the regular expression]:regexp' \
'-short[tell long-running tests to shorten their run time]' \
'-timeout[timeout long running tests]:t' \
'-trace[write an execution trace to the specified file]:trace' \
'-v[verbose output]' \
${build_flags[@]} \
'-exec[run test binary using xprog]:xprog' \
'-o[compile test binary to named file]:file:_files' \
'*:importpaths:__go_packages'
;;
tool)
local -a tools
tools=($(go tool))
_arguments \
'-n[print command that would be executed]' \
"1: :{_describe 'tool' tools}" \
'*:: :->args'
case $state in
args)
case $words[1] in
addr2line)
_files
;;
asm)
_arguments \
'-D[predefined symbol with optional simple value]:value' \
'-I[include directory]:value' \
'-S[print assembly and machine code]' \
'-debug[dump instructions as they are parsed]' \
'-dynlink[support references to Go symbols]' \
'-o[output file]:string' \
'-shared[generate code that can be linked into a shared lib]' \
'-trimpath[remove prefix from recorded source file paths]:string'
;;
callgraph)
local -a algos graphs
algos=(
'static:static calls only'
'cha:Class Hierarchy Analysis'
'rta:Rapid Type Analysis'
'pta:inclusion-based Points-To Analysis'
)
graphs=(
'digraph:output in digraph format'
'graphviz:output in AT&T GraphViz (.dot) format'
)
_arguments \
'-algo=[call-graph construction algorithm]:algos:{ _describe "algos" algos }' \
"-test[include the package's tests in the analysis]" \
'-format=[format in which each call graph edge is displayed]:graphs:{ _describe "graphs" graphs }'
;;
cgo)
_arguments \
'-debug-define[print relevant #defines]' \
'-debug-gcc[print gcc invocations]' \
'-dynimport[if non-empty, print dynamic import data]:string' \
'-dynlinker[record dynamic linker information]' \
'-dynout[write -dynimport output to file]:file' \
'-dynpackage[set Go package for -dynimport output]:string' \
'-exportheader[where to write export header]:string' \
'-gccgo[generate files for use with gccgo]' \
'-gccgopkgpath[-fgo-pkgpath option used with gccgo]:string' \
'-gccgoprefix[-fgo-prefix option used with gccgo]:string' \
'-godefs[write Go definitions for C file to stdout]' \
'-import_runtime_cgo[import runtime/cgo in generated code]' \
'-import_syscall[import syscall in generated code]' \
'-importpath[import path of package being built]:path' \
'-objdir[object directory]:dir'
;;
compile)
_arguments \
'-%[debug non-static initializers]' \
'-+[compiling runtime]' \
"-A[for bootstrapping, allow 'any' type]" \
'-B[disable bounds checking]' \
'-D[set relative path for local imports]:path' \
'-E[debug symbol export]' \
'-I[add directory to import search path]:directory' \
'-K[debug missing line numbers]' \
'-L[use full (long) path in error messages]' \
'-M[debug move generation]' \
'-N[disable optimizations]' \
'-P[debug peephole optimizer]' \
'-R[debug register optimizer]' \
'-S[print assembly listing]' \
'-V[print compiler version]' \
'-W[debug parse tree after type checking]' \
'-asmhdr[write assembly header to file]:file' \
'-buildid[record id as the build id in the export metadata]:id' \
'-complete[compiling complete package (no C or assembly)]' \
'-cpuprofile[write cpu profile to file]:file' \
'-d[print debug information about items in list]:list' \
'-dynlink[support references to Go symbols]' \
'-e[no limit on number of errors reported]' \
'-f[debug stack frames]' \
'-g[debug code generation]' \
'-h[halt on error]' \
'-i[debug line number stack]' \
'-importmap[add definition of the form source=actual to import map]:definition' \
'-installsuffix[set pkg directory suffix]:suffix' \
'-j[debug runtime-initialized variables]' \
'-l[disable inlining]' \
'-largemodel[generate code that assumes a large memory model]' \
'-live[debug liveness analysis]' \
'-m[print optimization decisions]' \
'-memprofile[write memory profile to file]:file' \
'-memprofilerate[set runtime.MemProfileRate to rate]:rate' \
'-nolocalimports[reject local (relative) imports]' \
'-o[write output to file]:file' \
'-p[set expected package import path]:path' \
'-pack[write package file instead of object file]' \
'-r[debug generated wrappers]' \
'-race[enable race detector]' \
'-s[warn about composite literals that can be simplified]' \
'-shared[generate code that can be linked into a shared library]' \
'-trimpath[remove prefix from recorded source file paths]:prefix' \
'-u[reject unsafe code]' \
'-v[increase debug verbosity]' \
'-w[debug type checking]' \
'-wb[enable write barrier (default 1)]' \
'-x[debug lexer]' \
'-y[debug declarations in canned imports (with -d)]' \
'*:file:_files -g "*.go(-.)"'
;;
cover)
if (( CURRENT == 2 )); then
_arguments \
'-func=[output coverage profile information for each function]:string' \
'-html=[generate HTML representation of coverage profile]:file:_files' \
'-mode=[coverage mode]:mode:(set count atomic)'
return
fi
_arguments \
'-o[file for output]:file' \
'-var=[name of coverage variable to generate]:var' \
'*:file:_files -g "*.go(-.)"'
;;
doc)
_arguments \
'-c[respect case when matching symbols]' \
'-cmd[treat a command (package main) like a regular package]' \
'-u[show docs for unexported and exported symbols and methods]' \
;;
fix)
_arguments \
'-diff[display diffs instead of rewriting files]' \
'-force[force fixes to run even if the code looks updated]:string' \
'-r[restrict the rewrites]:string' \
'*:files:_files'
;;
link)
_arguments \
'-B[add an ELF NT_GNU_BUILD_ID note when using ELF]:note' \
'-C[check Go calls to C code]' \
'-D[set data segment address (default -1)]:address' \
'-E[set entry symbol name]:entry' \
'-H[set header type]:type' \
'-I[use linker as ELF dynamic linker]:linker' \
'-L[add specified directory to library path]:directory' \
'-R[set address rounding quantum (default -1)]:quantum' \
'-T[set text segment address (default -1)]:address' \
'-V[print version and exit]' \
'-W[disassemble input]' \
'-X[add string value definition]:definition' \
'-a[disassemble output]' \
'-buildid[record id as Go toolchain build id]:id' \
'-buildmode[set build mode]:mode' \
'-c[dump call graph]' \
'-cpuprofile[write cpu profile to file]:file' \
'-d[disable dynamic executable]' \
'-extld[use linker when linking in external mode]:linker' \
'-extldflags[pass flags to external linker]:flags' \
'-f[ignore version mismatch]' \
'-g[disable go package data checks]' \
'-h[halt on error]' \
'-installsuffix[set package directory suffix]:suffix' \
'-k[set field tracking symbol]:symbol' \
'-linkmode[set link mode]:mode:(internal external auto)' \
'-linkshared[link against installed Go shared libraries]' \
'-memprofile[write memory profile to file]:file' \
'-memprofilerate[set runtime.MemProfileRate to rate]:rate' \
'-n[dump symbol table]' \
'-o[write output to file]:file' \
'-r[set the ELF dynamic linker search path to dir1:dir2:...]:path' \
'-race[enable race detector]' \
'-s[disable symbol table]' \
'-shared[generate shared object (implies -linkmode external)]' \
'-tmpdir[use directory for temporary files]:directory' \
'-u[reject unsafe packages]' \
'-v[print link trace]' \
'-w[disable DWARF generation]' \
'*:files:_files'
;;
objdump)
_arguments \
'-s[only dump symbols matching this regexp]:regexp' \
'*:files:_files'
;;
pack)
_arguments '1:ops:(c p r t x)' '::verbose:(v)' ':files:_files'
;;
pprof)
_arguments \
'-callgrind[outputs a graph in callgrind format]' \
'-disasm=[output annotated assembly]:p' \
'-dot[outputs a graph in DOT format]' \
'-eog[visualize graph through eog]' \
'-evince[visualize graph through evince]' \
'-gif[outputs a graph image in GIF format]' \
'-gv[visualize graph through gv]' \
'-list=[output annotated source for functions matching regexp]:p' \
'-pdf[outputs a graph in PDF format]' \
'-peek=[output callers/callees of functions matching regexp]:p' \
'-png[outputs a graph image in PNG format]' \
'-proto[outputs the profile in compressed protobuf format]' \
'-ps[outputs a graph in PS format]' \
'-raw[outputs a text representation of the raw profile]' \
'-svg[outputs a graph in SVG format]' \
'-tags[outputs all tags in the profile]' \
'-text[outputs top entries in text form]' \
'-top[outputs top entries in text form]' \
'-tree[outputs a text rendering of call graph]' \
'-web[visualize graph through web browser]' \
'-weblist=[output annotated source in HTML]:p' \
'-output=[generate output on file f (stdout by default)]:f' \
'-functions[report at function level (default)]' \
'-files[report at source file level]' \
'-lines[report at source line level]' \
'-addresses[report at address level]' \
'-base[show delta from this profile]:profile' \
'-drop_negative[ignore negative differences]' \
'-cum[sort by cumulative data]' \
'-seconds=[length of time for dynamic profiles]:n' \
'-nodecount=[max number of nodes to show]:n' \
'-nodefraction=[hide nodes below <f>*total]:f' \
'-edgefraction=[hide edges below <f>*total]:f' \
'-sample_index[index of sample value to display]' \
'-mean[average sample value over first value]' \
'-inuse_space[display in-use memory size]' \
'-inuse_objects[display in-use object counts]' \
'-alloc_space[display allocated memory size]' \
'-alloc_objects[display allocated object counts]' \
'-total_delay[display total delay at each region]' \
'-contentions[display number of delays at each region]' \
'-mean_delay[display mean delay at each region]' \
'-runtime[show runtime call frames in memory profiles]' \
'-focus=[restricts to paths going through a node matching regexp]:r' \
'-ignore=[skips paths going through any nodes matching regexp]:r' \
'-tagfocus=[restrict to samples tagged with key:value matching regexp]:r' \
'-tagignore=[discard samples tagged with key:value matching regexp]' \
'-call_tree[generate a context-sensitive call tree]' \
'-unit=[convert all samples to unit u for display]:u' \
'-divide_by=[scale all samples by dividing them by f]:f' \
'-buildid=[override build id for main binary in profile]:id' \
'-tools=[search path for object-level tools]:path' \
'-help[help message]' \
'*:files:_files'
;;
trace)
_arguments \
'-http=[HTTP service address]:addr' \
'*:files:_files'
;;
vet)
_arguments \
'-all[check everything]' \
'-asmdecl[check assembly against Go declarations]' \
'-assign[check for useless assignments]' \
'-atomic[check for common mistaken usages of the sync/atomic]' \
'-bool[check for mistakes involving boolean operators]' \
'-buildtags[check that +build tags are valid]' \
'-composites[check that composite literals used field-keyed elements]' \
'-compositewhitelist[use composite white list]' \
'-copylocks[check that locks are not passed by value]' \
'-methods[check that canonically named methods are canonically defined]' \
'-nilfunc[check for comparisons between functions and nil]' \
'-printf[check printf-like invocations]' \
'-printfuncs[print function names to check]:string' \
'-rangeloops[check that range loop variables are used correctly]' \
'-shadow[check for shadowed variables]' \
'-shadowstrict[whether to be strict about shadowing]' \
'-shift[check for useless shifts]' \
'-structtags[check that struct field tags have canonical format]' \
'-tags[list of build tags to apply when parsing]:list' \
'-test[for testing only: sets -all and -shadow]' \
'-unreachable[check for unreachable code]' \
'-unsafeptr[check for misuse of unsafe.Pointer]' \
'-unusedfuncs[list of functions whose results must be used]:string' \
'-unusedresult[check for unused result of calls to functions in -unusedfuncs]' \
'-unusedstringmethods[list of methods whose results must be used]:string' \
'-v[verbose]' \
'*:files:_files'
;;
yacc)
_arguments \
'-o[output]:output' \
'-v[parsetable]:parsetable' \
'*:files:_files'
;;
esac
;;
esac
;;
vet)
_arguments \
'-n[print commands that would be executed]' \
'-x[prints commands as they are executed]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
help)
local -a topics
topics=(
'c:calling between Go and C'
'buildmode:description of build modes'
'filetype:file types'
'gopath:GOPATH environment variable'
'environment:environment variables'
'importpath:import path syntax'
'packages:description of package lists'
'testflag:description of testing flags'
'testfunc:description of testing functions'
)
_arguments "1: :{_describe 'command' commands -- topics}"
;;
esac
;;
esac
}
_go

View File

@@ -1,5 +1,30 @@
#compdef google
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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
# -----------
#

View File

@@ -1,135 +0,0 @@
#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>
#
# ------------------------------------------------------------------------------
_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}'[specify 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 "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -0,0 +1,87 @@
#compdef gtk-launch
# ------------------------------------------------------------------------------
# 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 gtk-launch on gtk+-3.14.8 (http://www.gtk.org/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * ncaq <ncaq@ncaq.net> (version 3.14.8)
#
# ------------------------------------------------------------------------------
_gtk-launch() {
_arguments \
{-h,--help}'[Show help options]' \
--help-all'[Show all help options]' \
--help-gtk'[Show GTK+ Options]' \
--display='[X display to use]' \
'1: :_applications'
}
_applications() {
local -a applications
for file in /usr/share/applications/*.desktop; do
applications+=`_format_entry $file`
done
_values -w \
'applications' \
$applications
}
_format_entry() {
echo "`_remove_path_extension $1`[`_get_description $1`]"
}
_remove_path_extension() {
# echo arg
# remove path string
# remove extension string
echo $1 | \
sed 's/.*\///' | \
sed 's/\.desktop//'
}
_get_description() {
# grep --no-messages option is handling of not UTF-8 text
grep --no-messages '^Comment=\|^Exec=' $1 | \
tr '\n' ' '
}
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,209 +0,0 @@
#compdef heroku
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for the Heroku client gem (https://github.com/heroku/heroku)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ali B. (http://awhitebox.com)
#
# ------------------------------------------------------------------------------
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 a config vars for an app"
"config\:get":"display a config value for an app"
"config\:set":"set one or more config vars"
"config\:unset":"unset one or more config vars"
"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"
"open":"open app in a web browser"
"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"
"plugins\:update":"updates all plugins or a single plugin by name"
"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 \
'(-a|--app)'{-a,--app}'[the app name]' \
'(-r|--remote)'{-r,--remote}'[the git remote name]:remote:->remotes' \
&& return 0
__heroku_git_remotes () {
local expl gitdir remotes
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
__heroku_git_command_successful || return
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
__heroku_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
}
__heroku_git_command_successful () {
if (( ${#pipestatus:#0} > 0 )); then
_message 'not a git repository'
return 1
fi
return 0
}
case $state in
(remotes)
__heroku_git_remotes && return 0
;;
esac
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,177 +0,0 @@
#compdef hledger
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for hleder 0.23.2 ( http://hledger.org/ )
# Last updated: 16.11.2014
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Valodim ( https://github.com/Valodim )
#
# ------------------------------------------------------------------------------
# Notes
# -----
#
# account completion depends on availability of a ~/.hledger.journal file
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" curstate state line expl grp cmd ret=1
typeset -a args
typeset -A opt_args
args=(
'(- *)'{-h,--help}'[print help information]'
'(-f --file)'{-f,--file}'=[use a different input file]:input file:_files'
'--rules-file=[CSV conversion rules file]:rules file:_files'
'--alias=[display accounts named OLD as NEW]:alias specification'
'(-b --begin)'{-b,--begin}'=[include postings/txns on or after this date]:date'
'(-e --end)'{-e,--end}'=[include postings/txns before this date]:date'
'(-D --daily)'{-D,--daily}'[multiperiod/multicolumn report by day]'
'(-W --weekly)'{-W,--weekly}'[multiperiod/multicolumn report by week]'
'(-M --monthly)'{-M,--monthly}'[multiperiod/multicolumn report by month]'
'(-Q --quarterly)'{-Q,--quarterly}'[multiperiod/multicolumn report by quarter]'
'(-Y --yearly)'{-Y,--yearly}'[multiperiod/multicolumn report by year]'
'(-p --period)'{-p,--period}'=[set start date, end date, and/or reporting interval all at once]'
'(-C --cleared)'{-C,--cleared}'[include only cleared postings/txns]'
'(-U --uncleared)'{-U,--uncleared}'[include only uncleared postings/txns]'
'(-R --real)'{-R,--real}'[include only non-virtual postings]'
'(--depth)--depth=[hide accounts/postings deeper than N]:depth'
'(-E --empty)'{-E,--empty}'[show empty/zero things which are normally omitted]'
'(-B --cost)'{-B,--cost}'[show amounts in their cost price'\''s commodity]'
)
_arguments -C "$args[@]" -A "-*" \
'(- *)--version[print version information]' \
'--debug[show debug output]' \
'1: :->cmds' \
'*:: :->args' && ret=0
while (( $#state )); do
curstate=$state
shift state
case $curstate in
cmds)
typeset -a cmds
cmds=(
'print:show transaction entries'
'accounts:show account names'
'balance:show accounts and balances (bal)'
'register:show postings and running total (reg)'
'incomestatement:show an income statement (is)'
'balancesheet:show a balance sheet (bs)'
'cashflow:show a cashflow statement (cf)'
'activity:show an ascii barchart of posting counts per interval'
'stats:show some journal statistics'
)
_describe 'subcommands' cmds && ret=0
;;
args)
: $words
local cmd=$words[1]
(( $+cmd )) || return 1
# curcontext="${curcontext%:*:*}:$service-$cmd:"
case $cmd in
accounts)
args+=(
'(--tree)--tree[show accounts as a tree (default in simple reports)]'
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
'(--drop)--drop=[flat mode, omit N leading account name parts]:drop n'
)
;;
activity)
;;
bal|balance)
args+=(
'(--tree)--tree[show accounts as a tree (default in simple reports)]'
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
'(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n'
'(--format)--format=[in tree mode, use this custom line format]:custom line format'
'(--no-elide)--no-elide[tree mode, do not squash boring parent accounts]'
'(--no-total)--no-total[do not show the final total]'
'(--cumulative)--cumulative[multicolumn mode, show accumulated ending balances]'
'(-H --historical)'{-H,--historical}'[multicolumn mode, show historical ending balances]'
)
;;
cashflow|cf|balancesheet|bs|incomestatement|is)
args+=(
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
'(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n'
)
;;
print)
;;
register|reg)
args+=(
'(-H --historical)'{-H,--historical}'[include prior postings in the running total]'
'(-A --average)'{-A,--average}'[show a running average instead of the running total]'
'(-r --related)'{-r,--related}'[show postings'\'' siblings instead]'
'(-w --width)'{-w,--width}'=[set output width to 120, or N]:width (default 80)'
)
;;
stats)
;;
# fallback to _default
*) _arguments -C -A "-*" "$args[@]" \
'*: :_default' && ret=0
continue
esac
_arguments -C -A "-*" "$args[@]" \
'*:query patterns:->query' && ret=0
;;
query)
local -a accs keywords
keywords=(
'code\::match by transaction code'
'desc\::match transaction descriptions'
'tag\::match by tag name'
'depth\::match at or above depth'
'status\::match cleared/uncleared transactions'
'real\::match real/virtual transactions'
'empty\::match if amount is/is not zero'
'amt\::match transaction amount'
)
if compset -P 'amt:'; then
_message 'match amount (<, <=, >, >=, add sign for non-absolute match)' && ret=0
continue
fi
if compset -P '(#b)(code|desc|tag|depth|status|real|empty):'; then
_message "'$match[1]' parameter" && ret=0
continue
fi
accs=( ${(f)"$(_call_program hledger hledger accounts $PREFIX 2>/dev/null)"} )
if (( $? )); then
_message "error fetching accounts from hledger"
fi
# decided against partial matching here. these lines can
# be uncommented to complete subaccounts hierarchically
# (add -S '' -q to the compadd below, too)
# if compset -P '(#b)(*):'; then
# accs=( ${(M)accs:#$match[1]:*} )
# accs=( ${accs#$IPREFIX} )
# fi
# accs=( ${accs%%:*} )
_wanted accounts expl "accounts" compadd -a accs && ret=0
_describe "matcher keywords" keywords -S '' && ret=0
# not is special, it doesn't need the -S ''
keywords=(
'not:negate expression'
)
_describe "matcher keywords" keywords && ret=0
;;
esac
done
return ret

View File

@@ -0,0 +1,53 @@
#compdef homestead
# ------------------------------------------------------------------------------
# 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 homestead (http://laravel.com/docs/homestead).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * loranger (https://github.com/loranger)
#
# ------------------------------------------------------------------------------
_homestead_get_command_list () {
homestead --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }'
}
_homestead () {
if [ -f homestead ]; then
compadd `_homestead_get_command_list`
fi
}
compdef _homestead php homestead
compdef _homestead homestead

View File

@@ -36,6 +36,7 @@
#
# * Akira Maeda <https://github.com/glidenote>
# * Valodim <https://github.com/Valodim>
# * Claus Klingberg <https://github.com/cjk>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
@@ -72,16 +73,18 @@ _httpie_params () {
compset -P '(#b)([^:@=]#)'
local name=$match[1]
if compset -P ':'; then
_message "$name header content"
if compset -P '='; then
_message "$name data field value"
elif compset -P '@'; then
_files
elif compset -P ':=@'; then
_files
elif compset -P ':='; then
_message "$name raw json data"
elif compset -P '=='; then
_message "$name url parameter value"
elif compset -P '='; then
_message "$name data field value"
elif compset -P ':'; then
_message "$name header content"
else
typeset -a ops
ops=(
@@ -90,6 +93,7 @@ _httpie_params () {
'==:request parameter'
'@:data file field'
'\:=:raw json field'
'\:=@:raw json field file path'
)
_describe -t httpparams "parameter types" ops -Q -S ''
fi

View File

@@ -0,0 +1,84 @@
#compdef ibus
# ------------------------------------------------------------------------------
# Copyright (c) 2017 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 ibus (https://github.com/ibus/ibus).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Tomo Kazahaya <https://github.com/tomonacci>
#
# ------------------------------------------------------------------------------
# The completion of "ibus emoji --lang=" depends on _language_codes from
# https://github.com/zsh-users/zsh-completions.
local context state state_descr line
typeset -A opt_args
local curcontext=$curcontext
_arguments -C \
":command:(($(ibus help|sed -ne 's/^ \(\S\+\) \+\(.*\)/"\1\\:\2"/p')))" \
'*:: :->args' \
&& return
case $state in
args)
case $line[1] in
engine)
_arguments \
":engine:(($(ibus list-engine|sed -ne 's/:/\\\\:/g' -e 's/^ \(\S\+\) - \(.*\)$/"\1:\2"/p')))" \
&& return
;;
read-cache)
_arguments \
'--system[show the content of the system registry cache]' \
'--file=[custom registry cache to show]:registry cache:_files' \
&& return
;;
write-cache)
_arguments \
'--system[save the system registry cache]' \
'--file=[custom registry cache to save]:registry cache:_files' \
&& return
;;
emoji)
_arguments \
'--font=[emoji font]:emoji font: ' \
'--lang=[language of emoji annotations]:language:_language_codes ISO-639-1' \
'--partial-match[match annotations with a partial string]' \
&& return
;;
esac
;;
esac
return 1

View File

@@ -1,70 +0,0 @@
#compdef id3
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for id3, based on v0.15
#
# Last updated: 03.04.2013
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Valodim ( https://github.com/Valodim )
#
# ------------------------------------------------------------------------------
_id3_genre () {
setopt localoptions extendedglob
local -A _id3_genres
# got them cached?
if _cache_invalid id3-genres || ! _retrieve_cache id3-genres ; then
# generate from id3 -L otherwise
local tmp
for line in ${${${(f)"$(_call_program id3genre id3 -L)"}## #}}; do
tmp=( ${(s,: ,)line} )
_id3_genres[${tmp[1]}]=$tmp[2]
# alternate display string, which I decided against in the end
# to preserve reasonable alphabetic sorting
# "${(l:3:: :)${tmp[1]}}: ${tmp[2]}"
done
# store if we got any
(( $#_id3_genres > 0 )) && _store_cache id3-genres _id3_genres
fi
# bail if we don't
(( $#_id3_genres > 0 )) || { _message "could not fetch genres"; return }
_wanted id3genres expl 'Genres' \
compadd -d _id3_genres -k _id3_genres && return 0
}
# only show files if at least one argument or something has been provided
local showfiles=''
(( CURRENT <= 2 )) && showfiles='!'
_arguments \
- tagging \
'-t[modify title tag]:title' \
'-T[modify track tag]:track' \
'-a[modify artist tag]:artist' \
'-A[modify album tag]:album' \
'-y[modify year tag]:year' \
'-c[modify comment tag]:comment' \
'-g[modify genre tag]:genre:_id3_genre' \
'(-)-l[lists tags]' \
'-R[use rfc822-style format for output]' \
'(-)-d[delete id3 tag]' \
$showfiles'*:mp3 file:_files -g \*.mp3' \
- meta \
'(- *)-L[list all genres]' \
'(- *)-h[display help info]' \
'(- *)-v[print version info]' && return 0

View File

@@ -1,116 +0,0 @@
#compdef id3v2
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for id3v2, based on v0.1.12
#
# Last updated: 05.04.2013
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Valodim ( https://github.com/Valodim )
#
# ------------------------------------------------------------------------------
_id3v2_genre () {
setopt localoptions extendedglob
local -A _id3v2_genres
# got them cached?
if _cache_invalid id3v2-genres || ! _retrieve_cache id3v2-genres ; then
# generate from id3 -L otherwise
local tmp
for line in ${${${(f)"$(_call_program id3v2genres id3v2 -L)"}## #}}; do
tmp=( ${(s,: ,)line} )
_id3v2_genres[${tmp[1]}]=$tmp[2]
# alternate display string, which I decided against in the end
# to preserve reasonable alphabetic sorting
# "${(l:3:: :)${tmp[1]}}: ${tmp[2]}"
done
# store if we got any
(( $#_id3v2_genres > 0 )) && _store_cache id3v2-genres _id3v2_genres
fi
# bail if we don't
(( $#_id3v2_genres > 0 )) || { _message "could not fetch genres"; return }
_wanted id3v2genres expl 'Genres' \
compadd -d _id3v2_genres -k _id3v2_genres && return 0
}
# this function assumes _id3v2_frames is defined!
_id3v2_frame () {
(( $#_id3v2_frames > 0 )) || { _message "could not fetch genres"; return }
local -a framenames
framenames=( ${_id3v2_frames#--} )
_describe -t framenames 'id3v2 frames' framenames
}
_id3v2 () {
setopt localoptions extendedglob
# previous word was a frame name? this is an argument, then.
if [[ $words[$CURRENT-1] == --[A-Z](#c4) ]]; then
_message 'frame value'
return 0
fi
# load frame names
local -a _id3v2_frames
if _cache_invalid id3v2-frames || ! _retrieve_cache id3v2-frames ; then
_id3v2_frames=( ${${${(f)"$(_call_program id3v2frames id3v2 -f)"}## #}/ /:} )
(( $#_id3v2_frames > 0 )) && _store_cache id3v2-frames _id3v2_frames
fi
local ret=1
# if we already have a -- prefix, show all those frames
if [[ -prefix -- ]] && (( $#_id3v2_frames > 0 )); then
_describe -t frames 'id3v2 frames' _id3v2_frames && ret=0
fi
local showfiles=''
(( CURRENT <= 2 )) && showfiles='!'
# regular arguments either way
_arguments \
- tagging \
'(-s --delete-v1 -d --delete-v2)'{-s,--delete-v1}'[deletes id3v1 tags]' \
'(-s --delete-v1 -d --delete-v2)'{-d,--delete-v2}'[deletes id3v2 tags]' \
'(-C --convert)'{-C,--convert}'[converts id3v1 tag to id3v2]' \
'(-1 --id3v1-only -2 --id3v2-only)'{-1,--id3v1-only}'[write only id3v1 tag]' \
'(-1 --id3v1-only -2 --id3v2-only)'{-2,--id3v2-only}'[write only id3v2 tag]' \
'(-r --remove-frame)'{-r,--remove-frame}'[removes specified id3v2 frame]:frame id:_id3v2_frame' \
'(-a --artist)'{-a,--artist}'[set artist]:artist' \
'(-A --album)'{-A,--album}'[set album title]:album' \
'(-t --song)'{-t,--song}'[set song title]:song title' \
'(-c --comment)'{-c,--comment}'[set comment field]' \
'(-g --genre)'{-g,--genre}'[set the genre number]:genre:_id3v2_genre' \
'(-y --year)'{-y,--year}'[set the year]:year' \
'(-T --track)'{-T,--track}'[set the track number/(optional) total tracks]:track number (current/total)' \
'(-R --list-rfc822)'{-R,--list-rfc822}'[lists using an rfc822-style format for output]' \
'(-)'{-D,--delete-all}'[deletes both id3v1 and id3v2 tags]' \
'(-)'{-l,--list}'[lists the tag(s) on the file(s)]' \
$showfiles'*:mp3 file:_files -g "*.mp3"' \
- meta \
'(- *)'{-f,--list-frames}'[display all possible frames for id3v2]' \
'(- *)'{-L,--list-genres}'[lists all id3v1 genres]' \
'(- *)'{-h,--help}'[display help and exit]' \
'(- *)'{-v,--version}'[display version information and exit]' && ret=0
return ret
}
_id3v2 "$@"

View File

@@ -1,247 +0,0 @@
#compdef iw
# Some parameters to hold patterns that will be used later.
local xp='[[:xdigit:]][[:xdigit:]]'
local -a bssid devices flags fouraddr fouronoff frequency high_throughput ifacename ifacetype ifacetypes
local -a matchany matchnum key lladdr lladdrs meshid meshidval ssid value
# matches any word
matchany=(/$'[^\0]##\0'/)
# matches any number
matchnum=(/$'[[:digit:]]##\0'/)
# matches any BSSID
bssid=($matchany ':bssid:BSSID:')
# matches any devices
devices=( /$'[[:alpha:]]##[[:digit:]]##(\.[[:digit:]]##)#\0'/ ':interfaces:network_interface:_net_interfaces' )
# matches the word 'flags' followed by a list of some of the following words: none fcsfail control otherbss cook
flags=(/$'flags\0'/ ':flags:flags:(flags)' $matchany ':flags:flags:(none fcsfail control otherbss cook)' \#)
# matches the word '4addr' followed by either 'on' or 'off'
fouronoff=(/$'(on|off)\0'/ ':4addr:4addr:(on off)')
fouraddr=( /$'4addr\0'/ ':4addr:4addr:(4addr)' $fouronoff )
# matches any number (description is 'frequency')
frequency=($matchnum ':freq:frequency:')
# matches one of HT20 HT40+ or HT40-
high_throughput=(/$'HT[0-9]##(+|-)#\0'/ ':HT:high throughput:(HT20 HT40+ HT40-)')
# matches any name (description is 'name')
ifacename=($matchany ':name:name:')
# matches the word 'type' followed by one of: managed ibss monitor mesh wds
ifacetypes=(/$'(managed|ibss|monitor|mesh|wds)\0'/ ':type:type:(managed ibss monitor mesh wds)')
ifacetype=(/$'type\0'/ ':type:type:(type)' $ifacetypes)
# matches any word (description is 'key')
key=($matchany ':key:key:')
# matches a MAC address (i.e. a sequence of six 2-digit numbers separated by spaces), $xp is defined earlier.
lladdr=(/"${xp}:${xp}:${xp}:${xp}:${xp}:${xp}"$'\0'/ ':lladdress:link layer (MAC) address:')
# as above but with a different description
lladdrs=(/"${xp}:${xp}:${xp}:${xp}:${xp}:${xp}"$'\0'/ ':lladdress:link layer (MAC) addresses (use - to match any octet):' \#)
# matches the word 'mesh_id' followed by a number
meshidval=($matchnum ':meshid:mesh ID:')
meshid=(/$'mesh_id\0'/ ':meshid:meshid:(mesh_id)' $meshidval)
# matches any word (description 'SSID')
ssid=($matchany ':ssid:SSID:')
# matches any word (description 'value')
value=($matchany ':val:value:')
# matches any number (description 'value')
numvalue=($matchnum ':val:value:')
# Use the _regex_words function to create a variable containing command words to go after "iw reg"
local -a reg_cmds
_regex_words regulatory-commands "reg command" \
'g*et:print out the kernels current regulatory domain information'\
's*et:notify the kernel about the current regulatory domain'
reg_cmds=("$reply[@]")
# Options for to go after "iw event"
local -a event_opts
_regex_words event-options "event option" \
'-t:print timestamp' \
'-r:print relative timestamp' \
'-f:print full frame for auth/assoc etc'
event_opts=("$reply[@]")
# Commands to go after "iw phy <DEV> wowlan enable"
local -a phy_wowlan_enable_cmds
_regex_words phy-wowlan-enable-commands "phy WoWLAN enable commands" \
'4*way-handshake:enable WoWLAN with 4way handshake trigger' \
'a*ny:enable WoWLAN with any trigger' \
'd*isconnect:enable WoWLAN with disconnect trigger' \
'e*ap-identity-request:enable WoWLAN with EAP identity request trigger' \
'g*tk-rekey-failure:enable WoWLAN with gtk rekey failure trigger' \
'm*agic-packet:enable WoWLAN with magic packet trigger' \
'p*atterns:MAC address triggers:$lladdrs' \
'r*fkill-release:enable WoWLAN with rfkill release trigger'
phy_wowlan_enable_cmds=("$reply[@]")
# Commands to go after "iw phy <DEV> wowlan"
local -a phy_wowlan_cmds
_regex_words phy-wowlan-commands "phy WoWLAN commands" \
's*how:show WoWLAN status' \
'd*isable:disable WoWLAN' \
'e*nable:enable WoWLAN:$phy_wowlan_enable_cmds'
phy_wowlan_cmds=("$reply[@]")
# Some parameters to hold patterns that will be used for "iw phy set" commands
# (not perfect, but mostly OK).
local -a phy_set_antenna phy_set_channel phy_set_coverage phy_set_frag phy_set_freq phy_set_distance
local -a phy_set_name phy_set_netns phy_set_rts phy_set_txpower phy_txpower_opt
phy_set_antenna=($matchany ':antenna:bitmap:')
phy_set_channel=($matchnum ':channel:channel (1-14):' $high_throughput)
phy_set_coverage=($matchnum ':coverage:coverage class (0-255):')
phy_set_distance=($matchnum ':distance:valid values\: 0 - 114750:')
phy_set_frag=(/$'([0-9]##|off)\0'/ ':channel:channel (1-14):(1 2 3 4 5 6 7 8 9 10 11 12 13 14 off)')
phy_set_freq=($frequency $high_throughput)
phy_set_name=($matchany ':name:device name:')
phy_set_netns=($matchany ':netns:network namespace:')
phy_set_rts=($matchnum ':rts:rts threshold:')
phy_txpower_opt=($matchany ':txpower:tx power in mBm:')
_regex_words phy-set-txpower "set txpower" \
'a*uto:auto:' \
'f*ixed:fixed:$phy_txpower_opt' \
'l*imit:limit:$phy_txpower_opt'
phy_set_txpower=("$reply[@]")
# Commands to go after "iw phy <DEV> set"
local -a phy_set_cmds
_regex_words phy-set-commands "phy set commands" \
'a*ntenna:set a bitmap of allowed antennas to use for TX and RX:$phy_set_antenna' \
'ch*annel:set channel:$phy_set_channel' \
'co*verage:set coverage class (1 for every 3 usec of air propagation time):$phy_set_coverage' \
'd*istance:set appropriate coverage class for given link distance in meters:$phy_set_distance' \
'fra*g:set fragmentation threshold:$phy_set_frag' \
'fre*q:set frequency/channel the hardware is using, including HT configuration:$phy_set_freq' \
'na*me:rename this wireless device:$phy_set_name' \
'ne*tns:set network namespace:$phy_set_netns' \
'r*ts:set rts threshold:$phy_set_rts' \
't*xpower:specify transmit power level and setting type:$phy_set_txpower'
phy_set_cmds=("$reply[@]")
# Commands to go after "iw phy <DEV> interface"
local -a phy_interface_cmds
# This needs work (should not offer meshid, fouraddr of flags more than once, and need to accomodate multiple flag options)
phy_interface_cmds=(\( /$'add\0'/ ':add:add a new virtual interface with the given configuration:(add)' $ifacename $ifacetype \
\( $meshid \| $fouraddr \| $flags \) \# \))
# Commands to go after "iw phy <DEV>"
local -a phy_cmds
_regex_words phy-commands "phy command" \
's*et:set/configure interface properties:$phy_set_cmds' \
'inf*o:show capabilities for the specified wireless device' \
'int*erface:add a new virtual interface with the given configuration:$phy_interface_cmds' \
'w*owlan:WoWLAN commands:$phy_wowlan_cmds'
phy_cmds=("$reply[@]")
# Parameters to hold patterns for dev commands
local -a dev_cmds_connect dev_cmds_cqm dev_cmds_get dev_cmds_ibss dev_cmds_interface dev_cmds_mesh dev_cmds_scan_options
local -a dev_cmds_mpath dev_cmds_offchannel dev_cmds_roc dev_cmds_scan dev_cmds_set dev_cmds_station dev_cmds_survey
dev_cmds_connect=($ssid $frequency $bssid $key)
dev_cmds_cqm=(/$'rssi\0'/ ':rssi:rssi:(rssi)' $matchnum ':thresh:threshold:' $matchnum ':hysteresis:hysteresis:')
dev_cmds_get=(/$'(mesh_param|power_save)\0'/ ':get:parameter:(mesh_param power_save)' $value)
# TODO: THIS NEEDS WORK! THE FINAL OPTIONS FOR JOIN NEED WORK
# dev <devname> ibss join <SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [beacon-interval <TU>] [basic-rates <rate in Mbps,rate2,...>] [mcast-rate <rate in Mbps>] [key d:0:abcde]
dev_cmds_ibss=(\( /$'leave\0'/ ':cmd:command:((leave:"Leave the IBSS cell"))' \| \( /$'join\0'/ ':cmd:command:((join\:"Join an IBSS cell"))' $ssid $frequency \( /$'fixed-freq\0'/ ':opt:option:((fixed-freq\:"fixed frequency (no args)"))' \| $bssid \| /$'beacon-interval\0'/ ':opt:option:((beacon-interval\:"beacon interval (takes single arg)"))' $numvalue \| /$'basic-rates\0'/ ':opt:option:((basic-rates\:"basic rates (comma separated list of rates)"))' $numvalue \| /$'mcast-rate\0'/ ':opt:option:((mcast-rate\:"multicast rate (takes single arg)"))' $numvalue \| $key \) \# \) \))
dev_cmds_interface=(/$'add\0'/ ':add:add:(add)' $ifacename $ifacetype \( $meshid \| $fouraddr \| $flags \) \# )
dev_cmds_mesh=(\( /$'leave\0'/ ':leave:leave a mesh:(leave)' \| /$'join\0'/ ':join:join a mesh:(join)' \
$matchnum ':meshid:mesh ID:' $matchany ':parameter:mesh parameters [<param>=<value>]*:' \# \))
dev_cmds_mpath=(\( /$'(del|get)\0'/ ':mpath:mesh path command:((del\:"remove the mesh path to the given node" \
get\:"get information on mesh path to the given node"))' $lladdr \| /$'(new|set)\0'/ ':mpath:mesh path \
command:((new\:"create a new mesh path (instead of relying on automatic discovery)" set\:"set an existing mesh \
paths next hop"))' $lladdr /$'next_hop\0'/ ':nexthop:next hop:(next_hop)' $lladdr \| /$'dump\0'/ ':mpath:mesh path \
command:((dump\:"list known mesh paths"))' \))
dev_cmds_offchannel=($frequency $matchnum ':duration:duration:')
dev_cmds_roc=(/$'start\0'/ ':start:start:(start)' $frequency $matchnum ':time:time:')
dev_cmds_scan_options=(/$'freq\0'/ ':freq:freq:(freq)' $frequency $frequency \# /$'ies\0'/ ':ies:ies:(ies)' $lladdr \( /$'ssid\0'/ ':ssid:ssid:(ssid)' $ssid \# \| /$'passive\0'/ ':opt:passive:(passive)' \))
dev_cmds_scan=(\( $dev_cmds_scan_options \| $matchany -'! [[ $match[1] =~ "dump|trigger" ]]' ':opt:option:((-u\:"include unknown data in results" \:""))' $dev_cmds_scan_options \| /$'dump\0'/ ':cmd:command:((dump\:"dump the current scan results"))' $matchany ':opt:option:((-u\:"include unknown data in results" \:""))' \| /$'trigger\0'/ ':cmd:command:((trigger\:"trigger a scan on the given frequencies with probing for the given SSIDs (or wildcard if not given) unless passive scanning is requested"))' $dev_cmds_scan_options \))
local -a dev_cmds_set_bitrates dev_cmds_set_freq dev_cmds_set_mesh_param
local -a dev_cmds_set_monitor dev_cmds_set_peer dev_cmds_set_power_save
local -a dev_cmds_set_type dev_cmds_set_txpower
# dev <devname> set bitrates [legacy-<2.4|5> <legacy rate in Mbps>*]
dev_cmds_set_bitrates=(/$'legacy-*\0'/ ':opt:legacy:(legacy-2.4 legacy-2.5)' $matchnum ':rate:legacy rate in Mbps:')
# dev <devname> set freq <freq> [HT20|HT40+|HT40-]
dev_cmds_set_freq=($frequency $high_throughput)
# dev <devname> set mesh_param <param>=<value> [<param>=<value>]*
dev_cmds_set_mesh_param=( $matchany ':val:param=value:' \# )
# dev <devname> set monitor <flag>*
dev_cmds_set_monitor=( $matchany ':flag:flag:((none\:"no special flags" fcsfail\:"show frames with FCS errors"\
control\:"show control frames" otherbss\:"show frames from other BSSes" cook\:"use cooked mode"))' \# )
# dev <devname> set peer <MAC address>
dev_cmds_set_peer=($lladdr)
# dev <devname> set power_save <on|off>
dev_cmds_set_power_save=(/$'(on|off)\0'/ ':opt:power save mode:(on off)')
_regex_words setcmds "dev set commands" \
'4*addr:set interface 4addr (WDS) mode:$fouronoff'\
'b*itrates:set/clear specified rate masks:$dev_cmds_set_bitrates'\
'c*hannel:set channel:$phy_set_channel'\
'f*req:set frequency:$dev_cmds_set_freq'\
'mesh_param:set mesh parameters:$dev_cmds_set_mesh_param'\
'meshid:set mesh id:$meshidval'\
'mo*nitor:set monitor flags:$dev_cmds_set_monitor'\
'pe*er:set interface WDS peer MAC address:$dev_cmds_set_peer'\
'po*wer_save:set power save on/off:$dev_cmds_set_power_save'\
'tx*power:set transmission power:$phy_set_txpower'\
'ty*pe:set type:$ifacetypes'
dev_cmds_set=("$reply[@]")
local -a dev_cmds_station_plink dev_cmds_station_vlan
dev_cmds_station_plink=(/$'(open|block)\0'/ ':opt::(open block)')
dev_cmds_station_vlan=($matchnum ':val:ifindex:')
local -a dev_cmds_station_set
_regex_words stationsetcmds "dev station set commands"\
'plink_action:set peer link action:$dev_cmds_station_plink'\
'vlan:set AP VLAN:$dev_cmds_station_vlan'
dev_cmds_station_set=(\( $lladdr \) "$reply[@]")
_regex_words stationcmds "dev station commands" \
'del:remove the given station entry (use with caution!):$lladdr'\
'dump:list all stations known, e.g. the AP on managed interfaces:'\
'get:get information for a specific station:$lladdr'\
'set:set AP VLAN or mesh peer link action:$dev_cmds_station_set'
dev_cmds_station=("$reply[@]")
dev_cmds_survey=(/$'dump\0'/ ':dump:list all gathered channel survey data:(dump)')
local -a dev_cmds
_regex_words dev-commands "dev commands" \
'co*nnect:join a network:$dev_cmds_connect' \
'cq*m:set connection quality monitor RSSI threshold:$dev_cmds_cqm' \
'de*l:remove this virtual interface' \
'di*sconnect:disconnect from the current network' \
'g*et:retrieve mesh parameter / power save state:$dev_cmds_get' \
'ib*ss:join/leave IBSS cell:$dev_cmds_ibss' \
'inf*o:show information for this interface' \
'int*erface:add an interface:$dev_cmds_interface' \
'l*ink:print information about the current link, if any' \
'me*sh:join/leave a mesh:$dev_cmds_mesh' \
'mp*ath:mesh path commands:$dev_cmds_mpath' \
'o*ffchannel:leave operating channel and go to the given channel for a while:$dev_cmds_offchannel' \
'r*oc:roc:$dev_cmds_roc' \
'sc*an:scan:$dev_cmds_scan' \
'se*t:set interface parameter:$dev_cmds_set' \
'st*ation:station commands:$dev_cmds_station' \
'su*rvey:list all gathered channel survey data:$dev_cmds_survey'
dev_cmds=( $devices "$reply[@]")
# Arguments to _regex_arguments, built up in array $args.
local -a args reply
# Command word. Don't care what that is.
args=( $matchany )
local -a phydevs
phy_devs=( \( $(iw list|grep '^[[:alnum:]]\+'|cut -f 2 -d ' ') \) )
phy_cmds=( \( $matchany ":test:test:$phy_devs[*]" \) "$phy_cmds[@]" )
_regex_words commands "iw command" \
'd*ev:commands to control/list the software devices:$dev_cmds' \
'e*vent:monitor events from the kernel:$event_opts' \
'h*elp:print usage for each command' \
'l*ist:list all wireless devices and their capabilities' \
'p*hy:commands to control the physical device:$phy_cmds' \
'r*eg:get/set regulatory domain:$reg_cmds'
args+=("$reply[@]")
_regex_arguments _iw "${args[@]}"
_iw "$@"
# Local Variables:
# mode:shell-script
# End:

View File

@@ -1,145 +0,0 @@
#compdef jekyll
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for jekyll(http://jekyllrb.com)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * farseer90718 (https://github.com/farseer90718)
#
# ------------------------------------------------------------------------------
local ret=1 state
local -a common_ops
common_ops=(
{-v,--version}"[Display version information]"
{-h,--help}"[Display help documentation]"
{-p,--plugins}"[Plugins directory (defautls to ./_plugins)]: :_directories"
{-s,--source}"[Source directory (defaults to ./)]: :_directories"
{-d,--destination}"[Destination directory (defautls to ./_site)]: :_directories"
"--layouts=[Layouts directory (defaults to ./_layouts)]: :_directories"
"--safe=[Safe mode (defaults to false)]"
)
typeset -A opt_args
_arguments \
':subcommand:->subcommand' \
$common_ops \
'*::options:->options' && ret=0
case $state in
subcommand)
local -a subcommands
subcommands=(
"build:Build your site"
"docs:Launch local server with docs for jekyll"
"doctor:Search site and print specific deprecation warnings"
"help:Display global or [command] help documentation"
"import:Import your old blog to Jekyll"
"new:Creates a new Jekyll site scaffold in PATH"
"serve:Serve your site locally"
)
_describe -t subcommands 'jekyll subcommand' subcommands && ret=0
;;
options)
local -a args
args=(
$common_ops
)
local -a config
config=(
"--config[Custom configuration file]: :_files"
)
local -a help
help=(
{-h,--help}"[Display help information]"
)
local -a build
build=(
{-w,--watch}"[Watch for changes and rebuild]"
"--limit_posts[Limits the number of posts to parse and publish]"
"--future[Publishes posts with a future date]"
"--lsi[Use LSI for improved related posts]"
"--drafts[Render posts in the _drafts folder]"
)
case $words[1] in
help)
args=()
compadd "$@" build docs doctor help import new serve
;;
build)
args+=(
$build
$config
)
;;
docs)
args=(
{-p,--port}"[Port to listen on]: :_ports"
{-u,--host}"[Host to bind to]: :_hosts"
$help
)
;;
doctor)
args+=(
$config
)
;;
import)
args=(
"--source[Source file or URL to migrate from]:url"
"--file[File to migrate from]: :_files"
"--dbname[Database name to migrate from]:database"
"--user[Username to use when migrating]:user"
"--pass[Password to use when migrating]:password"
"--host[Host address to use when migrating]:url"
$help
)
;;
new)
args=(
": :_directories"
"--force[Force creation even if PATH already exists]"
"--blank[Creates scaffolding but with empty files]"
$help
)
;;
serve)
args+=(
$build
$config
{-P,--port}"[Port to listen on]: :_posts"
{-H,--host}"[Host to bind to]: :_hosts"
{-b,--baseurl}"[Base URL]:url"
)
esac
_arguments $args && ret=0
;;
esac
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -0,0 +1,65 @@
#compdef jrnl
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 jrnl a simple journal application for your command line. (https://maebert.github.io/jrnl/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
_jrnl() {
_arguments -C \
'(- 1 *)'-h"[Show help and exit]" \
'(- 1 *)'-v"[Prints version information and exits]" \
'(- 1 *)'-ls"[Displays accessible journals]" \
'(- 1 *)'-d"[Execute in debug mode]" \
'(- 1 *)'--tags"[Returns a list of all tags and number of occurences]" \
"--short[Show only titles or line containing the search]" \
"-from[View entries after this date]:date:" \
"-until[View entries before this date]:date:" \
"-to[View entries before this date]:date:" \
"-on[View entries on this date]:date:" \
"-and[Filter by tags using AND (default: OR)]" \
"-starred[Show only starred entries]" \
"-n[Shows the last n entries matching the filter. And '-3' have the same effect.]":number: \
"--export[Export your journal. TYPE can be json, markdown text.]:format:(json markdown text)" \
"-o[Optionally specifies output file when using --export If OUTPUT is a directory, exports each entry in individual file instead.]:output file:" \
"--encrypt[Encrypts your existing journal with a new pass]" \
"--decrypt[Decrypts your journal and stores it in plain text]" \
}
_jrnl

View File

@@ -0,0 +1,69 @@
#compdef kak
# ------------------------------------------------------------------------------
# Copyright (c) 2017 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 kak (https://github.com/mawww/kakoune)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Frank LENORMAND <https://github.com/lenormf>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_kak_sessions() {
session_ids=($(_call_program session_ids kak -l))
_values "${session_ids[@]}"
}
_kak() {
_arguments \
'-n[do not source rc files on startup]' \
'-l[list existing sessions]:session_id:_kak_sessions' \
'-clear[clear dead sessions]' \
'-ro[readonly mode]' \
'(-help --help)'{-help,--help}'[display a help message and quit]' \
'-d[run as a headless session (requires -s)]' \
'-q[in filter mode, be quiet about errors applying keys]' \
'-c[connect to given session]:session_id:_kak_sessions' \
'-e[execute argument on client initialisation]:keys' \
'-E[execute argument on server initialisation]:keys' \
'-s[set session name]:session_id' \
'-p[just send stdin as commands to the given session]:session_id:_kak_sessions' \
'-f[act as a filter, executing given keys on given files]:keys' \
'-i[backup the files on which a filter is applied using the given suffix]:suffix' \
'-ui[set the type of user interface to use (ncurses, dummy, or json)]:ui_type:(ncurses dummy json)' \
'*::files:_files'
}
_kak "$@"

View File

@@ -1,5 +1,26 @@
#compdef knife
# ------------------------------------------------------------------------------
# Copyright (c) 2009-2015 Robby Russell and contributors (see
# https://github.com/robbyrussell/oh-my-zsh/contributors)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
@@ -44,7 +65,7 @@ _knife() {
case $state in
knifecmd)
compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" environment user exec index node recipe role search ssh status windows $cloudproviders
compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff environment user exec index node recipe role search ssh status windows $cloudproviders
;;
knifesubcmd)
case $words[2] in
@@ -60,6 +81,9 @@ _knife() {
cookbook)
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
;;
diff)
_arguments '*:file or directory:_files -g "*.(rb|json)"'
;;
environment)
compadd -Q "$@" create delete edit "from file" list show
;;
@@ -195,7 +219,7 @@ _chef_users_remote() {
# 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)
(for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' | cut -d '"' -f2 ); do ls $i; done)
}
# This function extracts the available cookbook versions on the chef server

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -1,62 +0,0 @@
#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)
#
# ------------------------------------------------------------------------------
local ret=1 state
_arguments ':subcommand:->subcommand' && ret=0
case $state in
subcommand)
subcommands=(
"check:Check syntax and warn on reflection."
"classpath:Print the classpath of the current project."
"clean:Remove all files from project's target-path."
"compile:Compile Clojure source into .class files."
"deploy:Build and deploy jar to remote repository."
"deps:Download all dependencies."
"do:Higher-order task to perform other tasks in succession."
"help:Display a list of tasks or help for a given task."
"install:Install the current project to the local repository."
"jack-in:Jack in to a Clojure SLIME session from Emacs."
"jar:Package up all the project's files into a jar file."
"javac:Compile Java source files."
"new:Generate project scaffolding based on a template."
"pom:Write a pom.xml file to disk for Maven interoperability."
"pprint:Pretty-print a representation of the project map."
"repl:Start a repl session either with the current project or standalone."
"retest:Run only the test namespaces which failed last time around."
"run:Run a -main function with optional command-line arguments."
"search:Search remote maven repositories for matching jars."
"show-profiles:List all available profiles or display one if given an argument."
"test:Run the project's tests."
"trampoline:Run a task without nesting the project's JVM inside Leiningen's."
"uberjar:Package up the project files and dependencies into a jar file."
"upgrade:Upgrade Leiningen to specified version or latest stable."
"version:Print version for Leiningen and the current JVM."
"with-profile:Apply the given task with the profile(s) specified."
)
_describe -t subcommands 'leiningen subcommands' subcommands && ret=0
esac
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,61 +0,0 @@
#compdef logger
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for logger (from bsdutils).
#
# Last updated: 26.02.2013
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Valodim ( https://github.com/Valodim )
#
# ------------------------------------------------------------------------------
_logger_priority() {
local expl
if compset -P '*.'; then
# hidden aliases.. not quite sure how this is supposed to work :\
# compadd -n panic warning error
# just this one tag
_wanted priority expl "Priority" \
compadd -- debug info notice warn err crit alert emerg
return 0
fi
_wanted facility expl "Facility" \
compadd -S '.' -- kern user mail daemon auth syslog lpr news \
uucp cron security ftp ntp logaudit logalert clock \
local0 local1 local2 local3 local4 local5 local6 local7
return 0
}
_logger() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C -S -s \
{-d,--udp}'[use UDP (TCP is default)]' \
{-i,--id}'[log the process ID too]' \
{-f,--file}'[log the contents of this file]:Logfile:_files' \
'(-)'{-h,--help}'[display this help text and exit]' \
{-n,--server}'[write to this remote syslog server]:Server:_hosts' \
{-P,--port}'[use this UDP port]:UDP Port' \
{-p,--priority}'[mark given message with this priority]:Priority:_logger_priority' \
{-s,--stderr}'[output message to standard error as well]' \
{-t,--tag}'[mark every line with this tag]:Tag' \
{-u,--socket}'[write to this Unix socket]:Socket:_files -W *(=)' \
'(-)'{-V,--version}'[output version information and exit]' \
'*:Message:' && return 0
}
_logger "$@"

View File

@@ -0,0 +1,54 @@
#compdef lsattr
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 lsattr a tool which lists file attributes on a Linux second extended file system. (http://e2fsprogs.sourceforge.net/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
_lsattr() {
_arguments -C \
"(-d)-R[Recursively list attributes of directories and their contents.]" \
"-V[Display the program version.]" \
"(-d)-a[List all files in directories, including files that start with '.']" \
"(-a -R)-d[List directories like other files, rather than listing their contents.]" \
"-v[List the file\'s version/generation number.]" \
'*:files:_files' \
}
_lsattr

View File

@@ -0,0 +1,97 @@
#compdef lsblk
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 lsblk (from util-linux 2.27.1->)
# (https://git.kernel.org/cgit/utils/util-linux/util-linux.git/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ole Jørgen Brønner <olejorgenb@yahoo.no>
#
# ------------------------------------------------------------------------------
#
# Note: lsblk has upstream bash completions, which has served as a guide
# Note: Credit to https://github.com/RobSis/zsh-completion-generator which was
# used to generate an initial skeleton
local arguments
local lsblk_cols_all=(
NAME KNAME MAJ:MIN FSTYPE MOUNTPOINT
LABEL UUID PARTTYPE PARTLABEL PARTUUID PARTFLAGS
RA RO RM
MODEL SIZE STATE OWNER GROUP MODE
ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC
ROTA SCHED RQ-SIZE TYPE DISC-ALN
DISC-GRAN DISC-MAX DISC-ZERO WSAME WWN
RAND PKNAME HCTL TRAN REV VENDOR)
_lsblk_columns() {
compadd $@ $lsblk_cols_all
}
_lsblk_major_number() {
# /sys/dev/block/ contains MAJOR:MINOR symlinks. eg. 7:0
local device_paths=(/sys/dev/block/*(N))
local major_numbers=(${${device_paths##*/}%%:*})
# major_numbers might have duplicates but compadd handles that
compadd $@ $major_numbers
}
arguments=(
'(-a --all)'{-a,--all}'[print all devices]'
'(-b --bytes)'{-b,--bytes}'[print size in bytes rather than in human readable format]'
'(-d --nodeps)'{-d,--nodeps}'[dont print slaves or holders]'
'(-D --discard)'{-D,--discard}'[print discard capabilities]'
'(-e --exclude)'{-e,--exclude}'[exclude devices by major number]:major number:_sequence _lsblk_major_number'
'(-f --fs)'{-f,--fs}'[output info about filesystems]'
'(-i --ascii)'{-i,--ascii}'[use ascii characters only]'
'(-I --include)'{-I,--include}'=[show only devices with specified major numbers]:major number:_sequence _lsblk_major_number'
'(-J --json)'{-J,--json}'[use JSON output format]'
'(-l --list)'{-l,--list}'[use list format output]'
'(-m --perms)'{-m,--perms}'[output info about permissions]'
'(-n --noheadings)'{-n,--noheadings}'[dont print headings]'
'(-o --output)'{-o,--output}'=[specify output columns]:output column:_sequence _lsblk_columns'
'(-O --output-all)'{-O,--output-all}'[output all columns]'
'(-p --paths)'{-p,--paths}'[print complete device path]'
'(-P --pairs)'{-P,--pairs}'[use key="value" output format]'
'(-r --raw)'{-r,--raw}'[use raw output format]'
'(-s --inverse)'{-s,--inverse}'[inverse dependencies]'
'(-S --scsi)'{-S,--scsi}'[output info about SCSI devices]'
'(-t --topology)'{-t,--topology}'[output info about topology]'
'(-x --sort)'{-x,--sort}'=[sort output by specified column]:sort column:_lsblk_columns'
'(-h --help)'{-h,--help}'[display this help and exit]'
'(-V --version)'{-V,--version}'[output version information and exit]'
'*:device:_path_files -g "*(N-%) *(N-/)"'
)
_arguments -s $arguments

View File

@@ -1,314 +0,0 @@
#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)
#
# ------------------------------------------------------------------------------
# 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 "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,5 +1,30 @@
#compdef lunchy
# ------------------------------------------------------------------------------
# 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
# -----------
#

View File

@@ -1,270 +0,0 @@
#compdef manage.py django-admin.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)
#
# ------------------------------------------------------------------------------
_managepy-cleanup(){}
_managepy-compilemessages(){}
_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-makemessages(){}
_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-startproject(){
_arguments -s : \
"(-v --verbosity)"{-v,--verbosity}"[Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output.]:Verbosity:((0\:minimal 1\:normal 2\:verbose 4\:very\ verbose))" \
'--template[The path or URL to load the template from.]:file:_files' \
"(-e --extension)"{-e,--extension}"[The file extension(s) to render (default: "py"). Separate multiple extensions with commas, or use -e multiple times.]" \
"(-n --name)"{-n,--name}"[The file name(s) to render. Separate multiple extensions with commas, or use -n multiple times. --version show program\'s version number and exit]:file:_files" \
$nul_args \
'*::args:_gnu_generic'
}
_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-changepassword(){}
_managepy-createsuperuser(){}
_managepy-collectstatic(){}
_managepy-findstatic(){}
_managepy-commands() {
local -a commands
commands=(
'cleanup:Can be run as a cronjob or directly to clean out old data from the database (only expired sessions at the moment).'
'compilemessages:Compiles .po files to .mo files for use with builtin gettext support.'
'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.'
'makemessages:Runs over the entire source tree of the current directory and pulls out all strings marked for translation.'
'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."
"startproject:Creates a Django project directory structure for the given project name in the current directory or the given destination."
"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.'
)
if [[ $words[1] =~ "manage.py$" ]]; then
commands=($commands
"changepassword:Change a user's password for django.contrib.auth."
'createsuperuser:Used to create a superuser.'
'collectstatic:Collect static files in a single location.'
'findstatic:Finds the absolute paths for the given static file(s).'
)
fi
_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 "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,5 +1,25 @@
#compdef middleman
# ------------------------------------------------------------------------------
# Copyright (c) 2013 Jozef Izso, MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#

View File

@@ -1,5 +1,30 @@
#compdef mina
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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
# -----------
#

View File

@@ -0,0 +1,235 @@
#compdef mix
#autoload
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 Elixir Mix
#
# Last updated: 18.04.2017
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Han Ngo (https://github.com/tieubao)
# * Teja Sophista (https://github.com/tejanium)
#
# ------------------------------------------------------------------------------
local -a _1st_arguments
_1st_arguments=(
'app.start:Starts all registered apps'
'app.tree:Prints the application tree'
'archive:Lists installed archives'
'archive.build:Archives this project into a .ez file'
'archive.install:Installs an archive locally'
'archive.uninstall:Uninstalls archives'
'clean:Deletes generated application files'
'cmd:Executes the given command'
'compile:Compiles source files'
'deps:Lists dependencies and their status'
"deps.clean:Deletes the given dependencies' files"
'deps.compile:Compiles dependencies'
'deps.get:Gets all out of date dependencies'
'deps.tree:Prints the dependency tree'
'deps.unlock:Unlocks the given dependencies'
'deps.update:Updates the given dependencies'
'do:Executes the tasks separated by comma'
'ecto:Prints Ecto help information'
'ecto.create:Creates the repository storage'
'ecto.drop:Drops the repository storage'
'ecto.dump:Dumps the repository database structure'
'ecto.gen.migration:Generates a new migration for the repo'
'ecto.gen.repo:Generates a new repository'
'ecto.load:Loads previously dumped database structure'
'ecto.migrate:Runs the repository migrations'
'ecto.migrations:Displays the repository migration status'
'ecto.rollback:Rolls back the repository migrations'
'escript:Lists installed escripts'
'escript.build:Builds an escript for the project'
'escript.install:Installs an escript locally'
'escript.uninstall:Uninstalls escripts'
'gettext.extract:Extracts translations from source code'
'gettext.merge:Merge template files into translation files'
'help:Prints help information for tasks'
'hex:Prints Hex help information'
'hex.build:Builds a new package version locally'
'hex.config:Reads, updates or deletes Hex config'
'hex.docs:Fetch or open documentation of a package'
'hex.info:Prints Hex information'
'hex.key:Manages Hex API key'
'hex.outdated:Shows outdated Hex deps for the current project'
'hex.owner:Manages Hex package ownership'
'hex.public_keys:Manages Hex public keys'
'hex.publish:Publishes a new package version'
'hex.retire:Retires a package version'
'hex.search:Searches for package names'
'hex.user:Registers or manages Hex user'
'loadconfig:Loads and persists the given configuration'
'local:Lists local tasks'
'local.hex:Installs Hex locally'
'local.phoenix:Updates Phoenix locally'
'local.phx:Updates the Phoenix project generator locally'
'local.public_keys:Manages public keys'
'local.rebar:Installs Rebar locally'
'new:Creates a new Elixir project'
'phoenix.gen.html:Generates controller, model and views for an HTML based resource'
'phoenix.server:Starts applications and their servers'
'phx.digest:Digests and compresses static files'
'phx.digest.clean:Removes old versions of static assets.'
'phx.gen.channel:Generates a Phoenix channel'
'phx.gen.context:Generates a context with functions around an Ecto schema'
'phx.gen.html:Generates controller, views, and context for an HTML resource'
'phx.gen.json:Generates controller, views, and context for a JSON resource'
'phx.gen.presence:Generates a Presence tracker'
'phx.gen.schema:Generates an Ecto schema and migration file'
'phx.gen.secret:Generates a secret'
'phx.new:Creates a new Phoenix application'
'phx.new.ecto:Creates a new Ecto project within an umbrella project'
'phx.new.web:Creates a new Phoenix web project within an umbrella project'
'phx.routes:Prints all routes'
'phx.server:Starts applications and their servers'
'profile.fprof:Profiles the given file or expression with fprof'
'run:Runs the given file or expression'
"test:Runs a project's tests"
'xref:Performs cross reference checks'
'--help:Describe available tasks'
'--version:Prints the Elixir version information'
)
__task_list ()
{
local expl
declare -a tasks
tasks=(
'app.start'
'app.tree'
'archive'
'archive.build'
'archive.install'
'archive.uninstall'
'clean'
'cmd'
'compile'
'deps'
'deps.clean'
'deps.compile'
'deps.get'
'deps.tree'
'deps.unlock'
'deps.update'
'do'
'ecto'
'ecto.create'
'ecto.drop'
'ecto.dump'
'ecto.gen.migration'
'ecto.gen.repo'
'ecto.load'
'ecto.migrate'
'ecto.migrations'
'ecto.rollback'
'escript'
'escript.build'
'escript.install'
'escript.uninstall'
'gettext.extract'
'gettext.merge'
'help'
'hex'
'hex.build'
'hex.config'
'hex.docs'
'hex.info'
'hex.key'
'hex.outdated'
'hex.owner'
'hex.public_keys'
'hex.publish'
'hex.retire'
'hex.search'
'hex.user'
'loadconfig'
'local'
'local.hex'
'local.public_keys'
'local.rebar'
'new'
'phoenix.gen.html'
'phoenix.server'
'phx.digest'
'phx.digest.clean'
'phx.gen.channel'
'phx.gen.context'
'phx.gen.html'
'phx.gen.json'
'phx.gen.presence'
'phx.gen.schema'
'phx.gen.secret'
'phx.routes'
'phx.server'
'profile.fprof'
'run'
'test'
'xref'
)
_wanted tasks expl 'help' compadd $tasks
}
local expl
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "mix subcommand" _1st_arguments
return
;;
(options)
case $line[1] in
(help)
_arguments ':feature:__task_list'
return
;;
(test)
_arguments ':PATH:_files'
return
;;
esac
;;
esac

View File

@@ -1,35 +0,0 @@
#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)
#
# ------------------------------------------------------------------------------
_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'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -0,0 +1,163 @@
#compdef multirust
# ------------------------------------------------------------------------------
# Copyright (C) 2016 by Hideo Hattori <hhatto.jp@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for multirust (https://github.com/brson/multirust).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Hideo Hattori (https://github.com/hhatto)
#
# ------------------------------------------------------------------------------
_multirust() {
typeset -A opt_args
local context state line
_arguments -s -S \
"--verbose[run verbosely]" \
"--version[print version info]" \
"*::multirust commands:_multirust_command"
}
(( $+functions[_multirust_command] )) ||
_multirust_command() {
local cmd ret=1
(( $+multirust_cmds )) || _multirust_cmds=(
"default:Set the default toolchain" \
"override:Set the toolchain override for the current directory tree" \
"update:Install or update a given toolchain" \
"show-override:Show information about the current override" \
"show-default:Show information about the current default" \
"list-overrides:List all overrides" \
"list-toolchains:List all installed toolchains" \
"remove-override:Remove an override, for current directory unless specified" \
"remove-toolchain:Uninstall a toolchain" \
"run:Run a command in an environment configured for a toolchain" \
"delete-data:Delete all user metadata, including installed toolchains" \
"upgrade-data:Upgrade the ~/.multirust directory from previous versions" \
"doc:Open the documentation for the currently active toolchain" \
"which:Report location of the currently active Rust tool." \
"help:Show help for this command or subcommands" \
)
if (( CURRENT == 1 )); then
_describe -t commands 'multirust subcommand' _multirust_cmds || compadd "$@" - ${(s.:.)${(j.:.)_multirust_syns}}
else
local curcontext="$curcontext"
cmd="${${_multirust_cmds[(r)$words[1]:*]%%:*}:-${(k)_multirust_syns[(r)(*:|)$words[1](:*|)]}}"
if (( $#cmd )); then
curcontext="${curcontext%:*:*}:multirust-${cmd}:"
_call_function ret _multirust_$cmd || _message 'no more arguments'
else
_message "unknown multirust command: $words[1]"
fi
return ret
fi
}
(( $+functions[_multirust_default] )) ||
_multirust_default() {
_arguments -s \
"--copy-local[install by copying a local toolchain]:PATH:_gnu_generic::" \
"--link-local[install by linking a local toolchain]:PATH:_gnu_generic::" \
"--installer[allows arbitrary builds of rust to be installed from a custom-built installer]:PATH:_gnu_generic::" \
"*::multirust commands:_multirust"
}
(( $+functions[_multirust_override] )) ||
_multirust_override() {
_multirust_default
}
(( $+functions[_multirust_update] )) ||
_multirust_update() {
_multirust_default
}
__overrides() {
declare -a overrides
overrides=($(multirust list-overrides|awk -F";" '{print $1":"$2}'))
_describe 'override' overrides
}
__toolchains() {
declare -a toolchains
toolchains=($(multirust list-toolchains))
_describe "toolchain" toolchains
}
__subcommands() {
declare -a cmds
cmds=($(multirust|grep "# "|awk '{print $2}'))
_describe "command" cmds
}
(( $+functions[_multirust_remove-override] )) ||
_multirust_remove-override() {
__overrides
}
(( $+functions[_multirust_remove-toolchain] )) ||
_multirust_remove-toolchain() {
__toolchains
}
(( $+functions[_multirust_run] )) ||
_multirust_run() {
__toolchains
}
(( $+functions[_multirust_delete-data] )) ||
_multirust_delete-data() {
_arguments -s \
"-y[Disable prompt]" \
"*::multirust commands:_multirust"
}
(( $+functions[_multirust_doc] )) ||
_multirust_doc() {
_arguments -s \
"--all[open the documentation overview page, which gives access to all the installed documentation]:" \
"*::multirust commands:_multirust"
}
(( $+functions[_multirust_help] )) ||
_multirust_help() {
__subcommands
}
_multirust "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,30 +1,5 @@
#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
# -----------
#
@@ -430,6 +405,7 @@ _mvn_common_property_names() {
'skipTests:skip tests execution'
'maven.test.skip:skip tests compilation and execution'
'gpg.passphrase:gpg passphrase'
'tycho.mode:enable maven mode for Tycho projects to disable p2 resolution'
)
_describe -t 'common-property-names' 'common property name' properties $@
}
@@ -473,6 +449,7 @@ _mvn_property_values() {
((#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;;
((#i)*tycho.mode*) _wanted tychomodes expl 'tychomode' _mvn_tycho_modes && ret=0;;
(*) _default && ret=0;;
esac
return ret
@@ -546,6 +523,14 @@ _mvn_booleans() {
}
(( $+functions[_mvn_tycho_modes] )) ||
_mvn_tycho_modes() {
local tychomodes; tychomodes=(
'maven:maven mode, Tycho will not do any p2 dependency resolution'
)
_describe -t tychomodes 'boolean' tychomodes
}
# ------------------------------------------------------------------------------
# Helper functions
# ------------------------------------------------------------------------------

View File

@@ -1,56 +0,0 @@
#compdef nl
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for GNU nl (coreutils 8.13).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * github.com/RobSis
#
# ------------------------------------------------------------------------------
local arguments style_values format_values ret=1
style_values=(
"a:number all lines"
"t:number only nonempty lines"
"n:number no lines"
"pBRE:number only lines that contain a match for the basic regular expression, BRE"
)
format_values=(
"ln:left justified, no leading zeros"
"rn:right justified, no leading zeros"
"rz:right justified, leading zeros"
)
_arguments -C -s -S \
{-b+,--body-numbering=}'[use STYLE for given number of lines]:style:->style' \
{-d+,--section-delimiter=}'[use CC for separating logical pages]' \
{-f+,--footer-numbering=}'[use STYLE for numbering footer lines]:style:->style' \
{-h+,--header-numbering=}'[use STYLE for numbering header lines]:style:->style' \
{-i+,--line-increment=}'[line number increment at each line]' \
{-l+,--join-blank-lines=}'[group of NUMBER empty lines counted as one]' \
{-n+,--number-format=}'[insert line numbers according to FORMAT]:format:->format' \
{-p,--no-renumber}'[do not reset line numbers at logical pages]' \
{-s+,--number-separator=}'[add STRING after (possible) line number]' \
{-v+,--starting-line-number=}'[first line number on each logical page]' \
{-w+,--number-width=}'[use NUMBER columns for line numbers]' \
--help'[display help and exit]' \
--version'[output version information and exit]' \
'*:filename:_files' && ret=0
case "$state" in
(style)
_describe -t style style style_values && ret=0
;;
(format)
_describe -t format format format_values && ret=0
;;
esac
return $ret

View File

@@ -1,5 +1,30 @@
#compdef nvm
# ------------------------------------------------------------------------------
# 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
# -----------
#

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +0,0 @@
#compdef pactree
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for pactree 4.0
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Limao Luo <luolimao@gmail.com>
#
# ------------------------------------------------------------------------------
typeset -A opt_args
_pactree() {
local -a cmd packages packages_long
packages_long=(/var/lib/pacman/local/*(/))
packages=( ${${packages_long#/var/lib/pacman/local/}%-*-*} )
compadd "$@" -a packages
}
# run the main dispatcher
_pactree "$@"

View File

@@ -0,0 +1,58 @@
#compdef paste
#
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 paste (from util-linux 2.27.1->)
# (https://git.kernel.org/cgit/utils/util-linux/util-linux.git/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ole Jørgen Brønner <olejorgenb@yahoo.no>
#
# ------------------------------------------------------------------------------
#
# Note: paste has upstream bash completion
# Note: Credit to https://github.com/RobSis/zsh-completion-generator which was
# used to generate most of the script.
local arguments
arguments=(
'*'{-d,--delimiters}'[reuse characters from LIST instead of TABs]:delimiters'
'(-s --serial)'{-s,--serial}'[paste one file at a time instead of in parallel]'
'(-z --zero-terminated)'{-z,--zero-terminated}'[line delimiter is NUL, not newline]'
'--help[display this help and exit]'
'--version[output version information and exit]'
'*:filename:_files'
)
_arguments -s $arguments

View File

@@ -0,0 +1,95 @@
#compdef patool
# ------------------------------------------------------------------------------
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for patool (https://github.com/wummel/patool).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Sergei Eremenko (https://github.com/SmartFinn)
#
# ------------------------------------------------------------------------------
local state line ret=1
_arguments -C \
'(-h --help)'{-h,--help}'[show help message and exit]' \
'(--non-interactive)'--non-interactive'[do not query for user input]' \
'(-v --verbose)'{-v,--verbose}'[verbose operation]' \
'1:cmd:->cmds' \
'*:arg:->args' && ret=0
case $state in
(cmds)
local -a cmds
cmds=(
'create:create an archive from given files'
'diff:show differences between two archives'
'extract:extract files from given archives'
'formats:show all supported archive formats'
'list:list files in archives'
'repack:repackage archive to a different format'
'recompress:recompress an archive to smaller size'
'search:search in archive contents for given pattern'
'test:test the given archives'
)
_describe -t commands 'patool commands' cmds && ret=0
;;
(args)
case $line[1] in
(extract)
_arguments \
'--outdir[extract to the given output directory]:select directory:_files -/' \
'*:files:_files' && ret=0
;;
(formats)
_message 'no more arguments' && ret=0
;;
(search)
_arguments \
'2:search pattern:' \
'*:files:_files' && ret=0
;;
(*)
_arguments \
'*:files:_files' && ret=0
;;
esac
;;
esac
return $ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,89 +0,0 @@
#compdef pear
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Pear (http://pear.php.net).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * aki77 (https://github.com/aki77)
#
# ------------------------------------------------------------------------------
_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 "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -1,5 +1,30 @@
#compdef psql pg_dump pg_dumpall pg_restore createdb dropdb vacuumdb createuser dropuser initdb
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users, Dominic Mitchell, Johann 'Myrkraverk' Oskarsson, Daniel Serodio, J Smith
# 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
# -----------
#
@@ -121,11 +146,21 @@ _pgsql_databases () {
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
_pgsql_get_identity
local _pgsql_services _pgsql_service_files
_pgsql_service_files=(
~/.pg_service.conf
$(pg_config --sysconfdir)/pg_service.conf
)
_pgsql_services=$( grep -h '^\[.*\]' $_pgsql_service_files 2>/dev/null \
| sed -e 's/^\[/service=/' -e 's/\].*$//' )
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 template1 2>/dev/null )
compadd "$@" - \
${(f)_pgsql_services} \
$( psql $_pgsql_params[@] -Atq -c $_pgsql_db_sql template1 2>/dev/null )
}
_pgsql_encodings () {
@@ -154,8 +189,11 @@ _psql () {
{-A,--no-align}'[unaligned output mode]' \
{-c+,--command=}':execute SQL command:' \
{-d+,--dbname=}':database to connect to:_pgsql_databases' \
{-b,--echo-errors}'[echo failed commands]' \
{-e,--echo-queries}'[display queries submitted]' \
{-E,--echo-hidden}'[display hidden queries]' \
{-L,--log-file=}'[send session log to file]' \
{-n,--no-readline}'[disable enhanced command line editing (readline)]' \
{-f+,--file=}':SQL file to read:_files' \
{-F+,--field-separator=}':field separator char:' \
{-H,--html}'[HTML output]' \
@@ -171,6 +209,8 @@ _psql () {
-u'[prompt for username/password]' \
{-v+,--set=,--variable=}':set SQL variable:' \
{-x,--expanded}'[one column per line]' \
{-z,--field-separator-zero}'[set field separator for unaligned output to zero byte]' \
{-0,--record-separator-zero}'[set record separator for unaligned output to zero byte]' \
{-X,--no-psqlrc}'[dont read ~/.psqlrc]' \
':PostgreSQL database:_pgsql_databases' \
':PostgreSQL user:_pgsql_users'
@@ -191,6 +231,7 @@ _pg_dump () {
{-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]"' \
{-j,--jobs=}'[use this many parallel jobs to dump]' \
{-i,--ignore-version}'[ignore version mismatch]' \
{-n+,--schema=}':schema to dump:_pgsql_schemas' \
{-N+,--exclude-schema=}':schema to NOT dump:_pgsql_schemas' \
@@ -208,13 +249,23 @@ _pg_dump () {
{-Z+,--compress=}':compression level:_values "level" 9 8 7 6 5 4 3 2 1 0' \
':PostgreSQL database:_pgsql_databases' \
--section=':dump named section:_values "section" pre-data data post-data' \
--binary-upgrade'[for use by upgrade utilities only]' \
--column-inserts'[dump data as INSERT commands with column names]' \
--disable-dollar-quoting'[disable dollar quoting, use SQL standard quoting]' \
--disable-triggers'[disable triggers during data-only restore]' \
--enable-row-security'[enable row security (dump only content user has access to)]' \
--exclude-table-data='[do NOT dump data for the named table(s)]' \
--if-exists'[use IF EXISTS when dropping objects]' \
--inserts'[dump data as INSERT commands, rather than COPY]' \
--lock-wait-timeout='[fail after waiting TIMEOUT for a table lock]' \
--no-security-labels'[do not dump security label assignments]' \
--no-synchronized-snapshots'[do not use synchronized snapshots in parallel jobs]' \
--no-tablespaces'[do not dump tablespace assignments]' \
--no-unlogged-table-data'[do not dump unlogged table data]' \
--quote-all-identifiers'[quote all identifiers, even if not key words]' \
--serializable-deferrable'[wait until the dump can run without anomalies]' \
--snapshot='[use given snapshot for the dump]' \
--strict-names'[require table and/or schema include patterns to match at least one entity each]' \
--use-set-session-authorization'[use SET SESSION AUTHORIZATION commands instead of ALTER OWNER]'
}
@@ -341,6 +392,7 @@ _createuser () {
{-d,--createdb}'[role can create new databases]' \
{-D,--no-createdb}'[role cannot create databases]' \
{-E,--encrypted}'[encrypt stored password]' \
{-g,--role=}'[new role will be a member of this role]' \
{-i,--inherit}'[role inherits privileges of roles it is a member of (default)]' \
{-I,--no-inherit}'[role does not inherit privileges]' \
{-l,--login}'[role can login (default)]' \
@@ -350,7 +402,10 @@ _createuser () {
{-r,--createrole}'[role can create new roles]' \
{-R,--no-createrole}'[role cannot create roles]' \
{-s,--superuser}'[role will be superuser]' \
{-S,--no-superuser}'[role will not be superuser]'
{-S,--no-superuser}'[role will not be superuser]' \
{--interactive}'[prompt for missing role name and attributes rather than using defaults]' \
{--replication}'[role can initiate replication]' \
{--no-replication}'[role cannot initiate replication]' \
}
_dropuser () {
@@ -361,7 +416,7 @@ _dropuser () {
"$_pgsql_common_opts[@]" \
{-e,--echo}'[display SQL queries]' \
{-q,--quiet}'[non verbose mode]' \
{-i,--interactive}'[confirm before drop]' \
{-i,--interactive}'[prompt before deleting anything, and prompt for role name if not specified]' \
':PostgreSQL user:_pgsql_users'
}
@@ -371,6 +426,8 @@ _initdb () {
_arguments -C -s \
{--auth=,-A+}':default authentication method for local connections:_values "auth methods" $_pgsql_auth_methods[@]' \
--auth-host=':default authentication method for local TCP/IP connections:_values "auth methods" $_pgsql_auth_methods[@]' \
--auth-local=':default authentication method for local-socket connections:_values "auth methods" $_pgsql_auth_methods[@]' \
{-D+,--pgdata=}':location for this database cluster:_files' \
{-E+,--encoding=}':set default encoding for new databases:' \
--locale=':set default locale for new databases:' \
@@ -388,8 +445,11 @@ _initdb () {
{-X+,--xlogdir=}':location for the transaction log directory:_files' \
{-d,--debug}'[generate lots of debugging output]' \
-L+':where to find the input files:_files' \
{-k,--data-checksums}':use data page checksums:' \
{-n,--noclean}'[do not clean up after errors]' \
{-N,--nosync}':do not wait for changes to be written safely to disk:' \
{-s,--show}'[show internal settings]' \
{-S,--sync-only}'[only sync data directory]' \
':location for this database cluster:_files'
}
@@ -402,6 +462,7 @@ _pgsql_utils () {
{-p+,--port=}':database port number:_pgsql_ports'
{-U+,--username=}':connect as user:_pgsql_users'
{-W,--password}'[prompt for password]'
--role='[do SET ROLE before restore]'
)
_pgsql_auth_methods=(

View File

@@ -0,0 +1,100 @@
#compdef pixz
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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 pixz a parallel, indexing version of xz. (https://github.com/vasi/pixz).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
local -a files index
files=()
index=()
_pixz_compressed_files() {
files=("${(f)$(ls -l | grep '.tpxz$\|.xz$' | rev | cut -d' ' -f1 | rev)}")
}
_pixz_load_file_index() {
index=("${(f)$(pixz -l $1)}")
}
_pixz() {
_arguments -C \
'(- 1 *)'-h"[Show help and exit]" \
'(- 1 *)'-l"[List tarball contents very fast]:file:->xzfiles" \
'(- 1 *)'-x"[Extract one file very fast]:filepath:->filepath" \
'(- 1 *)'-d"[Decompress]:file:->xzfiles" \
"-i[Input]:file:->files" \
"-o[Output]:output:->outputxz" \
"-p[Use a maximum of NUM CPU-intensive threads]:cpu:->cpus" \
"-t[Don't assume input is in tar format]" \
"-k[Keep original input (do not remove it)]" \
"-e[Use "extreme" compression, which is much slower]" \
"-f[Set the size of each compression block, relative to the LZMA dictionary size (default is 2.0)]:num" \
"-q[Set the number of blocks to allocate for the compression queue (default is 1.3 * cores + 2)]:num" \
'1:inputfile:->files' \
'2:outputfile' \
'*: : :->args' \
case "$state" in
(cmds)
_describe -t commands 'commands' commands
;;
(xzfiles)
_pixz_compressed_files
_describe -t files 'files' files
;;
(files)
_files
;;
(cpus)
local num_cpus cores
num_cpus=$(nproc)
cores=()
for i in {1..$num_cpus}; do
cores+=($i)
done
_describe -t cores 'cores' cores
;;
(filepath)
;;
(*)
;;
esac
}
_pixz

View File

@@ -1,30 +1,5 @@
#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
# -----------
#

View File

@@ -12,6 +12,34 @@
# * Matt Cable <wozz@wookie.net>
# * Sorin Ionescu <sorin.ionescu@gmail.com>
# * Aljaž Srebrnič <a2piratesoft@gmail.com>
# -----------------------------------------------------------------------------
# License
# -------
#
# Copyright (c) 2016, Matt Cable, Sorin Ionescu, Aljaž Srebrnič
# 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 <organization> 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 <COPYRIGHT HOLDER> 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.
#
# ------------------------------------------------------------------------------
@@ -221,6 +249,13 @@ _port_select() {
fi
}
stat -f%m . > /dev/null 2>&1
if [ "$?" = 0 ]; then
stat_cmd=(stat -f%Z)
else
stat_cmd=(stat --format=%Z)
fi
_port_caching_policy() {
local reg_time comp_time check_file
case "${1##*/}" in
@@ -231,8 +266,8 @@ _port_caching_policy() {
check_file=${$(port dir MacPorts)%/*/*}/PortIndex
;;
esac
reg_time=$(stat -c '%Z' $check_file)
comp_time=$(stat -c '%Z' $1)
reg_time=$($stat_cmd $check_file)
comp_time=$($stat_cmd $1)
return $(( reg_time < comp_time ))
}

Some files were not shown because too many files have changed in this diff Show More