ZSH: Remove zsh folder

At the moment I don't receive any zimfw updates, as it is not registered
as a submodule. This commit changes that. Therefore I'm able to receive
patches again.

Signed-off-by: Tobias Manske <tobias.manske@mailbox.org>
This commit is contained in:
Tobias Manske 2018-09-02 07:35:58 +02:00
parent 6c460fc2d7
commit f0131856b1
No known key found for this signature in database
GPG Key ID: 978D99F12D4E041F
489 changed files with 4 additions and 42914 deletions

24
.gitmodules vendored
View File

@ -1,24 +1,3 @@
[submodule "zsh/modules/history-substring-search/external"]
path = zsh/modules/history-substring-search/external
url = https://github.com/zsh-users/zsh-history-substring-search.git
[submodule "zsh/modules/completion/external"]
path = zsh/modules/completion/external
url = https://github.com/zsh-users/zsh-completions.git
[submodule "zsh/modules/syntax-highlighting/external"]
path = zsh/modules/syntax-highlighting/external
url = https://github.com/zsh-users/zsh-syntax-highlighting.git
[submodule "zsh/modules/prompt/external-themes/pure"]
path = zsh/modules/prompt/external-themes/pure
url = https://github.com/sindresorhus/pure.git
[submodule "zsh/modules/prompt/external-themes/liquidprompt"]
path = zsh/modules/prompt/external-themes/liquidprompt
url = https://github.com/nojhan/liquidprompt.git
[submodule "zsh/modules/prompt/external-themes/lean"]
path = zsh/modules/prompt/external-themes/lean
url = https://github.com/miekg/lean
[submodule "zsh/modules/autosuggestions/external"]
path = zsh/modules/autosuggestions/external
url = https://github.com/zsh-users/zsh-autosuggestions.git
[submodule "tmux/plugins/tmux-battery"] [submodule "tmux/plugins/tmux-battery"]
path = tmux/plugins/tmux-battery path = tmux/plugins/tmux-battery
url = https://github.com/tmux-plugins/tmux-battery.git url = https://github.com/tmux-plugins/tmux-battery.git
@ -43,3 +22,6 @@
[submodule "tmux/plugins/tpm"] [submodule "tmux/plugins/tpm"]
path = tmux/plugins/tpm path = tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm.git url = https://github.com/tmux-plugins/tpm.git
[submodule "zsh"]
path = zsh
url = https://github.com/zimfw/zimfw

1
zsh Submodule

@ -0,0 +1 @@
Subproject commit 236eb14d5904985370c9e1844fdf1b56e9ddfe0f

View File

@ -1,132 +0,0 @@
#################
# CORE SETTINGS #
#################
#
# Zim settings
#
# Select what modules you would like enabled.
# The second line of modules may depend on options set by modules in the first line.
# These dependencies are noted on the respective module's README.md.
zmodules=(directory environment git history input utility meta custom \
syntax-highlighting history-substring-search prompt completion \
pacman git-info fasd )
source ~/.zim/modules/zsh-autosuggestions/zsh-autosuggestions.zsh
###################
# MODULE SETTINGS #
###################
#
# Prompt
#
# Set your desired prompt here
zprompt_theme='steeef'
#
# Completion
#
# set an optional host-specific filename for the completion cache file
# if none is provided, the default '.zcompdump' is used.
#zcompdump_file=".zcompdump-${HOST}-${ZSH_VERSION}"
#
# Utility
#
# Uncomment to enable command correction prompts
# See: http://zsh.sourceforge.net/Doc/Release/Options.html#Input_002fOutput
setopt CORRECT
#
# Environment
#
# Set the string below to the desired terminal title format string.
# The terminal title is redrawn upon directory change, however, variables like
# ${PWD} are only evaluated once. Use prompt expansion strings for dynamic data:
# http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
# The example below uses the following format: 'username@host:/current/directory'
ztermtitle='%n@%m:%~'
#
# Input
#
# Uncomment to enable double-dot expansion.
# This appends '../' to your input for each '.' you type after an initial '..'
#zdouble_dot_expand='true'
#
# Syntax-Highlighting
#
# This determines what highlighters will be used with the syntax-highlighting module.
# Documentation of the highlighters can be found here:
# https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
# For (u)rxvt, termite and gnome-terminal users,
# removing the 'cursor' highlighter will fix the disappearing cursor problem
zhighlighters=(main brackets)
#
# SSH
#
# Load these ssh identities with the ssh module
zssh_ids=(id_ed25519)
# Load any helper scripts as defined here
zpacman_helper=(aur)
# URXVT fix
autoload -Uz add-zsh-hook
function xterm_title_precmd () {
print -Pn '\e]2;%n@%m:%~\a'
}
if [[ "$TERM" == (screen*|xterm*|rxvt*) ]]; then
add-zsh-hook -Uz precmd xterm_title_precmd
# add-zsh-hook -Uz preexec xterm_title_preexec
fi
# ALIASES
alias -g cb="xclip -selection clipboard"
alias -g tb="nc termbin.com 9999 | xclip -selection clipboard"
alias -g sshot='xfce4-screenshooter -o "$(which xclip) -i -t image/png -selection clipboard" $@'
alias -g steam-wine='WINEDEBUG=-all wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe -no-cef-sandbox >/dev/null 2>&1 &'
# History search
bindkey -v
bindkey '^R' history-incremental-search-backward
# fzf
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
# thefuck
fuck () {
TF_PYTHONIOENCODING=$PYTHONIOENCODING;
export TF_SHELL=zsh;
export TF_ALIAS=fuck;
export TF_SHELL_ALIASES=$(alias);
export TF_HISTORY="$(fc -ln -10)";
export PYTHONIOENCODING=utf-8;
TF_CMD=$(
thefuck THEFUCK_ARGUMENT_PLACEHOLDER $@
) && eval $TF_CMD;
unset TF_HISTORY;
export PYTHONIOENCODING=$TF_PYTHONIOENCODING;
test -n "$TF_CMD" && print -s $TF_CMD
}
export VISUAL="vim"
export PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH
# If not running interactively, do not do anything
[[ $- != *i* ]] && return
[[ -z "$TMUX" ]] && exec tmux -u

View File

@ -1,25 +0,0 @@
The MIT License (MIT)
=====================
Copyright (c) `2015-2016` `Matt Hamilton and 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.

View File

@ -1,107 +0,0 @@
This is a slightly modified version of https://github.com/zimfw/zimfw
ZIM - Zsh IMproved
==================
<div align="center">
<a href="https://github.com/Eriner/zim">
<img width=650px src="https://i.eriner.me/zim_banner.png">
</a>
</div>
What is Zim?
------------
Zim is a Zsh configuration framework with [blazing speed][speed] and modular extensions.
Zim is very easy to customize, and comes with a rich set of modules and features without compromising on speed or functionality!
What does Zim offer?
-----------------
If you're here, it means you want to see the cool shit Zim can do. Check out the [available modules][modules]!
Below is a brief showcase of Zim's features.
### Speed
For a speed comparison between Zim and other frameworks, see [this wiki entry][speed].
### Themes
To preview some of the available themes, check the [themes wiki page][themes].
### Fish-shell History Navigation
![history-substring-search][fish_shell]
### Syntax Highlighting
![syntax-highlighting][syntax_highlighting]
### And much more!
Zim has many modules! Enable as many or as few as you'd like.
Installation
------------
Installing Zim is easy. If you have a different shell framework installed (like oh-my-zsh or prezto),
*uninstall those first to prevent conflicts*. It can be installed manually by following the instructions below:
1. In a Zsh shell, clone the repository:
```
git clone --recursive https://github.com/Eriner/zim.git ${ZDOTDIR:-${HOME}}/.zim
```
2. Paste this into your terminal to prepend the initialization templates to your configs:
```
setopt EXTENDED_GLOB
for template_file ( ${ZDOTDIR:-${HOME}}/.zim/templates/* ); do
user_file="${ZDOTDIR:-${HOME}}/.${template_file:t}"
touch ${user_file}
( print -rn "$(<${template_file})$(<${user_file})" >! ${user_file} ) 2>/dev/null
done
```
3. Set Zsh as the default shell:
```
chsh -s =zsh
```
4. Open a new terminal and finish optimization (this is only needed once, hereafter it will happen upon desktop/tty login):
```
source ${ZDOTDIR:-${HOME}}/.zlogin
```
5. You're done! Enjoy your Zsh IMproved! Take some time to read about the [available modules][modules] and tweak your `.zshrc` file.
Updating
--------
To update zim, run:
```
zmanage update
```
For more information about the `zmanage` tool, see the [meta module][meta-module] documentation.
Uninstalling
------------
The best way to remove zim is to manually delete `~/.zim`, `~/.zimrc`, and
remove the initialization lines from your `~/.zshrc`.
However, there are some **experimental** convenience functions to remove zim:
**NOTE: This functionality is experimental!**
To remove zim, run:
```
zmanage remove
```
**NOTE: This functionality is experimental!**
[fish_shell]: https://i.eriner.me/zim_history-substring-search.gif
[syntax_highlighting]: https://i.eriner.me/zim_syntax-highlighting.gif
[speed]: https://github.com/Eriner/zim/wiki/Speed
[modules]: https://github.com/Eriner/zim/wiki/Modules
[themes]: https://github.com/Eriner/zim/wiki/Themes
[meta-module]: https://github.com/Eriner/zim/tree/master/modules/meta

View File

@ -1,46 +0,0 @@
#
# Zim initializition
#
# Define zim location
ZIM="${ZDOTDIR:-${HOME}}/.zim"
# Source user configuration
if [[ -s "${ZDOTDIR:-${HOME}}/.zimrc" ]]; then
source "${ZDOTDIR:-${HOME}}/.zimrc"
fi
load_zim_module() {
local wanted_module
for wanted_module (${zmodules}); do
if [[ -s "${ZIM}/modules/${wanted_module}/init.zsh" ]]; then
source "${ZIM}/modules/${wanted_module}/init.zsh"
elif [[ ! -d "${ZIM}/modules/${wanted_module}" ]]; then
print "No such module \"${wanted_module}\"." >&2
fi
done
}
load_zim_function() {
local function_glob='^([_.]*|prompt_*_setup|README*)(-.N:t)'
local mod_function
# autoload searches fpath for function locations; add enabled module function paths
fpath=(${${zmodules}:+${ZIM}/modules/${^zmodules}/functions(/FN)} ${fpath})
function {
setopt LOCAL_OPTIONS EXTENDED_GLOB
for mod_function in ${ZIM}/modules/${^zmodules}/functions/${~function_glob}; do
autoload -Uz ${mod_function}
done
}
}
# initialize zim modules
load_zim_function
load_zim_module
unset zmodules
unfunction load_zim_{module,function}

View File

@ -1,31 +0,0 @@
Archive
=======
Provides `archive` and `unarchive` functions for easy archive manipulation.
This module will make use of `pigz` and `pbzip2` if available to make use of all available CPU cores.
Functions
---------
* `archive` generates an archive based on file extension. Syntax is `archive myarchive.tar.gz /path/to/archive`
* `unarchive` unarchives a file based on the extension. Syntax is `unarchive myarchive.7z`
Archive Formats
---------------
| Format | Requirements |
| ------ | ------------ |
| .tar | `tar` |
| .tar.gz, .tgz | `tar` or `pigz` |
| .tar.bz2, .tbz | `tar` or `pbzip2` |
| .tar.xz, .txz | `tar` with xz support |
| .tar.zma, .tlz | `tar` with lzma support |
| .gz | `gunzip` or `pigz` |
| .bz2 | `bunzip2` or `pbzip2` |
| .xz | `unxz` |
| .lzma | `unzlma` |
| .Z | `uncompress` |
| .zip | `unzip` |
| .rar | `unrar` or `rar` |
| .7z | `7za` |

View File

@ -1,43 +0,0 @@
#
# Creates archive files
#
local archive_name dir_to_archive
if (( ${#} != 2 )); then
print "usage: ${0} [archive_name.ext] [/path/to/include/in/archive]" >&2
return 1
fi
# we are quitting (above) if there are not exactly 2 vars,
# so we don't need any argc check here.
# strip the path, just in case one is provided for some reason
archive_name="${1:t}"
# use absolute paths, and follow symlinks
dir_to_archive="${2}"
# if the directory doesn't exist, quit. Nothing to archive
if [[ ! -e "${dir_to_archive}" ]]; then
print "${0}: file or directory not valid: ${dir_to_archive}" >&2
return 1
fi
# pigz and pbzip2 are aliased in the init.zsh file. This provides a significant speedup, resulting in a
# near-liner decrease in compression time based on on the number of available cores.
case "${archive_name}" in
(*.tar.gz|*.tgz) tar -cvf "${archive_name}" --use-compress-program="${_gzip_bin}" "${dir_to_archive}" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar -cvf "${archive_name}" --use-compress-program="${_bzip2_bin}" "${dir_to_archive}" ;;
(*.tar.xz|*.txz) tar --xz --help &> /dev/null && tar -cvJf "${archive_name}" "${dir_to_archive}" ;;
(*.tar.lzma|*.tlz) tar --lzma --help &> /dev/null && tar -cvf "${archive_name}" --lzma "${dir_to_archive}" ;;
(*.tar) tar -cvf "${archive_name}" "${dir_to_archive}" ;;
(*.zip) zip -r "${archive_name}" "${dir_to_archive}" ;;
(*.rar) rar a "${archive_name}" "${dir_to_archive}" ;;
(*.7z) 7za a "${archive_name}" "${dir_to_archive}" ;;
(*.gz) print "${0}: .gz is only useful for single files, and does not capture permissions. Use .tar.gz" ;;
(*.bz2) print "${0}: .bzip2 is only useful for single files, and does not capture permissions. Use .tar.bz2" ;;
(*.xz) print "${0}: .xz is only useful for single files, and does not capture permissions. Use .tar.xz" ;;
(*.lzma) print "${0}: .lzma is only useful for single files, and does not capture permissions. Use .tar.lzma" ;;
(*) print "${0}: unknown archive type: ${archive_name}" ;;
esac

View File

@ -1,42 +0,0 @@
#
# Unarchives files
#
local archive_name
if (( ${#} != 1 )); then
print "usage: ${0} [archive.ext]" >&2
return 1
fi
if [[ ! -s ${1} ]]; then
print "archive \"${1}\" was not found or has size 0." >&2
return 1
fi
# strip the path, just in case one is provided for some reason
archive_name="${1:t}"
# using unpigz/pbunzip2 provides little to decompression time; the benefit is mainly in compression time.
# setting it as an alias in the init.zsh file should be sufficient here.
case "${archive_name}" in
(*.tar.gz|*.tgz) tar -xvzf "${archive_name}" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar -xvjf "${archive_name}" ;;
(*.tar.xz|*.txz) tar --xz --help &> /dev/null && tar --xz -xvf "${archive_name}" \
|| xzcat "${archive_name}" | tar xvf - ;;
(*.tar.zma|*.tlz) tar --lzma --help &> /dev/null && tar --lzma -xvf "${archive_name}" \
|| lzcat "${archive_name}" | tar xvf - ;;
(*.tar) tar xvf "${archive_name}" ;;
(*.gz) gunzip "${archive_name}" ;;
(*.bz2) bunzip2 "${archive_name}" ;;
(*.xz) unxz "${archive_name}" ;;
(*.lzma) unlzma "${archive_name}" ;;
(*.Z) uncompress "${archive_name}" ;;
(*.zip) unzip "${archive_name}";;
(*.rar) unrar &> /dev/null \
&& unrar x -ad "${archive_name}" \
|| rar x -ad "${archive_name}" ;;
(*.7z) 7za x "${archive_name}" ;;
(*) print "${0}: unknown archive type: ${archive_name}" ;;
esac

View File

@ -1,29 +0,0 @@
#
# Archive aliases
#
# if pigz/pbzip2 are available, alias them as they are drop-in replacements for gzip and bzip2, respectively.
#
# pigz
#
if (( ${+commands[pigz]} )); then
alias gzip='pigz'
fi
if (( ${+commands[unpigz]} )); then
alias gunzip='unpigz'
fi
#
# pbzip2
#
if (( ${+commands[pbzip2]} )); then
alias bzip2='pbzip2'
fi
if (( ${+commands[pbunzip2]} )); then
alias bunzip2='pbunzip2'
fi

View File

@ -1,13 +0,0 @@
Completion
==========
Enables and configures smart and extensive tab completion.
Completions are sourced from [zsh-completions](https://github.com/zsh-users/zsh-completions).
This should be the **LAST** module in the `zmodules` list in your `.zimrc`.
Contributing
------------
Command completions should be submitted [upstream to zsh-completions](https://github.com/zsh-users/zsh-completions).

View File

@ -1,14 +0,0 @@
#
# Alias compdefs
#
# Any aliased commands will not function with completion without compdefs.
# Because completion is the LAST module to be loaded (so we make sure to catch all completions)
# we must assign the compdefs here, as opposed to within the modules themselves.
# Unfortunately, I'm not aware of a worthwhile way to ensure that these will be included in .zcompdump
# zpacman_frontend -> pacman
if (( ${+zpacman_frontend} )); then
compdef ${zpacman_frontend}='pacman'
fi

View File

@ -1,10 +0,0 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://EditorConfig.org
root = true
[_*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = LF

View File

@ -1,3 +0,0 @@
# zsh word code files
*.zwc

View File

@ -1,74 +0,0 @@
zsh-completions ![GitHub release](https://img.shields.io/github/release/zsh-users/zsh-completions.svg) ![GitHub contributors](https://img.shields.io/github/contributors/zsh-users/zsh-completions.svg) ![IRC](https://img.shields.io/badge/IRC-%23zsh--completions-yellow.svg)
=============
**Additional completion definitions for [Zsh](http://www.zsh.org).**
*This projects aims at gathering/developing new completion scripts that are not available in Zsh yet. The scripts may be contributed to the Zsh project when stable enough.*
## Status
See [issues](https://github.com/zsh-users/zsh-completions/issues) for details on each completion definition.
## Usage
### Using packages
| System | Package |
| ------------- | ------------- |
| Debian / Ubuntu | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
| Fedora / CentOS / RHEL / Scientific Linux | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
| OpenSUSE / SLE | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
| Arch Linux | [zsh-completions](https://www.archlinux.org/packages/zsh-completions), [zsh-completions-git](https://aur.archlinux.org/packages/zsh-completions-git) |
| Gentoo | [app-shells/zsh-completions](http://packages.gentoo.org/package/app-shells/zsh-completions) |
| NixOS | [zsh-completions](https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/zsh-completions/default.nix) |
| Mac OS | [homebrew](https://github.com/Homebrew/homebrew-core/blob/master/Formula/zsh-completions.rb) |
### Using zsh frameworks
#### [antigen](https://github.com/zsh-users/antigen)
Add `antigen bundle zsh-users/zsh-completions` to your `~/.zshrc`.
#### [oh-my-zsh](http://github.com/robbyrussell/oh-my-zsh)
* Clone the repository inside your oh-my-zsh repo:
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
* Enable it in your `.zshrc` by adding it to your plugin list and reloading the completion:
plugins=(… zsh-completions)
autoload -U compinit && compinit
### Manual installation
* Clone the repository:
git clone git://github.com/zsh-users/zsh-completions.git
* Include the directory in your `$fpath`, for example by adding in `~/.zshrc`:
fpath=(path/to/zsh-completions/src $fpath)
* You may have to force rebuild `zcompdump`:
rm -f ~/.zcompdump; compinit
### Contributing
Contributions are welcome, just make sure you follow the guidelines:
* Completions are not accepted when already available in zsh.
* Completions are not accepted when already available in their original project.
* Please do not just copy/paste someone else completion, ask before.
* Completions only partially implemented are not accepted.
* Please add a header containing authors, license info, status and origin of the script (example [here](src/_ack)).
* Please try to follow [Zsh completion style guide](https://github.com/zsh-users/zsh/blob/master/Etc/completion-style-guide).
* Please send one separate pull request per file.
* Send a pull request or ask for committer access.
## License
See each file for license details.

View File

@ -1,237 +0,0 @@
#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
# -----------
#
# Completion script for ack 1.96 and 2.14 (http://betterthangrep.com).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com> (version 1.94)
# * Zhao Cai <caizhaoff@gmail.com> (version 2.04)
#
# ------------------------------------------------------------------------------
_ack_version() {
local version
version=(${(f)"$(_call_program version $words[1] --version)"})
version=${${(z)${version[1]}}[2]}
echo $version
}
_ack() {
local context curcontext="$curcontext" state line cmds update_policy ret=1
integer NORMARG
typeset -A opt_args
# Don't complete if command doesn't exist
[[ ${+commands[${words[1]}]} -eq 0 ]] && return 0
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _ack_types_caching_policy
unset _ack_raw_types
if ( [[ ${+_ack_raw_types} -eq 0 ]] || _cache_invalid "ack-grep" ) && ! _retrieve_cache "ack-grep"; then
_ack_raw_types=(${(S)${(S)${(f)${${"$(_call_program types $words[1] --help=types)"}#*--\[no\]}}%; first line matches \/*\/}#*no\]})
[[ $#_ack_raw_types -gt 0 ]] && _store_cache "ack-grep" _ack_raw_types
fi
ack_20_options=(
'--ackrc[specify an ackrc file to use]:files:_files'
'(- 1 *)--bar[consult Admiral Ackbar]'
'(--nobreak --break)'{--nobreak,--break}'[print a break between results from different files, default on]'
'(- 1 *)--cathy[chocolate chocolate chocolate]'
'(- 1 *)--create-ackrc[create custom ackrc files based on the default settings loaded by ackrc]'
'(- 1 *)--dump[writes the list of options loaded and where they came from to standard output]'
'(--files-from -x)--files-from=[read the list of files to search from FILE]:files:_files'
'(--filter --nofilter)--filter[force ack to treat input as pipe]'
'(--filter --nofilter)--nofilter[force ack to treat input as tty]'
'(--noheading --heading)'{--noheading,--heading}'[print a filename heading above results, default on]'
'(- 1 *)--help-types[display all known types]'
'--ignore-ack-defaults[ignore default definitions included with ack]'
'*--ignore-file=[ignore file]:ignore file filter: _describe "ignore file filter" ignore_filter_opts'
'(-k --known-types)'{-k,--known-types}'[include only files of types that ack recognizes]'
'--lines=[only print line(s) NUM of each file]:number'
'--nopager[do not send output through a pager, overrides ackrc, ACK_PAGER & ACK_PAGER_COLOR]'
'-s[suppress error messages about nonexistent or unreadable files]'
'(- 1 *)--thpppt[bill the cat]'
'*--type-del[remove all filters associated with TYPE]' \
'(-x --files-from)-x[read the list of files to search from STDIN]'
)
ack_19_options=(
'(-a --all -u --unrestricted)'{-a,--all}'[operate on all files, regardless of type (but still skip directories like blib, CVS, etc.)]'
'-G+[only paths matching the given regex are included in the search]:regex'
'--invert-file-match[print/search handle files that do not match -g/-G]'
'--line=[only print given line of each file]:number' \
'(-u --unrestricted -a --all)'{-u,--unrestricted}'[all files and directories (including blib/, core.*, ...) are searched, nothing is skipped]'
)
if (( $(_ack_version) > 2.0 )); then
ack_version_options=(${ack_20_options})
else
ack_version_options=(${ack_19_options})
fi
_arguments -C -s -S -n \
'(- 1 *)--version[display version and copyright information]' \
'(- 1 *)--help[print a short help statement]' \
'(- 1 *)--man[print the manual page]' \
$ack_version_options \
'(-A --after-context -C --context)'{-A+,--after-context=}'[print N lines of trailing context after matching lines]:number' \
'(-B --before-context -C --context)'{-B+,--before-context=}'[print N lines of leading context before matching lines]:number' \
'(-C --context -A --after-context -B --before-context)'{-C-,--context=}'[print N lines (default 2) of context around matching lines]:number' \
'(-c --count)'{-c,--count}'[suppress normal output; instead print a count of matching lines for each input file]' \
'(--nocolor)--color[highlight the matching text]' \
'(--color --color-filename --color-match --color-lineno)--nocolor[suppress the color]' \
'(--nocolor --color)--color-filename[sets the color to be used for filenames]:color:->colors' \
'(--nocolor --color)--color-match[sets the color to be used for matches]:color:->colors' \
'(--nocolor --color)--color-lineno[sets the color to be used for line numbers]:color:->colors' \
'--column[show the column number of the first match]' \
'(--noenv)--env[enable environment processing]' \
'(--env)--noenv[disable all environment processing, no .ackrc is read and all environment variables are ignored]' \
'--flush[flush output immediately]' \
'-f[only print the files that would be searched, without actually doing any searching]' \
'(--nofollow)--follow[follow symlinks]' \
'(--follow)--nofollow[don'\''t follow symlinks]' \
'-g+[print files where the relative path + filename matches the given regex]:regex' \
'(--nogroup)--group[group matches by file name]' \
'(--group)--nogroup[do not group matches by file name]' \
'(-H --with-filename -h --no-filename)'{-H,--with-filename}'[print the filename for each match]' \
'(-h --no-filename -H --with-filename)'{-h,--no-filename}'[suppress the prefixing of filenames on output when multiple files are searched]' \
'(-i --ignore-case)'{-i,--ignore-case}'[ignore case in the search strings]' \
'*--ignore-dir=[ignore directory]:directory:_files' \
'*--noignore-dir=[ignore directory]:directory:_files' \
'(-l --files-with-matches -L --files-without-matches)'{-l,--files-with-matches}'[only print the filenames of matching files, instead of the matching text]' \
'(-L --files-without-matches -l --files-with-matches)'{-L,--files-without-matches}'[only print the filenames of files that do NOT match]' \
'--match=[specify the regular expression explicitly]:regex' \
'(-m --max-count)'{-m+,--max-count=}'[stop reading a file after N matches]:number' \
'(-r -R --recurse -n --no-recurse)'{-r,-R,--recurse}'[recurse into sub-directories]' \
'(-n --no-recurse -r -R --recurse)'{-n,--no-recurse}'[no descending into subdirectories]' \
'-o[show only the part of each line matching PATTERN (turns off text highlighting)]:pattern' \
'--output=[output the evaluation of expr for each line (turns off text highlighting)]:expression' \
'--pager=[direct ack'\''s output through program]:pager program:_command_names' \
'--passthru[prints all lines, whether or not they match the expression]' \
'--print0[the filenames are output separated with a null byte instead of the usual newline]' \
'(-Q --literal)'{-Q,--literal}'[quote all metacharacters in the pattern, it is treated as a literal]' \
'(--no-smart-case)--smart-case[ignore case in the search strings if pattern contains no uppercase characters]' \
'(--smart-case)--no-smart-case[disable --smart-case option]' \
'--sort-files[sorts the found files lexically]' \
'--show-types[outputs the filetypes that ack associates with each file]' \
'--thpppt[display the all-important Bill The Cat logo]' \
'*--type=[specify the types of files to include or exclude from a search]:type:->types' \
'*--type-add[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \
'*--type-set[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \
'(-v --invert-match)'{-v,--invert-match}'[invert match: select non-matching lines]' \
'(-w --word-regexp)'{-w,--word-regexp}'[force the given pattern to match only whole words]' \
'-1[stops after reporting first match of any kind]' \
{'--','--no'}${_ack_raw_types/ ##/\[}']' \
'*: :->args' \
&& ret=0
case $state in
args)
if [[ CURRENT -eq NORMARG && ${+opt_args[--match]} -eq 0 ]]; then
# If the current argument is the first non-option argument
# and --match isn't present then a pattern is expected
_message -e patterns 'pattern' && ret=0
else
_files
fi
;;
colors)
local colors; colors=(
'black' 'on_black'
'red' 'on_red'
'green' 'on_green'
'yellow' 'on_yellow'
'blue' 'on_blue'
'magenta' 'on_magenta'
'cyan' 'on_cyan'
'white' 'on_white'
'clear'
'reset'
'dark'
'bold'
'underline'
'underscore'
'blink'
'reverse'
'concealed'
)
_describe -t 'colors' 'color' colors && ret=0
;;
type-defs)
if compset -P '*='; then
local extensions; extensions=(*.*(:e))
_values -s ',' 'file extension' '.'$extensions && ret=0
else
_message -e type-name 'type name' && ret=0
fi
;;
types)
local types; types=({'','no'}${_ack_raw_types/ ##/:})
_describe -t 'types' 'type' types
;;
esac
return ret
}
ignore_filter_opts=(
'is\::FILENAME'
'ext\::[EXTENSION,EXTENSION2,...]'
'match\::PATTERN'
'firstlinematch\::PATTERN'
)
_ack_types_caching_policy() {
# Rebuild if ackrc more recent than cache.
[[ -f ${ACKRC:-$HOME/.ackrc} && ${ACKRC:-$HOME/.ackrc} -nt "$1" ]] && return 0
# Rebuild if cache is older than one week.
local -a oldp
oldp=( "$1"(Nmw+1) )
(( $#oldp )) && return 0
return 1
}
_ack "$@"
# 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,72 +0,0 @@
#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,333 +0,0 @@
#compdef android
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for the android command (Revision 12)
# (http://developer.android.com/guide/developing/tools/android.html).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_android() {
typeset -A opt_args
local context state line curcontext="$curcontext"
local ret=1
_arguments -C -A "-*" \
'(- : *)'{-h,--help}'[get help on a specific command]:command:_android_cmds' \
'(-s --silent -v --verbose)'{-v,--verbose}'[verbose mode: errors, warnings and informational messages are printed]' \
'(-v --verbose -s --silent)'{-s,--silent}'[silent mode: only errors are printed out]' \
'1: :_android_cmds' \
'*::arg:->args' \
&& ret=0
case "$state" in
(args)
curcontext="${curcontext%:*:*}:android-cmd-$words[1]:"
case $words[1] in
(list)
_arguments -C \
'1: :_android_list_entities' \
'*::list-arg:->list-args' \
&& ret=0
case "$state" in
(list-args)
case $words[1] in
(avd|target)
_arguments \
'(-0 --null)'{-0,--null}'[terminate lines with \0 instead of \n (e.g. for xargs -0)]' \
'(-c --compact)'{-c,--compact}'[compact output (suitable for scripts)]' \
&& ret=0
;;
(sdk)
_arguments \
'(-o --obsolete)'{-o,--obsolete}'[install obsolete packages]' \
'--proxy-host[HTTP/HTTPS proxy host (overrides settings if defined)]:proxy host:_hosts' \
'--proxy-port[HTTP/HTTPS proxy port (overrides settings if defined)]:proxy port number' \
'(-s --no-https)'{-s,--no-https}'[use HTTP instead of HTTPS (the default) for downloads]' \
'(-u --no-ui)'{-u,--no-ui}'[display list result on console (no GUI)]' \
&& ret=0
;;
esac
;;
esac
;;
(create)
_arguments -C \
'1: :_android_create_entities' \
'*::create-arg:->create-args' \
&& ret=0
case "$state" in
(create-args)
case $words[1] in
(avd)
_arguments \
'(-c --sdcard)'{-c,--sdcard}'[path to a shared SD card image, or size of a new sdcard for the new AVD]:SD card image or size:_files -g "*.img"' \
'(-n --name)'{-n,--name}'[name of the new AVD]:name' \
'(-a --snapshot)'{-a,--snapshot}'[place a snapshots file in the AVD, to enable persistence]' \
'(-p --path)'{-p,--path}'[directory where the new AVD will be created]: :_files -/' \
'(-f --force)'{-f,--force}'[forces creation (overwrites an existing AVD)]' \
'(-s --skin)'{-s,--skin}'[skin for the new AVD]:skin' \
'(-t --target)'{-t,--target}'[target ID of the new AVD]: :_android_targets' \
&& ret=0
;;
(project)
_arguments \
'(-n --name)'{-n,--name}'[project name]:project name' \
'(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
'(-k --package)'{-k,--package}'[Android package name for the application]:package name' \
'(-a --activity)'{-a,--activity}'[name of the default Activity that is created]:activity name' \
'(-t --target)'{-t,--target}'[target ID of the new project]: :_android_targets' \
&& ret=0
;;
(test-project)
_arguments \
'(-n --name)'{-n,--name}'[project name]:project name' \
'(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
'(-m --main)'{-m,--main}'[path to directory of the app under test, relative to the test project directory]:path' \
&& ret=0
;;
(lib-project)
_arguments \
'(-n --name)'{-n,--name}'[project name]:project name' \
'(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
'(-k --package)'{-k,--package}'[Android package name for the application]:package name' \
'(-t --target)'{-t,--target}'[target ID of the new project]: :_android_targets' \
&& ret=0
;;
esac
;;
esac
;;
(update)
_arguments -C \
'1: :_android_update_entities' \
'*::update-arg:->update-args' \
&& ret=0
case "$state" in
(update-args)
case $words[1] in
(avd)
_arguments \
'(-n --name)'{-n,--name}'[name of the AVD to update]: :_android_avd_names' \
&& ret=0
;;
(project)
_arguments \
'(-l --library)'{-l,--library}'[directory of an Android library to add, relative to this project'\''s directory]: :_files -/' \
'(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
'(-n --name)'{-n,--name}'[project name]:name' \
'(-t --target)'{-t,--target}'[target ID to set for the project]: :_android_targets' \
'(-s --subprojects)'{-s,--subprojects}'[also updates any projects in sub-folders, such as test projects]' \
&& ret=0
;;
(test-project)
_arguments \
'(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
'(-m --main)'{-m,--main}'[directory of the app under test, relative to the test project directory]:path' \
&& ret=0
;;
(lib-project)
_arguments \
'(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
'(-t --target)'{-t,--target}'[target ID to set for the project]: :_android_targets' \
&& ret=0
;;
(sdk)
_arguments \
'(-o --obsolete)'{-o,--obsolete}'[install obsolete packages]' \
'--proxy-host[HTTP/HTTPS proxy host (overrides settings if defined)]:proxy host:_hosts' \
'--proxy-port[HTTP/HTTPS proxy port (overrides settings if defined)]:proxy port number' \
'(-s --no-https)'{-s,--no-https}'[use HTTP instead of HTTPS (the default) for downloads]' \
'(-u --no-ui)'{-u,--no-ui}'[update from command-line (no GUI)]' \
'(-f --force)'{-f,--force}'[force replacement of a package or its parts, even if something has been modified]' \
'(-t --filter)'{-t,--filter}'[a filter that limits the update to the specified types of packages]: :_android_sdk_update_filters -s ,' \
'(-n --dry-mode)'{-n,--dry-mode}'[simulate the update but does not download or install anything]' \
&& ret=0
;;
esac
;;
esac
;;
(move)
_arguments -C \
'1: :_android_move_entities' \
'*::move-arg:->move-args' \
&& ret=0
case "$state" in
(move-args)
case $words[1] in
(avd)
_arguments \
'(-n --name)'{-n,--name}'[name of the AVD to move or rename]: :_android_avd_names' \
'(-p --path)'{-p,--path}'[path to the AVD'\''s new directory]: :_files -/' \
'(-r --rename)'{-r,--rename}'[new name of the AVD]:name' \
&& ret=0
;;
esac
;;
esac
;;
(delete)
_arguments -C \
'1: :_android_delete_entities' \
'*::delete-arg:->delete-args' \
&& ret=0
case "$state" in
(delete-args)
case $words[1] in
(avd)
_arguments \
'(-n --name)'{-n,--name}'[name of the AVD to delete]: :_android_avd_names' \
&& ret=0
;;
esac
;;
esac
;;
(display)
_arguments \
'1: :_android_display_entities' \
&& ret=0
;;
esac
;;
esac
return ret
}
(( $+functions[_android_cmds] )) ||
_android_cmds() {
local commands; commands=(
'list:list existing targets or virtual devices'
'create:create new virtual devices or projects'
'update:update a virtual device, project, SDK or adb'
'move:move a virtual device'
'delete:delete a virtual device'
'avd:displays the AVD Manager window'
'sdk:displays the SDK Manager window'
'display:display manager windows'
)
_describe -t commands 'command' commands "$@"
}
(( $+functions[_android_list_entities] )) ||
_android_list_entities() {
local entities; entities=(
'avd:list existing Android Virtual Devices'
'target:list existing targets'
'sdk:list remote SDK repository'
)
_describe -t entities 'entity' entities "$@"
}
(( $+functions[_android_create_entities] )) ||
_android_create_entities() {
local entities; entities=(
'avd:create a new Android Virtual Device'
'project:create a new Android project'
'test-project:create a new Android project for a test package'
'lib-project:create a new Android library project'
)
_describe -t entities 'entity' entities "$@"
}
(( $+functions[_android_update_entities] )) ||
_android_update_entities() {
local entities; entities=(
'avd:update an Android Virtual Device to match the folders of a new SDK'
'project:update an Android project'
'test-project:update the Android project for a test package'
'lib-project:update an Android library project'
'adb:update adb to support the USB devices declared in the SDK add-ons'
'sdk:update the SDK by suggesting new platforms to install if available'
)
_describe -t entities 'entity' entities "$@"
}
(( $+functions[_android_move_entities] )) ||
_android_move_entities() {
local entities; entities=(
'avd:move or rename an Android Virtual Device'
)
_describe -t entities 'entity' commands "$@"
}
(( $+functions[_android_delete_entities] )) ||
_android_delete_entities() {
local entities; entities=(
'avd:delete an Android Virtual Device'
)
_describe -t entities 'entity' entities "$@"
}
(( $+functions[_android_display_entities] )) ||
_android_display_entities() {
local entities; entities=(
'sdk:display the SDK Manager window'
'avd:display the AVD Manager window'
)
_describe -t entities 'entity' entities "$@"
}
(( $+functions[_android_targets] )) ||
_android_targets() {
local targets; targets=(${(f)"$(_call_program targets $service list target --compact)"//:/\\:})
_describe -t targets 'target' targets "$@"
}
(( $+functions[_android_avd_names] )) ||
_android_avd_names() {
local avd_names; avd_names=(${(f)"$(_call_program targets $service list avd --compact)"//:/\\:})
_describe -t avd-names 'AVD name' avd_names "$@"
}
(( $+functions[_android_sdk_update_filters] )) ||
_android_sdk_update_filters() {
local filters; filters=(platform tool platform-tool doc sample extra)
_values $@ 'filter' "${filters[@]}"
}
_android "$@"
# 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,709 +0,0 @@
#compdef ansible
# ------------------------------------------------------------------------------
# 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 ansible v2.0.0.2 (http://ansible.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Romain Bossart (https://github.com/bosr)
# * Adam Stevko (https://github.com/xen0l)
#
# ------------------------------------------------------------------------------
#
# Needs either ANSIBLE_HOSTS or /etc/ansible/hosts on linux
# (or /usr/local/etc/ansible/hosts on OSX)
#
# Note 1: the following gist (https://gist.github.com/15ed54a438a36d67fd99.git)
# has some files to help improve the hostfile shell parsing
#
# Note 2: I tried to use `_arguments --`, but the output of `ansible --help`
# is not parsed entirely correctly, and anyway no modules or host would available.
#
# ansible zsh completion
#
__host_file_location () {
# find the location of the host file:
# 1. check $ANSIBLE_HOSTS
# 2. else check /etc/ansible/hosts or /usr/local/etc/...
# (depending on platform)
#
[[ "$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}
}
__ll_group_list () {
# parses the ini hostfile for groups only: [...]
HOST_FILE=$(__host_file_location)
local -a group_list
group_list=$(command \
cat ${HOST_FILE} \
| awk '$1 ~ /^\[.*\]$/ && !/=/ && !/:vars/ \
{ gsub(/[\[\]]/, "", $1); gsub(/:children/, "", $1) ; print $1 }' \
| uniq )
echo ${group_list}
}
__host_list ()
{
# parses the ini hostfile for hosts only
# but then has to remove all group occurrences
HOST_FILE=$(__host_file_location)
# this will also contain groups if they are referenced in other groups
local -a mixed_host_list
mixed_host_list=$(command \
cat ${HOST_FILE} \
| awk 'NF && $1 !~ /^[[:space:]]*#|[\[:=]/ { print $1 }' \
| sort | uniq)
# compute set difference h1 - h2
local -a h1 h2 host_list
h1=${mixed_host_list}
h2=$(__ll_group_list)
host_list=($(command \
sort <(echo $h1) <(echo $h2) <(echo $h2) \
| uniq -u \
| paste -s -d ' ' - )
)
_wanted application expl 'hosts' compadd ${host_list}
# method that delegates to ansible (slow)
# _wanted application expl 'hosts' compadd $(command ansible \
# all --list-hosts\
# 2>/dev/null)
}
__group_list ()
{
gl=($(command echo $(__ll_group_list) | paste -s -d ' ' - )) # 'a\nb\nc' -> (a b c)
_wanted application2 expl 'groups' compadd $gl
}
_modules=(
'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: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'
'apt_rpm:apt_rpm package manager'
'assemble:Assembles a configuration file from fragments'
'assert:Fail with custom message'
'async_status:Obtain status of asynchronous task'
'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: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: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:Manages Perl library dependencies.'
'cron:Manage cron.d and crontab entries.'
'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: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: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_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'
'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.'
'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: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: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:a wrapper to the unix getent utility'
'git:Deploy software (or files) from git checkouts'
'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: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: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'
'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: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:Publish a message on an MQTT topic for the IoT'
'mysql_db:Add or remove MySQL databases from a remote host.'
'mysql_replication:Manage MySQL replication'
'mysql_user:Adds or removes a user from a MySQL database.'
'mysql_variables:Manage MySQL global variables'
'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'
'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: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_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.'
'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'
'rax_cbs_attachments:Manipulate Rackspace Cloud Block Storage Volume Attachments'
'rax_cdb:create/delete or resize a Rackspace Cloud Databases instance'
'rax_cdb_database:create / delete a database in the Cloud Databases'
'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'
'rax_files:Manipulate Rackspace Cloud Files Containers'
'rax_files_objects:Upload, download, and delete objects in Rackspace Cloud Files'
'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'
'rax_scaling_policy:Manipulate Rackspace Cloud Autoscale Scaling Policy'
'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 ``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 ``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: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:Send Slack notifications'
'slackpkg:Package manager for Slackware >= 12.2'
'slurp:Slurps a file from remote nodes'
'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: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: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:Urpmi manager'
'user:Manage user accounts'
'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.'
'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_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'
'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'
)
_ansible ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C -W \
'1:pattern:->pattern'\
"(-a --args)"{-a,--args}"[ARGS module arguments]:arguments:(ARG)"\
'--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"\
"(-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]'\
"(-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'\
'--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})"\
"--vault-password-file[VAULT_PASSWORD_FILE vault password file]:vault password file:_files"\
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]"\
"--version[show program's version number and exit]"\
case $state in
pattern)
_arguments '*:feature:__host_list'
_arguments '*:feature:__group_list'
;;
module)
_describe -t commands "modules" _modules
;;
esac
}
_ansible "$@"
# 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,183 +0,0 @@
#compdef ansible-galaxy
# ------------------------------------------------------------------------------
# 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 ansible-galaxy v2.0.0.2 (http://ansible.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Romain Bossart (https://github.com/bosr)
# * Adam Stevko (https://github.com/xen0l)
#
# ------------------------------------------------------------------------------
#
# Note: I tried to use `_arguments --`, but the output of `ansible --help`
# is not parsed entirely correctly, and anyway no modules or host would available.
#
# ansible-galaxy zsh completion
#
_ansible-galaxy ()
{
local context curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
"1:command:(delete import info init install list login remove search setup)" \
"*::option:->option"
case $state in
option)
case $line[1] in
delete)
_arguments \
"(-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]" \
":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)" \
"(-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
}
_ansible-galaxy "$@"
# 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,191 +0,0 @@
#compdef ansible-playbook
# ------------------------------------------------------------------------------
# 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 ansible-playbook v2.0.0.2 (http://ansible.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Romain Bossart (https://github.com/bosr)
# * Adam Stevko (https://github.com/xen0l)
#
# ------------------------------------------------------------------------------
#
# Needs either ANSIBLE_HOSTS or /etc/ansible/hosts on linux
# (or /usr/local/etc/ansible/hosts on OSX)
#
# Note 1: the following gist (https://gist.github.com/15ed54a438a36d67fd99.git)
# has some files to help improve the hostfile shell parsing
#
# Note 2: I tried to use `_arguments --`, but the output of `ansible --help`
# is not parsed entirely correctly, and anyway no modules or host would available.
#
# ansible-playbook zsh completion
#
__host_file_location () {
# find the location of the host file:
# 1. check $ANSIBLE_HOSTS
# 2. else check /etc/ansible/hosts or /usr/local/etc/...
# (depending on platform)
#
[[ "$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}
}
__ll_group_list () {
# parses the ini hostfile for groups only: [...]
HOST_FILE=$(__host_file_location)
local -a group_list
group_list=$(command \
cat ${HOST_FILE} \
| awk '$1 ~ /^\[.*\]$/ && !/=/ && !/:vars/ \
{ gsub(/[\[\]]/, "", $1); gsub(/:children/, "", $1) ; print $1 }' \
| uniq )
echo ${group_list}
}
__host_list ()
{
# parses the ini hostfile for hosts only
# but then has to remove all group occurrences
HOST_FILE=$(__host_file_location)
# this will also contain groups if they are referenced in other groups
local -a mixed_host_list
mixed_host_list=$(command \
cat ${HOST_FILE} \
| awk 'NF && $1 !~ /[\[:=]/ { print $1 }' \
| sort | uniq)
# compute set difference h1 - h2
local -a h1 h2 host_list
h1=${mixed_host_list}
h2=$(__ll_group_list)
host_list=($(command \
sort <(echo $h1) <(echo $h2) <(echo $h2) \
| uniq -u \
| paste -s -d ' ' - )
)
_wanted application expl 'hosts' compadd ${host_list}
# method that delegates to ansible (slow)
# _wanted application expl 'hosts' compadd $(command ansible \
# all --list-hosts\
# 2>/dev/null)
}
__group_list ()
{
gl=($(command echo $(__ll_group_list) | paste -s -d ' ' - )) # 'a\nb\nc' -> (a b c)
_wanted application2 expl 'groups' compadd $gl
}
_ansible-playbook ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C -W \
"1:playbook yml file:_files -g '*.yml'"\
'--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)]"\
"(-e --extra-vars)"{-e,--extra-vars}"[EXTRA_VARS set additional variables as key=value or YAML/JSON]:extra vars:(EXTRA_VARS)"\
'--flush-cache[clear the fact cache]'\
'--force-handlers[run handlers even if a task fails]'\
"(-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"\
"(-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 -/"\
'--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 (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)"\
"(-u --user)"{-u,--user}"[REMOTE_USER connect as this user (default=${USER})]:connect as user:(${USER})"\
"--vault-password-file[VAULT_PASSWORD_FILE vault password file]:vault password file:_files"\
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]"\
"--version[show program's version number and exit]"\
case $state in
pattern)
_arguments '*:feature:__host_list'
_arguments '*:feature:__group_list'
;;
esac
}
_ansible-playbook "$@"
# 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,94 +0,0 @@
#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

@ -1,85 +0,0 @@
#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

@ -1,63 +0,0 @@
#compdef artisan
# ------------------------------------------------------------------------------
# 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 artisan (http://laravel.com/docs/artisan).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * loranger (https://github.com/loranger)
# * Yohan Tambè (https://github.com/Cronos87)
#
# ------------------------------------------------------------------------------
_artisan_get_command_list () {
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
local -a commands
IFS=$'\n'
commands=(`_artisan_get_command_list`)
_describe 'commands' commands
fi
}
compdef _artisan php artisan
compdef _artisan artisan

View File

@ -1,71 +0,0 @@
#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
# -----------
#
# Completion script for atach (https://github.com/sorin-ionescu/atach).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Sorin Ionescu <sorin.ionescu@gmail.com>
#
# ------------------------------------------------------------------------------
local state mode_values existing_sessions ret=1
mode_values=(
"none:disable redrawing"
"ctrl_l:use ctrl + l to redraw"
"winch:use sigwinch to redraw"
)
existing_sessions=($(_call_program session atach))
_arguments -C -s -S \
'(--list -l)'{--list,-l}'[list sessions]' \
'(--sockets -L)'{--sockets,-L}'[list sockets]' \
'(--session -s)'{--session=,-s+}'[set the session name]:session' \
'(--char -c)'{--char=,-c+}'[set the detach character (default: ^\\)]:char' \
'(--redraw -r)'{--redraw=,-r+}'[set the redraw method (none, ctrl_l, or winch)]:mode:->mode' \
'(--detached -d)'{--detached,-d}'[start the session detached]' \
'(--no-detach -D)'{--no-detach,-D}'[disable detaching]' \
'(--no-suspend -Z)'{--no-suspend,-Z}'[disable suspending]' \
'(--version -v)'{--version,-v}'[display version and copyright]' \
'(--help -h)'{--help,-h}'[display help]' \
'(-)::args:->session-or-command' && ret=0
case "$state" in
(mode)
_describe -t mode 'redraw mode' mode_values && ret=0
;;
(session-or-command)
_describe -t 'session' 'sessions' existing_sessions && ret=0
_path_commands && ret=0
;;
esac
return $ret

View File

@ -1,172 +0,0 @@
#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
# -----------
#
# Completion script for Bower (http://bower.io).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Joe Lencioni (https://github.com/lencioni)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line _packages _opts ret=1
_arguments -C -A "-v" -A "--version" \
'(- 1 *)'{-v,--version}'[display version information]' \
'1: :->cmds' \
'*:: :->args' && ret=0
case $state in
cmds)
_values "bower command" \
"cache[Manage bower cache]" \
"help[Display help information about Bower]" \
"home[Opens a package homepage into your favorite browser]" \
"info[Info of a particular package]" \
"init[Interactively create a bower.json file]" \
"install[Install a package locally]" \
"link[Symlink a package folder]" \
"list[List local packages - and possible updates]" \
"login[Authenticate with GitHub and store credentials]" \
"lookup[Look up a package URL by name]" \
"prune[Removes local extraneous packages]" \
"register[Register a package]" \
"search[Search for a package by name]" \
"update[Update a local package]" \
"uninstall[Remove a local package]" \
"unregister[Remove a package from the registry]" \
"version[Bump a package version]"
_arguments \
'(--force)--force[Makes various commands more forceful]' \
'(--json)--json[Output consumable JSON]' \
'(--log-level)--log-level[What level of logs to report]' \
'(--offline)--offline[Do not hit the network]' \
'(--quiet)--quiet[Only output important information]' \
'(--silent)--silent[Do not output anything, besides errors]' \
'(--verbose)--verbose[Makes output more verbose]' \
'(--allow-root)--allow-root[Allows running commands as root]' \
'(--version)--version[Output Bower version]' \
'(--no-color)--no-color[Disable colors]'
ret=0
;;
args)
case $line[1] in
help)
_values 'commands' \
'cache' \
'home' \
'info' \
'init' \
'install' \
'link' \
'list' \
'login' \
'lookup' \
'prune' \
'register' \
'search' \
'update' \
'uninstall' \
'unregister' \
'version'
ret=0
;;
(home|info|init|link|lookup|prune|register|search|unregister)
_arguments \
'(--help)--help[Show help message]'
ret=0
;;
install)
_arguments \
'(--force-latest)--force-latest[Force latest version on conflict]' \
'(--help)--help[Show help message]' \
'(--production)--production[Do not install project devDependencies]' \
'(--save)--save[Save installed packages into the project''s bower.json dependencies]' \
'(--save-dev)--save-dev[Save installed packages into the project''s bower.json devDependencies]'
ret=0
;;
list)
_arguments \
'(--help)--help[Show help message]' \
'(--paths)--paths[Generate a simple JSON source mapping]' \
'(--relative)--relative[Make paths relative to the directory config property, which defaults to bower_components]'
ret=0
;;
login)
_arguments \
'(--help)--help[Show help message]' \
'(-t --token)'{-t,--token}'[Pass GitHub auth token (will not prompt for username/password)]'
ret=0
;;
uninstall)
_arguments \
'(--help)--help[Show help message]' \
'(--save)--save[Save installed packages into th projects''s bower.json dependencies]' \
'(--save-dev)--save-dev[Save installed packages into th projects''s bower.json devDependencies]'
ret=0
;;
update)
_arguments \
'(--force-latest)--force-latest[Force latest version on conflict]' \
'(--help)--help[Show help message]' \
'(--production)--production[Do not install project devDependencies]'
ret=0
;;
version)
_arguments \
'(--message)--message[Custom git commit and tag message]'
ret=0
;;
exec)
_normal && ret=0
;;
*)
_opts=( $(bower help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
_opts+=( $(bower help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
if [[ $_opts != "" ]]; then
_values 'options' $_opts && ret=0
fi
;;
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,129 +0,0 @@
#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
# -----------
#
# Completion script for Bundler (http://gembundler.com).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Bruno Michel (https://github.com/nono)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line _gems _opts ret=1
_arguments -C -A "-v" -A "--version" \
'(- 1 *)'{-v,--version}'[display version information]' \
'1: :->cmds' \
'*:: :->args' && ret=0
case $state in
cmds)
_values "bundle command" \
"install[Install the gems specified by the Gemfile or Gemfile.lock]" \
"update[Update dependencies to their latest versions]" \
"package[Package the .gem files required by your application]" \
"exec[Execute a script in the context of the current bundle]" \
"config[Specify and read configuration options for bundler]" \
"check[Determine whether the requirements for your application are installed]" \
"list[Show all of the gems in the current bundle]" \
"show[Show the source location of a particular gem in the bundle]" \
"console[Start an IRB session in the context of the current bundle]" \
"open[Open an installed gem in the editor]" \
"viz[Generate a visual representation of your dependencies]" \
"init[Generate a simple Gemfile, placed in the current directory]" \
"gem[Create a simple gem, suitable for development with bundler]" \
"help[Describe available tasks or one specific task]" \
"platform[Displays platform compatibility information]" \
"outdated[Show all of the outdated gems in the current bundle]"
ret=0
;;
args)
case $line[1] in
help)
_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]' \
'(--quiet)--quiet[only output warnings and errors]' \
'(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
'(--system)--system[install to the system location]' \
'(--deployment)--deployment[install using defaults tuned for deployment environments]' \
'(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
'(--path)--path=-[specify a different path than the system default]:path:_files' \
'(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
'(--without)--without=-[exclude gems that are part of the specified named group]:groups' \
'(--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)
_normal && ret=0
;;
(open|show)
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
if [[ $_gems != "" ]]; then
_values 'gems' $_gems && ret=0
fi
;;
*)
_opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
_opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
if [[ $_opts != "" ]]; then
_values 'options' $_opts && ret=0
fi
;;
esac
;;
esac
return ret
# 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,81 +0,0 @@
#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
# -----------
#
# Completion script for Capistrano (http://capify.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Bruno Michel (https://github.com/nono)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line cmds ret=1
_arguments -C \
{-d,--debug}'[Prompts before each remote command execution]' \
{-e,--explain}'[Displays help (if available) for the task]:task' \
{-F,--default-config}'[Always use default config, even with -f]' \
{-f,--file}'[A recipe file to load. May be given more than once]:file:_files' \
{-H,--long-help}'[Explain these options and environment variables]' \
{-h,--help}'[Display this help message]' \
{-l,--logger}'[Choose logger method. STDERR used by default]:file:_files' \
{-n,--dry-run}'[Prints out commands without running them]' \
{-p,--password}'[Immediately prompt for the password]' \
{-q,--quiet}'[Make the output as quiet as possible]' \
{-r,--preserve-roles}'[Preserve task roles]' \
{-S,--set-before}'[Set a variable before the recipes are loaded]:variable' \
{-s,--set}'[Set a variable after the recipes are loaded]:variable' \
{-T,--tasks}'[List all tasks (matching optional PATTERN) in the loaded recipe files]:pattern' \
{-t,--tool}'[Abbreviates the output of -T for tool integration]' \
{-V,--version}'[Display the Capistrano version, and exit]' \
{-v,--verbose}'[Be more verbose. May be given more than once]' \
{-X,--skip-system-config}'[Do not load the system config file (capistrano.conf)]' \
{-x,--skip-user-config}'[Do not load the user config file (.caprc)]' \
'*: :->cmds' && ret=0
case $state in
cmds)
cmds=( ${(f)"$(_call_program commands cap -T 2> /dev/null | sed -e '/ # /!d; s/:/\\:/g; s/cap \([A-Za-z0-9\\:_-]*\) .*# /\1:/')"} )
_describe -t commands 'cap command' cmds && ret=0
;;
esac
return ret
# 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 cask
# ------------------------------------------------------------------------------
# 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
# -----------
#
# Completion script for cask (http://cask.readthedocs.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * ptrv <mail@petervasil.net>
# * Johan Andersson <johan.rejeep@gmail.com>
# * Sebastien Duthil <duthils@free.fr>
#
# ------------------------------------------------------------------------------
function _cask() {
local ret=1 state
_arguments \
':subcommand:->subcommand' \
'*:: :->subcmds' && ret=0
case $state in
subcommand)
subcommands=(
"build:build all Elisp files in the files directive"
"clean-elc:remove all byte compiled Elisp files in the files directive"
"exec:execute command with correct 'exec-path' and 'load-path'"
"exec-path:print 'exec-path' for all packages and dependencies"
"files:print list of files specified in the files directive"
"help:display usage information or documentation for specified command"
"info:show info about the current package"
"init:initialize the current directory with a Cask-file"
"install:install all packages specified in the Cask-file"
"link:manage links"
"list:list dependencies"
"load-path:print 'load-path' for all packages and dependencies"
"outdated:print list of outdated packages"
"package:build package and put in specified directory (default: dist)"
"package-directory:print current package installation directory"
"path:print 'exec-path' for all packages and dependencies"
"pkg-file:write a 'define-package' file"
"update:update package version"
"upgrade-cask:upgrade Cask itself and its dependencies"
"upgrade:upgrade Cask itself and its dependencies"
"version:print program version"
)
_describe -t subcommands 'cask subcommands' subcommands && ret=0
esac
case "$words[1]" in
init)
_arguments \
'(--dev)--dev[Run in dev mode]' && ret=0 ;;
exec)
_generic
;;
esac
return ret
}
_cask "$@"

View File

@ -1,958 +0,0 @@
#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
}
# --------------------------
# ----- 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:' \
'-s=[Space]:space name:' \
'--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:' \
'-b=[Custom buildpack by name (e.g. my-buildpack) or GIT URL or GIT BRANCH URL]' \
'-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'
}
# ------------------
# ----- 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"
)
# -----------------------
# ----- 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 ;;
esac

View File

@ -1,77 +0,0 @@
#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

@ -1,73 +0,0 @@
#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,60 +0,0 @@
#compdef choc
# ------------------------------------------------------------------------------
# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for choc (http://chocolatapp.com)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Nicholas Penree (https://github.com/drudge)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments -C \
'(-a --async)'{-a,--async}'[do not wait for the user to close the file in Chocolat]' \
'(-w --wait)'{-w,--wait}'[wait for file to be closed by Chocolat]' \
'(-n --no-reactivation)'{-n,--no-reactivation}'[after editing with -w, do not reactivate the calling app]' \
'(-h --help)'{-h,--help}'[show help information]' \
'(-v --version)'{-v,--version}'[print version information]' \
'*:script or directory:_files' && ret=0
return ret
# 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,427 +0,0 @@
#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
# -----------
#
# Completion script for CMake (http://www.cmake.org).
#
# -------------------------------------------------------------------------
# Authors
# -------
#
# * Scott M. Kroll <skroll@gmail.com> (initial version)
# * Paul Seyfert <pseyfert@mathphys.fsk.uni-heidelberg.de> (handling of --build)
#
# -------------------------------------------------------------------------
# Notes
# -----
#
# * By default only C and C++ languages are supported for compiler flag
# variables. To define your own list of languages:
#
# cmake_langs=('C' 'C'
# 'CXX' 'C++')
# zstyle ':completion:*:cmake:*' languages $cmake_langs
#
# -------------------------------------------------------------------------
local context state line curcontext="$curcontext" cmake_args
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]'
'(- 1)--help-compatcommands[Print help for compatibility commands]'
'(- 1)--help-module[Print help for compatibility commands]:module-name:_cmake_module_names'
'(- 1)--help-module-list[Print help for a single module and exit]'
'(- 1)--help-modules[Print help for all modules and exit]'
'(- 1)--help-property[List available properties and exit]:property-name:_cmake_property_names'
'(- 1)--help-property-list[List available properties and exit]'
'(- 1)--help-properties[Print help for all properties and exit]'
'(- 1)--help-variable[Print help for a single variable and exit]:variable-name:_cmake_variable_names'
'(- 1)--help-variable-list[List documented variables and exit]'
'(- 1)--help-variables[Print help for all variables and exit]'
'(- 1)--copyright[Print the CMake copyright and exit]'
'(- 1)'{--help,-help,-usage,-h,-H}'[Print usage information and exit]'
'(- 1)--help-full[Print full help and exit]'
'(- 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]'
)
_cmake_help() {
_arguments -C -s - help "$cmake_help_actions[@]"
}
# -------------------
# _cmake_command_names
# -------------------
(( $+functions[_cmake_command_names] )) ||
_cmake_command_names() {
local command_names; command_names=(${(f)"$($service --help-command-list 2> /dev/null)"})
_values 'command name' ${command_names[@]:1} && return 0
}
# -----------------
# _cmake_list_names
# -----------------
(( $+functions[_cmake_list_names] )) ||
_cmake_list_names() {
local command; command="$@[1]"
local desc; desc="$@[2]"
local list_names; list_names=(${(f)"$($service $command 2> /dev/null | sed -e 's/\[/\\\[/' -e 's/\]/\\\]/')"})
_values ${desc} ${list_names[@]:1} && return 0
}
# ------------------
# _cmake_module_names
# ------------------
(( $+functions[_cmake_module_names] )) ||
_cmake_module_names() {
_cmake_list_names '--help-module-list' 'module name' && return 0
}
# --------------------
# _cmake_property_names
# --------------------
(( $+functions[_cmake_property_names] )) ||
_cmake_property_names() {
_cmake_list_names '--help-property-list' 'property name' && return 0
}
# ---------------------
# _cmake_variable_names
# ---------------------
(( $+functions[_cmake_variable_names] )) ||
_cmake_variable_names() {
_cmake_list_names '--help-variable-list' 'variable name' && return 0
}
# ----------------------
# _cmake_define_property
# ----------------------
(( $+functions[_cmake_define_property] )) ||
_cmake_define_property() {
if compset -P '*='; then
_wanted property-values expl 'property value' _cmake_define_property_values ${${IPREFIX%=}#-D} && return 0
else
_wanted property-names expl 'property name' _cmake_define_property_names -qS= && return 0
fi
}
# ----------------------------
# _cmake_define_property_names
# ----------------------------
(( $+functions[_cmake_define_property_names] )) ||
_cmake_define_property_names() {
local alternatives; alternatives=(
'common-property-names:common property name:_cmake_define_common_property_names -qS='
)
local -A cmake_langs
zstyle -a ":completion:${curcontext}:" languages cmake_langs
[[ $#cmake_langs -eq 0 ]] && cmake_langs=('C' 'C' 'CXX' 'C++')
for cmake_lang in ${(k)cmake_langs}; do
cmake_lang_desc="${cmake_langs[$cmake_lang]}"
alternatives+=("${cmake_lang//:/-}-property-names:${cmake_lang_desc} language property name:_cmake_define_lang_property_names -qS= ${cmake_lang} ${cmake_lang_desc}")
done
_alternative "${alternatives[@]}"
}
# ---------------------------------
# _cmake_define_lang_property_names
# ---------------------------------
(( $+functions[_cmake_define_lang_property_names] )) ||
_cmake_define_lang_property_names() {
local cmake_lang="$@[-2]" cmake_lang_desc="$@[-1]"
local properties; properties=(
"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_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"
)
_describe -t "${cmake_lang//:/-}-property-names" "${cmake_lang_desc} property name" properties $@[0,-3] && return 0
}
# -----------------------------------
# _cmake_define_common_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 $@
}
# ----------------------------
# _cmake_define_property_values
# ----------------------------
(( $+functions[_cmake_define_property_values] )) ||
_cmake_define_property_values() {
local ret=1
setopt localoptions extendedglob
case $@[-1] in
(CMAKE_BUILD_TYPE) _wanted build-types expl 'build type' _cmake_build_types && ret=0;;
(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;;
esac
return ret
}
# ------------------
# _cmake_build_types
# ------------------
(( $+functions[_cmake_build_types] )) ||
_cmake_build_types() {
local build_types; build_types=(
'Debug'
'Release'
'RelWithDebInfo'
'MinSizeRel'
)
_values 'build type' ${build_types[@]}
}
# -----------------
# _cmake_generators
# -----------------
(( $+functions[_cmake_generators] )) ||
_cmake_generators() {
local generators; generators=(
'Unix Makefiles'
'Ninja'
'CodeBlocks - Ninja'
'CodeBlocks - Unix Makefiles'
'Eclipse CDT4 - Ninja'
'Eclipse CDT4 - Unix Makefiles'
'KDevelop3'
'KDevelop3 - Unix Makefiles'
'Sublime Text 2 - Ninja'
'Sublime Text 2 - Unix Makefiles'
)
_describe -t generators 'generator' generators
}
# ----------------------
# _cmake_toolchain_files
# ----------------------
(( $+functions[_cmake_toolchain_files] )) ||
_cmake_toolchain_files() {
_files -g '*\.cmake*'
}
# ---------------
# _cmake_booleans
# ---------------
(( $+functions[_cmake_booleans] )) ||
_cmake_booleans() {
local booleans; booleans=(
'YES'
'NO'
)
_describe -t booleans 'boolean' booleans
}
# ---------------
# _cmake_compilers
# ---------------
(( $+functions[_cmake_compilers] )) ||
_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[@]"
}
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

@ -1,81 +0,0 @@
#compdef coffee
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mario Fernandez (https://github.com/sirech)
# * Dong Weiming (https://github.com/dongweiming)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1 version opts first second third
typeset -A opt_args
version=(${(f)"$(_call_program version $words[1] --version)"})
version=${${(z)${version[1]}}[3]}
first=$(echo $version|cut -d '.' -f 1)
second=$(echo $version|cut -d '.' -f 2)
third=$(echo $version|cut -d '.' -f 3)
if (( $first < 2 )) && (( $second < 7 )) && (( $third < 3 ));then
opts+=('(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]'
'(-r --require)'{-r,--require}'[require a library before executing your script]:library')
fi
_arguments -C \
'(- *)'{-h,--help}'[display this help message]' \
'(- *)'{-v,--version}'[display the version number]' \
$opts \
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
'(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
'(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
'(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
'(--nodejs)--nodejs[pass options directly to the "node" binary]' \
'(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
'(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
'(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
'(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
'(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
'(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
'(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
'*:script or directory:_files' && ret=0
return ret
# 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,60 +0,0 @@
#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

@ -1,76 +0,0 @@
#compdef composer
# ------------------------------------------------------------------------------
# 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 composer (https://getcomposer.org/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Daniel Gomes (me@danielcsgomes.com)
# * Valerii Hiora (https://github.com/vhbit)
# * loranger (https://github.com/loranger)
#
# ------------------------------------------------------------------------------
local curcontext=$curcontext state line
declare -A opt_args
_composer_get_command_list () {
composer --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }'
}
_composer_get_required_list () {
composer show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }'
}
_composer () {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments \
'1: :->command'\
'*: :->args'
if [ -f composer.json ]; then
case $state in
command)
compadd `_composer_get_command_list`
;;
*)
compadd `_composer_get_required_list`
;;
esac
else
compadd create-project init search selfupdate show
fi
}
compdef _composer composer

View File

@ -1,64 +0,0 @@
#compdef console
# ------------------------------------------------------------------------------
# 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 symfony console (https://github.com/symfony/Console).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * 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 () {
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 () {
local -a commands
IFS=$'\n'
commands=(`_console_get_command_list`)
_describe 'commands' commands
}
compdef _console php console
compdef _console console

View File

@ -1,68 +0,0 @@
#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,65 +0,0 @@
#compdef debuild
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for debuild 2.10.
#
# Status: incomplete.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# FIXME --noconf is only allowed in first position
_arguments \
'(- 1 *)'{-h,--help}'[show help]' \
'(- 1 *)--version[show version and copyright information]' \
{--no-conf,--noconf}'[don'\''t read devscripts config files]' \
{-r-,--rootcmd=}'[command used to become root if debuild not setuid root (default: fakeroot)]: :_command_names' \
'*'{-e-,--preserve-envvar=}'[preserve environment variable]: :_vars' \
'(-e --preserve-envvar)--preserve-env[preserve all environment vars (except PATH)]' \
'*'{-e-,--set-envvar=}'[preserve environment variable]: :_vars -qS=' \
'--prepend-path=[prepend to the sanitised PATH]: :_files -/' \
'(-D)-d[skip checking of build dependencies]' \
'(-d)-D[force checking of build dependencies]' \
'--check-dirname-level[how much to check directory names]:level:((0\:never 1\:only\ if\ program\ changes\ directory\ \(default\) 2\:always))' \
'--check-dirname-regex[Perl regex defining matching directory names, the string PACKAGE will be replaced by the package name (default: '\''PACKAGE(-.+)?'\'')]:regex'
# 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 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
# -----------
#
# Completion script for dget
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Kris Shannon <k.shannon@amaze.com.au>
#
# ------------------------------------------------------------------------------
_dget() {
local context state line expl
local -A opt_args
_arguments -A "-*" \
'(--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]" \
'(-)*:debian package urls:_urls'
}
_dget "$@"

View File

@ -1,78 +0,0 @@
#compdef dhcpcd
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for dhcpcd 2.3.2.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments \
'1:network interface:_net_interfaces' \
- release \
'(-k --release)'{-k,--release}'[causes an existing dhcpcd process running on the interface to release it'\''s lease, deconfigure the interface and then exit]' \
- exit \
'(-x --exit)'{-x,--exit}'[causes an existing dhcpcd process running on the interface to exit]' \
- main \
'(-d --debug)'{-d,--debug}'[echo debug and informational messages to the console]' \
'(-h --hostname)'{-h,--hostname}'[specify the hostname sent, or an empty string to stop any hostname from being sent]:hostname:_hosts' \
'(-i --classid)'{-i,--classid}'[override the DHCP vendor classid field we send]:classid' \
'(-l --leasetime)'{-l,--leasetime}'[request a specific lease time in seconds]:lease time \(seconds\)' \
'(-m --metric)'{-m,--metric}'[added routes will use the metric on systems where this is supported]:metric' \
'(-n --renew)'{-n,--renew}'[notifies an existing dhcpcd process running on the interface to renew it'\''s lease]' \
'(-p --persistent)'{-p,--persistent}'[don'\''t deconfigure the interface and configuration at exit]' \
'(-r --request)'{-r,--request}'[skip the broadcast request step and just request an address]:address' \
'(-s --inform)'{-s,--inform}'[behaves exactly like -r, but sends a DHCP inform instead of a request]:address' \
'(-t --timeout)'{-t,--timeout}'[timeout after seconds, instead of the default 20]:timeout \(seconds\)' \
'(-u --userclass)'{-u,--userclass}'[tags the DHCP message with the userclass class]:class' \
'*'{-H,--sethostname}'[forces dhcpcd to set the hostname as supplied by the DHCP server]' \
'({-I --clientid)'{-I,--clientid}'[send clientid as a client identifier string]:clientid' \
'*'{-S,--mscsr}'[request Microsoft specific Classless Static Routes (RFC 3442) code as well]' \
'(-A --noarp)'{-A,--noarp}'[don'\''t request or claim the address by ARP]' \
'(-G --nogateway)'{-G,--nogateway}'[don'\''t set any default routes]' \
'(-L --noipv4ll)'{-L,--noipv4ll}'[don'\''t use IPv4LL at all]' \
'(-M --nomtu)'{-M,--nomtu}'[don'\''t set the MTU of the interface]' \
'(-N --nontp)'{-N,--nontp}'[don'\''t touch /etc/ntpd.conf or restart the ntp service]' \
'(-R --nodns)'{-R,--nodns}'[don'\''t send DNS information to resolvconf or touch /etc/resolv.conf]' \
'(-T --test)'{-T,--test}'[on receipt of discover messages, simply print the contents of the DHCP message to the console]' \
'(-Y --nonis)'{-Y,--nonis}'[don'\''t touch /etc/yp.conf or restart the ypbind service]'
# 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,150 +0,0 @@
#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,83 +0,0 @@
#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
# -----------
#
# Completion script for docpad (https://github.com/bevry/docpad).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Changwoo Park (https://github.com/pismute)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
local -a _1st_arguments
_1st_arguments=(
'run: run [options], does everything - skeleton, generate, watch, server'
'server: server [options], creates a server for your generated project'
'skeleton: skeleton [options], will create a new project in your cwd based off an existing skeleton'
'render: render [path], render the file at <path> and output its results to stdout:path:_files'
'generate: (re)generates your project'
'watch: watches your project for changes, and (re)generates whenever a change is made'
'install: ensure everything is installed correctly'
'clean: ensure everything is cleaned correctly'
'info: display the information about your docpad instance'
'help: output the help'
)
_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]'\
'1: :->cmds'\
'*: :_files'&& ret=0
case $state in
cmds)
_describe -t commands 'docpad command' _1st_arguments && 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,191 +0,0 @@
#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
# -----------
#
# Completion script for Drush (http://drush.ws).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Vasily Kraev (https://github.com/vasilykraev)
#
# ------------------------------------------------------------------------------
_drush() {
local curcontext='$curcontext' state line cmds ret=1
integer NORMARG
typeset -A opt_args
global_args=('--debug' '--verbose' '--yes' '--no' '--simulate' '--root=' '--uri=')
_arguments -C \
'(--*)'{--version,--version}'[Show drush version.]' \
'(- *)'{-d,--debug}'[Display even more information, including internal messages.]' \
'(- *)'{-v,--verbose}'[Display extra information about the command.]' \
'(- *)'{-y,--yes}'[Assume "yes" as answer to all prompts.]' \
'(- *)'{-n,--no}'[Assume "no" as answer to all prompts.]' \
'(- *)'{-s,--simulate}'[Simulate all relevant actions (dont actually change the system).]' \
'(- *)'{-r,--root=}'[Drupal root directory to use (default: current directory).]' \
'(- *)'{-l,--uri=}'[URI of the drupal site to use (only needed in multisite environments or when running on an alternate port).]' \
'1: :->cmds' \
'*::arg:->args' \
&& ret=0
case $state in
cmds)
_values 'drush command' \
'(archive-dump)'{archive-dump,ard,arb}'[Backup your code, files, and database into a single file.]' \
'(archive-restore)'{archive-restore,arr}'[Expand a site archive into a Drupal web site.]' \
'(cache-clear)'{cache-clear,cc}'[Clear a specific cache, or all drupal caches.]' \
'(core-status)'{core-status,status,st}'[Provides a birds-eye view of the current Drupal installation, if any.]' \
'(core-cron)'{core-cron,cron}'[Run all cron hooks in all active modules for specified site.]' \
'(core-execute)'{core-execute,exec}'[Execute a shell command. Usually used with a site alias.]' \
'(drupal-directory)'{drupal-directory,dd}'[Return the filesystem path for modules/themes and other key folders.]' \
'help[Print this help message.]' \
'image-flush[Flush all derived images for a given style.]' \
'(site-alias)'{site-alias,sa}'[Print an alias record.]' \
'(site-install)'{site-install,si}'[Install Drupal along with modules/themes/configuration using the specified install profile.]' \
'test-clean[Clean temporary tables and files.]' \
'test-run[Run tests. Note that you must use the --uri option.]' \
'(updatedb)'{updatedb,updb}'[Apply any database updates required (as with running update.php).]' \
'(variable-delete)'{variable-delete,vdel}'[Delete a variable.]' \
'(variable-get)'{variable-get,vget}'[Get a list of some or all site variables and values.]' \
'(variable-set)'{variable-set,vset}'[Set a variable.]' \
'(pm-list)'{pm-list,pml}'[Show a list of available extensions (modules and themes).]' \
'(pm-disable)'{pm-disable,dis}'[Disable one or more extensions (modules or themes). Disable dependant extensions as well.]' \
'(pm-download)'{pm-download,dl}'[Download projects from drupal.org or other sources.]' \
'(pm-enable)'{pm-enable,en}'[Enable one or more extensions (modules or themes). Enable dependant extensions as well.]' \
'pm-uninstall[Uninstall one or more modules.]' \
'pm-update[Update Drupal core and contrib projects and apply any pending database updates (Same as pm-updatecode + updatedb).]' \
'(sql-cli)'{sql-cli,sqlc}'[Open a SQL command-line interface using Drupals credentials.]' \
'sql-drop[Drop all tables in a given database.]' \
'sql-dump[Exports the Drupal DB as SQL using mysqldump or equivalent.]' \
'(sql-query)'{sql-query,sqlq}'[Execute a query against the site database.]' \
'sql-sync[Copy and import source database to target database. Transfers via rsync.]' \
'(user-login)'{user-login,uli}'[Display a one time login link for the given user account (defaults to uid 1).]' \
'(user-password)'{user-password,upwd}'[(Re)Set the password for the user account with the specified name.]' \
'(devel-reinstall)'{devel-reinstall,dre}'[Disable, Uninstall, and Install a list of projects. (devel)]' \
'(devel-token)'{devel-token,token}'[List available tokens (devel)]' \
'(generate-content)'{generate-content,genc}'[Create content. (devel_generate)]' \
'(generate-menus)'{generate-menus,genm}'[Create menus and menu items. (devel_generate)]' \
'(generate-terms)'{generate-terms,gent}'[Create terms in specified vocabulary. (devel_generate)]' \
'(generate-users)'{generate-users,genu}'[Create users. (devel_generate)]' \
'(generate-vocabs)'{generate-vocabs,genv}'[Create vocabularies. (devel_generate)]' \
'(features-diff)'{features-diff,fd}'[Show the difference between the default and overridden state of a feature.]' \
'(features-export)'{features-export,fe}'[Export a feature from your site into a module.]' \
'(features-list)'{features-list,fl}'[List all the available features for your site.]' \
'(features-revert)'{features-revert,fr}'[Revert a feature module on your site.]' \
'(features-revert-all)'{features-revert-all,fra}'[Revert all enabled feature module on your site.]' \
'(features-update)'{features-update,fu}'[Update a feature module on your site.]' \
'(features-update-all)'{features-update-all,fua}'[Update all feature modules on your site.]' \
&& ret=0
;;
args)
case $line[1] in
(archive-dump|ard)
_arguments \
'(--description)--description=[Filter out extensions that are provided by drupal core.]' \
'(--destination)--destination=[The full path and filename in which the archive should be stored. If omitted, it will be saved to the drush-backups directory.]' \
'(--no-core)--no-core[Exclude Drupal core, so the backup only contains the site specific stuff.]' \
'(--pipe)--pipe[Only print the destination of the archive. Useful for scripts that dont pass --destination.]' \
'(--tar-options)--tar-options=[Options passed thru to the tar command.]' \
&& ret=0
compadd -a global_args
;;
(archive-restore|arr)
_arguments \
'(--db-prefix)--db-prefix[An optional table prefix to use during restore.]' \
'(--db-su)--db-su[Account to use when creating the new database. Optional.]' \
'(--db-su-pw)--db-su-pw[Password for the "db-su" account. Optional.]' \
'(--db-url)--db-url=[A Drupal 6 style database URL indicating the target for database restore. If not provided, the archived settings.php is used. ]' \
'(--destination)--destination[Specify where the Drupal site should be expanded, including the docroot. Defaults to the current working directory.]' \
'(--overwrite)--overwrite[Allow drush to overwrite any files in the destination.]' \
&& ret=0
compadd -a global_args
;;
(user-password|upwd)
_arguments \
'--password=:Set the password for the username someuser.' \
&& ret=0
;;
(help)
_values 'commands' 'arb' 'archive-dump' 'archive-restore' 'ard' 'arr' 'cache-clear' 'cc' 'core-cron' 'core-execute' 'core-status' 'cron' 'dd' 'devel-reinstall' 'devel-token' 'dis' 'dl' 'dre' 'drupal-directory' 'en' 'exec' 'fd' 'fe' 'features-diff' 'features-export' 'features-list' 'features-revert' 'features-revert-all' 'features-update' 'features-update-all' 'fl' 'fr' 'fra' 'fu' 'fua' 'genc' 'generate-content' 'generate-menus' 'generate-terms' 'generate-users' 'generate-vocabs' 'genm' 'gent' 'genu' 'genv' 'help' 'image-flush' 'pm-disable' 'pm-download' 'pm-enable' 'pm-list' 'pm-uninstall' 'pm-update' 'pml' 'sa' 'si' 'site-alias' 'site-install' 'sql-cli' 'sql-drop' 'sql-dump' 'sql-query' 'sql-sync' 'sqlc' 'sqlq' 'st' 'status' 'test-clean' 'test-run' 'token' 'uli' 'updatedb' 'updb' 'upwd' 'user-login' 'user-password' 'variable-delete' 'variable-get' 'variable-set' 'vdel' 'vget' 'vset'
;;
(cc)
_values 'options' 'all' 'drush' 'theme-registry' 'menu' 'css-js' 'block'
;;
(pm-list|pml)
_arguments \
'(--core)--core[Filter out extensions that are not in drupal core.]' \
'(--no-core)--no-core[Filter out extensions that are provided by drupal core.]' \
'(--pipe)--pipe[Returns a whitespace delimited list of the names of the resulting extensions.]' \
'(--status)--status=-[Filter by extension status. Choices: enabled, disabled and/or "not installed".]:status:(enabled disabled)' \
'(--type)--type=-[Filter by extensions ension type. Choices: module, theme.]:type:(module theme)' \
&& ret=0
;;
(pm-disable|dis)
_modules=( $(drush pml --status=enabled --pipe) )
if [[ $_modules != "" ]]; then
_values 'enabled modules' $_modules
fi
;;
(pm-enable|en)
_arguments -C \
'--resolve-dependencies[Attempt to download any missing dependencies. At the moment, only works when the module name is the same as the project name.]' \
'--skip[Skip automatic downloading of libraries (c.f. devel).]' && ret=0
_modules=( $(drush pml --status="disabled,not installed" --pipe) )
if [[ $_modules != "" ]]; then
_values -s 'not yet enabled modules' $_modules && ret=0
fi
;;
(*)
_values 'Global options' \
{-d,--debug}'[Display even more information, including internal messages.]' \
{-v,--verbose}'[Display extra information about the command.]' \
{-y,--yes}'[Assume "yes" as answer to all prompts.]' \
{-n,--no}'[Assume "no" as answer to all prompts.]' \
{-s,--simulate}'[Simulate all relevant actions (dont actually change the system).]' \
{-r,--root=}'[Drupal root directory to use (default: current directory).]' \
{-l,--uri=}'[URI of the drupal site to use (only needed in multisite environments or when running on an alternate port).]'
;;
esac
;;
esac
}
_drush '$@'
# 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,139 +0,0 @@
#compdef emulator
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for emulator (Android Emulator) 12.0
# (http://developer.android.com/guide/developing/tools/emulator.html).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext"
# TODO All image options are contextual to -sysdir value
# TODO All skin options are contextual to -skindir value
# TODO snapshot options are mutually exclusive
# TODO Use '-snapshot-list' output for snapshot names
# TODO Complete -avd with avd names ?
# TODO -logcat: use completer from _adb
# TODO Complete options with device values
# TODO Complete -prop
_arguments \
'(- : *)-version[display emulator version number]' \
'(- : *)-help[display help information]' \
'(- : *)-help-disk-images[about disk images]' \
'(- : *)-help-keys[supported key bindings]' \
'(- : *)-help-debug-tags[debug tags for -debug <tags>]' \
'(- : *)-help-char-devices[character <device> specification]' \
'(- : *)-help-environment[environment variables]' \
'(- : *)-help-keyset-file[key bindings configuration file]' \
'(- : *)-help-virtual-device[virtual device management]' \
'(- : *)-help-sdk-images[about disk images when using the SDK]' \
'(- : *)-help-build-images[about disk images when building Android]' \
'(- : *)-help-all[prints all help content]' \
'(- : *)-help-'{version,sysdir,system,image,datadir,kernel,ramdisk,initdata,data,partition-size,cache,no-cache,nocache,sdcard,snapstorage,no-snapstorage,snapshot,no-snapshot,no-snapshot-save,no-snapshot-load,snapshot-list,no-snapshot-update-time,wipe-data,avd,skindir,skin,noskin,no-skin,memory,netspeed,netdelay,netfast,trace,show-kernel,shell,no-jni,nojni,logcat,noaudio,no-audio,audio,raw-keys,radio,port,ports,onion,onion-alpha,onion-rotation,scale,dpi-device,http-proxy,timezone,dns-server,cpu-delay,no-boot-anim,no-window,report-console,gps,keyset,shell-serial,tcpdump,bootchart,charmap,prop,shared-net-id,nand-limits,memcheck,qemu,verbose}'[print option-specific help]' \
'-sysdir[search for system disk images in the directory]: :_files -/' \
'(-system -image)'{-system,-image}'[read initial system image from the file]: :_files -g "*.img"' \
'-datadir[write user data into the directory]: :_files -/' \
'-kernel[use specific emulated kernel]: :_files' \
'-ramdisk[ramdisk image (default <system>/ramdisk.img]: :_files -g "*.img"' \
'-initdata[same as '\''-init-data <file>'\'']: :_files' \
'-data[data image (default <datadir>/userdata-qemu.img]: :_files -g "*.img"' \
'-partition-size[system/data partition size]:size (in MBs)' \
'(-no-cache -nocache)-cache[cache partition image (default is temporary file)]: :_files -g "*.img"' \
'(-cache -no-cache -nocache)'{-no-cache,-nocache}'[disable the cache partition]' \
'-sdcard[SD card image (default <system>/sdcard.img]: :_files -g "*.img"' \
'(-no-snapstorage)-snapstorage[file that contains all state snapshots (default <datadir>/snapshots.img)]: :_files -g "*.img"' \
'(-snapstorage)-no-snapstorage[do not mount a snapshot storage file (this disables all snapshot functionality)]' \
'-snapshot[name of snapshot within storage file for auto-start and auto-save (default '\''default-boot'\'')]:snapshot name' \
'-no-snapshot[perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage]' \
'-no-snapshot-save[do not auto-save to snapshot on exit: abandon changed state]' \
'-no-snapshot-load[do not auto-start from snapshot: perform a full boot]' \
'-snapshot-list[show a list of available snapshots]' \
'-no-snapshot-update-time[do not do try to correct snapshot time on restore]' \
'-wipe-data[reset the user data image (copy it from initdata)]' \
'-avd[use a specific android virtual device]:android virtual device name' \
'-skindir[search skins in <dir> (default <system>/skins)]: :_files -/' \
'-skin[select a given skin]' \
'(-noskin -no-skin)'{-noskin,-no-skin}'[don'\''t use any emulator skin]' \
'-memory[physical RAM size in MBs]:size (in MBs)' \
'-netspeed[maximum network download/upload speeds]:speed' \
'-netdelay[network latency emulation]:delay' \
'-netfast[disable network shaping]' \
'-trace[enable code profiling (F9 to start)]:trace name' \
'-show-kernel[display kernel messages]' \
'-shell[enable root shell on current terminal]' \
{-no-jni,-nojni}'[disable JNI checks in the Dalvik runtime]' \
'-logcat[enable logcat output with given tags]:logcat tags' \
'(-audio -noaudio -no-audio)'{-noaudio,-no-audio}'[disable audio support]' \
'(-noaudio -no-audio)-audio[use specific audio backend]:audio backend' \
'-raw-keys[disable Unicode keyboard reverse-mapping]' \
'-radio[redirect radio modem interface to character device]:device' \
'-port[TCP port that will be used for the console]:port number' \
'-ports[TCP ports used for the console and adb bridge]:console port,adb port' \
'-onion[use overlay PNG image over screen]: :_files -g "*.(png|PNG)"' \
'-onion-alpha[specify onion-skin translucency]:percentage' \
'-onion-rotation[specify onion-skin rotation]:rotation:((1 2 3 4))' \
'-scale[scale emulator window]:scale' \
'-dpi-device[specify device'\''s resolution in dpi (default 165)]:dpi' \
'-http-proxy[make TCP connections through a HTTP/HTTPS proxy]:proxy' \
'-timezone[use this timezone instead of the host'\''s default]:timezone' \
'-dns-server[use this DNS server(s) in the emulated system]:DNS servers' \
'-cpu-delay[throttle CPU emulation]:CPU delay' \
'-no-boot-anim[disable animation for faster boot]' \
'-no-window[disable graphical window display]' \
'-report-console[report console port to remote socket]: :_socket' \
'-gps[redirect NMEA GPS to character device]:device' \
'-keyset[specify keyset file name]: :_files' \
'-shell-serial[specific character device for root shell]:device' \
'-tcpdump[capture network packets to file]: :_files' \
'-bootchart[enable bootcharting]:timeout' \
'-charmap[use specific key character map]: :_files' \
'*-prop[set system property on boot]:name=value' \
'-shared-net-id[join the shared network, using IP address 10.1.2.<number>]:number' \
'-nand-limits[enforce NAND/Flash read/write thresholds]:limits' \
'-memcheck[enable memory access checking]:flags' \
'-qemu[pass arguments to qemu]:arguments' \
'-verbose[same as '\''-debug-init'\'']' \
'*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag'
# 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,49 +0,0 @@
#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,51 +0,0 @@
#compdef exportfs
# ------------------------------------------------------------------------------
# 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 nfs's exportfs - maintain table of exported NFS file systems.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Timofey Titovets <nefelim4ag@gmail.com>
#
# ------------------------------------------------------------------------------
_exportfs() {
_values -w 'option' \
'(-i)-a[Export or unexport all directories]' \
'(-a -r -u)-i[Ignore the /etc/exports file and files under /etc/exports.d directory]' \
'(-i)-r[Reexport all directories]' \
'(-i)-u[Unexport one or more directories]' \
'-f[flush everything out of export table]' \
'-o[option1,option2.. Specify a list of export options]' \
'-s[Display the current export list suitable for /etc/exports]' \
'-v[Be verbose]'
}
_exportfs "$@"

View File

@ -1,109 +0,0 @@
#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
# -----------
#
# Completion script for Fabric (http://fabfile.org)
#
# Source: https://github.com/vhbit/fabric-zsh-autocomplete
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Valerii Hiora (https://github.com/vhbit)
#
# ------------------------------------------------------------------------------
local curcontext=$curcontext state line
declare -A opt_args
declare target_list
target_list=(`fab --shortlist 2>/dev/null`)
_targets() {
_describe -t commands "fabric targets" target_list
}
output_levels=(
'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.'
'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur there just wont be any output about why Fabric aborted!'
'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.'
'running: Printouts of commands being executed or files transferred, e.g. [myserver] run: ls /var/www. Also controls printing of tasks being run, e.g. [myserver] Executing task ''foo''.'
'stdout: Local, or remote, stdout, i.e. non-error output from commands.'
'stderr: Local, or remote, stderr, i.e. error-related output from commands.'
'user: User-generated output, i.e. local output printed by fabfile code via use of the fastprint or puts functions.'
)
_arguments -w -S -C \
'(-)'{-h,--help}'[show this help message and exit]: :->noargs' \
'(-)'{-V,--version}'[show program''s version number and exit]: :->noargs' \
'(-)--list[print list of possible commands and exit]: :->noargs' \
'(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \
'(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \
'(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \
"(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \
'(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \
'(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \
'(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \
'(-p+ --password=-)'{-p+,--password=-}'[password for use with authentication and/or sudo]: :' \
'(-H+ --hosts=-)'{-H+,--hosts=-}'[comma separated list of hosts to operate on]: :' \
'(-R+ --roles=-)'{-R+,--roles=-}'[comma separated list of roles to operate on]: :' \
'(-a --no-agent)'{-a,--no-agent}'[don''t use the running SSH agent]' \
'(-k --no-keys)'{-k,--no-keys}'[don''t load private key files from ~/.ssh/]' \
'(-w --warn-only)'{-w,--warn-only}'[warn instead of abort, when commands fail]' \
'-i+[path to SSH private key file. May be repeated]: :_files' \
"(-f+ --fabfile=)"{-f+,--fabfile=}"[Python module file to import]: :_files -g *.py" \
'(-c+ --config=-)'{-c+,--config=-}'[specify location of config file to use]: :_files' \
'(-s+ --shell=-)'{-s+,--shell=-}'[specify a new shell, defaults to ''/bin/bash -l -c'']: :' \
'(--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
if [[ CURRENT -ge 1 ]]; then
case $state in
noargs)
_message "nothing to complete";;
levels)
_describe -t commands "output levels" output_levels;;
*)
_targets;;
esac
return
fi
# 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 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

@ -1,123 +0,0 @@
#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

@ -1,69 +0,0 @@
#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
# -----------
#
# Completion script for gas (https://github.com/walle/gas).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Fredrik Wallgren <fredrik.wallgren@gmail.com>
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line cmds ret=1
_arguments -C \
'(- 1 *)'{-v,--version}'[display version information]' \
'(-h|--help)'{-h,--help}'[show help information]' \
'1: :->cmds' \
'*: :->args' && ret=0
case "$state" in
(cmds)
cmds=(
"version:Prints Gas's version"
"use:Uses author"
"show:Shows your current user"
"list:Lists your authors"
"import:Imports current user to gasconfig"
"help:Describe available tasks or one specific task"
"delete:Deletes author"
"add:Adds author to gasconfig"
)
_describe -t commands 'gas command' cmds && ret=0
;;
(args)
case "$line[1]" in
(use|delete)
_values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
;;
esac
;;
esac
return ret

View File

@ -1,73 +0,0 @@
#compdef geany
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Geany (http://www.geany.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments \
'(- 1 *)'{-h,--help}'[Show help options]' \
'(- 1 *)--help-all[Show all help options]' \
'(- 1 *)--help-gtk[Show GTK+ Options]' \
'(- 1 *)'{-V,--version}'[Show version and exit]' \
'(--column)--column[Set initial column number for the first opened file (useful in conjunction with --line)]:column number' \
'(-c --config)'{-c,--config}'[Use an alternate configuration directory]:configuration file:_files' \
'(--ft-names)--ft-names[Print internal filetype names]' \
'(-g --generate-tags)'{-g,--generate-tags}'[Generate global tags file (see documentation)]' \
'(-P --no-preprocessing)'{-P,--no-preprocessing}'[Don'\''t preprocess C/C++ files when generating tags]' \
'(-i --new-instance)'{-i,--new-instance}'[Don'\''t open files in a running instance, force opening a new instance]' \
'(--socket-file)--socket-file[Use this socket filename for communication with a running Geany instance]:socket file:_files' \
'(--list-documents)--list-documents[Return a list of open documents in a running Geany instance]' \
'(-l --line)'{-l,--line}'[Set initial line number for the first opened file]:line number' \
'(-m --no-msgwin)'{-m,--no-msgwin}'[Don'\''t show message window at startup]' \
'(-n --no-ctags)'{-n,--no-ctags}'[Don'\''t load auto completion data (see documentation)]' \
'(-p --no-plugins)'{-p,--no-plugins}'[Don'\''t load plugins]' \
'(--print-prefix)--print-prefix[Print Geany'\''s installation prefix]' \
'(-s --no-session)'{-s,--no-session}'[Don'\''t load the previous session'\''s files]' \
'(-t --no-terminal)'{-t,--no-terminal}'[Don'\''t load terminal support]' \
'(--vte-lib)--vte-lib[Filename of libvte.so]:libvte.so filename:_files -g "*.so"' \
'(-v --verbose)'{-v,--verbose}'[Be verbose]' \
'(--display)--display[X display to use]:X display:_x_display' \
'*: :_files'
# 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,618 +0,0 @@
#compdef ghc ghci ghc-pkg
# ------------------------------------------------------------------------------
# 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
# -----------
#
# Completion script for ghc (http://www.haskell.org/ghc/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Gérard Milmeister
# * Philip Dexter <philip.dexter@gmail.com>
#
# ------------------------------------------------------------------------------
local state
local WORDS
#
# ghci
#
_ghc_ghci () { _ghc_compiler }
#
# ghc
#
_ghc_compiler ()
{
_arguments \
"-no-hs-main[Don't assume this program contains main]" \
"-no-user-package-conf[Don't load the user's package config file]" \
'(- *)'{--help,-\?}'[Show help information]' \
'*-I-[Add directory to path for #include files]:directory:_files -/' \
'*-X-[Language flags]:flag:_ghc_language_flags' \
'*-d-[Debugging options]:flag:_ghc_debugging_options' \
'*-f-[Compiler options]:flag:_ghc_compiler_flags' \
'*-hide-package[Hide package]:Package:_ghc_pkg_list_packages' \
'*-trust[Expose package and set it to be trusted]:Package:_ghc_pkg_list_packages' \
'*-distrust[Expose package and set it to be distrusted]:Package:_ghc_pkg_list_packages' \
'*-distrust-all[Distrust all packages by default]' \
'*-i-[Add directory to import path]:directory:->ghc_include_directory' \
'*-package[Expose package]:Package:_ghc_pkg_list_packages' \
'*:file:_files -g \*.\{lhs,hs,hc,c,s\}' \
'--info[Display information about the compiler]' \
'--show-options[Display the supported command line options]' \
'--interactive[Interactive mode]' \
'--make[Compile and link a complete Haskell program]:file:_files -g "*.{lhs,hs,hc,c,s}"' \
'--numeric-version[Display GHC version (numeric only)]' \
'--print-libdir[Display GHC library directory]' \
'--show-iface[Show interface]:file:_files -g "*.hi"' \
{--supported-languages,--supported-extensions}'[Display the supported language extensions]' \
'-C[Stop after generating C]' \
'-E[Stop after generating preprocessed, de-litted Haskell]' \
'-H[Minimum heap size]:size:' \
'-M[Output Makefile rules]' \
'-O-[Enable optimization]:level:(0 1 2)' \
'-Rghc-timing[Summarise timing stats for GHC]' \
'-S[Stop after generating assembler]' \
'-V[Display GHC version]' \
'-W[Enable normal warnings]' \
'-Wall[Enable almost all warnings]' \
'-Werror[Make warnings fatal]' \
'-Wwarn[Make warnings non-fatal]' \
'-c[Stop after generating object files]' \
'-eventlog[Enable runtime event tracing]' \
'-debug[Use the debugging runtime]' \
"-dylib-install-name[On Darwin/OS X only, set the install name]" \
'-dynamic[Use dynamic Haskell libraries]' \
'-dynamic-too[Build dynamic object files as well as static object files during compilation]' \
'-dynosuf[Set the output suffix for dynamic object files]' \
'-dynload[Select one of a number of modes for finding shared libraries at runtime]' \
'--mk-dll[DLL-creation mode (Windows only)]' \
'-framework-path[On Darwin/OS X/iOS only, add dir to the list of directories searched for frameworks]' \
'-shared[Generate a shared library (as opposed to an executable)]' \
'-staticlib[On Darwin/OS X/iOS only, generate a standalone static library (as opposed to an executable)]' \
'-e[Evaluate expression]' \
'-hide-all-packages[Hide all packages by default]' \
'-hpcdir[Directory to deposit .mix files during compilation (default is .hpc)]' \
'-n[Do a dry run]' \
'-o[Set output filename]:file:_files' \
'-outputdir[Set output directory]:directory:_files -/' \
'-package-name[Compile to be part of package]' \
'-hide-all-packages[Hide all packages by default]' \
'-package-db[Add file to the package db stack]:file:_files' \
'-clear-package-db[Clear the package db stack]' \
'-msse2[(x86 only) Use SSE2 for floating point]' \
'-monly-\[432\]-regs[(x86 only) give some registers back to the C compiler]' \
'-no-global-package-db[Remove the global package db from the stack]' \
'-global-package-db[Add the global package db to the stack]' \
"-no-user-package-db[Remove the user's package db from the stack]" \
"-user-package-db[Add the user's package db to the stack]" \
"-no-auto-link-packages[Don't automatically link in the base and rts packages]" \
'-optL[pass option to the literate pre-processor]' \
'-optP[pass option to cpp (with -cpp only)]' \
'-optF[pass option to the custom pre-processor]' \
'-optc[pass option to the C compiler]' \
'-optlo[pass option to the LLVM optimiser]' \
'-optlc[pass option to the LLVM compiler]' \
'-optm[pass option to the mangler]' \
'-opta[pass option to the assembler]' \
'-optl[pass option to the linker]' \
'-optdll[pass option to the DLL generator]' \
'-optwindres[pass option to windres.]' \
'-prof[Turn on profiling]' \
'-pgmL[Use cmd as the literate pre-processor]' \
'-pgmP[Use cmd as the C pre-processor (with -cpp only)]' \
'-pgmc[Use cmd as the C compiler]' \
'-pgms[Use cmd as the splitter]' \
'-pgml[Use cmd as the linker]' \
'-pgmdll[Use cmd as the DLL generator]' \
'-pgmF[Use cmd as the pre-proecessor (with -F only)]' \
'-pgmwindres[Use cmd as the program for embedding manifests on Windows]' \
'-pgmlibtool[Use cmd as the command for libtool (with -staticlib only)]' \
'-rtsopts[Only a minimum of safe options can be given to RTS]' \
'-rtsopts=[Control whether the RTS behavior can be tweaked via command-line flags and the GHCRTS environment varaible (none, som, or all)]' \
'-with-rtsopts=[Set the default RTS options]' \
'-threaded[Use the threaded runtime]' \
'-ticky[Turn on ticky-ticky profiling]' \
'-tmpdir[Set the directory for temporary files]:directory:_files -/' \
'-v-[Control verbosity]:level:(0 1 2 3 4 5)' \
'-w[Disable all warnings]' \
'-x[Override default behaviour for source files]:suffix:(hs lhs hc c s o hspp)' \
'-hcsuf[Set the suffix to use for intermediate]:suffix:' \
'-hidir[Set directory for interface files]:directory:_files -/' \
'-hisuf[Set the suffix to use for interface files]:suffix:' \
'-odir[Set directory for object files]:directory:_files -/' \
'-ohi[Set the filename in which to put the interface]:filename:_files -/' \
'-osuf[Set the output file suffix]:suffix:' \
'-stubdir[Redirect FFi stub files]:directory:_files -/' \
'-dumpdir[Redirect dump files]:directory:_files -/' \
'-outputdir[Set output directory]:directory:_files -/' \
'-keep-hc-files[Retain intermediate .hc files]' \
'-keep-llvm-files[Retain intermediate LLVM .ll files]' \
'-keep-s-files[Retain intermediate .s files]' \
'-keep-raw-s-files[Retain intermediate .raw_s files]' \
'-keep-tmp-files[Retain all intermediate temporary files]' \
'-static[Use static Haskell libraries]' \
'-split-objs[Split objects (for libraries)]' \
'-no-link[Omit linking]' \
'-main-is[Set main module and function]:function:' \
'*-L-[Add dir to the list of directories searched for libraries]:directory:_files -/' \
'*-l-[Link in library]:library:->library'
[[ -n "$state" ]] &&
case "$state" in
ghc_include_directory) _ghc_include_directory ;;
library)
_wanted libraries expl library \
compadd - \
${^=LD_LIBRARY_PATH:-/usr/lib /usr/local/lib}/lib*.(a|so*)(:t:fr:s/lib//) \
&& ret=0
esac
}
_ghc_include_directory ()
{
compset -P '*:'
compset -S ':*'
_path_files -r': ' -/
}
_ghc_compiler_flags ()
{
local _ghc_compiler_flags_list
_ghc_compiler_flags_list=(
'ghci-hist-size:Set the number of entries GHCi keeps for \:history'
'print-explicit-foralls:Print explicit forall quantification in types'
'print-explicit-kinds:Print explicit kind foralls and kind arguments in types'
{no-,}'break-on-error:Break on uncaught exceptions and errors'
{no-,}'break-on-exception:Break on any exception thrown'
{no-,}'case-merge:Enable case-merging'
{no-,}'defer-type-errors:Defer as many type errors as possible until runtime'
{no-,}'dicts-strict:Make dictionaries strict'
{no-,}'do-eta-reduction:Enable eta-reduction'
{no-,}'do-lambda-eta-expansion:Enable lambda eta-reduction'
'eager-blackholing:Turn on eager blackholing'
{no-,}'enable-rewrite-rules:Switch on all rewrite rules (including rules generated by automatic specialisation of overloaded functions)'
'error-spans:Output full span in error messages'
'ext-core:Generate .hcr external Core file'
'force-recomp:Turn off recompilation checking'
{no-,}'float-in:Turn on the float-in transformation'
{no-,}'full-laziness:Turn on full laziness (floating bindings outwards)'
{no-,}'fun-to-thunk:Allow worker-wrapper to convert a function closure into a thunk if the function does not use any of its arguments. Off by default.'
{no-,}'glasgow-exts:Enable most language extensions'
{no-,}'helpful-errors:Make suggestions for mis-spelled names'
'history-size:Set simplification history size'
{no-,}'ignore-asserts:Ignore assertions in the source'
{no-,}'ignore-interface-pragmas:Ignore pragmas in interface files'
{no-,}'loopification:Turn saturated self-recursive tail-calls into local jumps in the generated assembly'
{no-,}'late-dmd-anal:Run demand analysis again, at the end of the simplification pipeline'
{no-,}'liberate-case:Turn on the liberate-case transformation'
'liberate-case-threshold=:Set the size threshold for the liberate-case transformation (default 200)'
'no-liberate-case-threshold:Set the size threshold for the liberate-case transformation (default 200)'
{no-,}'max-relevant-bindings=N:Set the maximum number of bindings to display in type error messages (default 6).'
'max-worker-args=:If a worker has that many arguments, none will be unpacked anymore (default 10)'
'max-simplifier-iterations=:Set the max iterations for the simplifier'
'no-asm-mangling:Turn off assembly mangling'
'no-black-holing:Turn off black holing'
"no-hi-version-check:Don't complain about .hi file mismatches"
'no-implicit-import-qualified:Turn off implicit qualified import of everything in GHCi'
'no-print-bind-contents:Turn off printing of binding contents in GHCi'
'no-opt-coercion:Turn off the coercion optimiser'
'no-ghci-history:Do not use the load/store the GHCi command history from/to ghci_history'
'no-ghci-sandbox:Turn off the GHCi sandbox. Means computations are run in the main thread, rather than a forked thread'
'no-gen-manifest:Do not generate a manifest file (Windows only)'
'no-embed-manifest:Do not embed the manifest in the executable (Windows only)'
"no-shared-implib:Don't generate an import library for a DLL (Windows only)"
'no-pre-inlining:Turn off pre-inlining'
'no-state-hack:Turn off the "state hack" whereby any lambda with a real-world state token as argument is considered to be single-entry'
{no-,}'print-bind-result:Turn on printing of binding results in GHCi'
{no-,}'print-evld-with-show:Enable usage of Show instances in \:print'
'unregisterised:Unregisterised compilation'
'asm:Use the native code generator'
'via-C:Compile via C'
'no-code:Omit code generation'
'byte-code:Generate byte-code'
'object-code:Generate object code'
'hpc:Turn on Haskell program coverage instrumentation'
'PIC:Generate position-independent code'
'plugin=:Load a plugin exported by a given module'
'plugin-opt=:Give arguments to a plugin module'
'context-stack=:Set the limit for context reduction (default is 20)'
'type-function-depth=:Set the limit for type function reductions (default is 200)'
'force-recomp:Turn off recompilation checking'
{no-,}"omit-interface-pragmas:Don't generate interface pragmas"
'package-trust:Enable Safe Haskell trusted package requirement for trustworthy modules'
{no-,}'pedantic-bottoms:Make GHC be more precise about its treatment of bottom'
{no-,}'disambiguate-record-fields:Enable record field disambiguation'
{no-,}'irrefutable-tuples:Make tuple pattern matching irrefutable'
{no-,}'vectorise:Enable vectorisation of nested data parallelism'
{no-,}'avoid-vect:Enable vectorisation avoidance'
{no-,}'excess-precision:Enable excess intermediate precision'
{no-,}'prof-auto:Auto-add SCCs to all bindings not marked INLINE'
{no-,}'prof-auto-top:Auto-add SCCs to all top-level bindings not marked INLINE'
{no-,}'prof-auto-exported:Auto-add SCCs to all exported bindings not marked INLINE'
{no-,}'prof-cafs:Auto-add SCCs to all CAFs'
{no-,}'prof-count-entries:Collect entry counts'
'simplifier-phases:Set the number of phases for the simplifier (default 2)'
'simpl-tick-factor=:Set the percentage factor for simplifier ticks (default 100)'
{no-,}'spec-constr:Turn on the SpecConstr transformation'
{no-,}'spec-constr-threshold=:Set the size threshold for the SpecConstr transformation (default 200)'
{no-,}'spec-constr-count=:Set the maximum number of specialisations that will be created for any one function by the SpecConstr transformation (default 3)'
'strictness=before=:Run an additional strictness analysis before a simplifier phase'
{no-,}'static-argument-transformation:Turn on the static argument transformation'
{no-,}'unbox-strict-fields:Flatten strict constructor fields'
{no-,}'unbox-small-strict-fields:Flatten strict constructor fields with a pointer-sized representation'
{no-,}'unfolding-creation-threshold:Tweak unfolding settings'
{no-,}'unfolding-fun-discount:Tweak unfolding settings'
{no-,}'unfolding-keeness-factor:Tweak unfolding settings'
{no-,}'unfolding-use-threshold:Tweak unfolding settings'
{no-,}'warn-warnings-deprecations:Warn about uses of functions & types that have warnings or deprecated pragmas'
{no-,}'warn-deprecated-flags:Warn about uses of commandline flags that are deprecated'
{no-,}'warn-duplicate-exports:Warn when an entity is exported multiple times'
{no-,}'warn-hi-shadowing:Warn when a .hi file in the current directory shadows a library'
{no-,}'warn-implicit-prelude:Warn when the Prelude is implicitly imported'
{no-,}'warn-incomplete-patterns:Warn when a pattern match could fail'
{no-,}'warn-incomplete-record-updates:Warn when a record update could fail'
{no-,}'warn-missing-fields:Warn when fields of a record are uninitialised'
{no-,}'warn-missing-methods:Warn when class methods are undefined'
{no-,}'warn-missing-signatures:Warn about top-level functions without signatures'
{no-,}'warn-duplicate-constraints:Warn when a constraint appears duplicated in a type signature'
{no-,}'warn-identities:Warn about uses of Prelude numeric conversions that are probably the identity (and hence could be omitted)'
{no-,}'warn-incomplete-uni-patterns:Warn when a pattern match in a lambda expression or pattern binding could fail'
{no-,}'warn-lazy-unlifted-bindings:(Deprecated) warn when a pattern binding looks lazy but must be strict'
{no-,}'warn-missing-import-lists:Warn when an import declaration does not explicitly list all the names brought into scope'
{no-,}'warn-missing-local-sigs:Warn about polymorphic local bindings without signatures'
{no-,}'warn-monomorphism-restriction:Warn when the Monomorphism Restriction is applied'
{no-,}'warn-name-shadowing:Warn when names are shadowed'
{warn-orphans,warn-auto-orphans}':Warn when the module contains orphan instance declarations or rewrite rules'
{no-,}'warn-overlapping-patterns:Warn about overlapping patterns'
{no-,}'warn-tabs:Warn if there are tabs in the source file'
{no-,}'warn-type-defaults:Warn when defaulting happens'
{no-,}"warn-unrecognised-pragmas:Warn about uses of pragmas that GHC doesn't recognise"
{no-,}'warn-unused-binds:Warn about bindings that are unused'
{no-,}'warn-unused-imports:Warn about unnecessary imports'
{no-,}"warn-unused-matches:Warn about variables in patterns that aren't used"
{no-,}'warn-unused-do-bind:Warn about do bindings that appear to throw away values of types other than ()'
{no-,}'warn-wrong-do-bind:Warn about do bindings that appear to throw away monadic values that you should have bound instead'
{no-,}'warn-unsafe:Warn if the module being compiled is regarded to be unsafe'
{no-,}'warn-safe:Warn if the module being compiled is regarded to be safe'
{no-,}'warn-amp:Warn on definitions conflicting with the Applicative-Monad Proposal (AMP)'
{no-,}'warn-typed-holes:Enable holes in expressions'
)
_describe -t flags 'ghc' _ghc_compiler_flags_list || compadd "$@"
}
_ghc_debugging_options ()
{
local _ghc_debugging_options_list
_ghc_debugging_options_list=(
"dump-hi:Dump the new interface to stdout"
"dump-hi-diffs:Show the differences vs. the old interface"
"dump-minimal-imports:Dump a minimal set of imports"
"core-lint:Turn on internal sanity checking"
"dump-asm:Dump assembly"
"dump-bcos:Dump interpreter byte code"
"dump-cmm:Dump C-- output"
"dump-cpranal:Dump output from CPR analysis"
"dump-cse:Dump CSE output"
"dump-deriv:Dump deriving output"
"dump-ds:Dump desugarer output"
'dump-flatC:Dump "flat" C'
"dump-foreign:Dump foreign export stubs"
"dump-hpc:Dump after instrumentation for program coverage"
"dump-inlinings:Dump inlining info"
"dump-occur-anal:Dump occurrence analysis output"
"dump-opt-cmm:Dump the results of C-- to C-- optimising passes"
"dump-parsed:Dump parse tree"
"dump-prep:Dump prepared core"
"dump-rn:Dump renamer output"
"dump-rules:Dump rules"
"dump-simpl:Dump final simplifier output"
"dump-simpl-phases:Dump output from each simplifier phase"
"dump-simpl-iterations:Dump output from each simplifier iteration"
"dump-spec:Dump specialiser output"
"dump-splices:Dump TH spliced expressions"
"dump-stg:Dump final STG"
"dump-stranal:Dump strictness analyser output"
"dump-tc:Dump typechecker output"
"dump-types:Dump type signatures"
"dump-worker-wrapper:Dump worker-wrapper output"
"dump-if-trace:Trace interface files"
"dump-tc-trace:Trace typechecker"
"dump-to-file:Dump to files instead of stdout"
"dump-core-stats:Print a one-line summary of the size of the Core program at the end of the optimisation pipeline"
"dump-llvm:Dump LLVM intermediate code"
"dump-rule-firings:Dump rule firing info"
"dump-rule-rewrites:Dump detailed rule firing info"
"dump-vect:Dump vectoriser input and output"
"dump-strsigs:Dump strictness signatures"
"dump-vt-trace:Trace vectoriser"
"dump-rn-trace:Trace renamer"
"dump-rn-stats:Renamer stats"
"dump-simpl-stats:Dump simplifier stats"
"suppress-all:In core dumps, suppress everything (except for uniques) that is suppressible"
"suppress-uniques:Suppress the printing of uniques in debug output (easier to use diff)"
"suppress-idinfo:Suppress extended information about identifiers where they are bound"
"suppress-module-prefixes:Suppress the printing of module qualification prefixes"
"suppress-type-signatures:Suppress type signatures"
"suppress-type-applications:Suppress type applications"
"suppress-coercions:Suppress the printing of coercions in Core dumps to make them shorter"
"no-debug-output:Suppress unsolicited debugging output"
"ppr-debug:Turn on debug printing (more verbose)"
"ppr-noprags:Don't output pragma info in dumps"
"ppr-user-length:Set the depth for printing expressions in error msgs"
"ppr-colsNNN:Set the width of debugging output. For example -dppr-cols200"
"ppr-case-as-let:Print single alternative case expressions as strict lets"
"source-stats:Dump haskell source stats"
"cmm-lint:C-- pass sanity checking"
"stg-lint:STG pass sanity checking"
"stg-stats:Dump STG stats"
"verbose-core2core:Show output from each core-to-core pass"
"verbose-stg2stg:Show output from each STG-to-STG pass"
"show-passes:Print out each pass name as it happens"
"faststring-stats:Show statistics for fast string usage when finished"
)
_describe -t flags 'ghc' _ghc_debugging_options_list || compadd "$@"
}
_ghc_language_flags ()
{
local _ghc_language_flags_list
_ghc_language_flags_list=(
"AllowAmbiguousTypes:Allow the user to write ambiguous types, and the type inference engine to infer them"
"Arrows:Enable arrow notation extension"
"AutoDeriveTypeable:Automatically derive Typeable instances for every datatype and type class declaration"
"BangPatterns:Enable bang patterns"
"ConstraintKinds:Enable a kind of constraints"
"CPP:Enable the C preprocessor"
"ConstrainedClassMethods:Enable constrained class methods"
"DataKinds:Enable datatype promotion"
"DefaultSignatures:Enable default signatures"
"DeriveDataTypeable:Enable deriving for the Data and Typeable classes"
"DeriveGeneric:Enable deriving for the Generic class"
"DisambiguateRecordFields:Enable record field disambiguation"
"EmptyCase:Allow empty case alternatives"
"EmptyDataDecls:Enable empty data declarations"
"ExistentialQuantification:Enable existential quantification"
"ExplicitForAll:Enable explicit universal quantification"
"ExplicitNamespaces:Enable using the keyword type to specify the namespace of entries in imports and exports"
"ExtendedDefaultRules:Use GHCi's extended default rules in a normal module"
"FlexibleContexts:Enable flexible contexts"
"FlexibleInstances:Enable flexible instances"
"ForeignFunctionInterface:Enable foreign function interface"
"FunctionalDependencies:Enable functional dependencies"
"GADTs:Enable generalised algebraic data types"
"GADTSyntax:Enable generalised algebraic data type syntax"
"GeneralizedNewtypeDeriving:Enable newtype deriving"
"Generics:Enable generic classes"
"ImplicitParams:Enable Implicit Parameters"
"ImpredicativeTypes:Enable impredicative types"
"IncoherentInstances:Enable incoherent instances"
"InterruptibleFFI:Enable interruptible FFI"
"KindSignatures:Enable kind signatures"
"LambdaCase:Enable lambda-case expressions"
"LiberalTypeSynonyms:Enable liberalised type synonyms"
"MonadComprehensions:Enable monad comprehensions"
"MonoLocalBinds:Enable do not generalise local bindings"
"MultiParamTypeClasses:Enable multi parameter type classes"
"MultiWayIf:Enable multi-way if-expressions"
"NamedFieldPuns:Enable record puns"
"NegativeLiterals:Enable support for negative literals"
"NewQualifiedOperators:Enable new qualified operator syntax"
"NoImplicitPrelude:Don't implicitly import Prelude"
"NoMonoPatBinds:Make pattern bindings polymorphic"
"NoMonomorphismRestriction:Disable the monomorphism"
"NoNPlusKPatterns:Disable support for n+k patterns"
"NoTraditionalRecordSyntax:Disable support for traditional record syntax (as supported by Haskell 98) C {f = x}"
"NullaryTypeClasses:Enable nullary (no parameter) type classes"
"NumDecimals:Enable support for 'fractional' integer literals"
"OverlappingInstances:Enable overlapping instances"
"OverloadedLists:Enable overloaded lists"
"OverloadedStrings:Enable overloaded string literals"
"PArr:Enable parallel arrays"
"PackageImports:Enable package-qualified imports"
"ParallelArrays:Enable parallel arrays"
"ParallelListComp:Enable parallel list comprehensions"
"PatternGuards:Enable pattern guards"
"PolyKinds:Enable kind polymorphism"
"PolymorphicComponents:Enable polymorphic components for data constructors"
"QuasiQuotes:Enable quasiquotation"
"Rank2Types:Enable rank-2 types"
"RankNTypes:Enable rank-N types"
"RebindableSyntax:Employ rebindable syntax"
"RecordWildCards:Enable record wildcards"
"RecursiveDo:Enable recursive do (mdo) notation"
"RelaxedPolyRec:Relaxed checking for mutually-recursive polymorphic functions"
"Safe:Enable the Safe Haskell Safe mode"
"ScopedTypeVariables:Enable lexically-scoped type variables"
"StandaloneDeriving:Enable standalone deriving"
"TemplateHaskell:Enable Template Haskell"
"TransformListComp:Enable transform list comprehensions"
"TypeFamilies:Enable type families"
"TypeOperators:Enable type operators"
"TypeSynonymInstances:Enable type synonyms"
"Trustworthy:Enable the Safe Haskell Trustworthy mode"
"UnboxedTuples:Enable unboxed tuples"
"UndecidableInstances:Enable undecidable instances"
"UnicodeSyntax:Enable unicode syntax"
"UnliftedFFITypes:Enable unlifted FFI types"
"Unsafe:Enable Safe Haskell Unsafe mode"
"ViewPatterns:Enable view patterns"
'MagicHash:Allow "#" as a postfix modifier on identifiers'
)
_describe -t flags 'ghc' _ghc_language_flags_list || compadd "$@"
}
#
# ghc-pkg
#
_ghc_pkg ()
{
WORDS=()
for w in $words[1,(($CURRENT - 1))]; do
if [[ $w != --* ]]; then WORDS+=$w; fi
done
_arguments '*:command:_ghc_pkg_command'
}
_ghc_pkg_command()
{
local -a _ghc_pkg_cmds
_ghc_pkg_cmds=(
"register:Register the package using package description"
"update:Register the package (overwriting existing package)"
"unregister:Unregister the specified package"
"expose:Expose the specified package"
"hide:Hide the specified package"
"list:List registered packages"
"find-module:List registered packages exposing module"
"latest:Prints the highest registered version of a package"
"check:Check the consistency of package dependencies and list broken packages"
"describe:Give the registered description for the specified package"
"field:Extract the specified field of the package description"
"dump:Dump the registered description for every package"
)
if (( $#WORDS == 1 )); then
_describe -t commands 'command' _ghc_pkg_cmds || compadd "$@"
else
local curcontext="$curcontext"
cmd="${${_ghc_pkg_cmds[(r)$WORDS[2]:*]%%:*}}"
if (( $#cmd )); then
_arguments \
"--user[Use current user's package database]" \
'--global[User the global package database]' \
{-f,--package-conf=}'[Use the specified package config file]:Package config file:_files' \
'--no-user-package-conf[Never reader the user package config]' \
{-V,--version}'[Output version information and exit]' \
'--force[Ignore missing directories and libraries only]' \
{-g,--auto-ghci-libs}'[Automatically build libs for GHCi]' \
{-?,--help}'[Display this help and exit]' \
'--simple-output[Print output in easy-to-parse format for some commands]' \
'--names-only[Only print package names, not versions]' \
'--ignore-case[Ignore case for substring matching]' \
'*:argument:_ghc_pkg_'$cmd
else
_message "unknown ghc-pkg command: $WORDS[2]"
fi
fi
}
_ghc_pkg_unregister () { _ghc_pkg_list_packages }
_ghc_pkg_expose () { _ghc_pkg_list_packages }
_ghc_pkg_hide () { _ghc_pkg_list_packages }
_ghc_pkg_latest () { _ghc_pkg_list_packages }
_ghc_pkg_describe () { _ghc_pkg_list_packages }
_ghc_pkg_field ()
{
_ghc_pkg_available_packages
if (( $#WORDS == 2 )); then
compadd "$@" -a -- _ghc_pkg_packages
elif (( $#WORDS == 3 )); then
compset -P '*,'
compset -S ',*'
compadd "$@" -S ',' -q -- \
name version license copyright maintainer \
stability homepage package-url description \
category author exposed exposed-modules \
hidden-modules import-dirs hs-libraries \
extra-libraries extra-ghci-libraries include-dirs \
includes depends hugs-options cc-options ld-options \
framework-dirs frameworks haddock-interfaces \
haddock-html
fi
}
_ghc_pkg_register () { _files }
_ghc_pkg_update () { _files }
_ghc_pkg_list () { _ghc_pkg_list_packages }
_ghc_pkg_find-module ()
{
if (( $#WORDS == 2)); then
if ( [[ ${+_ghc_modules} -eq 0 ]] || _cache_invalid GHC_MODULES ) &&
! _retrieve_cache GHC_MODULES;
then
_ghc_modules=( $(ghc-pkg dump | sed -n '/^exposed-modules:/{s/^exposed-modules:[ ]\+\(.*\)$/\1/;s/ /\n/;p;be};b;:e;n;/^ /{s/^[ ]\+\(.*\)$/\1/;s/ /\n/;p;be}') )
_store_cache GHC_MODULES _ghc_modules
fi
compadd "$@" -a -- _ghc_modules
fi
}
_ghc_pkg_dump () {}
_ghc_pkg_check () {}
_ghc_pkg_available_packages ()
{
if ( [[ ${+_ghc_pkg_packages_pkgs} -eq 0 ]] || _cache_invalid GHC_PACKAGES ) &&
! _retrieve_cache GHC_PACKAGES;
then
_ghc_pkg_packages=( $(ghc-pkg list --simple-output --names-only) )
_store_cache GHC_PACKAGES _ghc_pkg_packages
fi
}
_ghc_pkg_list_packages ()
{
_ghc_pkg_available_packages
compadd "$@" -a -- _ghc_pkg_packages
}
#
# dispatcher
#
case $service in
ghc)
_ghc_compiler
;;
ghci)
_ghc_ghci
;;
ghc-pkg)
_ghc_pkg
;;
esac

View File

@ -1,66 +0,0 @@
#compdef gist
# ------------------------------------------------------------------------------
# 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 gist (https://github.com/defunkt/gist)
#
# ------------------------------------------------------------------------------
# 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
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments -C \
'(--login)--login[Authenticate gist on this computer.]' \
'(-f --filename)'{-f,--filename}'[Sets the filename and syntax type.]:NAME' \
'(-t --type)'{-t,--type}'[Sets the file extension and syntax type.]:EXT' \
'(-p --private)'{-p,--private}'[Makes your gist private.]' \
'(--no-private)'--no-private'[Makes your gist no private.]' \
'(-d --description)'{-d,--description}'[Adds a description to your gist.]:DESCRIPTION' \
'(-s --shorten)'{-s,--shorten}'[Shorten the gist URL using git.io.]' \
'(-u --update)'{-u,--update}'[Update an existing gist.]:URL ID' \
'(-a --anonymous)'{-a,--anonymous}'[Create an anonymous gist.]' \
'(-c --copy)'{-c,--copy}'[Copy the resulting URL to the clipboard]' \
'(-e --embed)'{-e,--embed}'[Copy the embed code for the gist to the clipboard]' \
'(-o --open)'{-o,--open}'[Open the resulting URL in a browser]' \
'(--no-open)'--no-open'[No open the resulting URL in a browser]' \
'(-P --paste)'{-P,--paste}'[Paste from the clipboard to gist]' \
'(-h --help)'{-h,--help}'[print options help]' \
'(-v --version)'{-v,--version}'[print version]' \
'*: :_files' && ret=0
return ret

View File

@ -1,444 +0,0 @@
#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
# -----------
#
# Completion script for git-flow (http://github.com/nvie/gitflow).
#
# Source: https://github.com/bobthecow/git-flow-completion
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Justin Hileman (https://github.com/bobthecow)
# * Yusuke Muraoka (https://github.com/jbking)
# * Vincent Driessen (https://github.com/nvie)
# * Zifei Tong (https://github.com/chevalun)
# * Ben O'Hara (https://github.com/benohara)
#
# ------------------------------------------------------------------------------
_git-flow ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
local -a subcommands
subcommands=(
'init:Initialize a new git repo with support for the branching model.'
'feature:Manage your feature branches.'
'release:Manage your release branches.'
'hotfix:Manage your hotfix branches.'
'support:Manage your support branches.'
'version:Shows version information.'
'status:Shows some status.'
)
_describe -t commands 'git flow' subcommands
;;
(options)
case $line[1] in
(init)
_arguments \
-f'[Force setting of gitflow branches, even if already configured]' \
-d'[Use default branch naming conventions and prefixes]'
;;
(version)
;;
(hotfix)
__git-flow-hotfix
;;
(release)
__git-flow-release
;;
(feature)
__git-flow-feature
;;
(support)
__git-flow-support
;;
esac
;;
esac
}
__git-flow-release ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
local -a subcommands
subcommands=(
'start:Start a new release branch.'
'finish:Finish a release branch.'
'list:List all your release branches. (Alias to `git flow release`)'
'publish:Publish this release branch to origin.`)'
'track:Track a release branch from origin.`)'
)
_describe -t commands 'git flow release' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
(options)
case $line[1] in
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':version:__git_flow_version_list'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-s'[Sign the release tag cryptographically]'\
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
-m'[Use the given tag message]'\
-n'[Dont tag this release ]'\
-p'[Push to $ORIGIN after performing finish]'\
-k'[Keep branch after performing finish]'\
':version:__git_flow_version_list'
;;
(publish)
_arguments \
':version:__git_flow_version_list'
;;
(track)
_arguments \
':version:__git_flow_version_list'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
}
__git-flow-hotfix ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
local -a subcommands
subcommands=(
'start:Start a new hotfix branch.'
'finish:Finish a hotfix branch.'
'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
'publish:Publish this hotfix branch to origin`)'
)
_describe -t commands 'git flow hotfix' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
(options)
case $line[1] in
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':hotfix:__git_flow_version_list'\
':branch-name:__git_branch_names'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-s'[Sign the release tag cryptographically]'\
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
-m'[Use the given tag message]'\
-p'[Push to $ORIGIN after performing finish]'\
':hotfix:__git_flow_hotfix_list'
;;
(publish)
_arguments \
':hotfix:__git_flow_hotfix_list'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
}
__git-flow-feature ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
local -a subcommands
subcommands=(
'start:Start a new feature branch.'
'finish:Finish a feature branch.'
'list:List all your feature branches. (Alias to `git flow feature`)'
'publish:Publish this feature branch to origin.'
'track:Track a feature branch from origin.'
'diff:Show a diff of changes since this feature branched off.'
'rebase:Rebase a feature branch on top of develop.'
'checkout:Check out (switch to) the given feature branch.'
'pull:Pull a feature branch from a remote peer.'
)
_describe -t commands 'git flow feature' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
(options)
case $line[1] in
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':feature:__git_flow_feature_list'\
':branch-name:__git_branch_names'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-r'[Finish branch by rebasing first]'\
-k'[Keep branch after performing finish]'\
-D'[Force delete feature branch after finish]'\
':feature:__git_flow_feature_list'
;;
(publish)
_arguments \
':feature:__git_flow_feature_list'\
;;
(track)
_arguments \
':feature:__git_flow_feature_list'\
;;
(diff)
_arguments \
':branch:__git_branch_names'\
;;
(rebase)
_arguments \
-i'[Do an interactive rebase]' \
':branch:__git_branch_names'
;;
(checkout)
_arguments \
':branch:__git_flow_feature_list'\
;;
(pull)
_arguments \
':remote:__git_remotes'\
':branch:__git_branch_names'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
}
__git-flow-support ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
local -a subcommands
subcommands=(
'start:Start a new support branch.'
'list:List all your support branches. (Alias to `git flow support`)'
)
_describe -t commands 'git flow support' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
(options)
case $line[1] in
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':feature:__git_flow_support_list'\
':branch-name:__git_branch_names'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
}
__git_flow_version_list ()
{
local expl
declare -a versions
versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
_wanted versions expl 'version' compadd $versions
}
__git_flow_feature_list ()
{
local expl
declare -a features
features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
_wanted features expl 'feature' compadd $features
}
__git_remotes () {
local expl gitdir remotes
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
__git_command_successful || return
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
__git_command_successful || return
# TODO: Should combine the two instead of either or.
if (( $#remotes > 0 )); then
_wanted remotes expl remote compadd $* - $remotes
else
_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
fi
}
__git_flow_hotfix_list ()
{
local expl
declare -a hotfixes
hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
_wanted hotfixes expl 'hotfix' compadd $hotfixes
}
__git_flow_support_list ()
{
local expl
declare -a support
support=(${${(f)"$(_call_program support git flow support list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
_wanted hotfixes expl 'support' compadd $support
}
__git_branch_names () {
local expl
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
__git_command_successful || return
_wanted branch-names expl branch-name compadd $* - $branch_names
}
__git_command_successful () {
if (( ${#pipestatus:#0} > 0 )); then
_message 'not a git repository'
return 1
fi
return 0
}
_git-flow "$@"
# 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,225 +0,0 @@
#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,108 +0,0 @@
#compdef git-pulls
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for git-pulls 0.3.1 (https://git-pulls.com/schacon/git-pulls).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud (https://github.com/nicoulaj)
#
# ------------------------------------------------------------------------------
_git-pulls() {
typeset -A opt_args
local context state line curcontext="$curcontext"
local ret=1
_arguments -C \
'(- 1 *)--help[show usage]' \
'1:cmd:->cmds' \
'*::arg:->args' \
&& ret=0
case "$state" in
(cmds)
local commands; commands=(
'update:update pull requests list'
'list:list pull requests'
'show:show pull request'
'browse:open pull request in a web browser'
'merge:merge pull request'
)
_describe -t commands 'command' commands && ret=0
;;
(args)
curcontext="${curcontext%:*:*}:git-pulls-cmd-$words[1]:"
case $words[1] in
(update)
_message 'no more arguments' && ret=0
;;
(list)
_arguments \
'--reverse[list in reverse order]' \
&& ret=0
;;
(show)
_arguments \
'1: :_git-pulls_pull_requests_numbers' \
'--full[use verbose output]' \
&& ret=0
;;
(browse|merge)
_arguments \
'1: :_git-pulls_pull_requests_numbers' \
&& ret=0
;;
esac
;;
esac
return ret
}
(( $+functions[_git-pulls_pull_requests_numbers] )) ||
_git-pulls_pull_requests_numbers() {
local pull_requests; pull_requests=(${${${(M)${(f)"$(_call_program users $service list)"}:#[[:digit:]]##[[:space:]]*}//:/\\:}/[[:space:]]##/:})
_describe -t pull-request-numbers 'pull request number' pull_requests "$@"
}
_git-pulls "$@"
# 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,58 +0,0 @@
#compdef git-wtf
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for git-wtf, authored by
# William Morgan (http://git-wt-commit.rubyforge.org/git-wtf)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mario Fernandez (https://github.com/sirech)
#
# ------------------------------------------------------------------------------
_arguments -w -C -s \
'(--long --short)'{-l,--long}'[include author info and date for each commit]' \
'(--long --short)'{-s,--short}'[do not show commits]' \
'(--all)'{-a,--all}'[show all branches across all remote repos, not just those from origin]' \
'(--all-commits)'{-A,--all-commits}'[show all commits, not just the first 5]' \
'(--key)'{-k,--key}'[show key]' \
'(--relations)'{-r,--relations}'[show relation to features / integration branches]' \
'(--dump-config)--dump-config[print out current configuration and exit]' \
'*: :__git_branch_names'
# 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,63 +0,0 @@
#compdef glances
# ------------------------------------------------------------------------------
# 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 glances (http://nicolargo.github.com/glances/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * loranger (https://github.com/loranger)
#
# ------------------------------------------------------------------------------
_glances() {
_arguments \
"-b[Display network rate in Byte per second]" \
"-B[Bind server to the given IP or host NAME]:host:_hosts" \
"-c[Connect to a Glances server]:host:_hosts" \
"-C[Path to the configuration file]:configuration path:_files -/" \
"-d[Disable disk I/O module]" \
"-e[Enable the sensors module (Linux-only)]" \
"-f[Set the output folder (HTML) or file (CSV)]:output path:_files -/" \
"-h[Display the syntax and exit]" \
"-m[Disable mount module]" \
"-n[Disable network module]" \
"-o[Define additional output (available: HTML or CSV)]:output type:(HTML CSV)" \
"-p[Define the client or server TCP port (default: 61209)]:port:_ports" \
"-P[Client/server password]:password:" \
"-s[Run Glances in server mode]" \
"-t[Set the refresh time in seconds (default: 3)]:seconds:" \
"-v[Display the version and exit]" \
"-z[Do not use the bold color attribute]" \
}
_glances "$@"

View File

@ -1,554 +0,0 @@
#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,94 +0,0 @@
#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
# -----------
#
# Completion script for googlecl (https://code.google.com/p/googlecl/)
#
# Source: https://raw.github.com/dadrc/zsh-cfg/master/completions/_google
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * dadrc (https://github.com/dadrc)
# * Ben O'Hara (https://github.com/benohara)
#
# ------------------------------------------------------------------------------
_google() {
# init variables
local curcontext="$curcontext" state line
typeset -A opt_args
# init state
_arguments \
'1: :->service'\
'2: :->task'
case $state in
service)
_arguments '1:service:(picasa blogger youtube docs contacts calendar finance)'
;;
*)
case $words[2] in
picasa)
compadd "$@" get create list list-albums tag post delete
;;
blogger)
compadd "$@" post tag list delete
;;
youtube)
compadd "$@" post tag list delete
;;
docs)
compadd "$@" edit delete list upload get
;;
contacts)
compadd "$@" list list-groups add add-groups delete-groups delete
;;
calendar)
compadd "$@" add list today delete
;;
finance)
compadd "$@" list-txn delete-pos create-pos delete-txn create create-txn list list-pos delete
;;
*)
esac
esac
}
_google "$@"
# 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 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,53 +0,0 @@
#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

@ -1,181 +0,0 @@
#compdef http
# ------------------------------------------------------------------------------
# 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 httpie 0.7.2 (http://httpie.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * 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; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_httpie_params () {
local ret=1 expl
# or a url
if (( CURRENT <= NORMARG+1 )) && [[ $words[NORMARG] != *:* ]] ; then
_httpie_urls && ret=0
# regular param, if we already have a url
elif (( CURRENT > NORMARG )); then
# if the suffix is precisely : this is shorthand for a header
if [[ -prefix ':' ]]; then
PREFIX=
SUFFIX=:
fi
# if we are in front of a : (possibly due to the PREFIX move before)
if [[ -suffix ':' ]]; then
# this is rather buggy with normal tab behavior :\
compstate[insert]=menu
_wanted http_header expl 'HTTP Header' \
compadd -s ':' -S '' -- Content-Type Cookie && return 0
fi
# ignore all prefix stuff
compset -P '(#b)([^:@=]#)'
local name=$match[1]
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 header content"
else
typeset -a ops
ops=(
'=:data field'
'\::header'
'==:request parameter'
'@:data file field'
'\:=:raw json field'
'\:=@:raw json field file path'
)
_describe -t httpparams "parameter types" ops -Q -S ''
fi
ret=0
fi
# first arg may be a request method
(( CURRENT == NORMARG )) &&
_wanted http_method expl 'Request Method' \
compadd GET POST PUT DELETE HEAD OPTIONS TRACE CONNECT PATCH LINK UNLINK && ret=0
return $ret
}
_httpie_urls() {
local ret=1
if ! [[ -prefix [-+.a-z0-9]#:// ]]; then
local expl
compset -S '[^:/]*' && compstate[to_end]=''
_wanted url-schemas expl 'URL schema' compadd -S '' http:// https:// && ret=0
else
_urls && ret=0
fi
return $ret
}
_httpie_printflags () {
local ret=1
# not sure why this is necessary, but it will complete "-pH" style without it
[[ $IPREFIX == "-p" ]] && IPREFIX+=" "
compset -P '(#b)([a-zA-Z]#)'
local -a flags
[[ $match[1] != *H* ]] && flags+=( "H:request headers" )
[[ $match[1] != *B* ]] && flags+=( "B:request body" )
[[ $match[1] != *h* ]] && flags+=( "h:response headers" )
[[ $match[1] != *b* ]] && flags+=( "b:response body" )
_describe -t printflags "print flags" flags -S '' && ret=0
return $ret
}
integer NORMARG
_arguments -n -C -s \
'(-j --json -f)'{-j,--json}'[Data items from the command line are serialized as a JSON object.]' \
'(-f --form -j)'{-f,--form}'[Data items from the command line are serialized as form fields.]' \
'--pretty=[Controls output processing.]:output format:(all colors format none)' \
'(-s --style)'{-s,--style}'=[Output coloring style]:STYLE:(autumn borland bw colorful default emacs friendly fruity manni monokai murphy native pastie perldoc ttr solarized tango trac vim vs)' \
'(-p --print)'{-p,--print}'=[String specifying what the output should contain]:print flags:_httpie_printflags' \
'(-v --verbose)'{-v,--verbose}'[Print the whole request as well as the response.]' \
'(-p -h --headers)'{-h,--headers}'[Print only the response headers.]' \
'(-p -b --body)'{-b,--body}'[Print only the response body.]' \
'(-S --stream)'{-S,--stream}'[Always stream the output by line, i.e., behave like `tail -f`.]' \
'(-o --output)'{-o,--output}'=[Save output to FILE.]:output file:_files' \
'(-d --download)'{-d,--download}'=[Do not print the response body to stdout.]' \
'(-c --continue)'{-c,--continue}'[Resume an interrupted download.]' \
'(--session-read-only)--session=[Create, or reuse and update a session.]:session name (or path)' \
'(--session)--session-read-only=[Create or read a session without updating it form the request/response exchange.]:session name (or path)' \
'(-a --auth)'{-a,--auth}'=[If only the username is provided (-a username)]:USER\:PASS' \
'--auth-type=[The authentication mechanism to be used. Defaults to "basic".]:AUTH-TYPE:(basic digest)' \
'--proxy=[String mapping protocol to the URL of the proxy.]:PROXY' \
'--follow[Allow full redirects.]' \
"--verify=[Enable or disable verification of ssl certificates.]:verify certificate:(yes no)" \
'--allow-redirects[Set this flag if full redirects are allowed (e.g. re-POST-ing of data at new ``Location``)]' \
'--timeout=[Float describes the timeout of the request (Use socket.setdefaulttimeout() as fallback).]:timeout (seconds)' \
'--check-status[This flag instructs HTTPie to also check the HTTP status code and exit with an error if the status indicates one.]' \
'--ignore-stdin[Do not attempt to read stdin.]' \
'(- *)--help[show help message.]' \
"(- *)--version[show program's version number and exit.]" \
'--traceback[Prints exception traceback should one occur.]' \
'--debug[Prints exception traceback should one occur and other information useful for debugging HTTPie itself.]' \
'*:args:_httpie_params' && return 0

View File

@ -1,74 +0,0 @@
#compdef jmeter
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for JMeter (http://jakarta.apache.org/jmeter).
#
# Status: incomplete
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments \
'(- 1 *)'{-h,--help}'[print usage information and exit]' \
'(- 1 *)'{-v,--version}'[print the version information and exit]' \
{-p,--propfile}'[the jmeter property file to use]:properties file:_files -g "*.properties"' \
'*'{-q,--addprop}'[additional property file(s)]:properties file:_files -g "*.properties"' \
{-t,--testfile}'[the jmeter test plan file to run]:JMeter test plan file:_files -g "*.jmx"' \
{-j,--jmeterlogfile}'[the jmeter log file]: :_files -g "*.log"' \
{-l,--logfile}'[the file to log samples to]: :_files -g "*.jtl"' \
{-n,--nongui}'[run JMeter in nongui mode]' \
{-s,--server}'[run the JMeter server]' \
{-H,--proxyHost}'[set a proxy server for JMeter to use]: :_hosts' \
{-P,--proxyPort}'[set proxy server port for JMeter to use]:number' \
{-u,--username}'[set username for proxy server that JMeter is to use]:username:_users' \
{-a,--password}'[set password for proxy server that JMeter is to use]:password' \
{-J-,--jmeterproperty}'[define additional JMeter properties]:argument=value' \
{-G-,--globalproperty}'[define Global properties (sent to servers)]:argument=value' \
{-D-,--systemproperty}'[define additional System properties]:argument=value' \
{-S,--systemPropertyFile}'[a property file to be added as System properties]:properties file:_files -g "*.properties"' \
{-L,--loglevel}'[define loglevel]:[category=]level' \
{-r,--runremote}'[start remote servers (as defined by the jmeter property remote_hosts)]' \
{-R,--remotestart}'[start these remote servers (overrides remote_hosts)]:remote servers list' \
{-d,--homedir}'[the JMeter home directory to use]: :_files -/' \
{-X,--remoteexit}'[exit the remote servers at end of test (non-GUI)]'
# 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,67 +0,0 @@
#compdef jmeter-plugins
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for jmeter-plugins command line tool 0.4.2
# (http://code.google.com/p/jmeter-plugins).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments \
'(- 1 *)--help[show help options]' \
'--generate-png[generate PNG file containing graph]:PNG file name:_files -g "*.png"' \
'--generate-csv[generate CSV file containing graph data]:CSV file name:_files -g "*.csv"' \
'--input-jtl[load data from specified JTL file]:JTL file:_files -g "*.jtl"' \
'--plugin-type[type of graph to use for results generation]:class:((AggregateReport ThreadsStateOverTime BytesThroughputOverTime HitsPerSecond LatenciesOverTime PerfMon ResponseCodesPerSecond ResponseTimesDistribution ResponseTimesOverTime ResponseTimesPercentiles ThroughputOverTime ThroughputVsThreads TimesVsThreads TransactionsPerSecond))' \
'--width[set graph width]:graph width (pixels)' \
'--height[set graph height]::graph height (pixels)' \
'--granulation[granulation time for samples]:time (ms)' \
'--relative-times[use relative X axis times, no will set absolute times]: :((yes no))' \
'--aggregate-rows[aggregate all rows into one]: :((yes no))' \
'--paint-gradient[paint gradient background]: :((yes no))' \
'--paint-zeroing[paint zeroing lines]: :((yes no))' \
'--prevent-outliers[prevent outliers on distribution graph]: :((yes no))' \
'--limit-rows[limit number of points in row]:number of points' \
'--force-y[force Y axis limit]:limit' \
'--hide-low-counts[hide points with sample count below limit]:limit'
# 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,125 +0,0 @@
#compdef jonas
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for JOnAS 5.2 (http://jonas.ow2.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext" ret=1
_arguments -C \
'1:cmd:->cmds' \
'*::arg:->args' \
&& ret=0
case "$state" in
(cmds)
local commands; commands=(
'version:show version information'
'check:check that the JOnAS environment is correctly set'
'start:start a server instance'
'stop:stop a server instance'
'admin:administrate a server instance'
)
_describe -t commands 'command' commands && ret=0
;;
(args)
curcontext="${curcontext%:*:*}:jonas-cmd-$words[1]:"
case $words[1] in
(version|check)
_message 'no more arguments' && ret=0
;;
(start)
_arguments \
'-standby[start a minimal JOnAS server with only mandatory services]' \
'(-bg)-fg[start the server in foreground mode]' \
'(-fg)-bg[start the server in background mode]' \
'-win[start the server in a new window]' \
'(-bg)-tui[start the Apache Felix TUI (force foreground mode)]' \
'-gui[start the Apache Felix GUI]' \
'-dev[start a JOnAS server by using bundles present in the default maven repository instead of bundles under $JONAS_ROOT/lib/bundles]' \
'-clean[clean the Apache Felix cache before starting a JOnAS server]' \
'-n[set the server name, must be unique in the domain (default: jonas)]:name' \
'-target[start another server or cluster (group of servers) in the domain]:server' \
'-Ddomain.name=[set the name of the management domain to which the server belongs]:domain' \
&& ret=0
;;
(stop)
_arguments \
'-standby[stop all services except the mandatory ones]' \
'-n[set the name of the server to stop (default: jonas)]:name' \
'-target[stop another server or cluster (group of servers) in the domain]:server' \
'-Ddomain.name=[set the name of the management domain to which the server belongs]:domain' \
&& ret=0
;;
(admin)
_arguments \
'(- : *)-?[print the help message]' \
'-win[administer the server in a new window]' \
'-n[set the name of the server to administer (default: jonas)]:name' \
'-username[set the username when authentication is required]: :_users' \
'-password[set the password when authentication is required]:password' \
'-registry[set the registry URL]: :_urls' \
'-protocol[set the protocol name]:protocol:((jrmp\:JRE\ implementation\ of\ RMI\ on\ the\ JRMP\ protocol\ \(default\) iiop\:JacORB\ implementation\ of\ RMI\ over\ the\ IIOP\ protocol irmi\:Oracle\ JRE\ independant\ implementation\ of\ RMI))' \
'-a[deploy an application from a given filepath on the current server, or on another target in the domain if the current server is a master]:Java application archive:_files -g "*.(j|w|r|e)ar"' \
'-r[undeploy a previously deployed application from the current server or from the specified target if the current server is a master]:Java application archive:_files -g "*.(j|w|r|e)ar"' \
'-gc[run the garbage collector on the current JOnAS server]' \
'-passivate[passivate all entity bean instances]' \
'-e[list the properties of the current JOnAS server]' \
'-j[list the registered JNDI names, as seen by the current JOnAS server]' \
'-l[list the beans currently loaded by the current JOnAS server]' \
'-synch[synchronize the entity bean instances on the current JOnAS server]' \
'-debug[set the logging level for the given topic to DEBUG]:topic' \
'-tt[change the default timeout for transactions]:timeout (seconds)' \
'-ping[wait until the JOnAS server is available]' \
'-timeout[maximum time to wait when -ping is used]:timeout (seconds)' \
&& ret=0
;;
esac
;;
esac
return ret
# 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,84 +0,0 @@
#compdef jq
# ------------------------------------------------------------------------------
# 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 jq (http://stedolan.github.io/jq/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Hideaki Miyake (https://github.com/mollifier)
# * George Kontridze (https://github.com/gkze)
#
# ------------------------------------------------------------------------------
declare -a opts args
args=(
'--argfile[This option passes the first value from the named file as a value to the jq program as a predefined variable]'
'--unbuffered[Flush the output after each JSON object is printed]'
'(-C --color-output)'{-C,--color-output}'[Colorize the output even if writing to a pipe or a file]'
'(-I --online-input)'{-I,--online-input}'[When the top-level input value is an array produce its elements instead of the array]'
'(-M --monochrome-output)'{-M,--monochrome-output}'[Not colorize the output]'
'(-R --raw-input)'{-R,--raw-input}'[Parse the input as not JSON but string]'
'(-S --sort-keys)'{-S,--sort-keys}'[Output the fields of each object with the keys in sorted order]'
'(-V --version)'{-V,--version}'[Display version information]'
'(-a --ascii-output)'{-a,--ascii-output}'[Output with pure ASCII characters]'
'(-e --exit-status)'{-e,--exit-status}'[Sets the exitstatus of jq to 0 if the last output values was neither false nor null, 1 if the last output value was either false or null, or 4 if no valid result was ever produced]'
'(-c --compact-output)'{-c,--compact-output}'[Compact output]'
'(-h --help)'{-h,--help}'[Display help information]'
'(-n --null-input)'{-n,--null-input}'[Run the filter using null as the input]'
'(-r --raw-output)'{-r,--raw-output}'[Not format string result as a JSON string with quotes]'
'(-s --slurp)'{-s,--slurp}'[Run the filter just once]'
'--arg[Passes a value to the jq program, e.g. --arg foo bar]:jq variable: '
'1: :_guard "^-*" pattern'
'*:files:->file'
)
local curcontext=$curcontext state line ret=1
declare -A opt_args
_arguments -C $opts \
$args && ret=0
case $state in
file)
_files && 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,65 +0,0 @@
#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

@ -1,85 +0,0 @@
#compdef kitchen
# ------------------------------------------------------------------------------
# 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
# -----------
#
# Completion script for Test Kitchen (http://kitchen.ci/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Peter Eisentraut (https://github.com/petere)
#
# ------------------------------------------------------------------------------
_kitchen() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments '1: :->cmds'\
'2: :->args'
case $state in
cmds)
_kitchen_commands
;;
args)
case $line[1] in
converge|create|destroy|diagnose|list|setup|test|verify)
compadd 'all'
_kitchen_instances
;;
login)
_kitchen_instances
;;
esac
;;
esac
}
_kitchen_commands() {
local commands
commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) [ [].*# \(.*\)$/\1:\2/p')}")
_describe -t commands 'kitchen commands' commands
}
_kitchen_instances() {
if [[ $_kitchen_instances_cache_dir != $PWD ]]; then
unset _kitchen_instances_cache
fi
if [[ ${+_kitchen_instances_cache} -eq 0 ]]; then
_kitchen_instances_cache=(${(f)"$(_call_program instances $service list -b 2>/dev/null)"})
_kitchen_instances_cache_dir=$PWD
fi
_wanted instances expl 'instance' compadd -a _kitchen_instances_cache
}
_kitchen "$@"

View File

@ -1,238 +0,0 @@
#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
# -----------
#
# Completion script for Chef's knife (http://www.opscode.com/chef).
#
# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/knife
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Frank Louwers (https://github.com/franklouwers)
# * Mark Cornick (https://github.com/markcornick)
#
# ------------------------------------------------------------------------------
# knife has a very special syntax, some example calls are:
# knife status
# knife cookbook list
# knife role show ROLENAME
# knife data bag show DATABAGNAME
# knife role show ROLENAME --attribute ATTRIBUTENAME
# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes
# The -Q switch in compadd allow for completions of things like "data bag" without having to go through two rounds of completion and avoids zsh inserting a \ for escaping spaces
_knife() {
local curcontext="$curcontext" state line
typeset -A opt_args
# These flags should be available everywhere according to man knife
knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes --environment )
cloudproviders=(bluebox ec2 rackspace slicehost terremark)
_arguments \
'1: :->knifecmd'\
'2: :->knifesubcmd'\
'3: :->knifesubcmd2' \
'4: :->knifesubcmd3' \
'5: :->knifesubcmd4' \
'6: :->knifesubcmd5'
case $state in
knifecmd)
compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff environment user exec index node recipe role search ssh status windows $cloudproviders
;;
knifesubcmd)
case $words[2] in
(bluebox|ec2|rackspace|slicehost|terremark)
compadd "$@" server images
;;
client)
compadd -Q "$@" "bulk delete" list create show delete edit reregister
;;
configure)
compadd "$@" client
;;
cookbook)
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
;;
diff)
_arguments '*:file or directory:_files -g "*.(rb|json)"'
;;
environment)
compadd -Q "$@" create delete edit "from file" list show
;;
user)
compadd -Q "$@" create delete edit list reregister show
;;
node)
compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
;;
recipe)
compadd "$@" list
;;
role)
compadd -Q "$@" "bulk delete" create delete edit "from file" list show
;;
windows)
compadd "$@" bootstrap
;;
*)
_arguments '2:Subsubcommands:($(_knife_options1))'
esac
;;
knifesubcmd2)
case $words[3] in
server)
compadd "$@" list create delete
;;
images)
compadd "$@" list
;;
site)
compadd "$@" vendor show share search download list unshare
;;
(show|delete|edit)
_arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))'
;;
(upload|test)
_arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)'
;;
list)
compadd -a "$@" knife_general_flags
;;
bag)
compadd -Q "$@" show edit list "from file" create delete
;;
*)
_arguments '3:Subsubcommands:($(_knife_options2))'
esac
;;
knifesubcmd3)
case $words[3] in
show)
case $words[2] in
cookbook)
versioncomp=1
_arguments '4:Cookbookversions:($(_cookbook_versions) latest)'
;;
(node|client|role|environment)
compadd "$@" --attribute
esac
esac
case $words[4] in
(show|edit)
_arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))'
;;
file)
_arguments '*:file or directory:_files -g "*.(rb|json)"'
;;
list)
compadd -a "$@" knife_general_flags
;;
*)
_arguments '*:Subsubcommands:($(_knife_options3))'
esac
;;
knifesubcmd4)
if (( versioncomp > 0 )); then
compadd "$@" attributes definitions files libraries providers recipes resources templates
else
_arguments '*:Subsubcommands:($(_knife_options2))'
fi
;;
knifesubcmd5)
_arguments '*:Subsubcommands:($(_knife_options3))'
esac
}
# Helper functions to provide the argument completion for several depths of commands
_knife_options1() {
( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
}
_knife_options2() {
( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
}
_knife_options3() {
( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
}
# The chef_x_remote functions use knife to get a list of objects of type x on the server
_chef_roles_remote() {
(knife role list | awk '{print $1}')
}
_chef_clients_remote() {
(knife client list | awk '{print $1}')
}
_chef_nodes_remote() {
(knife node list | awk '{print $1}')
}
_chef_cookbooks_remote() {
(knife cookbook list | awk '{print $1}')
}
_chef_sitecookbooks_remote() {
(knife cookbook site list | awk '{print $1}')
}
_chef_data_bags_remote() {
(knife data bag list | awk '{print $1}')
}
_chef_environments_remote() {
(knife environment list | awk '{print $1}')
}
_chef_users_remote() {
(knife user list | awk '{print $1}')
}
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
_chef_cookbooks_local() {
(for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
}
# This function extracts the available cookbook versions on the chef server
_cookbook_versions() {
(knife cookbook show $words[4] | grep -v $words[4] | grep -v -E '\]|\[|\{|\}' | sed 's/ //g' | sed 's/"//g')
}
_knife "$@"
# 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,275 +0,0 @@
#autoload
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completer for language codes.
#
# Usage: _language_codes ISO-639-1
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
(( $+functions[_language_codes_iso_639_1] )) ||
_language_codes_iso_639_1() {
local codes; codes=(
'aa:Afar'
'ab:Abkhazian'
'af:Afrikaans'
'ak:Akan'
'sq:Albanian'
'am:Amharic'
'ar:Arabic'
'an:Aragonese'
'hy:Armenian'
'as:Assamese'
'av:Avaric'
'ae:Avestan'
'ay:Aymara'
'az:Azerbaijani'
'ba:Bashkir'
'bm:Bambara'
'eu:Basque'
'be:Belarusian'
'bn:Bengali'
'bh:Bihari languages'
'bi:Bislama'
'bo:Tibetan'
'bs:Bosnian'
'br:Breton'
'bg:Bulgarian'
'my:Burmese'
'ca:Catalan'
'cs:Czech'
'ch:Chamorro'
'ce:Chechen'
'zh:Chinese'
'cu:Church Slavic'
'cv:Chuvash'
'kw:Cornish'
'co:Corsican'
'cr:Cree'
'cy:Welsh'
'cs:Czech'
'da:Danish'
'de:German'
'dv:Divehi'
'nl:Dutch'
'dz:Dzongkha'
'el:Greek, Modern (1453-)'
'en:English'
'eo:Esperanto'
'et:Estonian'
'eu:Basque'
'ee:Ewe'
'fo:Faroese'
'fa:Persian'
'fj:Fijian'
'fi:Finnish'
'fr:French'
'fy:Western Frisian'
'ff:Fulah'
'ka:Georgian'
'de:German'
'gd:Gaelic'
'ga:Irish'
'gl:Galician'
'gv:Manx'
'gn:Guarani'
'gu:Gujarati'
'ht:Haitian'
'ha:Hausa'
'he:Hebrew'
'hz:Herero'
'hi:Hindi'
'ho:Hiri Motu'
'hr:Croatian'
'hu:Hungarian'
'hy:Armenian'
'ig:Igbo'
'is:Icelandic'
'io:Ido'
'ii:Sichuan Yi'
'iu:Inuktitut'
'ie:Interlingue'
'ia:Interlingua (International Auxiliary Language Association)'
'id:Indonesian'
'ik:Inupiaq'
'is:Icelandic'
'it:Italian'
'jv:Javanese'
'ja:Japanese'
'kl:Kalaallisut'
'kn:Kannada'
'ks:Kashmiri'
'ka:Georgian'
'kr:Kanuri'
'kk:Kazakh'
'km:Central Khmer'
'ki:Kikuyu'
'rw:Kinyarwanda'
'ky:Kirghiz'
'kv:Komi'
'kg:Kongo'
'ko:Korean'
'kj:Kuanyama'
'ku:Kurdish'
'lo:Lao'
'la:Latin'
'lv:Latvian'
'li:Limburgan'
'ln:Lingala'
'lt:Lithuanian'
'lb:Luxembourgish'
'lu:Luba-Katanga'
'lg:Ganda'
'mk:Macedonian'
'mh:Marshallese'
'ml:Malayalam'
'mi:Maori'
'mr:Marathi'
'ms:Malay'
'mk:Macedonian'
'mg:Malagasy'
'mt:Maltese'
'mn:Mongolian'
'mi:Maori'
'ms:Malay'
'my:Burmese'
'na:Nauru'
'nv:Navajo'
'nr:Ndebele, South'
'nd:Ndebele, North'
'ng:Ndonga'
'ne:Nepali'
'nl:Dutch'
'nn:Norwegian Nynorsk'
'nb:Bokmål, Norwegian'
'no:Norwegian'
'ny:Chichewa'
'oc:Occitan (post 1500)'
'oj:Ojibwa'
'or:Oriya'
'om:Oromo'
'os:Ossetian'
'pa:Panjabi'
'fa:Persian'
'pi:Pali'
'pl:Polish'
'pt:Portuguese'
'ps:Pushto'
'qu:Quechua'
'rm:Romansh'
'ro:Romanian'
'ro:Romanian'
'rn:Rundi'
'ru:Russian'
'sg:Sango'
'sa:Sanskrit'
'si:Sinhala'
'sk:Slovak'
'sk:Slovak'
'sl:Slovenian'
'se:Northern Sami'
'sm:Samoan'
'sn:Shona'
'sd:Sindhi'
'so:Somali'
'st:Sotho, Southern'
'es:Spanish'
'sq:Albanian'
'sc:Sardinian'
'sr:Serbian'
'ss:Swati'
'su:Sundanese'
'sw:Swahili'
'sv:Swedish'
'ty:Tahitian'
'ta:Tamil'
'tt:Tatar'
'te:Telugu'
'tg:Tajik'
'tl:Tagalog'
'th:Thai'
'bo:Tibetan'
'ti:Tigrinya'
'to:Tonga (Tonga Islands)'
'tn:Tswana'
'ts:Tsonga'
'tk:Turkmen'
'tr:Turkish'
'tw:Twi'
'ug:Uighur'
'uk:Ukrainian'
'ur:Urdu'
'uz:Uzbek'
've:Venda'
'vi:Vietnamese'
'vietnamien'
'vo:Volapük'
'cy:Welsh'
'wa:Walloon'
'wo:Wolof'
'xh:Xhosa'
'yi:Yiddish'
'yo:Yoruba'
'za:Zhuang'
'zh:Chinese'
'zu:Zulu'
)
_describe -t language-codes 'ISO 639-1 language code' codes "$@"
}
_language_codes() {
local command="$argv[$#]" ret=1
case $command in
ISO-639-1)
_language_codes_${${command//-/_}:l} "${@[1,-2]}" && ret=0
;;
*)
_message "unknown command: $command"
;;
esac
return ret
}
# 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,54 +0,0 @@
#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

@ -1,97 +0,0 @@
#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,74 +0,0 @@
#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
# -----------
#
# Completion script for lunchy (https://github.com/mperham/lunchy).
#
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Blake Walters (https://github.com/markupboy)
#
# ------------------------------------------------------------------------------
local state line cmds ret=1
_arguments -C '1: :->cmds' '*: :->args'
case $state in
cmds)
local -a cmds
cmds=(
'ls:list available agents'
'start:start an agent'
'stop:stop an agent'
'restart:restart an agent'
'status:get the status of agent[s]'
'install:install an agents plist file'
'edit:edit an agent'
)
_describe -t commands 'lunchy command' cmds && ret=0
;;
args)
case $line[1] in
(install)
;;
(restart|stop)
_values 'items' `lunchy status | awk '{print $3}' ` 2>/dev/null && ret=0
;;
*)
_values 'items' `lunchy ls` 2>/dev/null && ret=0
;;
esac
;;
esac
return ret

View File

@ -1,156 +0,0 @@
#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
# -----------
#
# Completion script for middleman (http://middlemanapp.com/)
# Includes commands from middleman-blog and middleman-deploy extesions.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jozef Izso (https://github.com/jozefizso)
#
# ------------------------------------------------------------------------------
local ret=1 state
local -a common_ops
common_ops=(
"--help[Display help]"
)
typeset -A opt_args
_arguments \
':subcommand:->subcommand' \
$common_ops \
'*::options:->options' && ret=0
case $state in
subcommand)
local -a subcommands
subcommands=(
"article:Create a new blog article"
"build:Builds the static site for deployment"
"console:Start an interactive console in the context of your Middleman application"
"deploy:Deploy a middleman built site over rsync, ftp, sftp, or git (e.g. gh-pages on github)."
"extension:Create Middleman extension scaffold"
"init:Create new project"
"server:Start the preview server"
"upgrade:Upgrade installed bundle"
"version:Show version"
)
_describe -t subcommands 'middleman subcommand' subcommands && ret=0
;;
options)
local -a args
args=(
$common_ops
)
local -a help
help=(
"--help[Display help information]"
)
case $words[1] in
article)
args=(
{-d,--date}"[The date to create the post with (defaults to now)]:date"
)
;;
build)
args=(
"--clean[Remove orphaned files from build (Default: true)]"
"--no-clean[Disable removing orphaned files from build]"
{-g,--glob}"[Build a subset of the project]:glob"
"--verbose[Print debug messages]"
"--instrument[Print instrument messages]:instrument"
"--profile[Generate profiling report for the build]"
)
;;
console)
args=(
{-e,--environment}"[The environment Middleman will run under (Default: development)]:environment"
"--verbose[Print debug messages]"
)
;;
deploy)
args=(
{-b,--build-before}"[Run \`middleman build\` before the deploy step]"
)
;;
extension)
args=(
"--git[Default: true]"
)
;;
init)
args=(
{-T,--template}"[Use a project template: default, html5, mobile, smacss, empty. (Default: default)]:template"
"--css-dir [The path to the css files]:css_dir"
"--js-dir [The path to the javascript files]:js_dir"
"--images-dir [The path to the image files]:images_dir"
"--rack [Include a config.ru file]"
"--skip-gemfile [Don't create a Gemfile]"
"--skip-bundle [Don't run bundle install]"
"--skip-git [Skip Git ignores and keeps]"
)
;;
server)
args=(
{-e,--environment}"[The environment Middleman will run under (Default: development)]:environment"
{-h,--host}"[Bind to HOST address (Default: 0.0.0.0)]:host"
{-p,--port}"[The port Middleman will listen on (Default: 4567)]:port"
"--verbose [Print debug messages]"
"--instrument [Print instrument messages]:instrument"
"--disable-watcher [Disable the file change and delete watcher process]"
"--profile [Generate profiling report for server startup]"
"--reload-paths [Additional paths to auto-reload when files change]:reload_paths"
"--force-polling [Force file watcher into polling mode]"
)
;;
upgrade)
args=()
;;
version)
args=()
;;
esac
_arguments $args && ret=0
;;
esac
return ret

View File

@ -1,68 +0,0 @@
#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
# -----------
#
# Completion script for Mina (http://nadarei.co/mina/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Kazuya Takeshima (https://github.com/mitukiii)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line cmds ret=1
_arguments -C \
{-h,--help}'[Show help]' \
{-V,--version}'[Show program version]' \
{-v,--verbose}'[Show commands as they happen]' \
{-s,--simulate}'[Run in simulation mode]' \
{-t,--trace}'[Show backtraces when errors occur]' \
-f'[Use FILE as the deploy configuration]:file:_files' \
'*: :->cmds' && ret=0
case $state in
cmds)
cmds=( ${(f)"$(_call_program commands mina -T 2> /dev/null | sed -e 's/:/\\:/g; s/\[/\\[/g; s/\]/\\]/g; s/mina \([^ ]*\) .*# /\1:/g')"} )
_describe -t commands 'mina command' cmds && 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,138 +0,0 @@
#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: 23.01.2016
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Han Ngo (https://github.com/tieubao)
#
# ------------------------------------------------------------------------------
local -a _1st_arguments
_1st_arguments=(
'app.start:Start all registered apps'
'archive:List all archives'
'archive.build:Archive this project into a .ez file'
'archive.install:Install an archive locally'
'archive.uninstall:Uninstall archives'
'clean:Delete generated application files'
'cmd:Executes the given command'
'compile:Compile source files'
'compile.protocols:Consolidates all protocols in all paths'
'deps:List dependencies and their status'
"deps.clean:Remove the given dependencies' files"
'deps.compile:Compile dependencies'
'deps.get:Get all out of date dependencies'
'deps.unlock:Unlock the given dependencies'
'deps.update:Update the given dependencies'
'do:Executes the tasks separated by comma'
'ecto.create:Create the storage for the repo'
'ecto.drop:Drop the storage for the repo'
'ecto.gen.migration:Generate a new migration for the repo'
'ecto.gen.repo:Generate a new repository'
'ecto.migrate:Run migrations up on a repo'
'ecto.rollback:Rollback migrations from a repo'
'escript.build:Builds an escript for the project'
'gettext.extract:Get text extract'
'gettext.merge:Get text merge'
'help:Print help information for tasks'
'hex:Print hex help information'
'hex.build:Builds a new package version locally'
'hex.config:Read or update hex config'
'hex.docs:Publish docs for package'
'hex.info:Print hex information'
'hex.key:Hex API key tasks'
'hex.outdated:Shows outdated hex deps for the current project'
'hex.owner:Hex package ownership tasks'
'hex.publish:Publish a new package version'
'hex.registry:Hex registry tasks'
'hex.search:Search for package names'
'hex.user:Hex user tasks'
'loadconfig:Loads and persists the given configuration'
'local:List local tasks'
'local.hex:Install hex locally'
'local.public_keys:Public keys'
'local.rebar:Install rebar locally'
'new:Create a new Elixir project'
'phoenix.digest:Digests and compress static files'
'phoenix.gen.channel:Generates a Phoenix channel'
'phoenix.gen.html:Generates controller, model and views for an HTML based resource'
'phoenix.gen.json:Generates a controller and model for a JSON based resource'
'phoenix.gen.model:Generates an Ecto model'
'phoenix.gen.secret:Generates a secret'
'phoenix.new:Create a new Phoenix application'
'phoenix.routes:Prints all routes'
'phoenix.server:Starts applications and their servers'
'profile.fprof:Profiles the given file or expression with fprof'
'run:Run the given file or expression'
"test:Run a project's tests"
'--help:Describe available tasks'
'--version:Prints the Elixir version information'
)
__task_list ()
{
local expl
declare -a tasks
tasks=$(mix --help | grep -v "default task" | awk '{print $2}')
_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'
esac
;;
esac

View File

@ -1,163 +0,0 @@
#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,86 +0,0 @@
#compdef mussh
# ------------------------------------------------------------------------------
# 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 MUltihost SSH Wrapper (http://mussh.sourceforge.net/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mario Fernandez (https://github.com/sirech)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
# TODO:
# -i: admit more than one use
# -d, -v, -t: control input
# -m: Accept number (but also empty)
# -h: Accept multiple hosts, also more than one use
# -H: Accept multiple files, also more than one use
_arguments -C \
'--help[display this help message]' \
'-V[print version info and exit]' \
'-d[Verbose debug]:level (from 0 to 2)' \
'-v[SSH debug level]:level (from 0 to 3)' \
'-m[Run concurrently]' \
'(-b -B)-b[Print each hosts output in a block without mingling with other hosts output]' \
'(-b -B)-B[Allow hosts output to mingle. (default)]' \
'(-a -A)-a[Force loading ssh-agent]' \
'(-a -A)-A[Do NOT load ssh-agent]' \
'(-u -U)-u[Unique. Eliminate duplicate hosts. (default)]' \
'(-u -U)-U[Do NOT make host list unique]' \
'-P[Do NOT fall back to passwords on any host. This will skip hosts where keys fail]' \
'-i[Load an identity file. May be used more than once]:identity' \
'-o[Args to pass to ssh with -o option]:ssh-args' \
'(-l -L)-l[Use _login_ when no other is specified with the hostname]:login' \
'(-l -L)-L[Force use of _login_ on all hosts]:login' \
'-s[Path to shell on remote host]:shell' \
'-t[Timeout setting for each session]:timeout' \
'-p[Host to use as proxy]:[user@]host' \
'-po[Args to pass to ssh on proxy with -o option]:ssh-args' \
'(-h -H)-h[Add a host to list of hosts]:[user@]host' \
'(-h -H)-H[Add contents of file to list of hosts]:host file:_files' \
'(-c -C)-c[Add a command or quoted list of commands to list of commands to be executed on each host]:command' \
'(-c -C)-C[Add file contents to list of commands to be executed on each host]:commands file:_files' \
'(-q)-q[No output unless necessary]' && ret=0
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,638 +0,0 @@
#compdef mvn mvnDebug
# ------------------------------------------------------------------------------
# Copyright (c) 2010-2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Maven (http://maven.apache.org).
#
# Status: See FIXME and TODO tags.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# Notes
# -----
#
# * By default advanced phases are displayed only if you start typing them. To have
# them always displayed:
#
# zstyle ':completion:*:mvn:*' show-all-phases true
#
# * By default full form plugins (groupId:artifactId[:version]) are only shown if you
# start typing them. To have them always displayed:
#
# zstyle ':completion:*:mvn:*' show-full-form-plugins true
#
# * By default only the plugins for which the completion has already been
# called ("mvn plugin:<TAB>") are shown. To define your own list of plugins:
#
# maven_plugins=(jboss tomcat gwt android)
# zstyle ':completion:*:mvn:*' plugins $maven_plugins
#
# * To have a better presentation of completions:
#
# zstyle ':completion:*:*:mvn:*:matches' group 'yes'
# zstyle ':completion:*:*:mvn:*:options' description 'yes'
# zstyle ':completion:*:*:mvn:*:options' auto-description '%d'
# zstyle ':completion:*:*:mvn:*:descriptions' format $'\e[1m -- %d --\e[22m'
# zstyle ':completion:*:*:mvn:*:messages' format $'\e[1m -- %d --\e[22m'
# zstyle ':completion:*:*:mvn:*:warnings' format $'\e[1m -- No matches found --\e[22m'
#
# ------------------------------------------------------------------------------
_mvn() {
typeset -A opt_args
local context state line
local curcontext="$curcontext" maven_version excl_opts
excl_opts=(-h --help -v --version -ep --encrypt-password -emp --encrypt-master-password)
_pick_variant -r maven_version maven3='Maven 3' maven2='Maven 2' unknown --version
if [[ $maven_version == 'maven3' ]]; then
opts=(
"($excl_opts -T --threads)"{-T,--threads}'[thread count, for instance 2.0C where C is core multiplied]:thread count:_mvn_thread_counts'
"($excl_opts -t --toolchains)"{-t,--toolchains}'[alternate path for the user toolchains file]:toolchains file:_mvn_toolchains_files'
"($excl_opts -l --log-file)"{-l,--log-file}'[log file to where all build output will go]:log file:_mvn_log_files'
)
elif [[ $maven_version == 'maven2' ]]; then
opts=(
"($excl_opts -cpu --check-plugin-updates -up --update-plugins -npu --no-plugin-updates -o --offline)"{-cpu,--check-plugin-updates,-up,--update-plugins}'[force upToDate check for any relevant registered plugins]'
"($excl_opts -npr --no-plugin-registry)"{-npr,--no-plugin-registry}'[don'\''t use plugin-registry.xml for plugin versions]'
"($excl_opts -npu --no-plugin-updates -cpu --check-plugin-updates -up --update-plugins)"{-npu,--no-plugin-updates}'[suppress upToDate check for any relevant registered plugins]'
"($excl_opts -r --reactor)"{-r,--reactor}'[dynamically build reactor from subdirectories]:reactor:_mvn_reactors'
)
fi
[[ -n ${(M)words:#"-pl"} || -n ${(M)words:#"--projects"} ]] && opts+=(
"($excl_opts -am --also-make)"{-am,--also-make}'[if project list is specified, also build projects required by the list]'
"($excl_opts -amd --also-make-dependents)"{-amd,--also-make-dependents}'[if project list is specified, also build projects that depend on projects on the list]'
)
_arguments -C \
"(- : *)"{-h,--help}'[display help information]' \
"(- : *)"{-v,--version}'[display version information]' \
"(- : *)"{-emp,--encrypt-master-password}'[encrypt master security password]:master password:_mvn_passwords' \
"(- : *)"{-ep,--encrypt-password}'[encrypt server password]:password:_mvn_passwords' \
"($excl_opts -B --batch-mode)"{-B,--batch-mode}'[run in non-interactive (batch) mode]' \
"($excl_opts -V --show-version)"{-V,--show-version}'[display version information without stopping build]' \
"($excl_opts -q --quiet -X --debug)"{-q,--quiet}'[quiet output, only show errors]' \
"($excl_opts -X --debug -q --quiet)"{-X,--debug}'[produce execution debug output]' \
"($excl_opts -N --non-recursive)"{-N,--non-recursive}'[do not recurse into sub-projects]' \
"($excl_opts -C --strict-checksums -c --lax-checksums)"{-C,--strict-checksums}'[fail the build if checksums don'\''t match]' \
"($excl_opts -c --lax-checksums -C --strict-checksums)"{-c,--lax-checksums}'[warn if checksums don'\''t match]' \
"($excl_opts -e --errors)"{-e,--errors}'[produce execution error messages]' \
"($excl_opts -f --file)"{-f,--file}'[force the use of an alternate POM file]:POM file:_mvn_pom_files' \
"($excl_opts -s --settings)"{-s,--settings}'[alternate path for the user settings file]:settings file:_mvn_settings_files' \
"($excl_opts -gs --global-settings)"{-gs,--global-settings}'[alternate path for the global settings file]:global settings file:_mvn_settings_files' \
"($excl_opts -fae --fail-at-end -ff --fail-fast -fn --fail-never)"{-fae,--fail-at-end}'[only fail the build afterwards, allow all non-impacted builds to continue]' \
"($excl_opts -ff --fail-fast -fae --fail-at-end -fn --fail-never)"{-ff,--fail-fast}'[stop at first failure in reactorized builds]' \
"($excl_opts -fn --fail-never -fae --fail-at-end -ff --fail-fast)"{-fn,--fail-never}'[never fail the build, regardless of project result]' \
"($excl_opts)*"{-P,--activate-profiles}'[comma-delimited list of profiles to activate]:profile:_mvn_profiles -s ,' \
"($excl_opts -pl --projects)"{-pl,--projects}'[build specified reactor projects instead of all projects]:project list:_mvn_projects -s ,' \
"($excl_opts -rf --resume-from)"{-rf,--resume-from}'[resume reactor from specified project]:project:_mvn_projects' \
"($excl_opts -o --offline -U --update-snapshots -cpu --check-plugin-updates -up --update-plugins)"{-o,--offline}'[work offline]' \
"($excl_opts -U --update-snapshots -nsu --no-snapshot-updates -o --offline)"{-U,--update-snapshots}'[force a check for updated releases and snapshots on remote repositories]' \
"($excl_opts -nsu --no-snapshot-updates -U --update-snapshots -o --offline)"{-nsu,--no-snapshot-updates}'[Suppress SNAPSHOT updates]' \
"*"{-D-,--define}'[define a system property]:property:_mvn_properties' \
"${opts[@]}" \
"($excl_opts)*: :_mvn_args"
}
(( $+functions[_mvn_args] )) ||
_mvn_args() {
_alternative \
'phases:phase:_mvn_phases' \
'plugin-colon-goals:plugin colon goal:_mvn_plugin_colon_goals'
}
(( $+functions[_mvn_phases] )) ||
_mvn_phases() {
local phases
phases=(
'clean:remove all files generated by the previous build'
'compile:compile the source code of the project'
'test:run tests using a suitable unit testing framework'
'package:take the compiled code and package it in its distributable format, such as a JAR'
'integration-test:process and deploy the package if necessary into an environment where integration tests can be run'
'verify:run any checks to verify the package is valid and meets quality criteria'
'install:install the package into the local repository, for use as a dependency in other projects locally'
'deploy:done in an integration or release environment, copies the final package to the remote repository'
'site:generates the projects site documentation'
'site-deploy:deploys the generated site documentation to the specified web server'
)
if [[ $#PREFIX -gt 0 ]] || zstyle -t ":completion:${curcontext}:" show-all-phases; then
phases+=(
'pre-clean:executes processes needed prior to the actual project cleaning'
'post-clean:executes processes needed to finalize the project cleaning'
'validate:validate the project is correct and all necessary information is available'
'initialize:initialize build state, e.g. set properties or create directories'
'generate-sources:generate any source code for inclusion in compilation'
'process-sources:process the source code, for example to filter any values'
'generate-resources:generate resources for inclusion in the package'
'process-resources:copy and process the resources into the destination directory, ready for packaging'
'process-classes:post-process the generated files from compilation'
'generate-test-sources:generate any test source code for inclusion in compilation'
'process-test-sources:process the test source code, for example to filter any values'
'generate-test-resources:create resources for testing'
'process-test-resources:copy and process the resources into the test destination directory'
'test-compile:compile the test source code into the test destination directory'
'process-test-classes:post-process the generated files from test compilation'
'prepare-package:perform any operations necessary to prepare a package before the actual packaging'
'pre-integration-test:perform actions required before integration tests are executed'
'post-integration-test:perform actions required after integration tests have been executed'
'pre-site:executes processes needed prior to the actual project site generation.'
'post-site:executes processes needed to finalize the site generation, and to prepare for site deployment'
)
fi
_describe -t 'phases' "phase" phases
}
(( $+functions[_mvn_plugins] )) ||
_mvn_plugins() {
local ret=1
if [[ $words[CURRENT] == *.* ]] || zstyle -t ":completion:${curcontext}:" show-full-form-plugins; then
_wanted full-form-plugins expl 'full form plugin' _mvn_full_form_plugins && ret=0
else
_wanted plugin-prefixes expl 'plugin prefix' _mvn_plugin_prefixes && ret=0
fi
return ret
}
(( $+functions[_mvn_plugin_colon_goals] )) ||
_mvn_plugin_colon_goals() {
local ret=1
if [[ $words[CURRENT] == *.* ]] || zstyle -t ":completion:${curcontext}:" show-full-form-plugins; then
_wanted full-form-plugin-colon-goals expl 'full form plugin colon goal' _mvn_full_form_plugin_colon_goals && ret=0
else
_wanted plugin-prefix-colon-goals expl 'plugin prefix colon goal' _mvn_plugin_prefix_colon_goals && ret=0
fi
return ret
}
(( $+functions[_mvn_plugin_prefix_colon_goals] )) ||
_mvn_plugin_prefix_colon_goals() {
local ret=1
if compset -P '*:'; then
local plugin="${IPREFIX%:}"
_wanted goals expl "${plugin} plugin goal" _mvn_plugin_goals $plugin && ret=0
else
_wanted plugin-prefixes expl 'plugin prefix' _mvn_plugin_prefixes -qS: && ret=0
fi
return ret
}
(( $+functions[_mvn_plugin_prefixes] )) ||
_mvn_plugin_prefixes() {
local plugins
zstyle -a ":completion:${curcontext}:" plugins plugins
[[ $#plugins -eq 0 ]] && plugins=($(__mvn_get_plugin_prefix $(__mvn_get_cache_dir)/mvn/plugins/*(:t)))
_describe -t plugin-prefixes 'plugin prefix' plugins $@
}
(( $+functions[_mvn_full_form_plugin_colon_goals] )) ||
_mvn_full_form_plugin_colon_goals() {
local ret=1
# FIXME Duplicates _mvn_full_form_plugins
if compset -P 1 '*:'; then
local groupId="${${IPREFIX%:}##*:}"
if compset -P 1 '*:'; then
local artifactId="${${IPREFIX%:}##*:}"
if compset -P 1 '*:'; then
local version="${${IPREFIX%:}##*:}"
_wanted goals expl "${artifactId}:${version} goal" _mvn_plugin_goals "${groupId}:${artifactId}:${version}" && ret=0
else
_alternative \
"versions:${artifactId} version:_mvn_artifact_versions -qS: ${groupId}:${artifactId}" \
"goals:${artifactId} goal:_mvn_plugin_goals ${groupId}:${artifactId}" \
&& ret=0
fi
else
_wanted artifactIds expl "${groupId} artifactId" _mvn_groupId_artifactIds -qS: $groupId && ret=0
fi
else
_wanted groupIds expl "groupId" _mvn_groupIds -qS: && ret=0
fi
return ret
}
(( $+functions[_mvn_full_form_plugins] )) ||
_mvn_full_form_plugins() {
local ret=1 chunk="${PREFIX%%:*}"
if compset -P 1 '*:'; then
local groupId="$chunk"
chunk="${PREFIX%%:*}"
if compset -P 1 '*:'; then
_wanted versions expl "${current} version" _mvn_artifact_versions $@ "${groupId}:${chunk}" && ret=0
else
_wanted artifactIds expl "${groupId} artifactId" _mvn_groupId_artifactIds -qS: "${groupId}" && ret=0
fi
else
_wanted groupIds expl "groupId" _mvn_groupIds -qS: && ret=0
fi
return ret
}
(( $+functions[_mvn_groupIds] )) ||
_mvn_groupIds() {
local repository_location=$(__mvn_get_repository_location) update_policy ret=1
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_groupIds_caching_policy
if [[ -d $repository_location ]]; then
unset _groupIds
if ( [[ ${+_groupIds} -eq 0 ]] || _cache_invalid "mvn/repositories/${repository_location}/groupIds" ) && ! _retrieve_cache "mvn/repositories/${repository_location}/groupIds"; then
_groupIds=($repository_location/**/)
_groupIds=(${${${(u)_groupIds:h:h}#"$repository_location/"}//\//.})
[[ $#_groupIds -gt 0 ]] && _store_cache "mvn/repositories/${repository_location}/groupIds" _groupIds
fi
[[ $#_groupIds -gt 0 ]] && _multi_parts $@ . _groupIds && ret=0
fi
return ret
}
(( $+functions[_mvn_groupId_artifactIds] )) ||
_mvn_groupId_artifactIds() {
local groupId_repository_location="${$(__mvn_get_repository_location)}/${${@[-1]}//\.//}" ret=1
if [[ -d $groupId_repository_location ]]; then
local artifactIds; artifactIds=($groupId_repository_location/*/*/*.pom(:h:h:t))
_describe -t artifactIds "artifactId" artifactIds $@[0,-2] && ret=0
fi
return ret
}
(( $+functions[_mvn_artifact_versions] )) ||
_mvn_artifact_versions() {
local artifact_repository_location="${$(__mvn_get_repository_location)}/${${@[-1]}//[\.:]//}" ret=1
if [[ -d $artifact_repository_location ]]; then
local versions; versions=($artifact_repository_location/*/*.pom(:h:t))
_describe -t versions "version" versions $@[0,-2]
fi
return ret
}
(( $+functions[_mvn_plugin_goals] )) ||
_mvn_plugin_goals() {
local ret=1 plugin="$@[-1]" update_policy
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_goals_caching_policy
unset _goals
if ( [[ ${+_goals} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin}" ) && ! _retrieve_cache "mvn/plugins/${plugin}"; then
setopt localoptions extendedglob
_goals=(${(s:,,,:)${${${(f)${${${(f)${${${${(F)${(S)${(f)"$(_call_program goals $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=$plugin)"}//#$(__mvn_get_plugin_prefix $plugin):/,,,}}:#*BUILD FAILURE*}#*This plugin has*goals#:}%For more information, run \'mvn help:describe*}}//:/\\:}}}// ##/ }// Description\\: /:}})
[[ $#_goals -gt 0 ]] && _store_cache "mvn/plugins/${plugin}" _goals
fi
[[ $#_goals -gt 0 ]] && _describe -t "goals" "${plugin} goal" _goals $@[0,-2] && ret=0
return ret
}
(( $+functions[_mvn_profiles] )) ||
_mvn_profiles() {
# FIXME Use "mvn help:all-profiles" output instead of parsing settings and pom files...
# Blocked on http://jira.codehaus.org/browse/MPH-82 and http://jira.codehaus.org/browse/MPH-83
local profs update_policy settings_file=$(__mvn_get_settings_file) parent_pom_file=$(__mvn_get_parent_pom_file) cache_name profiles_section ret=1
# TODO Should be split into _mvn_profiles/mvn_profiles_lists
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_profiles_caching_policy
profs=()
# Resolve profiles from settings.xml
if [[ -f $settings_file ]]; then
unset _profiles
cache_name="mvn/profiles${settings_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10
if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then
_profiles=()
profiles_section="${(M)${(f)$(<$settings_file)}:#*<profiles>*}"
if [[ -n "$profiles_section" ]]; then
for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*<profile>}%</profile>*}//<repositories>*<\/repositories>}//<pluginRepositories>*<\/pluginRepositories>}//<build>*<\/build>}//<\/id>*<id>/,,,}##*<id>}%%</id>*}}; do
[[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in settings file"']')
done
fi
[[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
fi
profs+=($_profiles)
fi
# Resolve project profiles
if [[ -f $parent_pom_file ]]; then
unset _profiles
cache_name="mvn/profiles${parent_pom_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10
if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then
_profiles=()
setopt localoptions extendedglob
for file in ${parent_pom_file:h}/**/pom.xml~*target\/*; do # FIXME project.build.directory is not always target/
profiles_section="${(M)${(f)$(<$file)}:#*<profiles>*}"
if [[ -n "$profiles_section" ]]; then
for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*<profile>}%</profile>*}//<repositories>*<\/repositories>}//<pluginRepositories>*<\/pluginRepositories>}//<build>*<\/build>}//<\/id>*<id>/,,,}##*<id>}%%</id>*}}; do
[[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in ${file#${parent_pom_file:h}\/}"']')
done
fi
done
[[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
fi
profs+=($_profiles)
fi
compset -P '-'; compset -P '+'; compset -P '!' # FIXME Only works for the first profile
[[ $#profs -gt 0 ]] && _values $@ 'profile' "${profs[@]}" && ret=0
return ret
}
(( $+functions[_mvn_projects] )) ||
_mvn_projects() {
# TODO Projects can also be given in the form [groupId:]artifactId.
# TODO Should be split into _mvn_projects/mvn_projects_lists
local pom_file=$(__mvn_get_parent_pom_file) ret=1
if [[ -f $pom_file ]]; then
setopt localoptions extendedglob
local projects; projects=(${pom_file:h}/*/**/pom.xml~*target\/*) # FIXME project.build.directory is not always target/
projects=(${${projects#.\/}:h})
[[ $#projects -gt 0 ]] && _values "$@" 'project' "${projects[@]}" && ret=0
fi
return ret
}
(( $+functions[_mvn_properties] )) ||
_mvn_properties() {
local ret=1
if compset -P '*='; then
_wanted property-values expl 'property value' _mvn_property_values ${${IPREFIX%=}#-D} && ret=0
else
_wanted property-names expl 'property name' _mvn_property_names -qS= && ret=0
fi
return ret
}
(( $+functions[_mvn_property_names] )) ||
_mvn_property_names() {
# FIXME "-qS=" should be inherited from _mvn_properties
local alternatives; alternatives=(
"common-property-names:common property name:_mvn_common_property_names -qS="
)
for plugin_colon_goal in ${(M)words:#[^-]*:*}; do
alternatives+=("plugin-property-names:plugin property name:_mvn_plugin_goal_property_names -qS= ${plugin_colon_goal}")
done
_alternative "${alternatives[@]}"
}
(( $+functions[_mvn_common_property_names] )) ||
_mvn_common_property_names() {
local properties; properties=(
'skipTests:skip tests execution'
'maven.test.skip:skip tests compilation and execution'
'gpg.passphrase:gpg passphrase'
'tycho.mode:enable maven mode for Tycho projects to disable p2 resolution'
)
_describe -t 'common-property-names' 'common property name' properties $@
}
(( $+functions[_mvn_plugin_goal_property_names] )) ||
_mvn_plugin_goal_property_names() {
local plugin_colon_goal="$@[-1]" update_policy ret=1
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_properties_caching_policy
unset _properties
if ( [[ ${+_properties} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin_colon_goal}" ) && ! _retrieve_cache "mvn/plugins/${plugin_colon_goal}"; then
# FIXME Does not work for:
# android:apk (new line before expression)
# ear:ear (unknown cause)
_properties=(${(M)${(ps:,,,:)${${${${(pj: :)${${${(f)${"$(_call_program properties $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=${plugin_colon_goal%:*} -Dgoal=${plugin_colon_goal##*:} -Ddetail)"#*Available parameters:}%%\[INFO\]*}//# [a-z]*/,,,}##*Expression: \$\{}}//\}[[:space:]]##/:}//[[:space:]]##/ }//[[:space:]]#,,,[[:space:]]#/,,,}}:#[a-zA-Z]##:*})
[[ $#_properties -gt 0 ]] && _store_cache "mvn/plugins/${plugin_colon_goal}" _properties
fi
[[ $#_properties -gt 0 ]] && _describe -t "${plugin_colon_goal//:/-}-property-names" "${plugin_colon_goal} property name" _properties $@[0,-2] && ret=0
return ret
}
(( $+functions[_mvn_property_values] )) ||
_mvn_property_values() {
local ret=1
setopt localoptions extendedglob
case $@[-1] in
((#i)*pomFile*) _wanted pom-files expl 'POM file' _mvn_pom_files && ret=0;;
((#i)*file*) _wanted files expl 'file' _files && ret=0;;
((#i)*groupId*) _wanted groupIds expl 'groupId' _mvn_groupIds && ret=0;;
((#i)*artifactId*) _wanted artifactIds expl 'artifactId' _mvn_groupId_artifactIds ${${(M)${(ps.:.)opt_args[(K)-D]}:#groupId=*}#groupId=} && ret=0;;
((#i)*version*) _wanted versions expl 'version' _mvn_artifact_versions ${${(M)${(ps.:.)opt_args[(K)-D]}:#groupId=*}#groupId=}:${${(M)${(ps.:.)opt_args[(K)-D]}:#artifactId=*}#artifactId=} && ret=0;;
((#i)*repositoryId*) _message -e repositoryIds 'repositoryId' && ret=0;; # TODO Not implemented
((#i)*classifier*) _message -e classifiers 'classifier' && ret=0;;
((#i)*scope*) _wanted scopes expl 'scope' _mvn_scopes && ret=0;;
((#i)*url*) _wanted urls expl 'url' _urls && ret=0;; # TODO Use _alternative and add repository urls from settings + projects
((#i)*(password|passphrase)*) _wanted passwords expl password _mvn_passwords && ret=0;;
((#i)*(createChecksum|generatePom|maven.test.skip)*) _wanted booleans expl 'boolean' _mvn_booleans && ret=0;;
((#i)*user*) _wanted users expl 'user' _users && ret=0;; # TODO Use _alternative and add repository usernames from settings + projects
((#i)*plugin*) _wanted plugin expl 'plugin' _mvn_plugins && ret=0;;
((#i)*tycho.mode*) _wanted tychomodes expl 'tychomode' _mvn_tycho_modes && ret=0;;
(*) _default && ret=0;;
esac
return ret
}
(( $+functions[_mvn_scopes] )) ||
_mvn_scopes() {
local scopes; scopes=(
'compile:default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.'
'provided:much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.'
'runtime:indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath.'
'test:indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.'
'system:similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.'
'import:only used on a dependency of type pom in the <dependencyManagement> section. It indicates that the specified POM should be replaced with the dependencies in that POM'\''s <dependencyManagement> section. Since they are replaced, dependencies with a scope of import do not actually participate in limiting the transitivity of a dependency.'
)
_describe -t scopes 'scope' scopes
}
(( $+functions[_mvn_thread_counts] )) ||
_mvn_thread_counts() {
local thread_counts; thread_counts=(
'1:build with 1 thread' '1C:build with 1 thread per CPU core'
'2:build with 2 threads' '2C:build with 2 threads per CPU core'
'3:build with 3 threads' '3C:build with 3 threads per CPU core'
'4:build with 4 threads' '4C:build with 4 threads per CPU core'
'5:build with 5 threads' '5C:build with 5 threads per CPU core'
'6:build with 6 threads' '6C:build with 6 threads per CPU core'
'7:build with 7 threads' '7C:build with 7 threads per CPU core'
'8:build with 8 threads' '8C:build with 8 threads per CPU core'
)
_describe -t thread-counts 'thread count' thread_counts
}
(( $+functions[_mvn_reactors] )) ||
_mvn_reactors() {
_message -e reactors 'reactor' # FIXME No idea what kind of value the "--reactor" option is supposed to take
}
(( $+functions[_mvn_passwords] )) ||
_mvn_passwords() {
_message -e passwords 'password'
}
(( $+functions[_mvn_pom_files] )) ||
_mvn_pom_files() {
_files -g '*pom*\.xml*'
}
(( $+functions[_mvn_toolchains_files] )) ||
_mvn_toolchains_files() {
_files -g '*toolchains*\.xml*'
}
(( $+functions[_mvn_settings_files] )) ||
_mvn_settings_files() {
_files -g '*settings*\.xml*'
}
(( $+functions[_mvn_log_files] )) ||
_mvn_log_files() {
_files
}
(( $+functions[_mvn_booleans] )) ||
_mvn_booleans() {
local booleans; booleans=(
'true:"true" boolean value'
'false:"false" boolean value'
)
_describe -t booleans 'boolean' booleans
}
(( $+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
# ------------------------------------------------------------------------------
__mvn_get_pom_file() {
print ${~opt_args[-f]:-${opt_args[--file]:-pom.xml}}
}
__mvn_get_parent_pom_file() {
local pom_file=$(__mvn_get_pom_file)
while [[ -f ${pom_file:a:h:h}/pom.xml ]]; do
pom_file=${pom_file:a:h:h}/pom.xml;
done
print $pom_file
}
__mvn_get_settings_file() {
print ${~opt_args[-s]:-${opt_args[--settings]:-$HOME/.m2/settings.xml}}
}
__mvn_get_repository_location() {
print ${${${${(M)"$(<$(__mvn_get_settings_file))":#*<localRepository>*}:-$HOME/.m2/repository}##*<localRepository>}%%<\/localRepository>*}
}
__mvn_get_plugin_prefix() {
print ${${${${@#*.*:}%%:*}%-plugin}/-#maven-#}
}
__mvn_get_cache_dir() {
local cache_dir
zstyle -s ":completion:${curcontext}:" cache-path cache_dir
print ${cache_dir:-${ZDOTDIR:-$HOME}/.zcompcache}
}
# ------------------------------------------------------------------------------
# Caching policies
# ------------------------------------------------------------------------------
(( $+functions[_mvn_goals_caching_policy] )) ||
_mvn_goals_caching_policy() {
# Rebuild if cache is older than one month.
local -a oldp
oldp=( "$1"(NmM+1) )
(( $#oldp ))
}
(( $+functions[_mvn_properties_caching_policy] )) ||
_mvn_properties_caching_policy() {
_mvn_goals_caching_policy
}
(( $+functions[_mvn_groupIds_caching_policy] )) ||
_mvn_groupIds_caching_policy() {
_mvn_goals_caching_policy
}
(( $+functions[_mvn_profiles_caching_policy] )) ||
_mvn_profiles_caching_policy() {
# Rebuild if cached file more recent than cache.
local cached_file="${1#$(__mvn_get_cache_dir)}"
[[ -f $cached_file && $cached_file -nt "$1" ]] && return 0
# Rebuild if cache is older than one week.
local -a oldp
oldp=( "$1"(Nmw+1) )
(( $#oldp )) && return 0
return 1
}
_mvn "$@"
# 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,66 +0,0 @@
#compdef node
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Node.js v0.8.4 (http://nodejs.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mario Fernandez (https://github.com/sirech)
# * Nicholas Penree (https://github.com/drudge)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments -C \
'(- 1 *)--help[print options help]' \
'(- 1 *)'{-v,--version}'[print node version]' \
'(--no-deprecation)--no-deprecation[silence deprecation warnings]' \
'(--trace-deprecation)--trace-deprecation[show stack traces on deprecations]' \
'(- 1 *)--v8-options[print v8 command line options]' \
'(--max-stack-size)--max-stack-size=[set max v8 stack size (bytes)]' \
'(-e --eval)'{-e,--eval}'[evaluate script]:Inline Script' \
'(-i --interactive)'{-i,--interactive}'[always enter the REPL even if stdin does not appear to be a terminal]' \
'(-p --print)'{-p,--print}'[print result of --eval]' \
'(--vars)--vars[print various compiled-in variables]' \
'*:JS Script:_files -g "*.js"' && ret=0
return ret
# 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,110 +0,0 @@
#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
# -----------
#
# Completion script for nvm (https://github.com/creationix/nvm).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Changwoo Park (https://github.com/pismute)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
local -a _1st_arguments
_1st_arguments=(
'help:Show this message'
'install:Download and install a <version>'
'uninstall:Uninstall a <version>'
'use:Modify PATH to use <version>'
'run:Run <version> with <args> as arguments'
'ls:List installed [versions]'
'ls-remote:List remote versions available for install'
'deactivate:Undo effects of NVM on current shell'
'alias:Set an alias named <name> pointing to <version>. Show all aliases beginning with [<pattern>].'
'unalias:Deletes the alias named <name>'
'copy-packages:Install global NPM packages contained in <version> to current version'
'clear-cache:Clear cache'
'version:Show current node version'
)
_arguments -C \
'1: :->cmds' \
'*: :->args' && ret=0
__nvm_aliases(){
local aliases
aliases=""
if [ -d $NVM_DIR/alias ]; then
aliases="`cd $NVM_DIR/alias && ls`"
fi
echo "${aliases}"
}
__nvm_versions(){
echo "$(nvm_ls) $(__nvm_aliases)"
}
case $state in
cmds)
_describe -t commands 'nvm command' _1st_arguments && ret=0
;;
args)
case $words[2] in
(use|run|ls|list|install|uninstall|copy-packages)
_values 'version' $(__nvm_versions) && ret=0
;;
(alias|unalias)
_values 'aliases' $(__nvm_aliases) && ret=0
;;
*)
(( ret )) && _message 'no more arguments'
;;
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

File diff suppressed because it is too large Load Diff

View File

@ -1,75 +0,0 @@
#compdef optirun
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for the optirun command from bumblebee
# (https://github.com/Bumblebee-Project/Bumblebee).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Christophe-Marie Duquesne <chm.duquesne@gmail.com>
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line
typeset -A opt_args
local -a arguments
arguments=(
'--version[output version information]'
'(-h --help)'{-h,--help}'[show help]'
'(-c --vgl-compress)'{-c,--vgl-compress}'[image transport method]:method:(proxy jpeg rgb xb yuv)'
'--failsafe[run a program even if the nvidia card is unavailable]:boolean:(true false)'
'--no-failsafe[do not run a program if the nvidia card is unavailable]'
'--vgl-options[options to be passed to vglrun (example: +tr)]'
'(-q --quiet --silent)'{-q,--quiet,--silent}'[suppress all logging messages]'
'(-v --verbose)'{-v,--verbose}'[increase the verbosity level of log messages]'
'--debug[set the verbosity level to the maximum]'
'(-b --bridge)'{-b,--bridge}'[specify bridge library to use: VirtualGL, Primus or auto]:method:(auto primus virtualgl none)'
'(-d --display)'{-d,--display}'[the X display number to use]'
'(-C --config)'{-C,--config}'[retrieve settings for Bumblebee from FILE]:file:_files'
'(-l --ldpath)'{-l,--ldpath}'[PATH the libraries like libGL.so are searched in]:file:_files'
'--primus-ldpath[a colon-separated list of paths which are searched for the primus libGL.so.1]:file:_files'
'(-s --socket)'{-s,--socket}'[use FILE for communication with the daemon]:file:_files'
'--no-xorg[do not start secondary X server (implies -b none)]'
'*::arguments: _normal'
)
_arguments $arguments
# 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,58 +0,0 @@
#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

@ -1,95 +0,0 @@
#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,279 +0,0 @@
#compdef perf
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Linux performance counters 3.3 (perf.wiki.kernel.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_perf() {
local context curcontext="$curcontext" state line
typeset -A opt_args
local ret=1
_arguments -C \
'(- : *)--version[show version number and exit]' \
'(- : *)--help[show help]: :_perf_cmds' \
'1: :_perf_cmds' \
'*::arg:->args' \
&& ret=0
case $state in
(args)
curcontext="${curcontext%:*:*}:perf-cmd-$words[1]:"
case $line[1] in
(annotate)
# TODO Complete CPU list
# TODO Complete disassembler style
_arguments \
'(- : *)'{-a,--all}'[prints all the available commands on the standard output]' \
'(-i --input)'{-i,--input=}'[input file name]: :_files' \
'(-d --dsos)'{-d,--dsos=}'[only consider symbols in these dsos]:dso list' \
'(-s --symbol)'{-s,--symbol=}'[symbol to annotate]:symbol' \
'(-f --force)'{-f,--force}'[do not complain, do it]' \
'(-v --verbose)'{-v,--verbose}'[be more verbose]' \
'(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \
'(-k --vmlinux)'{-k,--vmlinux=}'[vmlinux pathname]: :_files' \
'(-m --modules)'{-m,--modules}'[load module symbols]' \
'(-l --print-line)'{-l,--print-line}'[print matching source lines]' \
'(-P --full-paths)'{-P,--full-paths}'[don'\''t shorten the displayed pathnames]' \
'--stdio[use the stdio interface]' \
'--tui[use the TUI interface]' \
'(-C --cpu)'{-C,--cpu}'[only report samples for the list of CPUs provided]:CPU list' \
'--asm-raw[show raw instruction encoding of assembly instructions]' \
'(--no-source)--source[interleave source code with assembly code]' \
'(--source)--no-source[don'\''t interleave source code with assembly code]' \
'--symfs=[look for files with symbols relative to this directory]: :_files -/' \
'(-M --disassembler-style)'{-M,--disassembler-style=}'[set disassembler style for objdump]:disassembler style' \
'1::symbol name' \
&& ret=0
;;
(archive)
_arguments \
'1: :_files' \
&& ret=0
;;
(bench)
# TODO Complete subsystems
# TODO Complete suites
_arguments \
'(-f --format)'{-f,--format=}'[specify format style]: :((default\:mainly\ for\ human\ reading simple\:friendly\ for\ automated\ processing\ by\ scripts))' \
'1::subsystem' \
'2::suite' \
&& ret=0
;;
(buildid-cache)
_arguments \
'(-a --add)'{-a,--add=}'[add specified file to the cache]: :_files' \
'(-r --remove)'{-r,--remove=}'[remove specified file from the cache]: :_files' \
'(-v --verbose)'{-v,--verbose}'[be more verbose]' \
&& ret=0
;;
(buildid-list)
_arguments \
'(-H --with-hits)'{-H,--with-hits}'[show only DSOs with hits]' \
'(-i --input)'{-i,--input=}'[input file name]: :_files' \
'(-f --force)'{-f,--force}'[don'\''t do ownership validation]' \
'(-k --kernel)'{-k,--kernel}'[show running kernel build id]' \
'(-v --verbose)'{-v,--verbose}'[be more verbose]' \
&& ret=0
;;
(diff)
_arguments \
'(-M --displacement)'{-M,--displacement}'[show position displacement relative to baseline]' \
'(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \
'(-m --modules)'{-m,--modules}'[load module symbols]' \
'(-d --dsos)'{-d,--dsos=}'[only consider symbols in these dsos]:dso list' \
'(-C --comms)'{-C,--comms=}'[only consider symbols in these comms]:comm list' \
'(-S --symbols)'{-S,--symbols=}'[only consider these symbols]:symbol list' \
'(-s --sort)'{-s,--sort=}'[sort by key(s)]: :_values -s , key pid comm dso symbol' \
'(-t --field-separator)'{-t,--field-separator=}'[use a special separator character and don'\''t pad with spaces]:separator' \
'(-v --verbose)'{-v,--verbose}'[be verbose, for instance, show the raw counts in addition to the diff]' \
'(-f --force)'{-f,--force}'[don'\''t complain, do it]' \
'--symfs=[look for files with symbols relative to this directory]: :_files -/' \
'1:old file:_files' \
'2:new file:_files' \
&& ret=0
;;
(evlist)
_arguments \
'(-i --input)'{-i,--input=}'[input file name]: :_files' \
&& ret=0
;;
(inject)
_arguments \
'(-b --build-ids)'{-b,--build-ids=}'[inject build-ids into the output stream]:build-id list' \
'(-v --verbose)'{-v,--verbose}'[be more verbose]' \
&& ret=0
;;
(kmem)
# TODO Complete 'record' command
_arguments \
'(-i --input)'{-i,--input=}'[input file name]: :_files' \
'--caller[show per-callsite statistics]' \
'--alloc[show per-allocation statistics]' \
'(-s --sort)'{-s,--sort=}'[sort by output]: :_values -s , key frag hit bytes' \
'(-n --lines)'{-n,--lines}'[print n lines only]:number' \
'1:command:((record\:record\ the\ kmem\ events\ of\ an\ arbitrary\ workload stat\:report\ kernel\ memory\ statistics))' \
&& ret=0
;;
(kvm)
_arguments \
'(-i --input)'{-i,--input=}'[input file name]: :_files' \
'(-o --output)'{-o,--output=}'[output file name]: :_files' \
'--host=[collect host side performance profile]:host' \
'--guest=[collect guest side performance profile]:guest' \
'--guestmount=[guest os root file system mount directory]: :_files -/' \
'--guestkallsyms=[guest os /proc/kallsyms file copy]: :_files' \
'--guestmodules=[guest os /proc/modules file copy]: :_files' \
'--guestvmlinux=[guest os kernel vmlinux]: :_files' \
'1:command:((top record report diff buildid-list))' \
&& ret=0
;;
(list)
_arguments \
'1:event type:((hw\:hardware\ events hardware\:hardware\ events sw\:software\ events software\:software\ events cache\:cache\ events hwcache\:cache\ events tracepoint\:tracepoint\ events))' \
&& ret=0
;;
(lock)
# TODO Complete 'record' command
# TODO Complete 'report' command options
_arguments \
'(-i --input)'{-i,--input=}'[input file name]: :_files' \
'(-v --verbose)'{-v,--verbose}'[be more verbose]' \
'(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \
'1:command:((record\:record\ lock\ events trace\:show\ raw\ lock\ events report\:report\ statistical\ data))' \
&& ret=0
;;
(probe)
# TODO not implemented
;;
(record)
# TODO not implemented
;;
(report)
# TODO not implemented
;;
(sched)
# TODO Complete 'record' command
_arguments \
'(-i --input)'{-i,--input=}'[input file name]: :_files' \
'(-v --verbose)'{-v,--verbose}'[be more verbose]' \
'(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \
'1:command:((record\:record\ scheduling\ events script\:see\ a\ detailed\ trace replay\:simulate\ the\ workload map\:print\ a\ textual\ context-switching\ outline))' \
&& ret=0
;;
(script)
# TODO not implemented
;;
(stat)
# TODO not implemented
;;
(test)
_arguments \
'(-v --verbose)'{-v,--verbose}'[be more verbose]' \
&& ret=0
;;
(timechart)
# TODO Complete 'record' command
_arguments \
'(-i --input)'{-i,--input=}'[input file name]: :_files' \
'(-o --output)'{-o,--output=}'[output file name]: :_files' \
'(-w --width)'{-w,--width=}'[select the width of the SVG file]:width' \
'(-P --power-only)'{-P,--power-only}'[only output the CPU power section of the diagram]' \
'(-p --process)'{-p,--process}'[select the processes to display, by name or PID]:process' \
'--symfs=[look for files with symbols relative to this directory]: :_files -/' \
'1:command:((record))' \
&& ret=0
;;
(top)
# TODO not implemented
;;
(help)
_arguments \
'(- : *)'{-a,--all}'[prints all the available commands on the standard output]' \
'1: :_perf_cmds' \
&& ret=0
;;
*)
_call_function ret _perf_cmd_$words[1] && ret=0
(( ret )) && _message 'no more arguments'
;;
esac
;;
esac
}
# FIXME Parse 'perf --help' instead of hard-coding.
(( $+functions[_perf_cmds] )) ||
_perf_cmds() {
local commands; commands=(
'annotate:read perf.data (created by perf record) and display annotated code'
'archive:create archive with object files with build-ids found in perf.data file'
'bench:general framework for benchmark suites'
'buildid-cache:manage build-id cache'
'buildid-list:list the buildids in a perf.data file'
'diff:read two perf.data files and display the differential profile'
'evlist:list the event names in a perf.data file'
'inject:filter to augment the events stream with additional information'
'kmem:tool to trace/measure kernel memory(slab) properties'
'kvm:tool to trace/measure kvm guest os'
'list:list all symbolic event types'
'lock:analyze lock events'
'probe:define new dynamic tracepoints'
'record:run a command and record its profile into perf.data'
'report:read perf.data (created by perf record) and display the profile'
'sched:tool to trace/measure scheduler properties (latencies)'
'script:read perf.data (created by perf record) and display trace output'
'stat:run a command and gather performance counter statistics'
'test:runs sanity tests'
'timechart:tool to visualize total system behavior during a workload'
'top:system profiling tool'
'help:show command usage information'
)
_describe -t commands 'command' commands "$@"
}
_perf "$@"
# 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 periscope
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Periscope (http://code.google.com/p/periscope).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments \
'(- : *)'{-h,--help}'[show help message and exit]' \
'(- : *)--version[show version number and exit]' \
'*'{-l,--language}'[wanted language]: :_language_codes ISO-639-1' \
'(-f --force)'{-f,--force}'[replace existing subtitle file]' \
'(-q --query)'{-q,--query}'[query to send to the subtitles website]:queries' \
'--list-plugins[list all plugins supported by periscope]' \
'--list-active-plugins[list all plugins used to search subtitles]' \
'--cache-folder[cache/config directory to use]: :_files -/' \
'--quiet[run in quiet mode (only show warn and error messages)]' \
'--debug[set the logging level to debug]' \
'*: :_files'
# 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,479 +0,0 @@
#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
# -----------
#
# Completion script for PostgreSQL utils (http://postgresql.org).
#
# Source: http://www.zsh.org/mla/users/2004/msg01006.html
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Dominic Mitchell <dom+zsh@happygiraffe.net>
#
# * Johann 'Myrkraverk' Oskarsson <johann@2ndquadrant.com>
#
# * Daniel Serodio <dserodio@gmail.com> pg_dumpall completion
#
# * J Smith <dark.panda@gmail.com> pg_restore completion
#
# ------------------------------------------------------------------------------
_pgsql_get_identity () {
_pgsql_user=${(v)opt_args[(i)-U|--username]}
_pgsql_port=${(v)opt_args[(i)-p|--port]}
_pgsql_host=${(v)opt_args[(i)-h|--host]}
_pgsql_params=(
${_pgsql_user:+"--username=$_pgsql_user"}
${_pgsql_port:+"--port=$_pgsql_port"}
${_pgsql_host:+"--host=$_pgsql_host"}
)
}
# Postgres Allows specifying the path to the directory containing the
# socket as well as a hostname.
_pgsql_host_or_dir() {
_alternative \
'hosts:host:_hosts' \
'directories:directory:_directories'
}
# This creates a port completion list based on socket files on the
# local computer. Be default, Postgres puts them in /tmp/ but Debian
# changed that to /var/run/postgresql/ in their packages.
_pgsql_ports() {
compadd "$@" - /tmp/.s.PGSQL.<->(N:e) /var/run/postgresql/.s.PGSQL.<->(N:e)
}
_pgsql_users () {
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
local _pgsql_user_sql
_pgsql_get_identity
# We use _pgsql_port and _pgsql_host directly here instead of
# _pgsql_params so as to not pick up a partially completed
# username.
_pgsql_params=(
${_pgsql_port:+"--port=$_pgsql_port"}
${_pgsql_host:+"--host=$_pgsql_host"}
)
_pgsql_user_sql='select r.rolname from pg_catalog.pg_roles r where r.rolcanlogin = true'
compadd "$@" - $( psql $_pgsql_params[@] -Aqt -c $_pgsql_user_sql template1 2>/dev/null )
}
_pgsql_tables () {
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
_pgsql_get_identity
# Need to pull out the database name from the existing arguments.
# This is going to vary between commands. Thankfully, it's only
# used by pg_dump, which always has the dbname in arg1. If it's
# not present it defaults to ${PGDATABASE:-$LOGNAME}, which
# matches (I think) the PostgreSQL behaviour.
local db
db=${line[1]:-${PGDATABASE:-$LOGNAME}}
## Instead of parsing the output of the psql \ commands, we look
## up the tables ourselves. The following query has been tested
## with Postgres 8.2 - 9.2.
local _pgsql_table_sql
_pgsql_table_sql="select n.nspname || '.' || c.relname \
from pg_catalog.pg_class c \
left join pg_catalog.pg_namespace n on n.oid = c.relnamespace \
where c.relkind in ('r', '') \
and n.nspname <> 'pg_catalog' \
and n.nspname <> 'information_schema' \
and n.nspname !~ '^pg_toast' \
and pg_catalog.pg_table_is_visible( c.oid ) \
order by 1"
compadd "$@" - \
$( psql $_pgsql_params[@] -Aqt -c $_pgsql_table_sql $db 2>/dev/null )
}
_pgsql_schemas () {
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
_pgsql_get_identity
local db
db=${line[1]:-${PGDATABASE:-$LOGNAME}}
local _pgsql_schema_sql="select n.nspname \
from pg_catalog.pg_namespace n \
where n.nspname !~ '^pg_' \
and n.nspname <> 'information_schema' \
order by 1;"
compadd "$@" - \
$( psql $_pgsql_params[@] -Aqt -c $_pgsql_schema_sql $db 2>/dev/null )
}
_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 "$@" - \
${(f)_pgsql_services} \
$( psql $_pgsql_params[@] -Atq -c $_pgsql_db_sql template1 2>/dev/null )
}
_pgsql_encodings () {
local _pgsql_user
_pgsql_get_identity
local _pgsql_db_sql
_pgsql_db_sql="select pg_encoding_to_char(i) from generate_series(0,100) i;"
compadd "$@" - $( psql $_pgsql_params[@] -Atq -c $_pgsql_db_sql template1 )
}
##
## The actual completion code for the commands
##
_psql () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s "-*" \
"$_pgsql_common_opts[@]" \
{-V,--version}'[display client version]' \
{-a,--echo-all}'[print commands read]' \
{-A,--no-align}'[unaligned output mode]' \
{-c+,--command=}':execute SQL command:' \
{-d+,--dbname=}':database to connect to:_pgsql_databases' \
{-e,--echo-queries}'[display queries submitted]' \
{-E,--echo-hidden}'[display hidden queries]' \
{-f+,--file=}':SQL file to read:_files' \
{-F+,--field-separator=}':field separator char:' \
{-H,--html}'[HTML output]' \
{-l,--list}'[list databases]' \
{-o+,--output=}':query output:_files' \
{-P+,--pset=}':set psql variable:' \
{-q,--quiet}'[non verbose mode]' \
{-R+,--record-separator=}':record separator char:' \
{-s,--single-step}'[prompt before each query]' \
{-S,--single-line}'[newline sends query]' \
{-t,--tuples-only}'[dont display header/footer]' \
{-T+,--table-attr=}':HTML table options:' \
-u'[prompt for username/password]' \
{-v+,--set=,--variable=}':set SQL variable:' \
{-x,--expanded}'[one column per line]' \
{-X,--no-psqlrc}'[dont read ~/.psqlrc]' \
':PostgreSQL database:_pgsql_databases' \
':PostgreSQL user:_pgsql_users'
}
_pg_dump () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-a,--data-only}'[dump only data]' \
{-b,--blobs}'[dump blobs as well]' \
{-c,--clean}'[include clean cmds in dump]' \
{-C,--create}'[include createdb cmds in dump]' \
{-E+,--encoding=}':database encoding:_pgsql_encodings' \
{-d,--inserts}'[use INSERT not COPY]' \
{-D,--{attribute,column}-inserts}'[use INSERT (cols) not COPY]' \
{-f+,--file=}':output file:_files' \
{-F+,--format=}':output format:_values "format" "p[plain text]" "t[tar]" "c[custom]"' \
{-i,--ignore-version}'[ignore version mismatch]' \
{-n+,--schema=}':schema to dump:_pgsql_schemas' \
{-N+,--exclude-schema=}':schema to NOT dump:_pgsql_schemas' \
{-o,--oids}'[dump objects identifiers for every table]' \
{-O,--no-owner}'[dont recreate as same owner]' \
{-R,--no-reconnect}'[dont output connect]' \
{-s,--schema-only}'[no data, only schema]' \
{-S+,--superuser=}':superuser name:_pgsql_users' \
{-t+,--table=}':table to dump:_pgsql_tables' \
{-T+,--exclude-table=}':table to NOT dump:_pgsql_tables' \
{-v,--verbose}'[verbose mode]' \
{-V,--version}'[display client version]' \
{-x,--no-{acl,privileges}}'[dont dump ACLs]' \
-X+':option:_values "option" use-set-session-authorization disable-triggers' \
{-Z+,--compress=}':compression level:_values "level" 9 8 7 6 5 4 3 2 1 0' \
':PostgreSQL database:_pgsql_databases' \
--section=':dump named section:_values "section" pre-data data post-data' \
--disable-dollar-quoting'[disable dollar quoting, use SQL standard quoting]' \
--disable-triggers'[disable triggers during data-only restore]' \
--no-security-labels'[do not dump security label assignments]' \
--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]' \
--use-set-session-authorization'[use SET SESSION AUTHORIZATION commands instead of ALTER OWNER]'
}
_pg_restore () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-d+,--dbname=}':database to connect to:_pgsql_databases' \
{-f+,--file=}':output file:_files' \
{-F+,--format=}':output format:_values "format" "p[plain text]" "t[tar]" "c[custom]"' \
{-l,--list}'[list databases]' \
{-a,--data-only}'[dump only data]' \
{-c,--clean}'[include clean (drop) cmds before recreating]' \
{-C,--create}'[include createdb cmds in dump]' \
{-e,--exit-on-error}'[exit on error, default is to continue]' \
{-I,--index=}':index name:' \
{-j,--jobs=}':use this many parallel jobs to restore:' \
{-L,--use-list=}':use table of contents from this file for selecting/ordering output:' \
{-n,--schema=}':restore only objects in this schema:' \
{-O,--no-owner}'[skip restoration of object ownership]' \
{-P,--function=}':restore named function:' \
{-s,--schema-only}'[restore only the schema, no data]' \
{-S,--superuser=}':superuser user name to use for disabling triggers:' \
{-t,--table=}':restore named table:' \
{-T,--trigger=}':restore named trigger:' \
{-x,--no-privileges}'[skip restoration of access privileges (grant/revoke)]' \
{-1,--single-transaction}'[restore as a single transaction]' \
{-v,--verbose}'[verbose mode]' \
{-V,--version}'[display client version]' \
--disable-triggers'[disable triggers during data-only restore]' \
--if-exists'[use IF EXISTS when dropping objects]' \
--no-data-for-failed-tables'[do not restore data of tables that could not be created]' \
--no-security-labels'[do not restore security labels]' \
--no-tablespaces'[do not restore tablespace assignments]' \
--section=':dump named section:_values "section" pre-data data post-data' \
--use-set-session-authorization'[use SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownership]'
}
_pg_dumpall () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-a,--data-only}'[dump only data]' \
{-c,--clean}'[include clean (drop) cmds before recreating]' \
{-g,--globals-only}'[dump only global objects, no databases]' \
{-f+,--file=}':output file:_files' \
{-o,--oids}'[dump objects identifiers for every table]' \
{-O,--no-owner}'[dont recreate as same owner]' \
{-r,--roles-only}'[no databases or tablespaces, only roles]' \
{-s,--schema-only}'[no data, only schema]' \
{-S+,--superuser=}':superuser name:_pgsql_users' \
{-t,--tablespaces-only}'[no databases or roles, only tablespaces]' \
{-x,--no-privileges}'[dont dump ACLs]' \
--binary-upgrade'[for use by upgrade utilities only]' \
--column-inserts'[use INSERT with column names not COPY]' \
--disable-dollar-quoting'[disable dollar quoting, use SQL standard quoting]' \
--disable-triggers'[disable triggers during data-only restore]' \
--inserts'[use INSERT not COPY]' \
--no-security-labels'[do not dump security label assignments]' \
--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]' \
--use-set-session-authorization'[use SET SESSION AUTHORIZATION cmds instead of ALTER OWNER]'
}
_createdb () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-e,--echo}'[display SQL queries]' \
{-q,--quiet}'[non verbose mode]' \
{-D+,--location=}':database location:_directories' \
{-T+,--template=}':database template:_pgsql_databases' \
{-E+,--encoding=}':database encoding:_pgsql_encodings' \
':PostgreSQL database:' \
':comment:'
}
_dropdb () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-e,--echo}'[display SQL queries]' \
{-q,--quiet}'[non verbose mode]' \
{-i,--interactive}'[confirm before drop]' \
':PostgreSQL database:_pgsql_databases'
}
_vacuumdb () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-a,--all}'[vacuum all databases]' \
{-d+,--dbname=}':database to connect to:_pgsql_databases' \
{-t+,--table=}':table to dump:_pgsql_tables' \
{-f,--full}'[do full vacuuming]' \
{-z,--analyze}'[update optimizer hints]' \
{-e,--echo}'[show the commands being sent to the server]' \
{-q,--quiet}'[do not write any messages]' \
{-v,--verbose}'[write a lot of output]' \
'--help[show this help, then exit]' \
'--version[output version information, then exit]' \
'1:PostgreSQL database:_pgsql_databases'
}
_createuser () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-e,--echo}'[display SQL queries]' \
{-c,--connection-limit=}'[connection limit for role (default: no limit)]' \
{-d,--createdb}'[role can create new databases]' \
{-D,--no-createdb}'[role cannot create databases]' \
{-E,--encrypted}'[encrypt stored password]' \
{-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)]' \
{-L,--no-login}'[role cannot login]' \
{-N,--unencrypted}'[do not encrypt stored password]' \
{-P,--pwprompt}'[assign a password to new role]' \
{-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]'
}
_dropuser () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-e,--echo}'[display SQL queries]' \
{-q,--quiet}'[non verbose mode]' \
{-i,--interactive}'[confirm before drop]' \
':PostgreSQL user:_pgsql_users'
}
_initdb () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
{--auth=,-A+}':default authentication method for local 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:' \
--lc-collate=':set the default locale for collate:' \
--lc-ctype=':set the default locale for ctype:' \
--lc-messages=':set the default locale for messages:' \
--lc-monetary=':set the default locale for monetary:' \
--lc-numeric=':set the default locale for numeric:' \
--lc-time=':set the default local for time:' \
--no-locale'[equivalent to --locale=C]' \
--pwfile=':read password for the new superuser from file:_files' \
{-T+,--text-search-config=}'[default text search configuration]' \
{-U+,--username=NAME}':database superuser name:' \
{-W,--pwprompt}'[prompt for a password for the new superuser]' \
{-X+,--xlogdir=}':location for the transaction log directory:_files' \
{-d,--debug}'[generate lots of debugging output]' \
-L+':where to find the input files:_files' \
{-n,--noclean}'[do not clean up after errors]' \
{-s,--show}'[show internal settings]' \
':location for this database cluster:_files'
}
_pgsql_utils () {
local _pgsql_common_opts _pgsql_auth_methods
_pgsql_common_opts=(
{-\?,--help}'[display help]'
{-h+,--host=}':database host:_pgsql_host_or_dir'
{-p+,--port=}':database port number:_pgsql_ports'
{-U+,--username=}':connect as user:_pgsql_users'
{-W,--password}'[prompt for password]'
)
_pgsql_auth_methods=(
trust
reject
md5
password
gss
sspi
krb5
ident
peer
ldap
radius
cert
pam
)
case "$service" in
psql) _psql "$@" ;;
pg_dump) _pg_dump "$@" ;;
pg_restore) _pg_restore "$@" ;;
createdb) _createdb "$@" ;;
dropdb) _dropdb "$@" ;;
vacuumdb) _vacuumdb "$@" ;;
createuser) _createuser "$@" ;;
dropuser) _dropuser "$@" ;;
initdb) _initdb "$@" ;;
esac
}
_pgsql_utils "$@"
# 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,94 +0,0 @@
#compdef phing
# ------------------------------------------------------------------------------
# Copyright (c) Igor M. Timoshenko <igor.timoshenko@i.ua>
#
# 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 Phing (http://phing.info).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Igor Timoshenko <igor.timoshenko@i.ua>
#
# ------------------------------------------------------------------------------
_phing() {
local context curcontext="$curcontext" state line ret=1
integer NORMARG
typeset -A opt_args
# Follow http://phing.info/docs/stable/webhelp/sec.commandlineargs.html for more information
_arguments \
'(-h -help)'{-h,-help}'[display the help screen]' \
'(-v -version)'{-v,-version}'[print version information and exit]' \
'(-l -list)'{-l,-list}'[list all available targets in buildfile (excluding targets that have their hidden attribute set to true)]' \
'(-q -quiet)'{-q,-quiet}'[quiet operation, no output at all]' \
'-verbose[verbose, give some more output]' \
'-debug[output debug information]' \
'-logfile [use given file for log]:file:_files' \
'-D[set the property to the specified value to be used in the buildfile]' \
'-find []:file:_files' \
'-buildfile [specify an alternate buildfile name. Default is build.xml]:file:_files' \
'-logger [specify an alternate logger. Default is phing.listener.DefaultLogger. Other options include phing.listener.NoBannerLogger, phing.listener.AnsiColorLogger, phing.listener.XmlLogger, phing.listener.TargetLogger and phing.listener.HtmlColorLogger]' \
'-propertyfile [load properties from the specified file]:file:_files' \
'(-v --version)'{-v,--version}'[show version]' \
'1: :->targets' \
'*:: :->args' \
&& ret=0
case $state in
targets)
local buildfile; buildfile=build.xml
if [[ ! -f $buildfile ]]
then
ret=0
else
local targets; targets=($(sed -nE "/<target /s/.*name=[\"'](\w+)[\"'].*/\1/p" $buildfile))
_describe -t 'targets' 'target' targets && ret=0
fi
;;
args)
if [[ CURRENT -eq NORMARG && ${+opt_args[--match]} -eq 0 ]]
then
# If the current argument is the first non-option argument
# and --match isn't present then a pattern is expected
_message -e patterns 'pattern' && ret=0
else
_files
fi
;;
esac
return ret
}
_phing "$@"
# 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,100 +0,0 @@
#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,137 +0,0 @@
#compdef pkcon
# ------------------------------------------------------------------------------
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for pkcon (http://www.packagekit.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
#
# ------------------------------------------------------------------------------
local -a options
options=(
'--version[Show the program version and exit]'
'--filter[Set the filter, e.g. installed]'
"--root[Set the install root, e.g. '/' or '/mnt/ltsp']"
'(-n --nowait)'{-n,--nowait}'[Exit without waiting for actions to complete]'
'(-y --noninteractive)'{-g,--noninteractive}'[Install the packages without asking for confirmation]'
'--background[Run the command using idle network bandwidth and also using less power]'
'(-p --plain)'{-p,--plain}'[Print to screen a machine readable output, rather than using animated widgets]'
'(-c --cache-age)'{-c,--cache-age}"[The maximum metadata cache age. Use -1 for 'never'.]"
'(-h --help)'{-h,--help}'[Show help options.]'
'(-v --verbose)'{-v,--verbose}'[Show debugging information for all files]'
)
local -a actions
actions=(
'accept-eula'
'get-roles'
'get-distro-upgrades'
'get-categories'
'get-actions'
'get-groups'
'get-filters'
'get-transactions'
'get-time'
'search'
'install'
'install-local'
'download'
'remove'
'update'
'refresh'
'resolve'
'get-updates'
'get-depends'
'get-requires'
'get-details'
'get-files'
'get-update-detail'
'get-packages'
'repo-list'
'repo-enable'
'repo-disable'
'repo-set-data'
'what-provides'
'upgrade-system'
)
local context state line expl cmd
local -A opt_args
integer i=2
while (( i < $#words )); do
case "$words[$i]" in
-*)
# skip option
(( i++ ))
continue
;;
esac
if [[ -z "$cmd" ]]; then
cmd="$words[$i]"
words[$i]=()
(( CURRENT-- ))
fi
(( i++ ))
done
if [[ -z "$cmd" ]]
then
_arguments -s -w : $options \
":action:($actions)"
return
fi
case "$cmd" in
search)
_arguments : $options \
':type:(name details group file)' \
':data: :'
;;
refresh)
_arguments -s -w : $options \
'--force'
;;
*)
_arguments -s -w : $options
;;
esac
return 1
# 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,215 +0,0 @@
#compdef play
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Play! framework 1.2.2 (http://www.playframework.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
# * Mario Fernandez (https://github.com/sirech)
#
# ------------------------------------------------------------------------------
_play() {
local context curcontext="$curcontext" state line
typeset -A opt_args
local ret=1
_arguments -C \
'1: :_play_cmds' \
'*::arg:->args' \
&& ret=0
case $state in
(args)
curcontext="${curcontext%:*:*}:play-cmd-$words[1]:"
case $line[1] in
(build-module|list-modules|lm|check|id)
_message 'no more arguments' && ret=0
;;
(dependencies|deps)
_arguments \
'1:: :_play_apps' \
'(--debug)--debug[Debug mode (even more informations logged than in verbose mode)]' \
'(--jpda)--jpda[Listen for JPDA connection. The process will suspended until a client is plugged to the JPDA port.]' \
'(--sync)--sync[Keep lib/ and modules/ directory synced. Delete unknown dependencies.]' \
'(--verbose)--verbose[Verbose Mode]' \
&& ret=0
;;
(clean|javadoc|jd|out|pid|secret|stop)
_arguments '1:: :_play_apps' && ret=0
;;
(help)
_arguments '1: :_play_cmds -F "(cp deps ec idea jd st lm nb nm help antify evolutions evolutions:apply evolutions:markApplied evolutions:resolve)"' && ret=0
;;
(status|st)
_arguments \
'1:: :_play_apps' \
'(--url)--url[If you want to monitor an application running on a remote server, specify the application URL using this option]:URL:_urls' \
'(--secret)--secret[You can provide your own secret key using this option]:Secret key' \
&& ret=0
;;
(new)
_arguments \
'1: :_play_apps' \
'(--with)--with[Automatically enable this set of module for the newly created application]:Modules list:_play_modules_list' \
&& ret=0
;;
(install)
_arguments '1:Play! module:_play_modules_dash_versions' && ret=0
;;
(new-module)
_arguments '1:Module directory:_files -/' && ret=0
;;
(test|precompile|run|start|war|auto-test|classpath|cp|eclipsify|ec|idealize|idea|modules|netbeansify|nb)
local cmd_args; cmd_args=(
'1:: :_play_apps'
'(--deps)--deps[Resolve and install dependencies before running the command]'
)
case $line[1] in
(precompile|run|start|restart|war)
local app_dir="$line[2]"
[[ -d "$app_dir" ]] || app_dir=.
[[ -f "$app_dir/conf/application.conf" ]] && cmd_args+=('--'${(u)${(M)$(<$app_dir/conf/application.conf):#%*}%%.*}'[Use this ID to run the application (override the default framework ID)]')
;|
(test|run)
cmd_args+=('(-f)-f[Disable the JPDA port checking and force the jpda.port value]')
;|
(war)
cmd_args+=(
'(-o --output)'{-o,--output}'[The path where the WAR directory will be created. The contents of this directory will first be deleted]:output directory:_files -/'
'(--zip)--zip[By default, the script creates an exploded WAR. If you want a zipped archive, specify the --zip option]'
'(--exclude)--exclude[Excludes a list of colon separated directories]:excluded directories list:_play_colon_dirs_list'
)
;|
(test|run|start|restart|war)
cmd_args+=('*:Java option')
;;
esac
_arguments "$cmd_args[@]" && ret=0
;;
*)
_call_function ret _play_cmd_$words[1] && ret=0
(( ret )) && _message 'no more arguments'
;;
esac
;;
esac
}
# FIXME Completes only core commands, some modules add commands too (eg Maven). Where do we get them ?
# FIXME Parse 'play help' and 'play help <command>' (for aliases) instead of hard-coding.
(( $+functions[_play_cmds] )) ||
_play_cmds() {
local commands; commands=(
'antify:Create a build.xml file for this project'
'auto-test:Automatically run all application tests'
'build-module:Build and package a module'
'check:Check for a release newer than the current one'
{classpath,cp}':Display the computed classpath'
'clean:Delete temporary files (including the bytecode cache)'
{dependencies,deps}':Resolve and retrieve project dependencies'
{eclipsify,ec}':Create all Eclipse configuration files'
'evolutions:Run the evolution check'
'evolutions\:apply:Automatically apply pending evolutions'
'evolutions\:mark:AppliedMark pending evolutions as manually applied'
'evolutions\:resolve:Resolve partially applied evolution'
'help:Display help on a specific command'
'id:Define the framework ID'
{idealize,idea}':Create all IntelliJ Idea configuration files'
'install:Install a module'
{javadoc,jd}':Generate your application Javadoc'
{list-modules,lm}':List modules available from the central modules repository'
'modules:Display the computed modules list'
{netbeansify,nb}':Create all NetBeans configuration files'
'new:Create a new application'
{new-module,nm}':Create a module'
'out:Follow logs/system.out file'
'pid:Show the PID of the running application'
'precompile:Precompile all Java sources and templates to speed up application start-up'
'restart:Restart the running application'
'run:Run the application in the current shell'
'secret:Generate a new secret key'
'start:Start the application in the background'
{status,st}':Display the running application status'
'stop:Stop the running application'
'test:Run the application in test mode in the current shell'
'war:Export the application as a standalone WAR archive'
)
_describe -t commands 'Play! command' commands "$@"
}
(( $+functions[_play_apps] )) ||
_play_apps() {
_wanted application expl 'Play! application directory' _files -/
}
(( $+functions[_play_modules] )) ||
_play_modules() {
local modules; modules=(${(ps:,:)${${${(S)${(f)$(_call_program modules $service list-modules)}//\]*\[/,}%%\]*}##*\[}})
_describe -t modules 'Play! module' modules "$@"
}
(( $+functions[_play_modules_dash_versions] )) ||
_play_modules_dash_versions() {
local ret=1
if compset -P '*-'; then
local versions; versions=(${(ps:,:)${${${${${(f)$(_call_program versions $service list-modules)}##*${IPREFIX%-}\]}#*Versions:}%%"~"*}//[[:space:]]/}})
_describe -t module-versions "${IPREFIX%-} module versions" versions && ret=0
else
_wanted modules expl 'Play! module' _play_modules -qS- && ret=0
fi
}
(( $+functions[_play_modules_list] )) ||
_play_modules_list() {
compset -P '*,'; compset -S ',*'
_wanted module-list expl 'Play! modules list' _play_modules -qS,
}
(( $+functions[_play_colon_dirs_list] )) ||
_play_colon_dirs_list() {
compset -P '*:'; compset -S ':*'
_wanted directories-list expl 'Directories list' _files -/ -qS:
}
_play "$@"
# 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,274 +0,0 @@
#compdef port
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for MacPorts (http://www.macports.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * 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.
#
# ------------------------------------------------------------------------------
_port() {
local -a upgrade_options revupgrade_options select_options \
actions pseudo_common pseudo_advanced port_prefix
port_prefix=$(which port | sed 's|/bin/port||')
actions=(
'activate\:Activate\ the\ given\ ports'
'archive\:Archive\ the\ given\ ports,\ i.e.\ install\ the\ port\ image\ but\ do\ not\ activate'
'archivefetch\:Fetch\ archive\ for\ the\ given\ ports'
'build\:Build\ the\ given\ ports'
'cat\:Writes\ the\ Portfiles\ of\ the\ given\ ports\ to\ stdout'
'checksum\:Compares\ the\ checksums\ for\ the\ downloaded\ files\ of\ the\ given\ ports'
'clean\:Removes\ files\ associated\ with\ the\ given\ ports'
'configure\:Configure\ the\ given\ ports'
'contents\:\Returns\ a\ list\ of\ files\ installed\ by\ given\ ports'
'deactivate\:Deactivates\ the\ given\ ports'
'dependents\:Returns\ a\ list\ of\ installed\ dependents\ for\ each\ of\ the\ given\ ports'
'deps\:Display\ a\ dependency\ listing\ for\ the\ given\ ports'
'destroot\:Destroot\ the\ given\ ports'
'dir\:Returns\ the\ directories\ of\ the\ given\ ports'
'distcheck\:Checks\ if\ the\ given\ ports\ can\ be\ fetched\ from\ all\ of\ its\ master_sites'
'distfiles\:Returns\ a\ list\ of\ distfiles\ for\ the\ given\ port'
'dmg\:Creates\ a\ dmg\ for\ each\ of\ the\ given\ ports'
'dpkg\:Creates\ a\ dpkg\ for\ each\ of\ the\ given\ ports'
'echo\:Returns\ the\ list\ of\ ports\ the\ argument\ expands\ to'
'edit\:Edit\ given\ ports'
'extract\:Extract\ the\ downloaded\ files\ of\ the\ given\ ports'
'fetch\:Downloaded\ distfiles\ for\ the\ given\ ports'
'file\:Returns\ the\ path\ to\ the\ Portfile\ for\ each\ of\ the\ given\ ports'
'gohome\:Opens\ the\ homepages\ of\ the\ given\ ports\ in\ your\ browser'
'help\:Displays\ short\ help\ texts\ for\ the\ given\ actions'
'info\:Returns\ information\ about\ the\ given\ ports '
'install\:Installs\ the\ given\ ports'
'installed\:List\ installed\ versions\ of\ the\ given\ port,\ or\ all\ installed\ ports\ if\ no\ port\ is\ given'
'lint\:Checks\ if\ the\ Portfile\ is\ lint-free\ for\ each\ of\ the\ given\ ports'
'list\:List\ the\ available\ version\ for\ each\ of\ the\ given\ ports'
'livecheck\:Checks\ if\ a\ new\ version\ of\ the\ software\ is\ available'
'load\:Interface\ to\ launchctl(1)\ for\ ports\ providing\ startup\ items'
'location\:Returns\ the\ install\ location\ for\ each\ of\ the\ given\ ports'
'log\:Shows\ main\ log\ for\ given\ ports'
'logfile\:Returns\ the\ log\ file\ path\ for\ each\ of\ the\ given\ ports'
'mdmg\:Creates\ a\ dmg\ containing\ an\ mpkg\ for\ each\ of\ the\ given\ ports\ and\ their\ dependencies'
'mirror\:Fetches\ distfiles\ for\ the\ given\ ports'
'mpkg\:Creates\ an\ mpkg\ for\ each\ of\ the\ given\ ports\ and\ their\ dependencies'
'notes\:Displays\ informational\ notes\ for\ each\ of\ the\ given\ ports'
'outdated\:Returns\ a\ list\ of\ outdated\ ports'
'patch\:Applies\ patches\ to\ each\ of\ the\ given\ ports'
'pkg\:Creates\ a\ pkg\ for\ each\ of\ the\ given\ ports'
'platform\:Returns\ the\ current\ platform\ that\ port\ is\ running\ on'
'provides\:Return\ which\ port\ provides\ each\ of\ the\ files\ given'
'rdependents\:Recursive\ version\ of\ dependents'
'rdeps\:Display\ a\ recursive\ dependency\ listing\ for\ the\ given\ ports'
'rev-upgrade\:Scan\ for\ broken\ binaries\ in\ the\ installed\ ports\ and\ rebuild\ them\ as\ needed'
'rpm\:Creates\ a\ rpm\ for\ each\ of\ the\ given\ ports'
'search\:Search\ for\ a\ port'
'select\:Select\ between\ multiple\ versions\ of\ a\ versioned\ port'
'selfupdate\:Upgrade\ MacPorts\ itself\ and\ run\ the\ sync\ target'
'setrequested\:Marks\ each\ of\ the\ given\ ports\ as\ requested'
'space\:Show\ the\ disk\ space\ used\ by\ the\ given\ ports'
'srpm\:Creates\ a\ srpm\ for\ each\ of\ the\ given\ ports'
'sync\:Synchronize\ the\ set\ of\ Portfiles'
'test\:Run\ tests\ on\ each\ of\ the\ given\ ports'
'unarchive\:Unarchive\ the\ destroot\ of\ the\ given\ ports\ from\ installed\ images'
'uninstall\:Uninstall\ the\ given\ ports'
'unload\:Interface\ to\ launchctl(1)\ for\ ports\ providing\ startup\ items'
'unsetrequested\:Marks\ each\ of\ the\ given\ ports\ as\ unrequested'
'upgrade\:Upgrades\ the\ given\ ports\ to\ the\ latest\ version'
'url\:Returns\ the\ URL\ for\ each\ of\ the\ given\ ports'
'usage\:Returns\ basic\ usage\ of\ the\ port\ command'
'variants\:Returns\ a\ list\ of\ variants\ provided\ by\ the\ given\ ports,\ with\ descriptions\ if\ present'
'version\:Returns\ the\ version\ of\ MacPorts'
'work\:Returns\ the\ path\ to\ the\ work\ directory\ for\ each\ of\ the\ given\ ports'
)
pseudo_common=(all current active inactive actinact installed uninstalled outdated
obsolete requested unrequested leaves)
pseudo_advanced=('variants:' 'variant:' 'description:' 'depends:'
'depends_lib:' 'depends_run:' 'depends_build:' 'depends_fetch:' 'depends_extract:'
'portdir:' 'homepage:' 'epoch:' 'platforms:' 'platform:' 'name:' 'long_description:'
'maintainers:' 'maintainer:' 'categories:' 'category:' 'version:' 'revision:' 'license:')
select_options=(
'--list:List available versions for the group'
'--set:Select the given version for the group'
'--show:Show which version is currently selected for the group (default if none given)'
)
revupgrade_options=('--id-loadcmd-check:Run more checks against a special loadcommand in Mach-O binaries')
upgrade_options=(
'--force\:Ignore\ circumstances\ that\ would\ normally\ cause\ ports\ to\ be\ skipped\ \(e.g.\ not\ outdated\).' \
'--enforce-variants\:If\ the\ installed\ variants\ do\ not\ match\ those\ requested,\ upgrade\ even\ if\ the\ port\ is\ not\ outdated.' \
'--no-replace\:Do\ not\ replace\ one\ port\ with\ another\ according\ to\ the\ replaced_by\ field.' \
)
_arguments -s -C \
'-v[Verbose mode (generate verbose messages)]' \
'-d[Debug mode (generate debugging messages, implies -v)]' \
'-q[Quiet mode (suppress messages)]' \
"-n[Don't upgrade dependencies (affects upgrade and install)]" \
"-R[Also upgrade dependents (only affects upgrade) - note that this does not upgrade dependents' dependencies]" \
'-u[Uninstall non-active ports when upgrading and uninstalling]' \
'-f[Force mode (ignore state file)]' \
'-o[Honor state files even if the Portfile has been modified since (called -o because it used to mean "older")]' \
'-s[Source-only mode (build and install from source, do not attempt to fetch binary archives)]' \
'-b[Binary-only mode (build and install from binary archives, ignore source, abort if no archive available)]' \
'-c[Autoclean mode (execute clean after install)]' \
"-k[Keep mode (don't autoclean after install)]" \
'-D[Specify portdir]' \
'-F[Read and process the file of commands specified by the argument.]' \
'-p[Despite any errors encountered, proceed to process multiple ports and commands.]' \
'-y[Perform a dry run.]' \
'-t[Enable trace mode debug facilities on platforms that support it (Mac OS X).]' \
"1:Port actions:(($actions))" \
'::Per-action arguments:_port_dispatch' \
&& return 0
}
_port_dispatch() {
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
zstyle ":completion:${curcontext}:" cache-policy ${cache_policy:-_port_caching_policy}
case "$words[2]" in
provides)
_files
;;
search)
_message 'pattern'
;;
help)
_describe -t actions 'Port actions' actions
;;
select)
_call_function - _port_select
;;
contents|deactivate|setrequested|space|uninstall|unsetrequested)
# Cache the list of installed ports.
if ( [[ ${+_port_installed_packages} -eq 0 ]] || _cache_invalid PORT_INSTALLED_PACKAGES ) &&
! _retrieve_cache PORT_INSTALLED_PACKAGES;
then
_port_installed_packages=( $(_call_program path-all "port -q echo installed") )
_store_cache PORT_INSTALLED_PACKAGES _port_installed_packages
fi
_alternative \
"ports:Installed ports:($_port_installed_packages)" \
"pseudo-common:Common Pseudo-portnames:($pseudo_common)" \
"pseudo-advanced:Advanced Pseudo-portnames:($pseudo_advanced)"
;;
upgrade)
# No good reason to actually cache outdated ports list
local outdated_packages
outdated_packages=( $(_call_program path-outdated "port -q echo outdated") )
_alternative -- \
"upgrade-options:Upgrade options:(($upgrade_options))" \
"ports:Outdated ports:($outdated_packages)" \
"pseudo-common:Common Pseudo-portnames:($pseudo_common)" \
"pseudo-advanced:Advanced Pseudo-portnames:($pseudo_advanced)"
;;
rev-upgrade)
if (( CURRENT == 3 )); then
_describe 'Rev-upgrade options' revupgrade_options
fi
;;
outdated|sync)
# No need to complete anything more here.
return 0;
;;
selfupdate)
_all_labels 'Selfupdate options' '--nosync'
;;
*)
# Cache the list of all ports.
if ( [[ ${+_port_available_packages} -eq 0 ]] || _cache_invalid PORT_AVAILABLE_PACKAGES ) &&
! _retrieve_cache PORT_AVAILABLE_PACKAGES;
then
_port_available_packages=( $(_call_program path-all "port -q echo all") )
_store_cache PORT_AVAILABLE_PACKAGES _port_available_packages
fi
_alternative \
"ports:Available ports:($_port_available_packages)" \
"pseudo-common:Common Pseudo-portnames:($pseudo_common)" \
"pseudo-advanced:Advanced Pseudo-portnames:($pseudo_advanced)"
;;
esac
}
_port_select() {
if (( CURRENT == 3 )); then
_describe 'Port select options' select_options
elif (( CURRENT == 4 )); then
local select_group
select_group=()
for f in $port_prefix/etc/select/*; do
select_group+=$(basename $f)
done
_describe "Port select groups" select_group
elif [[ $CURRENT -eq 5 && $words[3] == '--set' ]]; then
local select_variants
select_variants=("${(f)$(port select --list $words[4] | sed -e '1 d' -e 's/^[ \t]*//' -e 's/ (active)$//')}")
_describe "Port select group $words[4] variants" select_variants
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
PORT_INSTALLED_PACKAGES)
check_file=$port_prefix/var/macports/registry/registry.db
;;
PORT_AVAILABLE_PACKAGES)
check_file=${$(port dir MacPorts)%/*/*}/PortIndex
;;
esac
reg_time=$($stat_cmd $check_file)
comp_time=$($stat_cmd $1)
return $(( reg_time < comp_time ))
}
_port "$@"

View File

@ -1,147 +0,0 @@
#compdef pygmentize
# ------------------------------------------------------------------------------
# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for pygmentize.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Hideo Hattori <hhatto.jp@gmail.com>
#
# ------------------------------------------------------------------------------
_pygmentize() {
local context state line
_arguments -s -S \
'-h[prints help]:' \
'-V[prints the package version]:' \
'-L[lists lexers, formatters, styles or filters]:args:(lexers formatters styles filters):' \
'-f[formatter]:FORMATTER:_get_formatters' \
'-o[output file]:FILENAME:_gnu_generic' \
'(-h -V -L -f -o -S -F -H -g -l)-N[guesses and prints out a lexer name based solely on given filename]:FILENAME:_files:' \
'(-h -V -L -o -F -H -g -l -N)-S[style]:STYLE:_get_styles' \
'-F[filter]:STYLE:_get_filters' \
'-H[prints detailed help for the object <name> of type <type>]:' \
'(-g)-l[lexer]::LEXER:_get_lexers:' \
'(-l)-g[attempt to guess the lexer from the file contents]' \
'*:args:_gnu_generic'
}
_get_filters() {
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy
fi
if ( [[ ${+_pygmentize_filters} -eq 0 ]] || _cache_invalid pygmentize_filters ) \
&& ! _retrieve_cache pygmentize_filters; then
_pygmentize_filters=(${${(f)"$(pygmentize -L filters | grep '* ' | cut -c3- | sed -e 's/:$//')"}})
_store_cache pygmentize_filters _pygmentize_filters
fi
local expl
_wanted pygmentize_filters expl 'pygmentize filters' compadd -a _pygmentize_filters
}
(( $+functions[_pygmentize_get_formatters] )) ||
_get_formatters() {
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy
fi
if ( [[ ${+_pygmentize_formatter} -eq 0 ]] || _cache_invalid pygmentize_formatter ) \
&& ! _retrieve_cache pygmentize_formatter; then
_pygmentize_formatter=(${${(f)"$(pygmentize -L formatters | grep '* ' | cut -c3- | sed -e 's/, /\n/g' -e 's/:$//')"}})
_store_cache pygmentize_formatter _pygmentize_formatter
fi
local expl
_wanted pygmentize_formatter expl 'pygmentize formatters' compadd -a _pygmentize_formatter
}
_get_lexers() {
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy
fi
if ( [[ ${+_pygmentize_lexer} -eq 0 ]] || _cache_invalid pygmentize_lexer ) \
&& ! _retrieve_cache pygmentize_lexer; then
_pygmentize_lexer=(${${(f)"$(pygmentize -L lexers | grep '* ' | cut -c3- | sed -e 's/, /\n/g' -e 's/:$//')"}})
_store_cache pygmentize_lexer _pygmentize_lexer
fi
local expl
_wanted pygmentize_lexer expl 'pygmentize lexers' compadd -a _pygmentize_lexer
}
_get_styles() {
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy
fi
if ( [[ ${+_pygmentize_style} -eq 0 ]] || _cache_invalid pygmentize_style ) \
&& ! _retrieve_cache pygmentize_style; then
_pygmentize_style=(${${(f)"$(pygmentize -L styles | grep '* ' | cut -c3- | sed -e 's/:$//')"}})
_store_cache pygmentize_style _pygmentize_style
fi
local expl
_wanted pygmentize_style expl 'pygmentize styles' compadd -a _pygmentize_style
}
_pygmentize_caching_policy() {
local -a oldp
oldp=( "$1"(Nmh+24) ) # 24 hour
(( $#oldp ))
}
_pygmentize "$@"
# 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

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