init
This commit is contained in:
1725
.zcompdump
Normal file
1725
.zcompdump
Normal file
File diff suppressed because it is too large
Load Diff
BIN
.zcompdump.zwc
Normal file
BIN
.zcompdump.zwc
Normal file
Binary file not shown.
3
.zprezto/.gitignore
vendored
Normal file
3
.zprezto/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*.zwc
|
||||
*.zwc.old
|
||||
modules/*/cache.zsh
|
21
.zprezto/.gitmodules
vendored
Normal file
21
.zprezto/.gitmodules
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
[submodule "modules/history-substring-search/external"]
|
||||
path = modules/history-substring-search/external
|
||||
url = https://github.com/zsh-users/zsh-history-substring-search.git
|
||||
[submodule "modules/syntax-highlighting/external"]
|
||||
path = modules/syntax-highlighting/external
|
||||
url = https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||
[submodule "modules/completion/external"]
|
||||
path = modules/completion/external
|
||||
url = https://github.com/zsh-users/zsh-completions.git
|
||||
[submodule "modules/prompt/external/powerline"]
|
||||
path = modules/prompt/external/powerline
|
||||
url = https://github.com/davidjrice/prezto_powerline.git
|
||||
[submodule "modules/prompt/external/agnoster"]
|
||||
path = modules/prompt/external/agnoster
|
||||
url = https://github.com/agnoster/agnoster-zsh-theme.git
|
||||
[submodule "modules/prompt/functions/pure"]
|
||||
path = modules/prompt/external/pure
|
||||
url = https://github.com/sindresorhus/pure.git
|
||||
[submodule "modules/autosuggestions/external"]
|
||||
path = modules/autosuggestions/external
|
||||
url = https://github.com/tarruda/zsh-autosuggestions
|
41
.zprezto/CONTRIBUTING.md
Normal file
41
.zprezto/CONTRIBUTING.md
Normal file
@@ -0,0 +1,41 @@
|
||||
Contributing
|
||||
------------
|
||||
|
||||
This project would not exist without all of its users and [contributors][1].
|
||||
|
||||
If you have ideas on how to make the configuration easier to maintain or
|
||||
improve its performance, do not hesitate to fork and send pull requests.
|
||||
|
||||
### Issue Reporting
|
||||
|
||||
- Check that the issue has not already been reported.
|
||||
- Check that the issue has not already been fixed in the latest code.
|
||||
- Open an issue with a clear title and description in grammatically correct,
|
||||
complete sentences.
|
||||
|
||||
### Pull Request
|
||||
|
||||
- Read [how to properly contribute to open source projects on GitHub][2].
|
||||
- Use a topic branch to easily amend a pull request later, if necessary.
|
||||
- Write [good commit messages][3].
|
||||
- Squash commits on the topic branch before opening a pull request.
|
||||
- Use the same coding style and spacing.
|
||||
- Open a [pull request][4] that relates to but one subject with a clear
|
||||
title and description in grammatically correct, complete sentences.
|
||||
|
||||
#### Modules
|
||||
|
||||
- A *README.md* must be present.
|
||||
- Large functions must be placed in a *functions* directory.
|
||||
- Functions that take arguments must have completion.
|
||||
|
||||
#### Themes
|
||||
|
||||
- A screenshots section must be present in the file header.
|
||||
- The pull request description must have [embedded screenshots][5].
|
||||
|
||||
[1]: https://github.com/sorin-ionescu/prezto/contributors
|
||||
[2]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request
|
||||
[3]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
||||
[4]: https://help.github.com/articles/using-pull-requests
|
||||
[5]: http://daringfireball.net/projects/markdown/syntax#img
|
117
.zprezto/README.md
Normal file
117
.zprezto/README.md
Normal file
@@ -0,0 +1,117 @@
|
||||
Prezto — Instantly Awesome Zsh
|
||||
==============================
|
||||
|
||||
Prezto is the configuration framework for [Zsh][1]; it enriches the command line
|
||||
interface environment with sane defaults, aliases, functions, auto completion,
|
||||
and prompt themes.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Prezto will work with any recent release of Zsh, but the minimum required
|
||||
version is 4.3.17.
|
||||
|
||||
1. Launch Zsh:
|
||||
|
||||
zsh
|
||||
|
||||
2. Clone the repository:
|
||||
|
||||
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
|
||||
|
||||
3. Create a new Zsh configuration by copying the Zsh configuration files
|
||||
provided:
|
||||
|
||||
setopt EXTENDED_GLOB
|
||||
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
|
||||
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
|
||||
done
|
||||
|
||||
4. Set Zsh as your default shell:
|
||||
|
||||
chsh -s /bin/zsh
|
||||
|
||||
5. Open a new Zsh terminal window or tab.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
If you are not able to find certain commands after switching to *Prezto*,
|
||||
modify the `PATH` variable in *~/.zprofile* then open a new Zsh terminal
|
||||
window or tab.
|
||||
|
||||
Updating
|
||||
--------
|
||||
|
||||
Pull the latest changes and update submodules.
|
||||
|
||||
git pull && git submodule update --init --recursive
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Prezto has many features disabled by default. Read the source code and
|
||||
accompanying README files to learn of what is available.
|
||||
|
||||
### Modules
|
||||
|
||||
1. Browse */modules* to see what is available.
|
||||
2. Load the modules you need in *~/.zpreztorc* then open a new Zsh terminal
|
||||
window or tab.
|
||||
|
||||
### Themes
|
||||
|
||||
1. For a list of themes, type `prompt -l`.
|
||||
2. To preview a theme, type `prompt -p name`.
|
||||
3. Load the theme you like in *~/.zpreztorc* then open a new Zsh terminal
|
||||
window or tab.
|
||||
|
||||
![sorin theme][2]
|
||||
|
||||
Customization
|
||||
-------------
|
||||
|
||||
The project is managed via [Git][3]. It is highly recommended that you fork this
|
||||
project; so, that you can commit your changes and push them to [GitHub][4] to
|
||||
not lose them. If you do not know how to use Git, follow this [tutorial][5] and
|
||||
bookmark this [reference][6].
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
||||
The [Zsh Reference Card][7] and the [zsh-lovers][8] man page are indispensable.
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2009-2011 Robby Russell and contributors.
|
||||
|
||||
Copyright (c) 2011-2015 Sorin Ionescu 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.
|
||||
|
||||
[1]: http://www.zsh.org
|
||||
[2]: http://i.imgur.com/nrGV6pg.png "sorin theme"
|
||||
[3]: http://git-scm.com
|
||||
[4]: https://github.com
|
||||
[5]: http://gitimmersion.com
|
||||
[6]: http://gitref.org
|
||||
[7]: http://www.bash2zsh.com/zsh_refcard/refcard.pdf
|
||||
[8]: http://grml.org/zsh/zsh-lovers.html
|
113
.zprezto/init.zsh
Normal file
113
.zprezto/init.zsh
Normal file
@@ -0,0 +1,113 @@
|
||||
#
|
||||
# Initializes Prezto.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
#
|
||||
# Version Check
|
||||
#
|
||||
|
||||
# Check for the minimum supported version.
|
||||
min_zsh_version='4.3.17'
|
||||
if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then
|
||||
print "prezto: old shell detected, minimum required: $min_zsh_version" >&2
|
||||
return 1
|
||||
fi
|
||||
unset min_zsh_version
|
||||
|
||||
#
|
||||
# Module Loader
|
||||
#
|
||||
|
||||
# Loads Prezto modules.
|
||||
function pmodload {
|
||||
local -a pmodules
|
||||
local pmodule
|
||||
local pfunction_glob='^([_.]*|prompt_*_setup|README*)(-.N:t)'
|
||||
|
||||
# $argv is overridden in the anonymous function.
|
||||
pmodules=("$argv[@]")
|
||||
|
||||
# Add functions to $fpath.
|
||||
fpath=(${pmodules:+${ZDOTDIR:-$HOME}/.zprezto/modules/${^pmodules}/functions(/FN)} $fpath)
|
||||
|
||||
function {
|
||||
local pfunction
|
||||
|
||||
# Extended globbing is needed for listing autoloadable function directories.
|
||||
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
||||
|
||||
# Load Prezto functions.
|
||||
for pfunction in ${ZDOTDIR:-$HOME}/.zprezto/modules/${^pmodules}/functions/$~pfunction_glob; do
|
||||
autoload -Uz "$pfunction"
|
||||
done
|
||||
}
|
||||
|
||||
# Load Prezto modules.
|
||||
for pmodule in "$pmodules[@]"; do
|
||||
if zstyle -t ":prezto:module:$pmodule" loaded 'yes' 'no'; then
|
||||
continue
|
||||
elif [[ ! -d "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule" ]]; then
|
||||
print "$0: no such module: $pmodule" >&2
|
||||
continue
|
||||
else
|
||||
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh" ]]; then
|
||||
source "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh"
|
||||
fi
|
||||
|
||||
if (( $? == 0 )); then
|
||||
zstyle ":prezto:module:$pmodule" loaded 'yes'
|
||||
else
|
||||
# Remove the $fpath entry.
|
||||
fpath[(r)${ZDOTDIR:-$HOME}/.zprezto/modules/${pmodule}/functions]=()
|
||||
|
||||
function {
|
||||
local pfunction
|
||||
|
||||
# Extended globbing is needed for listing autoloadable function
|
||||
# directories.
|
||||
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
||||
|
||||
# Unload Prezto functions.
|
||||
for pfunction in ${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/functions/$~pfunction_glob; do
|
||||
unfunction "$pfunction"
|
||||
done
|
||||
}
|
||||
|
||||
zstyle ":prezto:module:$pmodule" loaded 'no'
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
# Prezto Initialization
|
||||
#
|
||||
|
||||
# Source the Prezto configuration file.
|
||||
if [[ -s "${ZDOTDIR:-$HOME}/.zpreztorc" ]]; then
|
||||
source "${ZDOTDIR:-$HOME}/.zpreztorc"
|
||||
fi
|
||||
|
||||
# Disable color and theme in dumb terminals.
|
||||
if [[ "$TERM" == 'dumb' ]]; then
|
||||
zstyle ':prezto:*:*' color 'no'
|
||||
zstyle ':prezto:module:prompt' theme 'off'
|
||||
fi
|
||||
|
||||
# Load Zsh modules.
|
||||
zstyle -a ':prezto:load' zmodule 'zmodules'
|
||||
for zmodule ("$zmodules[@]") zmodload "zsh/${(z)zmodule}"
|
||||
unset zmodule{s,}
|
||||
|
||||
# Autoload Zsh functions.
|
||||
zstyle -a ':prezto:load' zfunction 'zfunctions'
|
||||
for zfunction ("$zfunctions[@]") autoload -Uz "$zfunction"
|
||||
unset zfunction{s,}
|
||||
|
||||
# Load Prezto modules.
|
||||
zstyle -a ':prezto:load' pmodule 'pmodules'
|
||||
pmodload "$pmodules[@]"
|
||||
unset pmodules
|
204
.zprezto/modules/README.md
Normal file
204
.zprezto/modules/README.md
Normal file
@@ -0,0 +1,204 @@
|
||||
Modules
|
||||
=======
|
||||
|
||||
Load modules in *zpreztorc*. The order matters.
|
||||
|
||||
zstyle ':prezto:load' pmodule 'environment' 'terminal'
|
||||
|
||||
Archive
|
||||
-------
|
||||
|
||||
Provides functions to list and extract archives.
|
||||
|
||||
Autosuggestions
|
||||
---------------
|
||||
|
||||
Integrates zsh-autosuggestions into Prezto.
|
||||
|
||||
Command-Not-Found
|
||||
-----------------
|
||||
|
||||
Loads the command-not-found tool on Debian-based distributions.
|
||||
|
||||
Completion
|
||||
----------
|
||||
|
||||
Loads and configures tab completion and provides additional completions from
|
||||
the zsh-completions project.
|
||||
|
||||
Directory
|
||||
---------
|
||||
|
||||
Sets directory options and defines directory aliases.
|
||||
|
||||
DNF
|
||||
---
|
||||
|
||||
Defines dnf aliases.
|
||||
|
||||
Dpkg
|
||||
----
|
||||
|
||||
Defines dpkg aliases and functions.
|
||||
|
||||
Editor
|
||||
------
|
||||
|
||||
Sets key bindings.
|
||||
|
||||
Emacs
|
||||
-----
|
||||
|
||||
Enables Emacs dependency management.
|
||||
|
||||
Environment
|
||||
-----------
|
||||
|
||||
Sets general shell options and defines environment variables.
|
||||
|
||||
Fasd
|
||||
----
|
||||
|
||||
Maintains a frequently used file and directory list for fast access.
|
||||
|
||||
Git
|
||||
---
|
||||
|
||||
Enhances the Git distributed version control system by providing aliases,
|
||||
functions and by exposing repository status information to prompts.
|
||||
|
||||
GNU Utility
|
||||
-----------
|
||||
|
||||
Provides for the interactive use of GNU utilities on non-GNU systems.
|
||||
|
||||
GPG
|
||||
---
|
||||
|
||||
Provides for an easier use of GPG by setting up gpg-agent.
|
||||
|
||||
Haskell
|
||||
-------
|
||||
|
||||
Enables local Haskell package installation.
|
||||
|
||||
Helper
|
||||
------
|
||||
|
||||
Provides helper functions for developing modules.
|
||||
|
||||
History
|
||||
-------
|
||||
|
||||
Sets history options and defines history aliases.
|
||||
|
||||
History Substring Search
|
||||
------------------------
|
||||
|
||||
Integrates zsh-history-substring-search into Prezto.
|
||||
|
||||
Homebrew
|
||||
--------
|
||||
|
||||
Defines Homebrew aliases.
|
||||
|
||||
MacPorts
|
||||
--------
|
||||
|
||||
Defines MacPorts aliases and adds MacPorts directories to path variables.
|
||||
|
||||
Node.js
|
||||
-------
|
||||
|
||||
Provides utility functions for Node.js and loads npm completion.
|
||||
|
||||
OCaml
|
||||
-----
|
||||
|
||||
Initializes OCaml package management.
|
||||
|
||||
OSX
|
||||
---
|
||||
|
||||
Defines Mac OS X aliases and functions.
|
||||
|
||||
Pacman
|
||||
------
|
||||
|
||||
Provides aliases and functions for the Pacman package manager and frontends.
|
||||
|
||||
Perl
|
||||
----
|
||||
|
||||
Enables local Perl module installation on Mac OS X and defines alises.
|
||||
|
||||
Prompt
|
||||
------
|
||||
|
||||
Loads prompt themes.
|
||||
|
||||
Python
|
||||
------
|
||||
|
||||
Enables local Python and local Python package installation.
|
||||
|
||||
Ruby on Rails
|
||||
-------------
|
||||
|
||||
Defines Ruby on Rails aliases.
|
||||
|
||||
Rsync
|
||||
-----
|
||||
|
||||
Defines rsync aliases.
|
||||
|
||||
Ruby
|
||||
----
|
||||
|
||||
Configures Ruby local gem installation, loads version managers, and defines
|
||||
aliases.
|
||||
|
||||
GNU Screen
|
||||
----------
|
||||
|
||||
Defines GNU Screen aliases and provides for auto launching it at start-up.
|
||||
|
||||
Spectrum
|
||||
--------
|
||||
|
||||
Provides for easier use of 256 colors and effects.
|
||||
|
||||
SSH
|
||||
---
|
||||
|
||||
Provides for an easier use of SSH by setting up ssh-agent.
|
||||
|
||||
Syntax Highlighting
|
||||
-------------------
|
||||
|
||||
Integrates zsh-syntax-highlighting into Prezto.
|
||||
|
||||
Terminal
|
||||
--------
|
||||
|
||||
Sets terminal window and tab titles.
|
||||
|
||||
Tmux
|
||||
----
|
||||
|
||||
Defines tmux aliases and provides for auto launching it at start-up.
|
||||
|
||||
Utility
|
||||
-------
|
||||
|
||||
Defines general aliases and functions.
|
||||
|
||||
Wake-on-LAN
|
||||
-----------
|
||||
|
||||
This module provides a wrapper around the wakeonlan tool.
|
||||
|
||||
Yum
|
||||
---
|
||||
|
||||
Defines yum aliases.
|
40
.zprezto/modules/archive/README.md
Normal file
40
.zprezto/modules/archive/README.md
Normal file
@@ -0,0 +1,40 @@
|
||||
Archive
|
||||
=======
|
||||
|
||||
Provides functions to list and extract archives.
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
- `lsarchive` lists the contents of one or more archives.
|
||||
- `unarchive` extracts the contents of one or more archives.
|
||||
|
||||
Supported Formats
|
||||
-----------------
|
||||
|
||||
The following archive formats are supported when the required utilities are
|
||||
installed:
|
||||
|
||||
- *.tar.gz*, *.tgz* require `tar`.
|
||||
- *.tar.bz2*, *.tbz* require `tar`.
|
||||
- *.tar.xz*, *.txz* require `tar` with *xz* support.
|
||||
- *.tar.zma*, *.tlz* require `tar` with *lzma* support.
|
||||
- *.tar* requires `tar`.
|
||||
- *.gz* requires `gunzip`.
|
||||
- *.bz2* requires `bunzip2`.
|
||||
- *.xz* requires `unxz`.
|
||||
- *.lzma* requires `unlzma`.
|
||||
- *.Z* requires `uncompress`.
|
||||
- *.zip* requires `unzip`.
|
||||
- *.rar* requires `unrar` or `rar`.
|
||||
- *.7z* requires `7za`.
|
||||
- *.deb* requires `ar`, `tar`.
|
||||
|
||||
Authors
|
||||
-------
|
||||
|
||||
*The authors of this module should be contacted via the [issue tracker][1].*
|
||||
|
||||
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
||||
|
||||
[1]: https://github.com/sorin-ionescu/prezto/issues
|
13
.zprezto/modules/archive/functions/_lsarchive
Normal file
13
.zprezto/modules/archive/functions/_lsarchive
Normal file
@@ -0,0 +1,13 @@
|
||||
#compdef lsarchive
|
||||
#autoload
|
||||
|
||||
#
|
||||
# Completes lsarchive.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
_arguments \
|
||||
'(-v --verbose)'{-v,--remove}'[verbose archive listing]' \
|
||||
"*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z)(-.)'" && return 0
|
13
.zprezto/modules/archive/functions/_unarchive
Normal file
13
.zprezto/modules/archive/functions/_unarchive
Normal file
@@ -0,0 +1,13 @@
|
||||
#compdef unarchive
|
||||
#autoload
|
||||
|
||||
#
|
||||
# Completes unarchive.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
_arguments \
|
||||
'(-r --remove)'{-r,--remove}'[remove archive]' \
|
||||
"*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0
|
55
.zprezto/modules/archive/functions/lsarchive
Normal file
55
.zprezto/modules/archive/functions/lsarchive
Normal file
@@ -0,0 +1,55 @@
|
||||
#
|
||||
# Lists the contents of archives.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
local verbose
|
||||
|
||||
if (( $# == 0 )); then
|
||||
cat >&2 <<EOF
|
||||
usage: $0 [-option] [file ...]
|
||||
|
||||
options:
|
||||
-v, --verbose verbose archive listing
|
||||
|
||||
Report bugs to <sorin.ionescu@gmail.com>.
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [[ "$1" == "-v" || "$1" == "--verbose" ]]; then
|
||||
verbose=0
|
||||
shift
|
||||
fi
|
||||
|
||||
while (( $# > 0 )); do
|
||||
if [[ ! -s "$1" ]]; then
|
||||
print "$0: file not valid: $1" >&2
|
||||
shift
|
||||
continue
|
||||
fi
|
||||
|
||||
case "$1:l" in
|
||||
(*.tar.gz|*.tgz) tar t${verbose:+v}vzf "$1" ;;
|
||||
(*.tar.bz2|*.tbz|*.tbz2) tar t${verbose:+v}jf "$1" ;;
|
||||
(*.tar.xz|*.txz) tar --xz --help &> /dev/null \
|
||||
&& tar --xz -t${verbose:+v}f "$1" \
|
||||
|| xzcat "$1" | tar t${verbose:+v}f - ;;
|
||||
(*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
|
||||
&& tar --lzma -t${verbose:+v}f "$1" \
|
||||
|| lzcat "$1" | tar x${verbose:+v}f - ;;
|
||||
(*.tar) tar t${verbose:+v}f "$1" ;;
|
||||
(*.zip) unzip -l${verbose:+v} "$1" ;;
|
||||
(*.rar) unrar &> /dev/null \
|
||||
&& unrar ${${verbose:+v}:-l} "$1" \
|
||||
|| rar ${${verbose:+v}:-l} "$1" ;;
|
||||
(*.7z) 7za l "$1" ;;
|
||||
(*)
|
||||
print "$0: cannot list: $1" >&2
|
||||
success=1
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
80
.zprezto/modules/archive/functions/unarchive
Normal file
80
.zprezto/modules/archive/functions/unarchive
Normal file
@@ -0,0 +1,80 @@
|
||||
#
|
||||
# Extracts the contents of archives.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
local remove_archive
|
||||
local success
|
||||
local file_name
|
||||
local file_path
|
||||
local extract_dir
|
||||
|
||||
if (( $# == 0 )); then
|
||||
cat >&2 <<EOF
|
||||
usage: $0 [-option] [file ...]
|
||||
|
||||
options:
|
||||
-r, --remove remove archive
|
||||
|
||||
Report bugs to <sorin.ionescu@gmail.com>.
|
||||
EOF
|
||||
fi
|
||||
|
||||
remove_archive=1
|
||||
if [[ "$1" == "-r" || "$1" == "--remove" ]]; then
|
||||
remove_archive=0
|
||||
shift
|
||||
fi
|
||||
|
||||
while (( $# > 0 )); do
|
||||
if [[ ! -s "$1" ]]; then
|
||||
print "$0: file not valid: $1" >&2
|
||||
shift
|
||||
continue
|
||||
fi
|
||||
|
||||
success=0
|
||||
file_name="${1:t}"
|
||||
file_path="${1:A}"
|
||||
extract_dir="${file_name:r}"
|
||||
case "$1:l" in
|
||||
(*.tar.gz|*.tgz) tar xvzf "$1" ;;
|
||||
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
|
||||
(*.tar.xz|*.txz) tar --xz --help &> /dev/null \
|
||||
&& tar --xz -xvf "$1" \
|
||||
|| xzcat "$1" | tar xvf - ;;
|
||||
(*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
|
||||
&& tar --lzma -xvf "$1" \
|
||||
|| lzcat "$1" | tar xvf - ;;
|
||||
(*.tar) tar xvf "$1" ;;
|
||||
(*.gz) gunzip "$1" ;;
|
||||
(*.bz2) bunzip2 "$1" ;;
|
||||
(*.xz) unxz "$1" ;;
|
||||
(*.lzma) unlzma "$1" ;;
|
||||
(*.Z) uncompress "$1" ;;
|
||||
(*.zip) unzip "$1" -d $extract_dir ;;
|
||||
(*.rar) unrar &> /dev/null \
|
||||
&& unrar x -ad "$1" \
|
||||
|| rar x -ad "$1" ;;
|
||||
(*.7z) 7za x "$1" ;;
|
||||
(*.deb)
|
||||
mkdir -p "$extract_dir/control"
|
||||
mkdir -p "$extract_dir/data"
|
||||
cd "$extract_dir"; ar vx "${file_path}" > /dev/null
|
||||
cd control; tar xvf ../control.tar.*
|
||||
cd ../data; tar xvf ../data.tar.*
|
||||
cd ..; rm control.tar.* data.tar.* debian-binary
|
||||
cd ..
|
||||
;;
|
||||
(*)
|
||||
print "$0: cannot extract: $1" >&2
|
||||
success=1
|
||||
;;
|
||||
esac
|
||||
|
||||
(( success = $success > 0 ? $success : $? ))
|
||||
(( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1"
|
||||
shift
|
||||
done
|
53
.zprezto/modules/autosuggestions/README.md
Normal file
53
.zprezto/modules/autosuggestions/README.md
Normal file
@@ -0,0 +1,53 @@
|
||||
Autosuggestions
|
||||
---------------
|
||||
|
||||
Integrates zsh-autosuggestions into Prezto.
|
||||
|
||||
Autosuggestions
|
||||
===============
|
||||
|
||||
Integrates [zsh-autosuggestions][1] into Prezto, which implements the
|
||||
[Fish shell][2]'s autosuggestions feature, where the user can type in any part
|
||||
of a previously entered command and Zsh suggests commands as you type based on
|
||||
history and completions.
|
||||
|
||||
If this module is used in conjuncture with the *syntax-highlighting* module, it
|
||||
must be loaded **after** it.
|
||||
|
||||
If this module is used in conjuncture with the *history-substring-search*
|
||||
module, it must be loaded **after** it.
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
New features and bug fixes should be submitted to the [zsh-autosuggestions][1]
|
||||
project according to its rules and regulations. This module will be synchronized
|
||||
against it.
|
||||
|
||||
Settings
|
||||
--------
|
||||
|
||||
### Highlighting
|
||||
|
||||
If colors are enabled, *autosuggestions* will automatically highlight
|
||||
positive results.
|
||||
|
||||
To enable highlighting for this module only, add the following line to
|
||||
*zpreztorc*:
|
||||
|
||||
zstyle ':prezto:module:autosuggestions' color 'yes'
|
||||
|
||||
To set the query found color, add the following line to *zpreztorc*:
|
||||
|
||||
zstyle ':prezto:module:autosuggestions:color' found ''
|
||||
|
||||
Authors
|
||||
-------
|
||||
|
||||
*The authors of this module should be contacted via the [issue tracker][3].*
|
||||
|
||||
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
||||
|
||||
[1]: https://github.com/tarruda/zsh-autosuggestions
|
||||
[2]: http://fishshell.com
|
||||
[3]: https://github.com/sorin-ionescu/prezto/issues
|
35
.zprezto/modules/autosuggestions/init.zsh
Normal file
35
.zprezto/modules/autosuggestions/init.zsh
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# Integrates zsh-autosuggestions into Prezto.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# Load dependencies.
|
||||
pmodload 'editor'
|
||||
|
||||
# Source module files.
|
||||
source "${0:h}/external/zsh-autosuggestions.zsh" || return 1
|
||||
|
||||
#
|
||||
# Highlighting
|
||||
#
|
||||
|
||||
# Set highlight color, default 'fg=8'.
|
||||
zstyle -s ':prezto:module:autosuggestions:color' found \
|
||||
'ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE' || ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
|
||||
|
||||
# Disable highlighting.
|
||||
if ! zstyle -t ':prezto:module:autosuggestions' color; then
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=''
|
||||
fi
|
||||
|
||||
#
|
||||
# Key Bindings
|
||||
#
|
||||
|
||||
if [[ -n "$key_info" ]]; then
|
||||
# vi
|
||||
bindkey -M viins "$key_info[Control]F" vi-forward-word
|
||||
bindkey -M viins "$key_info[Control]E" vi-add-eol
|
||||
fi
|
15
.zprezto/modules/command-not-found/README.md
Normal file
15
.zprezto/modules/command-not-found/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
Command-Not-Found
|
||||
=================
|
||||
|
||||
Displays installation information for not found commands by loading the
|
||||
[command-not-found][1] tool on Debian-based and Arch Linux-based distributions.
|
||||
|
||||
Authors
|
||||
-------
|
||||
|
||||
*The authors of this module should be contacted via the [issue tracker][2].*
|
||||
|
||||
- [Joseph Booker](https://github.com/sargas)
|
||||
|
||||
[1]: https://code.launchpad.net/command-not-found
|
||||
[2]: https://github.com/sorin-ionescu/prezto/issues
|
17
.zprezto/modules/command-not-found/init.zsh
Normal file
17
.zprezto/modules/command-not-found/init.zsh
Normal file
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# Displays installation information for not found commands.
|
||||
#
|
||||
# Authors:
|
||||
# Joseph Jon Booker <joe@neoturbine.net>
|
||||
#
|
||||
|
||||
# Load command-not-found on Debian-based distributions.
|
||||
if [[ -s '/etc/zsh_command_not_found' ]]; then
|
||||
source '/etc/zsh_command_not_found'
|
||||
# Load command-not-found on Arch Linux-based distributions.
|
||||
elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then
|
||||
source '/usr/share/doc/pkgfile/command-not-found.zsh'
|
||||
# Return if requirements are not found.
|
||||
else
|
||||
return 1
|
||||
fi
|
23
.zprezto/modules/completion/README.md
Normal file
23
.zprezto/modules/completion/README.md
Normal file
@@ -0,0 +1,23 @@
|
||||
Completion
|
||||
==========
|
||||
|
||||
Loads and configures tab completion and provides additional completions from
|
||||
the [zsh-completions][1] project.
|
||||
|
||||
This module must be loaded **after** the *utility* module.
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
Completions should be submitted to the [zsh-completions][1] project according
|
||||
to its rules and regulations. This module will be synchronized against it.
|
||||
|
||||
Authors
|
||||
-------
|
||||
|
||||
*The authors of this module should be contacted via the [issue tracker][2].*
|
||||
|
||||
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
||||
|
||||
[1]: https://github.com/zsh-users/zsh-completions
|
||||
[2]: https://github.com/sorin-ionescu/prezto/issues
|
10
.zprezto/modules/completion/external/.editorconfig
vendored
Normal file
10
.zprezto/modules/completion/external/.editorconfig
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
; 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
|
3
.zprezto/modules/completion/external/.gitignore
vendored
Normal file
3
.zprezto/modules/completion/external/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# zsh word code files
|
||||
*.zwc
|
||||
|
77
.zprezto/modules/completion/external/README.md
vendored
Normal file
77
.zprezto/modules/completion/external/README.md
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
zsh-completions
|
||||
===============
|
||||
|
||||
**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 are meant to 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.
|
||||
|
||||
Gentoo's completions have been removed, as they are maintained upstream. See: [Gentoo zsh-completions](https://github.com/radhermit/gentoo-zsh-completions)
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
#### Using packages
|
||||
|
||||
* Arch Linux: [community/zsh-completions](https://www.archlinux.org/packages/zsh-completions) / [AUR/zsh-completions-git](https://aur.archlinux.org/packages/zsh-completions-git/)
|
||||
* [Gentoo](http://packages.gentoo.org/package/app-shells/zsh-completions)
|
||||
* Mac OS: [Homebrew](https://github.com/mxcl/homebrew/blob/master/Library/Formula/zsh-completions.rb)
|
||||
* Debian based distributions (Debian/Ubuntu/Linux Mint...): Packager needed, please get in touch !
|
||||
* RPM based distributions (Fedora/RHEL/CentOS...): Packager needed, please get in touch !
|
||||
|
||||
#### Using frameworks
|
||||
|
||||
* If you're using [antigen](https://github.com/zsh-users/antigen), just add `antigen bundle zsh-users/zsh-completions src` to your .zshrc where you're loading your other zsh plugins.
|
||||
|
||||
|
||||
#### 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
|
||||
|
||||
#### oh-my-zsh
|
||||
|
||||
If you use [oh-my-zsh][] then just clone the repository inside your oh-my-zsh repo:
|
||||
|
||||
```Shell
|
||||
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
|
||||
```
|
||||
|
||||
and enable it in your `.zshrc`:
|
||||
|
||||
```zsh
|
||||
plugins+=(zsh-completions)
|
||||
autoload -U compinit && compinit
|
||||
```
|
||||
|
||||
[oh-my-zsh]: http://github.com/robbyrussell/oh-my-zsh
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Contributions are welcome, just make sure you follow the guidelines:
|
||||
|
||||
* 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).
|
||||
* Send a pull request or ask for committer access.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
See each file for license details.
|
237
.zprezto/modules/completion/external/src/_ack
vendored
Normal file
237
.zprezto/modules/completion/external/src/_ack
vendored
Normal file
@@ -0,0 +1,237 @@
|
||||
#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
|
||||
|
422
.zprezto/modules/completion/external/src/_adb
vendored
Normal file
422
.zprezto/modules/completion/external/src/_adb
vendored
Normal file
@@ -0,0 +1,422 @@
|
||||
#compdef adb
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for adb (Android Debug Bridge) 1.0.26
|
||||
# (http://developer.android.com/guide/developing/tools/adb.html).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_adb() {
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext" adb_args
|
||||
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
'(-e -s)-d[directs command to the only connected USB device, returns an error if more than one USB device is present]' \
|
||||
'(-d -s)-e[directs command to the only running emulator, returns an error if more than one emulator is running]' \
|
||||
'(-d -e)-s[directs command to the USB device or emulator with the given serial number]: :_adb_serial_numbers' \
|
||||
'-p[simple product name or a relative/absolute path to a product out directory]: :_adb_products' \
|
||||
'1: :_adb_cmds' \
|
||||
'*::arg:->args' \
|
||||
&& ret=0
|
||||
|
||||
adb_args="${(fkv)opt_args[(I)-d|-e|-s|-p]}"
|
||||
|
||||
case "$state" in
|
||||
(args)
|
||||
curcontext="${curcontext%:*:*}:adb-cmd-$words[1]:"
|
||||
case $words[1] in
|
||||
(help|version|devices|jdwp|bugreport|wait-for-device|start-server|kill-server|get-state|get-serialno|status-window|remount|reboot-bootloader|root|usb)
|
||||
_message 'no more arguments' && ret=0
|
||||
;;
|
||||
(connect|disconnect)
|
||||
_arguments \
|
||||
'1: :_adb_host_colon_ports' \
|
||||
&& ret=0
|
||||
;;
|
||||
(push)
|
||||
_arguments \
|
||||
'1:local directory:_files -/' \
|
||||
'2: :_adb_remote_files -/' \
|
||||
&& ret=0
|
||||
;;
|
||||
(pull)
|
||||
_arguments \
|
||||
'1: :_adb_remote_files -/' \
|
||||
'2:local directory:_files -/' \
|
||||
&& ret=0
|
||||
;;
|
||||
(sideload)
|
||||
_arguments \
|
||||
'1:local directory:_files -/' \
|
||||
&& ret=0
|
||||
;;
|
||||
(sync)
|
||||
_arguments \
|
||||
'-l[list but do not copy]' \
|
||||
'1: :_adb_sync_directories' \
|
||||
&& ret=0
|
||||
;;
|
||||
(shell|emu)
|
||||
_arguments -C \
|
||||
'1: :_adb_remote_commands' \
|
||||
'*::remote-command-arg:->remote-command-args' \
|
||||
&& ret=0
|
||||
case "$state" in
|
||||
(remote-command-args)
|
||||
curcontext="${curcontext%:*:*}:adb-remote-cmd-$words[1]:"
|
||||
if (( $+functions[_adb_remote_command_$words[1]_args] )); then
|
||||
_adb_remote_command_$words[1] && ret=0
|
||||
# TODO Write handlers for following commands:
|
||||
# * am (Activity Manager)
|
||||
# * pm (Package Manager)
|
||||
# TODO Reuse existing compdefs for standard commands (ls, id, ifconfig, kill, etc) ?
|
||||
# How do we tell them to use _remote_ files/pids/users/etc ?
|
||||
else
|
||||
_adb_remote_command_default && ret=0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(logcat)
|
||||
local -a rotation_opts
|
||||
[[ -n ${(M)words:#"-f"} ]] && rotation_opts+=('-r[rotates the log file every kbytes of output. The default value is 16]:value (in kb)')
|
||||
[[ -n ${(M)words:#"-r"} ]] && rotation_opts+=('-n[sets the maximum number of rotated logs. The default value is 4]:count')
|
||||
_arguments \
|
||||
'-b[loads an alternate log buffer for viewing, such as event or radio. The main buffer is used by default]: :_adb_logcat_buffers' \
|
||||
'-c[clears (flushes) the entire log and exits]' \
|
||||
'-d[dumps the log to the screen and exits]' \
|
||||
'-f[writes log message output to file. The default is stdout]: :_files' \
|
||||
'-g[prints the size of the specified log buffer and exits]' \
|
||||
'-s[sets the default filter spec to silent]' \
|
||||
'-v[sets the output format for log messages]: :_adb_logcat_output_formats' \
|
||||
"${rotation_opts[@]}" \
|
||||
'*: :_adb_logcat_filter_specs' \
|
||||
&& ret=0
|
||||
;;
|
||||
(forward)
|
||||
_arguments \
|
||||
'1: :_adb_local_forward_specs' \
|
||||
'2: :_adb_remote_forward_specs' \
|
||||
&& ret=0
|
||||
;;
|
||||
(install)
|
||||
_arguments \
|
||||
'-l[forward-lock the app]' \
|
||||
'-r[reinstall the app, keeping its data]' \
|
||||
'-s[install on SD card instead of internal storage]' \
|
||||
'1: :_files' \
|
||||
&& ret=0
|
||||
;;
|
||||
(uninstall)
|
||||
_arguments \
|
||||
'-k[keep the data and cache directories]' \
|
||||
'1: :_adb_packages' \
|
||||
&& ret=0
|
||||
;;
|
||||
(reboot)
|
||||
_arguments \
|
||||
'1:program:((bootloader:reboot\ into\ the\ bootloader\ program recovery:reboot\ into\ the\ recovery\ program))' \
|
||||
&& ret=0
|
||||
;;
|
||||
(tcpip)
|
||||
_arguments \
|
||||
'1::port' \
|
||||
&& ret=0
|
||||
;;
|
||||
(ppp)
|
||||
# TODO Complete tty (See http://developer.android.com/guide/developing/tools/adb.html#commandsummary)
|
||||
# TODO Complete PPP parameters (See http://ppp.samba.org/pppd.html)
|
||||
_arguments \
|
||||
'1::tty' \
|
||||
'*::parameters' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_adb_cmds] )) ||
|
||||
_adb_cmds() {
|
||||
_alternative \
|
||||
'general-commands:general command:_adb_general_cmds' \
|
||||
'device-commands:device command:_adb_device_cmds' \
|
||||
'scripting-commands:scripting command:_adb_scripting_cmds'
|
||||
}
|
||||
|
||||
(( $+functions[_adb_general_cmds] )) ||
|
||||
_adb_general_cmds() {
|
||||
local commands; commands=(
|
||||
'help:show help message'
|
||||
'version:show version number'
|
||||
'devices:list all connected devices'
|
||||
'connect:connect to a device via TCP/IP'
|
||||
'disconnect:disconnect from a TCP/IP device'
|
||||
)
|
||||
_describe -t general-commands 'general command' commands "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_adb_device_cmds] )) ||
|
||||
_adb_device_cmds() {
|
||||
local commands; commands=(
|
||||
'push:copy file/dir to device'
|
||||
'pull:copy file/dir from device'
|
||||
'sync:copy host->device only if changed'
|
||||
'shell:run remote shell interactively or command'
|
||||
'emu:run emulator console command'
|
||||
'logcat:view device log'
|
||||
'forward:forward socket connections'
|
||||
'jdwp:list PIDs of processes hosting a JDWP transport'
|
||||
'install:push this padbage file to the device and install it'
|
||||
'uninstall:remove this app padbage from the device'
|
||||
'bugreport:return all information from the device'
|
||||
)
|
||||
_describe -t device-commands 'device command' commands "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_adb_scripting_cmds] )) ||
|
||||
_adb_scripting_cmds() {
|
||||
local commands; commands=(
|
||||
'wait-for-device:block until device is online'
|
||||
'start-server:ensure that there is a server running'
|
||||
'kill-server:kill the server if it is running'
|
||||
'get-state:prints\: offline | bootloader | device'
|
||||
'get-serialno:prints\: <serial-number>'
|
||||
'status-window:continuously print device status for a specified device'
|
||||
'remount:remounts the /system partition on the device read-write'
|
||||
'reboot:reboots the device, optionally into the bootloader or recovery program'
|
||||
'reboot-bootloader:reboots the device into the bootloader'
|
||||
'root:restarts the adbd daemon with root permissions'
|
||||
'usb:restarts the adbd daemon listening on USB'
|
||||
'tcpip:restarts the adbd daemon listening on TCP on the specified port'
|
||||
'ppp:run PPP over USB'
|
||||
)
|
||||
_describe -t scripting-commands 'scripting command' commands "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_adb_products] )) ||
|
||||
_adb_products() {
|
||||
_alternative \
|
||||
'product-names:product name:_adb_product_names' \
|
||||
'directories:directory:_files -/'
|
||||
}
|
||||
|
||||
(( $+functions[_adb_product_names] )) ||
|
||||
_adb_product_names() {
|
||||
local ret=1
|
||||
if [[ -n "$ANDROID_PRODUCT_OUT" ]]; then
|
||||
local product_names; product_names=("$ANDROID_PRODUCT_OUT:default value set in ANDROID_PRODUCT_OUT environment variable")
|
||||
_describe -t product-names 'product name' product_names && ret=0
|
||||
else
|
||||
_message -e product-names 'product name' && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_adb_serial_numbers] )) ||
|
||||
_adb_serial_numbers() {
|
||||
local serial_numbers; serial_numbers=(${${(M)${(f)"$(_call_program devices $service devices)"//:/\\:}:#*device}%%[[:space:]]*}":connected device")
|
||||
[[ -n "$ANDROID_SERIAL" ]] && serial_numbers+=("$ANDROID_SERIAL:default value set in ANDROID_SERIAL environment variable")
|
||||
_describe -t serial-numbers 'serial number' serial_numbers "$@" && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_adb_packages] )) ||
|
||||
_adb_packages() {
|
||||
local packages; packages=(${${(ps:\r\n:)"$(_call_program packages $service $adb_args shell 'ls /data/data 2>/dev/null')"}:#\**\*})
|
||||
_multi_parts . packages
|
||||
}
|
||||
|
||||
(( $+functions[_adb_host_colon_ports] )) ||
|
||||
_adb_host_colon_ports() {
|
||||
local ret=1
|
||||
if compset -P '*:'; then
|
||||
_message -e ports 'port' && ret=0
|
||||
else
|
||||
_wanted hosts expl 'host' _hosts -qS: && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_adb_remote_files] )) ||
|
||||
_adb_remote_files() {
|
||||
local dirsonly command="ls -d ${(S)words[CURRENT]/\/*//}*/ 2>/dev/null"
|
||||
zparseopts -D -E '/=dirsonly'
|
||||
(( ! $#dirsonly )) && command+="; ls -d ${words[CURRENT]}* 2>/dev/null"
|
||||
local files; files=(${${(ps:\r\n:)"$(_call_program files $service $adb_args shell "'$command'" 2>/dev/null)"}:#\**\*})
|
||||
_multi_parts "$@" / files
|
||||
}
|
||||
|
||||
(( $+functions[_adb_remote_commands] )) ||
|
||||
_adb_remote_commands() {
|
||||
local commands; commands=(${${(ps:\r\n:)"$(_call_program commands $service $adb_args shell "'IFS=:;for path_dir in \$PATH; do ls \$path_dir 2>/dev/null; done'" 2>/dev/null)"}:#\**\*})
|
||||
_describe -t remote-commands 'remote command' commands && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_adb_local_forward_specs] )) ||
|
||||
_adb_local_forward_specs() {
|
||||
local ret=1
|
||||
if compset -P '*:'; then
|
||||
case ${IPREFIX%:} in
|
||||
(tcp)
|
||||
_message -e ports 'port' && ret=0
|
||||
;;
|
||||
(localabstract|localreserved)
|
||||
_wanted sockets expl 'socket' _socket && ret=0
|
||||
;;
|
||||
(localfilesystem)
|
||||
_wanted socket-files expl 'socket file' _files && ret=0
|
||||
;;
|
||||
(dev)
|
||||
_wanted devices expl 'device' _files -g "/dev/**" && ret=0
|
||||
;;
|
||||
esac
|
||||
else
|
||||
local modes; modes=(
|
||||
'tcp:TCP socket'
|
||||
'localabstract:local abstract socket'
|
||||
'localreserved:local reserved socket'
|
||||
'localfilesystem:local filesystem socket'
|
||||
'dev:device'
|
||||
)
|
||||
_describe -t forward-modes 'forward mode' modes -qS: && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_adb_remote_forward_specs] )) ||
|
||||
_adb_remote_forward_specs() {
|
||||
local ret=1
|
||||
if compset -P '*:'; then
|
||||
case ${IPREFIX%:} in
|
||||
(tcp)
|
||||
_message -e ports 'remote port' && ret=0
|
||||
;;
|
||||
(localabstract|localreserved|localfilesystem)
|
||||
_message -e sockets 'remote socket' && ret=0
|
||||
;;
|
||||
(dev)
|
||||
_message -e devices 'remote device' && ret=0
|
||||
;;
|
||||
(jdwp)
|
||||
local pids; pids=(${${(f)"$(_call_program pids $service $adb_args jdwp 2>/dev/null)"}:#\**\*})
|
||||
_describe -t remote-pids 'remote pid' pids && ret=0
|
||||
;;
|
||||
esac
|
||||
else
|
||||
local modes; modes=(
|
||||
'tcp:TCP socket'
|
||||
'localabstract:local abstract socket'
|
||||
'localreserved:local reserved socket'
|
||||
'localfilesystem:local filesystem socket'
|
||||
'dev:device'
|
||||
'jdwp:Java Debug Wire Protocol'
|
||||
)
|
||||
_describe -t forward-modes 'forward mode' modes -qS: && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_adb_sync_directories] )) ||
|
||||
_adb_sync_directories() {
|
||||
_alternative \
|
||||
'partitions:partition:((system:the\ /system\ partition data:the\ /data\ partition))' \
|
||||
'directories:directory:_adb_remote_files -/'
|
||||
}
|
||||
|
||||
(( $+functions[_adb_logcat_filter_specs] )) ||
|
||||
_adb_logcat_filter_specs() {
|
||||
local ret=1
|
||||
if compset -P '*:'; then
|
||||
local priorities; priorities=(
|
||||
'V:verbose (lowest priority)'
|
||||
'D:debug'
|
||||
'I:info'
|
||||
'W:warning'
|
||||
'E:error'
|
||||
'F:fatal'
|
||||
'S:silent (highest priority, on which nothing is ever printed)'
|
||||
)
|
||||
_describe -t log-priorities 'log priority' priorities "$@" && ret=0
|
||||
else
|
||||
local tags; tags=(${(u)${${${(f)"$(_call_program tags $service $adb_args logcat -d 2>/dev/null)"}%%[[:space:]]#\(*}##*\/}:#\**\*})
|
||||
_describe -t log-tags 'log tag' tags -qS: "$@" && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_adb_logcat_output_formats] )) ||
|
||||
_adb_logcat_output_formats() {
|
||||
local formats; formats=(
|
||||
'brief:display priority/tag and PID of originating process (the default format)'
|
||||
'process:display PID only'
|
||||
'tag:display the priority/tag only'
|
||||
'thread:display process:thread and priority/tag only'
|
||||
'raw:display the raw log message, with no other metadata fields'
|
||||
'time:display the date, invocation time, priority/tag, and PID of the originating process'
|
||||
'long:display all metadata fields and separate messages with a blank lines'
|
||||
)
|
||||
_describe -t log-formats 'log format' formats "$@" && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_adb_logcat_buffers] )) ||
|
||||
_adb_logcat_buffers() {
|
||||
local buffers; buffers=(
|
||||
'main:view the main log buffer (default)'
|
||||
'radio:view the buffer that contains radio/telephony related messages'
|
||||
'events:view the buffer containing events-related messages'
|
||||
)
|
||||
_describe -t log-buffers 'log buffer' buffers "$@" && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_adb_remote_command_default] )) ||
|
||||
_adb_remote_command_default() {
|
||||
_wanted remote-files expl 'remote file' _adb_remote_files
|
||||
}
|
||||
|
||||
_adb "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
217
.zprezto/modules/completion/external/src/_ag
vendored
Normal file
217
.zprezto/modules/completion/external/src/_ag
vendored
Normal file
@@ -0,0 +1,217 @@
|
||||
#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 "$@"
|
331
.zprezto/modules/completion/external/src/_android
vendored
Normal file
331
.zprezto/modules/completion/external/src/_android
vendored
Normal file
@@ -0,0 +1,331 @@
|
||||
#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'
|
||||
'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
|
439
.zprezto/modules/completion/external/src/_ansible
vendored
Normal file
439
.zprezto/modules/completion/external/src/_ansible
vendored
Normal file
@@ -0,0 +1,439 @@
|
||||
#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 v1.8.4 (http://ansible.org)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Romain Bossart (https://github.com/bosr)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
#
|
||||
# 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=/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
|
||||
}
|
||||
|
||||
|
||||
_modules=(
|
||||
'a10_server:(E) Manage A10 Networks AX/SoftAX/Thunder/vThunder devices'
|
||||
'a10_service_group:(E) Manage A10 Networks AX/SoftAX/Thunder/vThunder devices'
|
||||
'a10_virtual_server:(E) Manage A10 Networks AX/SoftAX/Thunder/vThunder devices'
|
||||
'accelerate:Enable accelerated mode on remote node'
|
||||
'acl:Sets and retrieves file ACL information.'
|
||||
'add_host:add a host (and alternatively a group) to the ansible-playbook in-memory inventory'
|
||||
'airbrake_deployment:(E) Notify airbrake about app deployments'
|
||||
'alternatives:(E) Manages alternative programs for common commands'
|
||||
'apache2_module:enables/disables a module of the Apache2 webserver'
|
||||
'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:(E) Schedule the execution of a command or script file via the at command.'
|
||||
'authorized_key:Adds or removes an SSH authorized key'
|
||||
'azure:create or terminate a virtual machine in azure'
|
||||
'bigip_facts:(E) Collect facts from F5 BIG-IP devices'
|
||||
'bigip_monitor_http:(E) Manages F5 BIG-IP LTM http monitors'
|
||||
'bigip_monitor_tcp:(E) Manages F5 BIG-IP LTM tcp monitors'
|
||||
'bigip_node:(E) Manages F5 BIG-IP LTM nodes'
|
||||
'bigip_pool:(E) Manages F5 BIG-IP LTM pools'
|
||||
'bigip_pool_member:(E) Manages F5 BIG-IP LTM pool members'
|
||||
'bigpanda:(E) Notify BigPanda about deployments'
|
||||
'boundary_meter:(E) Manage boundary meters'
|
||||
'bower:(E) Manage bower packages with bower'
|
||||
'bzr:(E) Deploy software (or files) from bzr branches'
|
||||
'campfire:(E) Send a message to Campfire'
|
||||
'capabilities:(E) Manage Linux capabilities'
|
||||
'cloudformation:create a AWS CloudFormation stack'
|
||||
'command:Executes a command on a remote node'
|
||||
'composer:(E) Dependency Manager for PHP'
|
||||
'copy:Copies files to remote locations.'
|
||||
'cpanm:(E) Manages Perl library dependencies.'
|
||||
'cron:Manage cron.d and crontab entries.'
|
||||
'crypttab:(E) Encrypted Linux block devices'
|
||||
'datadog_event:(E) Posts events to DataDog service'
|
||||
'debconf:(E) Configure a .deb package'
|
||||
'debug:Print statements during execution'
|
||||
'digital_ocean:Create/delete a droplet/SSH_key in DigitalOcean'
|
||||
'digital_ocean_domain:Create/delete a DNS record in DigitalOcean'
|
||||
'digital_ocean_sshkey:Create/delete an SSH key in DigitalOcean'
|
||||
'django_manage:Manages a Django application.'
|
||||
'dnf:(E) Manages packages with the I(dnf) package manager'
|
||||
'dnsimple:(E) Interface with dnsimple.com (a DNS hosting service).'
|
||||
'dnsmadeeasy:(E) Interface with dnsmadeeasy.com (a DNS hosting service).'
|
||||
'docker:manage docker containers'
|
||||
'docker_image (D):manage docker images'
|
||||
'easy_install:Installs Python libraries'
|
||||
'ec2:create, terminate, start or stop an instance in ec2'
|
||||
'ec2_ami:create or destroy an image in ec2'
|
||||
'ec2_ami_search:Retrieve AWS AMI information for a given operating system.'
|
||||
'ec2_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_lb:Creates or destroys Amazon ELB.'
|
||||
'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_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_vpc:configure AWS virtual private clouds'
|
||||
'ejabberd_user:(E) Manages users for ejabberd servers'
|
||||
'elasticache:Manage cache clusters in Amazon Elasticache.'
|
||||
'facter:(E) Runs the discovery program I(facter) on the remote system'
|
||||
'fail:Fail with custom message'
|
||||
'fetch:Fetches a file from remote nodes'
|
||||
'file:Sets attributes of files'
|
||||
'filesystem:(E) Makes file system on block device'
|
||||
'fireball:Enable fireball mode on remote node'
|
||||
'firewalld:(E) Manage arbitrary ports/services with firewalld'
|
||||
'flowdock:(E) Send a message to a flowdock'
|
||||
'gc_storage:This module manages objects/buckets in Google Cloud Storage.'
|
||||
'gce:create or terminate GCE instances'
|
||||
'gce_img:(E) utilize GCE image resources'
|
||||
'gce_lb:create/destroy GCE load-balancer resources'
|
||||
'gce_net:create/destroy GCE networks and firewall rules'
|
||||
'gce_pd:utilize GCE persistent disk resources'
|
||||
'gem:Manage Ruby gems'
|
||||
'get_url:Downloads files from HTTP, HTTPS, or FTP to node'
|
||||
'getent:(E) a wrapper to the unix getent utility'
|
||||
'git:Deploy software (or files) from git checkouts'
|
||||
'github_hooks:(E) Manages github service hooks.'
|
||||
'glance_image:Add/Delete images from glance'
|
||||
'gluster_volume:(E) Manage GlusterFS volumes'
|
||||
'group:Add or remove groups'
|
||||
'group_by:Create Ansible groups based on facts'
|
||||
'grove:(E) Sends a notification to a grove.io channel'
|
||||
'haproxy:(E) An Ansible module to handle states enable/disable server and set weight to backend host in haproxy using socket commands.'
|
||||
'hg:Manages Mercurial (hg) repositories.'
|
||||
'hipchat:(E) Send a message to hipchat'
|
||||
'homebrew:(E) Package manager for Homebrew'
|
||||
'homebrew_cask:(E) Install/uninstall homebrew casks.'
|
||||
'homebrew_tap:(E) Tap a Homebrew repository.'
|
||||
'hostname:Manage hostname'
|
||||
'htpasswd:manage user files for basic authentication'
|
||||
'include_vars:Load variables from files, dynamically within a task.'
|
||||
'ini_file:Tweak settings in INI files'
|
||||
'irc:(E) Send a message to an IRC channel'
|
||||
'jabber:(E) Send a message to jabber user or chat room'
|
||||
'jboss:(E) deploy applications to JBoss'
|
||||
'jira:(E) create and modify issues in a JIRA instance'
|
||||
'kernel_blacklist:(E) Blacklist kernel modules'
|
||||
'keystone_user:Manage OpenStack Identity (keystone) users, tenants and roles'
|
||||
'layman:(E) Manage Gentoo overlays'
|
||||
'librato_annotation:(E) create an annotation in librato'
|
||||
'lineinfile:Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression.'
|
||||
'linode:create / delete / stop / restart an instance in Linode Public Cloud'
|
||||
'lldp:(E) get details reported by lldp'
|
||||
'locale_gen:(E) Creates or removes locales.'
|
||||
'logentries:(E) Module for tracking logs via logentries.com'
|
||||
'lvg:(E) Configure LVM volume groups'
|
||||
'lvol:(E) Configure LVM logical volumes'
|
||||
'macports:(E) Package manager for MacPorts'
|
||||
'mail:(E) Send an email'
|
||||
'modprobe:(E) Add or remove kernel modules'
|
||||
'mongodb_user:(E) Adds or removes a user from a MongoDB database.'
|
||||
'monit:(E) Manage the state of a program monitored via Monit'
|
||||
'mount:Control active and configured mount points'
|
||||
'mqtt:(E) Publish a message on an MQTT topic for the IoT'
|
||||
'mysql_db:Add or remove MySQL databases from a remote host.'
|
||||
'mysql_replication:(E) Manage MySQL replication'
|
||||
'mysql_user:Adds or removes a user from a MySQL database.'
|
||||
'mysql_variables:Manage MySQL global variables'
|
||||
'nagios:(E) Perform common tasks in Nagios related to downtime and notifications.'
|
||||
'netscaler:(E) Manages Citrix NetScaler entities'
|
||||
'newrelic_deployment:(E) Notify newrelic about app deployments'
|
||||
'nexmo:(E) Send a SMS via nexmo'
|
||||
'nova_compute:Create/Delete VMs from OpenStack'
|
||||
'nova_keypair:Add/Delete key pair from nova'
|
||||
'npm:(E) Manage node.js packages with npm'
|
||||
'ohai:(E) Returns inventory data from I(Ohai)'
|
||||
'open_iscsi:(E) Manage iscsi targets with open-iscsi'
|
||||
'openbsd_pkg:(E) Manage packages on OpenBSD.'
|
||||
'openvswitch_bridge:(E) Manage Open vSwitch bridges'
|
||||
'openvswitch_port:(E) Manage Open vSwitch ports'
|
||||
'opkg:(E) Package manager for OpenWrt'
|
||||
'osx_say:(E) Makes an OSX computer to speak.'
|
||||
'ovirt:(E) oVirt/RHEV platform management'
|
||||
'pacman:(E) Manage packages with I(pacman)'
|
||||
'pagerduty:(E) Create PagerDuty maintenance windows'
|
||||
'patch:(E) Apply patch files using the GNU patch tool.'
|
||||
'pause:Pause playbook execution'
|
||||
'ping:Try to connect to host and return C(pong) on success.'
|
||||
'pingdom:(E) Pause/unpause Pingdom alerts'
|
||||
'pip:Manages Python library dependencies.'
|
||||
'pkg5:(E) Manages packages with the Solaris 11 Image Packaging System'
|
||||
'pkg5_publisher:(E) Manages Solaris 11 Image Packaging System publishers'
|
||||
'pkgin:(E) Package manager for SmartOS'
|
||||
'pkgng:(E) Package manager for FreeBSD >= 9.0'
|
||||
'pkgutil:(E) Manage CSW-Packages on Solaris'
|
||||
'portage:(E) Package manager for Gentoo'
|
||||
'portinstall:(E) Installing packages from FreeBSD’s ports system'
|
||||
'postgresql_db:Add or remove PostgreSQL databases from a remote host.'
|
||||
'postgresql_lang:(E) Adds, removes or changes procedural languages with a PostgreSQL database.'
|
||||
'postgresql_privs:Grant or revoke privileges on PostgreSQL database objects.'
|
||||
'postgresql_user:Adds or removes a users (roles) from a PostgreSQL database.'
|
||||
'quantum_floating_ip:Add/Remove floating IP from an instance'
|
||||
'quantum_floating_ip_associate:Associate or disassociate a particular floating IP with an instance'
|
||||
'quantum_network:Creates/Removes networks from OpenStack'
|
||||
'quantum_router:Create or Remove router from openstack'
|
||||
'quantum_router_gateway:set/unset a gateway interface for the router with the specified external network'
|
||||
'quantum_router_interface:Attach/Dettach a subnet’s interface to a router'
|
||||
'quantum_subnet:Add/remove subnet from a network'
|
||||
'rabbitmq_parameter:(E) Adds or removes parameters to RabbitMQ'
|
||||
'rabbitmq_plugin:(E) Adds or removes plugins to RabbitMQ'
|
||||
'rabbitmq_policy:(E) Manage the state of policies in RabbitMQ.'
|
||||
'rabbitmq_user:(E) Adds or removes users to RabbitMQ'
|
||||
'rabbitmq_vhost:(E) Manage the state of a virtual host in RabbitMQ'
|
||||
'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_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_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 C(subscription-manager) command'
|
||||
'redis:(E) Various redis commands, slave and flush'
|
||||
'replace:Replace all instances of a particular string in a file using a back-referenced regular expression.'
|
||||
'rhn_channel:Adds or removes Red Hat software channels'
|
||||
'rhn_register:Manage Red Hat Network registration using the C(rhnreg_ks) command'
|
||||
'riak:(E) This module handles some common Riak operations'
|
||||
'rollbar_deployment:(E) Notify Rollbar about app deployments'
|
||||
'route53:add or delete entries in Amazons Route53 DNS service'
|
||||
'rpm_key:Adds or removes a gpg key from the rpm db'
|
||||
's3:S3 module putting a file into S3.'
|
||||
'script:Runs a local script on a remote node after transferring it'
|
||||
'seboolean:Toggles SELinux booleans.'
|
||||
'selinux:Change policy and state of SELinux'
|
||||
'service:Manage services.'
|
||||
'set_fact:Set host facts from a task'
|
||||
'setup:Gathers facts about remote hosts'
|
||||
'shell:Execute commands in nodes.'
|
||||
'slack:(E) Send Slack notifications'
|
||||
'slurp:Slurps a file from remote nodes'
|
||||
'snmp_facts:(E) Retrieve facts for a device using SNMP.'
|
||||
'sns:(E) Send Amazon Simple Notification Service (SNS) messages'
|
||||
'stackdriver:(E) Send code deploy and annotation events to stackdriver'
|
||||
'stat:retrieve file or file system status'
|
||||
'subversion:Deploys a subversion repository.'
|
||||
'supervisorctl:Manage the state of a program or group of programs running via supervisord'
|
||||
'svc:(E) Manage daemontools services.'
|
||||
'svr4pkg:(E) Manage Solaris SVR4 packages'
|
||||
'swdepot:(E) Manage packages with swdepot package manager (HP-UX)'
|
||||
'synchronize:Uses rsync to make synchronizing file paths in your playbooks quick and easy.'
|
||||
'sysctl:Manage entries in sysctl.conf.'
|
||||
'template:Templates a file out to a remote server.'
|
||||
'twilio:(E) Sends a text message to a mobile phone through Twilio.'
|
||||
'typetalk:(E) Send a message to typetalk'
|
||||
'ufw:(E) Manage firewall with UFW'
|
||||
'unarchive:Copies an archive to a remote location and unpack it'
|
||||
'uptimerobot:(E) Pause and start Uptime Robot monitoring'
|
||||
'uri:Interacts with webservices'
|
||||
'urpmi:(E) Urpmi manager'
|
||||
'user:Manage user accounts'
|
||||
'virt:(E) Manages virtual machines supported by libvirt'
|
||||
'vsphere_guest:Create/delete/manage a guest VM through VMware vSphere.'
|
||||
'wait_for:Waits for a condition before continuing.'
|
||||
'win_chocolatey:(E) Installs packages using chocolatey'
|
||||
'win_feature:Installs and uninstalls Windows Features'
|
||||
'win_get_url:Fetches a file from a given URL'
|
||||
'win_group:Add and remove local groups'
|
||||
'win_msi:Installs and uninstalls Windows MSI files'
|
||||
'win_ping:A windows version of the classic ping module.'
|
||||
'win_service:Manages Windows services'
|
||||
'win_stat:returns information about a Windows file'
|
||||
'win_updates:(E) Lists / Installs windows updates'
|
||||
'win_user:Manages local Windows user accounts'
|
||||
'xattr:set/retrieve extended attributes'
|
||||
'yum:Manages packages with the I(yum) package manager'
|
||||
'zabbix_group:(E) Add or remove a host group to Zabbix.'
|
||||
'zabbix_maintenance:(E) Create Zabbix maintenance windows'
|
||||
'zfs:(E) Manage zfs'
|
||||
'zypper:(E) Manage packages on SUSE and openSUSE'
|
||||
'zypper_repository:(E) Add and remove Zypper repositories'
|
||||
)
|
||||
|
||||
|
||||
_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)"\
|
||||
"(-k --ask-pass)"{-k,--ask-pass}"[ask for SSH password]"\
|
||||
'--ask-su-pass[ask for su password]'\
|
||||
"(-K --ask-sudo-pass)"{-K,--ask-sudo-pass}"[ask for sudo password]"\
|
||||
'--ask-vault-pass[ask for vault password]'\
|
||||
"(-B --background)"{-B,--background}"[DURATION run asynchronously for DURATION (s)]:duration:(DURATION)"\
|
||||
"(-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)"\
|
||||
"(-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 -/"\
|
||||
"(-o --one-line)"{-o,--one-line}"[condense output]"\
|
||||
"(-P --poll)"{-P,--poll}"[POLL_INTERVAL set the poll interval (s) if using -B (default=15)]:poll interval:(15)"\
|
||||
"--private-key[PRIVATE_KEY_FILE use this file to authenticate the connection]:private key file:_files"\
|
||||
"(-S --su)"{-S,--su}"[run operations with su]"\
|
||||
"(-R --su-user)"{-R,--su-user}"[SU_USER run operations with su as this user (default=root)]:su user:(root)"\
|
||||
"(-s --sudo)"{-s,--sudo}"[run operations with sudo (nopasswd)]"\
|
||||
"(-U --sudo-user)"{-U,--sudo-user}"[SUDO_USER desired sudo user (default=root)]:su user:(root)"\
|
||||
"(-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
|
111
.zprezto/modules/completion/external/src/_ansible-galaxy
vendored
Normal file
111
.zprezto/modules/completion/external/src/_ansible-galaxy
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
#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 v1.8.4 (http://ansible.org)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Romain Bossart (https://github.com/bosr)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:(init info install list remove)" \
|
||||
"*::option:->option"
|
||||
|
||||
case $state in
|
||||
option)
|
||||
case $line[1] in
|
||||
init)
|
||||
_arguments \
|
||||
"(-h --help)"{-h,--help}"[help message]" \
|
||||
"(-p --init-path)"{-p,--init-path}"[INIT_PATH path in which the skeleton role will be created (default=./)]:init path:(./)" \
|
||||
"(--offline)--offline[Don't query the galaxy API when creating roles]" \
|
||||
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
|
||||
"(-f --force)"{-f,--force}"[Force overwriting an existing role]" \
|
||||
":role name:(ROLE)"
|
||||
;;
|
||||
info)
|
||||
_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 -/" \
|
||||
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
|
||||
":role name:(ROLE,version)"
|
||||
;;
|
||||
install)
|
||||
_arguments \
|
||||
"(-h --help)"{-h,--help}"[help message]" \
|
||||
"(-i --ignore-errors)"{-i,--ignore-errors}"[Ignore errors and continue with the next specified role]" \
|
||||
"(-n --no-deps)"{-n,--no-deps}"[Don't download roles listed as dependencies]" \
|
||||
"(-r --role-file)"{-r,--role-file}"[ROLE_FILE A file containing a list of roles to be imported]:role file:_files" \
|
||||
"(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
|
||||
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
|
||||
"(-f --force)"{-f,--force}"[Force overwriting an existing role]" \
|
||||
":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 -/" \
|
||||
":role name:(ROLE)"
|
||||
;;
|
||||
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 -/" \
|
||||
"*:role name:(ROLE)"
|
||||
;;
|
||||
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
|
177
.zprezto/modules/completion/external/src/_ansible-playbook
vendored
Normal file
177
.zprezto/modules/completion/external/src/_ansible-playbook
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
#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 v1.8.4 (http://ansible.org)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Romain Bossart (https://github.com/bosr)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
#
|
||||
# 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=/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'"\
|
||||
"(-k --ask-pass)"{-k,--ask-pass}"[ask for SSH password]"\
|
||||
'--ask-su-pass[ask for su password]'\
|
||||
"(-K --ask-sudo-pass)"{-K,--ask-sudo-pass}"[ask for sudo password]"\
|
||||
'--ask-vault-pass[ask for vault password]'\
|
||||
"(-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]'\
|
||||
"(-M --module-path)"{-M,--module-path}"[MODULE_PATH specify path to module library (default=None)]:module path:_files -/"\
|
||||
"--private-key[PRIVATE_KEY_FILE use this file to authenticate the connection]:private key file:_files"\
|
||||
"--skip-tags[SKIP_TAGS only run plays and tasks whose tags do not match these values]:skip tags:(SKIP_TAGS)"\
|
||||
"--start-at-task[START_AT start the playbook at the task matching this name]:name:(TASK_NAME)"\
|
||||
'--step[one-step-at-a-time: confirm each task before running]'\
|
||||
"(-S --su)"{-S,--su}"[run operations with su]"\
|
||||
"(-R --su-user)"{-R,--su-user}"[SU_USER run operations with su as this user (default=root)]:su user:(root)"\
|
||||
"(-s --sudo)"{-s,--sudo}"[run operations with sudo (nopasswd)]"\
|
||||
"(-U --sudo-user)"{-U,--sudo-user}"[SUDO_USER desired sudo user (default=root)]:su user:(root)"\
|
||||
'--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
|
53
.zprezto/modules/completion/external/src/_artisan
vendored
Normal file
53
.zprezto/modules/completion/external/src/_artisan
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
#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)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_artisan_get_command_list () {
|
||||
php artisan --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }'
|
||||
}
|
||||
|
||||
_artisan () {
|
||||
if [ -f artisan ]; then
|
||||
compadd `_artisan_get_command_list`
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _artisan php artisan
|
||||
compdef _artisan artisan
|
50
.zprezto/modules/completion/external/src/_atach
vendored
Normal file
50
.zprezto/modules/completion/external/src/_atach
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
#compdef atach
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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
|
||||
|
87
.zprezto/modules/completion/external/src/_boot2docker
vendored
Normal file
87
.zprezto/modules/completion/external/src/_boot2docker
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
#compdef boot2docker
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for boot2docker (https://github.com/boot2docker/boot2docker-cli).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * hhatto (https://github.com/hhatto)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_boot2docker() {
|
||||
local context state line
|
||||
|
||||
_arguments -C \
|
||||
--basevmdk'[Path to VMDK to use as base for persistent partition]:vmdk:' \
|
||||
--dhcp'[enable VirtualBox host-only network DHCP. default=true]' \
|
||||
--dhcpip'[VirtualBox host-only network DHCP server address. default=192.168.59.99]' \
|
||||
'(-s --disksize)'{-s,--disksize}'[boot2docker disk image size (in MB). default=20000.]:disksize:' \
|
||||
--dockerport'[host Docker port (forward to port 2375 in VM).]:PORT:' \
|
||||
--hostip'[VirtualBox host-only network IP address.]:IP:' \
|
||||
--iso'[path to boot2docker ISO image.]:FILE:_files' \
|
||||
--lowerip'[VirtualBox host-only network DHCP lower bound.]:IP:' \
|
||||
'(-m --memory)'{-m,--memory}'[virtual machine memory size (in MB). default=2048]' \
|
||||
--netmask'[VirtualBox host-only network mask.]' \
|
||||
--serial'[try serial console to get IP address (experimental) default=false]' \
|
||||
--serialfile'[path to the serial socket/pipe.]:FILE:_files' \
|
||||
--ssh'[path to SSH client utility. default="ssh"]:SSH:' \
|
||||
--ssh-keygen'[path to ssh-keygen utility. default="ssh-keygen"]:KEYGEN:' \
|
||||
--sshkey'[path to SSH key to use.]:FILE:_files' \
|
||||
--sshport'[host SSH port (forward to port 22 in VM). default=2022]:PORT:' \
|
||||
--upperip'[VirtualBox host-only network DHCP upper bound. default=192.168.59.254]:IP:' \
|
||||
--vbm'[path to VirtualBox management utility. default="VBoxManage"]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[display verbose command invocations. default=false]' \
|
||||
--vm'[virtual machine name. default="boot2docker-vm"]' \
|
||||
'*::boot2docker commands:_boot2docker_command'
|
||||
}
|
||||
|
||||
(( $+functions[_boot2docker_command] )) ||
|
||||
_boot2docker_command() {
|
||||
local _boot2docker_cmds
|
||||
|
||||
_boot2docker_cmds=(
|
||||
'init:Create a new boot2docker VM.' \
|
||||
'up:Start VM from any states.' \
|
||||
'start:Start VM from any states.' \
|
||||
'boot:Start VM from any states.' \
|
||||
'ssh:Login to VM via SSH.' \
|
||||
'save:Suspend VM and save state to disk.' \
|
||||
'suspend:Suspend VM and save state to disk.' \
|
||||
"down:Gracefully shutdown the VM." \
|
||||
"stop:Gracefully shutdown the VM." \
|
||||
"halt:Gracefully shutdown the VM." \
|
||||
"restart:Gracefully reboot the VM." \
|
||||
"poweroff:Forcefully power off the VM (might corrupt disk image)." \
|
||||
"reset:Forcefully power cycle the VM (might corrupt disk image)." \
|
||||
"delete:Delete boot2docker VM and its disk image." \
|
||||
"destroy:Delete boot2docker VM and its disk image." \
|
||||
"config:Show selected profile file settings." \
|
||||
"cfg:Show selected profile file settings." \
|
||||
"info:Display detailed information of VM." \
|
||||
"ip:Display the IP address of the VM's Host-only network." \
|
||||
"status:Display current state of VM." \
|
||||
"download:Download boot2docker ISO image." \
|
||||
"upgrade:Upgrade the boot2docker ISO image (if vm is running it will be stopped and started)." \
|
||||
"version:Display version information."
|
||||
)
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands 'boot2docker subcommand' _boot2docker_cmds
|
||||
fi
|
||||
}
|
||||
|
||||
_boot2docker "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
147
.zprezto/modules/completion/external/src/_bower
vendored
Normal file
147
.zprezto/modules/completion/external/src/_bower
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
#compdef bower
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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
|
52
.zprezto/modules/completion/external/src/_bpython
vendored
Normal file
52
.zprezto/modules/completion/external/src/_bpython
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
#compdef bpython bpython2
|
||||
# ------------------------------------------------------------------------------
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for bpython (http://bpython-interpreter.org/).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments -A "-*" \
|
||||
'(-h --help)'{-h,--help}'[Show help message]' \
|
||||
'(-i --interactive)'{-i,--interactive}'[Drop to bpython shell after running file instead of exiting]' \
|
||||
'(-q --quiet)'{-q,--quiet}"[Don't flush the output to stdout]" \
|
||||
'(-V --version)'{-V,--version}'[Print version and exit]' \
|
||||
'--config[Use CONFIG instead of default config file]:Config file:_files' \
|
||||
'*: :_files'
|
||||
|
||||
# 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
|
215
.zprezto/modules/completion/external/src/_brew
vendored
Normal file
215
.zprezto/modules/completion/external/src/_brew
vendored
Normal file
@@ -0,0 +1,215 @@
|
||||
#compdef brew
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for brew (https://github.com/mxcl/homebrew).
|
||||
#
|
||||
# Source: https://github.com/mxcl/homebrew/blob/master/Library/Contributions/brew_zsh_completion.zsh
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * kulakowski (https://github.com/kulakowski)
|
||||
# * Gabe Berke-Williams (https://github.com/gabebw)
|
||||
# * James Conroy-Finn (https://github.com/jcf)
|
||||
# * Daniel Schauenberg (https://github.com/mrtazz)
|
||||
# * Adam Vandenberg (https://github.com/adamv)
|
||||
# * Erik Kastner (https://github.com/kastner)
|
||||
# * Katsunori Kanda (https://github.com/potix2)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_brew_all_formulae() {
|
||||
formulae=(${(f)"$(_call_program formulae brew search 2>/dev/null)"})
|
||||
}
|
||||
|
||||
_brew_installed_formulae() {
|
||||
installed_formulae=(${(f)"$(_call_program formulae brew list 2>/dev/null)"})
|
||||
}
|
||||
|
||||
_brew_installed_taps() {
|
||||
installed_taps=(${(f)"$(_call_program formulae brew tap 2>/dev/null)"})
|
||||
}
|
||||
|
||||
_brew_outdated_formulae() {
|
||||
outdated_formulae=(${(f)"$(_call_program formulae brew outdated 2>/dev/null)"})
|
||||
}
|
||||
|
||||
_brew_cask() {
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
"alfred:displays note about new built-in alfred support"
|
||||
"audit:verifies installability of Casks"
|
||||
"cat:dump raw source of the given Cask to the standard output"
|
||||
"cleanup:cleans up cached downloads and tracker symlinks"
|
||||
"create:creates the given Cask and opens it in an editor"
|
||||
"doctor:checks for configuration issues"
|
||||
"edit:edits the given Cask"
|
||||
"fetch:downloads Cask resources to local cache"
|
||||
"home:opens the homepage of the given Cask"
|
||||
"info:displays information about the given Cask"
|
||||
"install:installs the given Cask"
|
||||
"list:with no args, lists installed Casks; given installed Casks, lists staged files"
|
||||
"search:searches all known Casks"
|
||||
"uninstall:uninstalls the given Cask"
|
||||
"update:a synonym for 'brew update'"
|
||||
"zap:zaps all files associated with the given Cask"
|
||||
)
|
||||
|
||||
if (( CURRENT == 2 )); then
|
||||
_describe -t commands "brew cask subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
||||
local expl
|
||||
local -a all_cask_formulae installed_cask_formulae
|
||||
case "$words[2]" in
|
||||
audit|cat|edit|info|install|search)
|
||||
all_cask_formulae=( $(brew cask search 2>/dev/null) )
|
||||
_wanted all_cask_formulae expl 'all cask formulae' compadd -a all_cask_formulae ;;
|
||||
uninstall|zap)
|
||||
installed_cask_formulae=( $(brew cask list 2>/dev/null) )
|
||||
_wanted installed_cask_formulae expl 'installed cask formulae' compadd -a installed_cask_formulae ;;
|
||||
*) ;;
|
||||
esac
|
||||
}
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'audit:check formulae for Homebrew coding style'
|
||||
'cat:display formula file for a formula'
|
||||
'cleanup:uninstall unused and old versions of packages'
|
||||
'create:create a new formula'
|
||||
'deps:list dependencies and dependants of a formula'
|
||||
'doctor:audits your installation for common issues'
|
||||
'diy:automatically determine the installation prefix for non-Homebrew software'
|
||||
'edit:edit a formula'
|
||||
'fetch:download the source packages for the given formulae'
|
||||
'home:visit the homepage of a formula or the brew project'
|
||||
'info:information about a formula'
|
||||
'install:install a formula'
|
||||
'link:link a formula'
|
||||
'list:list files in a formula or not-installed formulae'
|
||||
'log:git commit log for a formula'
|
||||
'missing:check all installed formulae for missing dependencies.'
|
||||
'options:display install options specific to formula'
|
||||
'outdated:list formulae for which a newer version is available'
|
||||
'prune:remove dead links'
|
||||
'reinstall:install a formula anew; re-using its current options'
|
||||
'remove:remove a formula'
|
||||
'search:search for a formula (/regex/ or string)'
|
||||
'server:start a local web app that lets you browse formulae (requires Sinatra)'
|
||||
'services:manage background services via launchctl'
|
||||
'tap:tap a new formula repository from GitHub, or list existing taps'
|
||||
'test:a few formulae provide a test method'
|
||||
'unlink:unlink a formula'
|
||||
'untap:remove a tapped repository'
|
||||
'unpin:unpin specified formulae'
|
||||
'update:freshen up links'
|
||||
'upgrade:upgrade outdated formulae'
|
||||
'uses:show formulae which depend on a formula'
|
||||
'versions:list previous versions of formulae'
|
||||
)
|
||||
|
||||
local expl
|
||||
local -a formulae installed_formulae installed_taps outdated_formulae
|
||||
|
||||
_arguments \
|
||||
'(-v)-v[verbose]' \
|
||||
'(--cellar)--cellar[brew cellar]' \
|
||||
'(--config)--config[brew configuration]' \
|
||||
'(--env)--env[brew environment]' \
|
||||
'(--repository)--repository[brew repository]' \
|
||||
'(--version)--version[version information]' \
|
||||
'(--prefix)--prefix[where brew lives on this system]' \
|
||||
'(--cache)--cache[brew cache]' \
|
||||
'*:: :->subcmds' && return 0
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "brew subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
||||
case "$words[1]" in
|
||||
search|-S)
|
||||
_arguments \
|
||||
'(--debian)--debian[search the Debian repository]' \
|
||||
'(--fedora)--fedora[search the Fedora repository]' \
|
||||
'(--fink)--fink[search the Fink repository]' \
|
||||
'(--macports)--macports[search the Macports repository]' \
|
||||
'(--opensuse)--opensuse[search the OpenSuse repository]' \
|
||||
'(--ubuntu)--ubuntu[search the Ubuntu repository]' \
|
||||
'1: :->forms' && return 0
|
||||
|
||||
if [[ "$state" == forms ]]; then
|
||||
_brew_all_formulae
|
||||
_wanted formulae expl 'all formulae' compadd -a formulae
|
||||
fi ;;
|
||||
link|ln)
|
||||
_arguments \
|
||||
'(-n --dry-run)'{-n,--dry-run}'[All files would be linked or be deleted will be listed, but no real linking or deletion will be done]' \
|
||||
'(--force)--force[Allow keg-only formulae to be linked]' \
|
||||
'(--overwrite)--overwrite[Also delete files which already exist in the prefix while linking]' \
|
||||
'1: :->forms' && return 0
|
||||
|
||||
if [[ "$state" == forms ]]; then
|
||||
_brew_installed_formulae
|
||||
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
|
||||
fi ;;
|
||||
list|ls)
|
||||
_arguments \
|
||||
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
|
||||
'(--pinned)--pinned[list all versions of pinned formulae]' \
|
||||
'(--versions)--versions[list all installed versions of a formula]' \
|
||||
'1: :->forms' && return 0
|
||||
|
||||
if [[ "$state" == forms ]]; then
|
||||
_brew_installed_formulae
|
||||
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
|
||||
fi ;;
|
||||
install|reinstall)
|
||||
_arguments \
|
||||
'(--devel)--devel[install the development version]' \
|
||||
'(--env=std)--env=std[use the standard build environment instead of superenv]' \
|
||||
'(--env=super)--env=super[use superenv even if the formula specifies the standard build environment]' \
|
||||
'(--fresh)--fresh[the installation process will not re-use any options from previous installs]' \
|
||||
'(--ignore-dependencies)--ignore-dependencies[skip any dependencies installation]' \
|
||||
'(--use-clang)--use-clang[attempt to compile using clang]' \
|
||||
'(--use-gcc)--use-gcc[attempt to compile using GCC]' \
|
||||
'(--use-llvm)--use-llvm[attempt to compile using the LLVM front-end to GCC]' \
|
||||
'1: :->forms' && return 0
|
||||
|
||||
if [[ "$state" == forms ]]; then
|
||||
_brew_all_formulae
|
||||
_wanted formulae expl 'all formulae' compadd -a formulae
|
||||
fi ;;
|
||||
audit|home|homepage|log|info|abv|uses|cat|deps|edit|options)
|
||||
_brew_all_formulae
|
||||
_wanted formulae expl 'all formulae' compadd -a formulae ;;
|
||||
remove|rm|uninstall|unlink|cleanup|pin|unpin|test)
|
||||
_brew_installed_formulae
|
||||
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
|
||||
tap)
|
||||
_arguments \
|
||||
'(--repair)--repair[repair all tap formula, i.e. symlinks and dead formula]' && return 0 ;;
|
||||
upgrade)
|
||||
_brew_outdated_formulae
|
||||
_wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;
|
||||
untap)
|
||||
_brew_installed_taps
|
||||
_wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
|
||||
cask)
|
||||
_brew_cask ;;
|
||||
esac
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
|
92
.zprezto/modules/completion/external/src/_bundle
vendored
Normal file
92
.zprezto/modules/completion/external/src/_bundle
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
#compdef bundle
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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)
|
||||
_arguments \
|
||||
'(--no-color)--no-color[disable colorization in output]' \
|
||||
'(--local)--local[do not attempt to connect to rubygems.org]' \
|
||||
'(--quiet)--quiet[only output warnings and errors]' \
|
||||
'(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
|
||||
'(--system)--system[install to the system location]' \
|
||||
'(--deployment)--deployment[install using defaults tuned for deployment environments]' \
|
||||
'(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
|
||||
'(--path)--path=-[specify a different path than the system default]:path:_files' \
|
||||
'(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
|
||||
'(--without)--without=-[exclude gems that are part of the specified named group]:groups'
|
||||
ret=0
|
||||
;;
|
||||
exec)
|
||||
_normal && ret=0
|
||||
;;
|
||||
(open|show)
|
||||
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
|
||||
if [[ $_gems != "" ]]; then
|
||||
_values 'gems' $_gems && ret=0
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
_opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
|
||||
_opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
|
||||
if [[ $_opts != "" ]]; then
|
||||
_values 'options' $_opts && ret=0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
||||
# 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
|
648
.zprezto/modules/completion/external/src/_cabal
vendored
Normal file
648
.zprezto/modules/completion/external/src/_cabal
vendored
Normal file
@@ -0,0 +1,648 @@
|
||||
#compdef cabal
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for cabal-install (http://hackage.haskell.org/trac/hackage/wiki/CabalInstall)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Gérard Milmeister
|
||||
# * Matvey Aksenov <matvey.aksenov@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local WORDS
|
||||
|
||||
_cabal ()
|
||||
{
|
||||
WORDS=()
|
||||
for w in $words[1,(($CURRENT - 1))]; do
|
||||
if [[ $w != -* ]]; then WORDS+=$w; fi
|
||||
done
|
||||
|
||||
if (( $#WORDS == 1 )); then
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-V,--version}'[print version information]' \
|
||||
'--numeric-version[print just the version number]' \
|
||||
'--config-file=[set an alternate location for the config file]:config file:_files' \
|
||||
'--sandbox-config-file=[set an alternate location for the sandbox config file]:config file:_files' \
|
||||
'--require-sandbox[enable requiring the presence of a sandbox for sandbox-aware commands]' \
|
||||
'--no-require-sandbox[disable requiring the presence of a sandbox for sandbox-aware commands]' \
|
||||
'--ignore-sandbox[ignore any existing sandbox]' \
|
||||
'*::command:_cabal_command'
|
||||
else
|
||||
_arguments '*::command:_cabal_command'
|
||||
fi
|
||||
}
|
||||
|
||||
_cabal_command ()
|
||||
{
|
||||
local -a _cabal_cmds
|
||||
_cabal_cmds=(
|
||||
'install:installs a list of packages'
|
||||
'update:updates list of known packages'
|
||||
'list:list packages matching a search string'
|
||||
'info:display detailed information about a particular package'
|
||||
'fetch:downloads packages for later installation'
|
||||
'freeze:freeze dependencies'
|
||||
"get:get a package's source code"
|
||||
'check:check the package for common mistakes'
|
||||
'sdist:generate a source distribution file (.tar.gz)'
|
||||
'upload:uploads source packages to Hackage'
|
||||
'report:upload build reports to a remote server'
|
||||
'run:runs the compiled executable'
|
||||
'init:interactively create a .cabal file'
|
||||
'configure:prepare to build the package'
|
||||
'build:compile all targets or specific targets'
|
||||
'repl:open an interpreter session for the given target'
|
||||
'sandbox:create/modify/delete a sandbox'
|
||||
'haddock:generate Haddock HTML documentation'
|
||||
'exec:run a command with the cabal environment'
|
||||
'copy:copy the files into the install locations'
|
||||
'clean:clean up after a build'
|
||||
'hscolour:generate HsColour colourised code, in HTML format'
|
||||
'register:register this package with the compiler'
|
||||
'test:run the test suite, if any (configure with UserHooks)'
|
||||
'bench:run the benchmark, if any (configure with UserHooks)'
|
||||
'help:help about commands'
|
||||
)
|
||||
|
||||
local -a _cabal_programs
|
||||
_cabal_programs=()
|
||||
|
||||
programs=(alex ar c2hs cpphs ffihugs gcc ghc ghc-pkg greencard haddock
|
||||
happy hmake hpc hsc2hs hscolour hugs jhc ld lhc lhc-pkg nhc98 pkg-config
|
||||
ranlib strip tar uhc)
|
||||
|
||||
for program in $programs; do
|
||||
_cabal_programs+=(
|
||||
"--with-${program}=[give the path to ${program}]:file:_files"
|
||||
"--${program}-options=[give extra options to ${program}]"
|
||||
"--${program}-option=[give an extra option to ${program}]"
|
||||
)
|
||||
done
|
||||
|
||||
if (( CURRENT == 1 )) then
|
||||
_describe -t commands 'command' _cabal_cmds || compadd "$@"
|
||||
else
|
||||
local curcontext="$curcontext"
|
||||
cmd="${${_cabal_cmds[(r)$WORDS[2]:*]%%:*}}"
|
||||
if (( $#cmd )); then
|
||||
_call_function ret _cabal_$cmd
|
||||
else
|
||||
_message "unknown cabal command: $WORDS[2]"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
_cabal_bench ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
|
||||
'--benchmark-options=[give extra options to benchmark executables]' \
|
||||
'--benchmark-option=[give an extra option to benchmark executables (no need to quote options containing spaces)]' \
|
||||
{-j,--jobs=}'[run NUM jobs simultaneously]' \
|
||||
$_cabal_programs \
|
||||
"--only[don't reinstall add-source dependencies (sandbox-only)]"
|
||||
}
|
||||
|
||||
_cabal_build ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
|
||||
$_cabal_programs \
|
||||
{-j,--jobs=}'[run NUM jobs simultaneously]' \
|
||||
"--only[don't reinstall add-source dependencies (sandbox-only)]"
|
||||
}
|
||||
|
||||
_cabal_check ()
|
||||
{
|
||||
_arguments {-h,--help}'[show help]'
|
||||
}
|
||||
|
||||
_cabal_clean ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
|
||||
{-s,--save-configure}'[do not remove the configuration file]'
|
||||
}
|
||||
|
||||
_cabal_configure ()
|
||||
{
|
||||
local context state state_descr line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
|
||||
{-g,--ghc}'[compile with GHC]' \
|
||||
'--nhc98[compile with NHC]' \
|
||||
'--jhc[compile with JHC]' \
|
||||
'--lhc[compile with LHC]' \
|
||||
'--hugs[compile with Hugs]' \
|
||||
'--uhc[compile with UHC]' \
|
||||
'--haskell-suite[compile with a haskell-suite compiler]' \
|
||||
{-w,--with-compiler=}'[give the path to a particular compiler]:file:_files' \
|
||||
'--with-hc-pkg=[give the path to the package tool]:file:_files' \
|
||||
'--prefix=[take this prefix in preparation of installation]:directory:_files -/' \
|
||||
'--bindir=[installation directory for executables]:directory:_files -/' \
|
||||
'--libdir=[installation directory for libraries]:directory:_files -/' \
|
||||
'--libsubdir=[subdirectory of libdir in which libs are installed]:directory:_files -/' \
|
||||
'--libexecdir=[installation directory for program executables]:directory:_files -/' \
|
||||
'--datadir=[installation directory for read-only data]:directory:_files -/' \
|
||||
'--datasubdir=[subdirectory of datadir in which data files are installed]:directory:_files -/' \
|
||||
'--docdir=[installation directory for documentation]:directory:_files -/' \
|
||||
'--htmldir=[installation directory for HTML]:directory:_files -/' \
|
||||
'--haddockdir=[installation directory for haddock interfaces]:directory:_files -/' \
|
||||
'--sysconfdir=[installation directory for configuration files]:directory:_files -/' \
|
||||
{-b,--scratchdir=}'[directory to receive the built package]:directory:_files -/' \
|
||||
'--program-prefix=[prefix to be applied to installed executables]' \
|
||||
'--program-suffix=[suffix to be applied to installed executables]' \
|
||||
'--enable-library-vanilla[enable Vanilla libraries]' \
|
||||
'--disable-library-vanilla[disable Vanilla libraries]' \
|
||||
{-p,--enable-library-profiling}'[enable Library profiling]' \
|
||||
'--disable-library-profiling[disable Library profiling]' \
|
||||
'--enable-shared[enable Shared library]' \
|
||||
'--disable-shared[disable Shared library]' \
|
||||
'--enable-executable-dynamic[enable Executable dynamic linking]' \
|
||||
'--disable-executable-dynamic[disable Executable dynamic linking]' \
|
||||
'--enable-executable-profiling[enable Executable profiling]' \
|
||||
'--disable-executable-profiling[disable Executable profiling]' \
|
||||
{-O-,--enable-optimization=}'[build with optimization]:level:(0 1 2)' \
|
||||
'--disable-optimization[build without optimization]' \
|
||||
'--enable-library-for-ghci[enable compile library for use with GHCi]' \
|
||||
'--disable-library-for-ghci[disable compile library for use with GHCi]' \
|
||||
'--enable-split-objs[enable split library into smaller objects]' \
|
||||
'--disable-split-objs[disable split library into smaller objects]' \
|
||||
'--enable-executable-stripping[enable strip executables upon installation]' \
|
||||
'--disable-executable-stripping[disable strip executables upon installation]' \
|
||||
'--configure-option=[extra option for configure]' \
|
||||
'--user[enable doing a per-user installation]' \
|
||||
'--global[disable doing a per-user installation]' \
|
||||
'--package-db=[use a given package database]:: :->default-db-or-filepath' \
|
||||
{-f,--flags=}'[force values for the given flags]:flags:' \
|
||||
'--extra-include-dirs=[a list of directories to search for header files]:directory:_files -/' \
|
||||
'--extra-lib-dirs=[a list of directories to search for externallibraries]:directory:_files -/' \
|
||||
'--extra-prog-path=[A list of directories to search for required programs]:directory:_files -/' \
|
||||
'--enable-tests[enable dependency checking and compilation for test suites listed in the package description file]' \
|
||||
'--disable-tests[disable dependency checking and compilation for test suites listed in the package description file]' \
|
||||
'--enable-library-coverage[enable build library and test suites with, Haskell Program Coverage enabled. (GHC only)]' \
|
||||
'--disable-library-coverage[disable build library and test suites with, Haskell Program Coverage enabled. (GHC only)]' \
|
||||
'--enable-benchmarks[enable dependency checking and compilation, for benchmarks listed in the package]' \
|
||||
'--disable-benchmarks[disable dependency checking and compilation, for benchmarks listed in the package]' \
|
||||
$_cabal_programs \
|
||||
'--cabal-lib-version=[select which version of the Cabal lib to use]' \
|
||||
'--constraint=[a list of additional constraints on the dependencies]' \
|
||||
'--preference=[specify preferences on the version of a package]' \
|
||||
'--solver=[select dependency solver to use]:solver:(topdown modular choose)' \
|
||||
'--allow-newer=[ignore upper bounds in dependencies on some or all packages]'
|
||||
|
||||
case $state in
|
||||
(default-db-or-filepath)
|
||||
_alternative \
|
||||
':default db:(global user clear)' \
|
||||
':filepath:_files'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_cabal_copy ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated build]:directory:_files -/' \
|
||||
'--destdir=[directory to copy files to]:directory:_files -/'
|
||||
}
|
||||
|
||||
_cabal_exec ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)'
|
||||
}
|
||||
|
||||
_cabal_fetch ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--dependencies[resolve and fetch dependencies]' \
|
||||
'--no-dependencies[ignore dependencies]' \
|
||||
'--dry-run[do not install anything, only print what would be installed]' \
|
||||
'--solver=[select dependency solver to use]:solver:(topdown modular choose)]' \
|
||||
'--max-backjumps=[maximum number of backjumps allowed while solving dependencies]' \
|
||||
'--reorder-goals[try to reorder goals according to certain heuristics]' \
|
||||
'--shadow-installed-packages[if multiple package instances of the same version are installed, treat all but one as shadowed]' \
|
||||
'*:package:_cabal_list_packages'
|
||||
}
|
||||
|
||||
_cabal_freeze ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--dry-run[do not freeze anything, only print what would be frozen]' \
|
||||
'--solver=[select dependency solver to use]:solver:(topdown modular choose)]' \
|
||||
'--max-backjumps=[maximum number of backjumps allowed while solving dependencies]' \
|
||||
'--reorder-goals[try to reorder goals according to certain heuristics]' \
|
||||
'--shadow-installed-packages[if multiple package instances of the same version are installed, treat all but one as shadowed]'
|
||||
}
|
||||
|
||||
_cabal_get ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
{-d-,--destdir=}'[where to unpack the packages]:directory:_files -/' \
|
||||
{-s,--source-repository=}"[copy the package's source repository]" \
|
||||
'--pristine[unpack the original pristine tarball, rather than updating the .cabal file with the latest revision from the package archive.]' \
|
||||
'*:package:_cabal_list_packages'
|
||||
}
|
||||
|
||||
_cabal_haddock ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated files]:directory:_files -/' \
|
||||
'--keep-temp-files[keep temporary files]' \
|
||||
'--hoogle[generate a hoogle database]' \
|
||||
'--html[generate HTML documentation]' \
|
||||
'--html-location=[location of HTML documentation]:url:' \
|
||||
'--executables[run haddock for Executables targets]' \
|
||||
'--tests[run haddock for Test Suite targets]' \
|
||||
'--benchmarks[run haddock for Benchmark targets]' \
|
||||
'--all[run haddock for all targets]' \
|
||||
'--internal[run haddock for internal modules]' \
|
||||
'--css=[path to the haddock stylesheet]:file:_files' \
|
||||
'--hyperlink-source[hyperlink the documentation to the source code]' \
|
||||
'--hscolour-css=[path to the HsColour stylesheet]:file:_files' \
|
||||
'--contents-location=[bake URL in as the location for the contents page]:url:' \
|
||||
'--with-ghc=[path to ghc]:file:_files' \
|
||||
'--with-haddock=[path to haddock]:file:_files' \
|
||||
'--PROG-option=[give an extra option to PROG (no need to quote options containing spaces)]:option:' \
|
||||
'--ghc-options=[give extra options to ghc]:option:' \
|
||||
'--haddock-options=[give extra options to haddock]:option:' \
|
||||
}
|
||||
|
||||
_cabal_help ()
|
||||
{
|
||||
local -a cmds
|
||||
cmds=(install update list info fetch freeze get check sdist upload report run init
|
||||
configure build repl sandbox haddock exec copy clean hscolour register test bench help)
|
||||
_arguments \
|
||||
{-h,--help}'[Show help]' \
|
||||
'*::command:( $cmds )'
|
||||
}
|
||||
|
||||
_cabal_hscolour ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated files]:directory:_files -/' \
|
||||
'--executables[run hscolour for Executables targets]' \
|
||||
'--tests[run hscolour for Test Suite targets]' \
|
||||
'--benchmarks[run hscolour for Benchmarks targets]' \
|
||||
'--all[run hscolour for all targets]' \
|
||||
'--css=[path to stylesheet]:file:_files'
|
||||
}
|
||||
|
||||
_cabal_info ()
|
||||
{
|
||||
local context state state_descr line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--package-db=[use a given package database]:: :->default-db-or-filepath' \
|
||||
'*:package:_cabal_list_packages'
|
||||
|
||||
case $state in
|
||||
(default-db-or-filepath)
|
||||
_alternative \
|
||||
':default db:(global user clear)' \
|
||||
':filepath:_files'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_cabal_install ()
|
||||
{
|
||||
local context state state_descr line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
|
||||
{-g,--ghc}'[compile with GHC]' \
|
||||
'--nhc98[compile with NHC]' \
|
||||
'--jhc[compile with JHC]' \
|
||||
'--lhc[compile with LHC]' \
|
||||
'--hugs[compile with Hugs]' \
|
||||
'--uhc[compile with UHC]' \
|
||||
'--haskell-suite[compile with a haskell-suite compiler]' \
|
||||
{-w,--with-compiler=}'[give the path to a particular compiler]:file:_files' \
|
||||
'--with-hc-pkg=[give the path to the package tool]:file:_files' \
|
||||
'--prefix=[take this prefix in preparation of installation]:directory:_files -/' \
|
||||
'--bindir=[installation directory for executables]:directory:_files -/' \
|
||||
'--libdir=[installation directory for libraries]:directory:_files -/' \
|
||||
'--libsubdir=[subdirectory of libdir in which libs are installed]:directory:_files -/' \
|
||||
'--libexecdir=[installation directory for program executables]:directory:_files -/' \
|
||||
'--datadir=[installation directory for read-only data]:directory:_files -/' \
|
||||
'--datasubdir=[subdirectory of datadir in which data files are installed]:directory:_files -/' \
|
||||
'--docdir=[installation directory for documentation]:directory:_files -/' \
|
||||
'--htmldir=[installation directory for HTML]:directory:_files -/' \
|
||||
'--haddockdir=[installation directory for haddock interfaces]:directory:_files -/' \
|
||||
'--sysconfdir=[installation directory for configuration files]:directory:_files -/' \
|
||||
{-b,--scratchdir=}'[directory to receive the built package]:directory:_files -/' \
|
||||
'--program-prefix=[prefix to be applied to installed executables]' \
|
||||
'--program-suffix=[suffix to be applied to installed executables]' \
|
||||
'--enable-library-vanilla[enable Vanilla libraries]' \
|
||||
'--disable-library-vanilla[disable Vanilla libraries]' \
|
||||
{-p,--enable-library-profiling}'[enable Library profiling]' \
|
||||
'--disable-library-profiling[disable Library profiling]' \
|
||||
'--enable-shared[enable Shared library]' \
|
||||
'--disable-shared[disable Shared library]' \
|
||||
'--enable-executable-dynamic[enable Executable dynamic linking]' \
|
||||
'--disable-executable-dynamic[disable Executable dynamic linking]' \
|
||||
'--enable-executable-profiling[enable Executable profiling]' \
|
||||
'--disable-executable-profiling[disable Executable profiling]' \
|
||||
{-O-,--enable-optimization=}'[build with optimization]:level:(0 1 2)' \
|
||||
'--disable-optimization[build without optimization]' \
|
||||
'--enable-library-for-ghci[enable compile library for use with GHCi]' \
|
||||
'--disable-library-for-ghci[disable compile library for use with GHCi]' \
|
||||
'--enable-split-objs[enable split library into smaller objects]' \
|
||||
'--disable-split-objs[disable split library into smaller objects]' \
|
||||
'--enable-executable-stripping[enable strip executables upon installation]' \
|
||||
'--disable-executable-stripping[disable strip executables upon installation]' \
|
||||
'--configure-option=[extra option for configure]' \
|
||||
'--user[enable doing a per-user installation]' \
|
||||
'--global[disable doing a per-user installation]' \
|
||||
'--package-db=[use a given package database]:: :->default-db-or-filepath' \
|
||||
{-f,--flags=}'[force values for the given flags]:flags:' \
|
||||
'--extra-include-dirs=[a list of directories to search for header files]:directory:_files -/' \
|
||||
'--extra-lib-dirs=[a list of directories to search for external libraries]:directory:_files -/' \
|
||||
'--extra-prog-path=[a list of directories to search for required programs]:directory:_files -/' \
|
||||
'--enable-tests[enable dependency checking and compilation for test suites listed in the package description file]' \
|
||||
'--disable-tests[disable dependency checking and compilation for test suites listed in the package description file]' \
|
||||
'--enable-library-coverage[enable build library and test suites with, Haskell Program Coverage enabled. (GHC only)]' \
|
||||
'--disable-library-coverage[disable build library and test suites with, Haskell Program Coverage enabled. (GHC only)]' \
|
||||
'--enable-benchmarks[enable dependency checking and compilation, for benchmarks listed in the package]' \
|
||||
'--disable-benchmarks[disable dependency checking and compilation, for benchmarks listed in the package]' \
|
||||
$_cabal_programs \
|
||||
'--cabal-lib-version=[select which version of the Cabal lib to use]' \
|
||||
'--constraint=[a list of additional constraints on the dependencies]' \
|
||||
'--preference=[specify preferences on the version of a package]' \
|
||||
'--solver=[select dependency solver to use]:solver:(topdown modular choose)' \
|
||||
'--allow-newer=[ignore upper bounds in dependencies on some or all packages]' \
|
||||
'--enable-documentation[enable building of documentation]' \
|
||||
'--disable-documentation[disable building of documentation]' \
|
||||
'--doc-index-file=[a central index of haddock API documentation]:file:_files' \
|
||||
'--dry-run[do not install anything]' \
|
||||
'--max-backjumps=[maximum number of backjumps allowed while solving dependencies]' \
|
||||
'--reorder-goals[try to reorder goals according to certain heuristics]' \
|
||||
'--shadow-installed-packages[if multiple package instances of the same version are installed, treat all but one as shadowed]' \
|
||||
'--reinstall[always install]' \
|
||||
'--avoid-reinstalls[do not select versions that would destructively overwrite installed packages]' \
|
||||
'--force-reinstalls[reinstall packages even if they will most likely break other installed packages]' \
|
||||
'--upgrade-dependencies[pick the latest version for all dependencies, rather than trying to pick an installed version]' \
|
||||
{--only-dependencies,--dependencies-only}'[install only the dependencies necessary to build the given packages]' \
|
||||
'--root-cmd=[command used to gain root privileges]::' \
|
||||
'--symlink-bindir=[add symlinks into this directory]:directory:_files -/' \
|
||||
'--build-summary=[save build summaries to file]:file:_files' \
|
||||
'--build-log=[log all builds to file]:file:_files' \
|
||||
'--remote-build-reporting=[generate build reports to send to a remote]:level:(none anonymous detailed)' \
|
||||
'--one-shot[do not record the packages in the world file]' \
|
||||
'--run-tests[run package test suites during installation]' \
|
||||
{-j,--jobs=}'[run NUM jobs simultaneously]' \
|
||||
'--haddock-hoogle[generate a hoogle database]' \
|
||||
'--haddock-html[generate HTML documentation]' \
|
||||
'--haddock-html-location=[location of HTML documentation]:url:' \
|
||||
'--haddock-executables[run haddock for Executables targets]' \
|
||||
'--haddock-tests[run haddock for Test Suite targets]' \
|
||||
'--haddock-benchmarks[run haddock for Benchmarks targets]' \
|
||||
'--haddock-all[run haddock for all targets]' \
|
||||
'--haddock-internal[run haddock for internal modules]' \
|
||||
'--haddock-css=[path to the haddock stylesheet]:file:_files' \
|
||||
'--haddock-hyperlink-source[hyperlink the documentation to the source code]' \
|
||||
'--haddock-hscolour-css=[path to the HsColour stylesheet]:file:_files' \
|
||||
'--haddock-contents-location=[bake URL in as the location for the contents page]:url:' \
|
||||
'*:: :->package-or-cabal-file'
|
||||
|
||||
case $state in
|
||||
(default-db-or-filepath)
|
||||
_alternative \
|
||||
':default db:(global user clear)' \
|
||||
':filepath:_files'
|
||||
;;
|
||||
(package-or-cabal-file)
|
||||
_alternative \
|
||||
':package:_cabal_list_packages' \
|
||||
':files:_files -g "*.cabal"'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_cabal_list ()
|
||||
{
|
||||
local context state state_descr line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--installed[only print installed packages]' \
|
||||
'--simple-output[print in a easy-to-parse format]' \
|
||||
'--package-db=[use a given package database]:: :->default-db-or-filepath' \
|
||||
'*:package:_cabal_list_packages'
|
||||
|
||||
case $state in
|
||||
(default-db-or-filepath)
|
||||
_alternative \
|
||||
':default db:(global user clear)' \
|
||||
':filepath:_files'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_cabal_register ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated files]:directory:_files -/' \
|
||||
"--user[register in user's local package database]" \
|
||||
"--global[register in the system-wide package database]" \
|
||||
'--inplace[register in build location]' \
|
||||
'--gen-script[generate a script to register later]' \
|
||||
'--gen-pkg-config=[generate package registration file]'
|
||||
}
|
||||
|
||||
_cabal_repl ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
|
||||
$_cabal_programs
|
||||
}
|
||||
|
||||
_cabal_report ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
{-u,--username=}'[hackage username]' \
|
||||
{-p,--password=}'[hackage password]'
|
||||
}
|
||||
|
||||
_cabal_run ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated build files]:directory:_files -/' \
|
||||
{-j,--jobs=}'[run NUM jobs simultaneously]' \
|
||||
$_cabal_programs \
|
||||
"--only[don't reinstall add-source dependencies (sandbox-only)]"
|
||||
}
|
||||
|
||||
_cabal_sandbox ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--sandbox=[Sandbox location]:sandbox:_files -/'
|
||||
|
||||
if (( CURRENT == 2 )); then
|
||||
local -a _cabal_sandbox_cmds
|
||||
_cabal_sandbox_cmds=(
|
||||
'init:initialize the sandbox'
|
||||
'delete:delete the sandbox'
|
||||
'add-source:add sources path to sandbox'
|
||||
'hc-pkg:call sandbox related haskell compiler package database'
|
||||
'list-sources:list added sources paths'
|
||||
)
|
||||
_describe -t sandbox-commands 'sandbox-command' _cabal_sandbox_cmds || compadd "$@"
|
||||
else
|
||||
case $WORDS[3] in
|
||||
add-source)
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--snapshot[take a snapshot instead of creating a link]' \
|
||||
'--sandbox=[Sandbox location]:sandbox:_files -/' \
|
||||
'*:sources:_files -/'
|
||||
;;
|
||||
*)
|
||||
_message "unknown cabal sandbox command: $WORDS[3]"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
_cabal_sdist ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated files]:directory:_files -/' \
|
||||
"--list-sources=[just write a list of the package's sources to a file]:directory:_files -/" \
|
||||
'--snapshot[produce a snapshot source distribution]' \
|
||||
'--output-directory=[generate a source distribution in the given directory]:directory:_files -/' \
|
||||
'--targz[produce a .tar.gz format archive]' \
|
||||
'--zip[produce a .zip format archive]'
|
||||
}
|
||||
|
||||
_cabal_test ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
'--builddir=[the directory where Cabal puts generated files]:directory:_files -/' \
|
||||
'--log=[log all test suite results to file]:file:_files' \
|
||||
'--machine-log=[produce a machine-readable log file]:file:_files' \
|
||||
'--show-details=[when to show results of individual test cases?]:filter:(always never failures)' \
|
||||
'--keep-tix-files[keep .tix files for HPC between test runs]' \
|
||||
'--test-options=[give extra options to test executables]' \
|
||||
'--test-option=[give an extra option to test executables]' \
|
||||
{-j,--jobs=}'[run NUM jobs simultaneously]' \
|
||||
$_cabal_programs \
|
||||
"--only[don't reinstall add-source dependencies (sandbox-only)]"
|
||||
}
|
||||
|
||||
_cabal_update ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)'
|
||||
}
|
||||
|
||||
_cabal_upload ()
|
||||
{
|
||||
_arguments \
|
||||
{-h,--help}'[show help]' \
|
||||
{-v-,--verbose=}'[control verbosity]:level:(0 1 2 3)' \
|
||||
{-c,--check}'[do not upload, just do QA checks]' \
|
||||
{-u-,--username=}'[hackage username]' \
|
||||
{-p-,--password=}'[hackage password]' \
|
||||
'*:file:_files -g "*.tar.gz"'
|
||||
}
|
||||
|
||||
_cabal_list_packages () {
|
||||
_cabal_get_available_packages
|
||||
_cabal_get_available_files=(*.cabal)
|
||||
compadd "$@" -a -- _cabal_available_packages _cabal_get_available_files
|
||||
}
|
||||
|
||||
_cabal_get_available_packages ()
|
||||
{
|
||||
if ( [[ ${+_cabal_available_packages} -eq 0 ]] || _cache_invalid CABAL_AVAILABLE_PACKAGES ) &&
|
||||
! _retrieve_cache CABAL_AVAILABLE_PACKAGES;
|
||||
then
|
||||
_cabal_available_packages=( $(cabal list --simple-output | cut -d' ' -f1 | uniq) )
|
||||
_store_cache CABAL_AVAILABLE_PACKAGES _cabal_available_packages
|
||||
fi
|
||||
}
|
||||
|
||||
_cabal "$@"
|
56
.zprezto/modules/completion/external/src/_cap
vendored
Normal file
56
.zprezto/modules/completion/external/src/_cap
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
#compdef cap
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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
|
89
.zprezto/modules/completion/external/src/_cask
vendored
Normal file
89
.zprezto/modules/completion/external/src/_cask
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
#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 "$@"
|
139
.zprezto/modules/completion/external/src/_celery
vendored
Normal file
139
.zprezto/modules/completion/external/src/_celery
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
#compdef celery
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for celery (https://github.com/celery/celery).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Dong weiming (https://github.com/dongweiming)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_celery () {
|
||||
local -a _1st_arguments ifargs dopts controlargs
|
||||
|
||||
typeset -A opt_args
|
||||
|
||||
_1st_arguments=('worker' 'events' 'beat' 'shell' 'multi' 'amqp' 'status' 'inspect' \
|
||||
'control' 'purge' 'list' 'migrate' 'call' 'result' 'report')
|
||||
ifargs=('--app=' '--broker=' '--loader=' '--config=' '--version')
|
||||
dopts=('--detach' '--umask=' '--gid=' '--uid=' '--pidfile=' '--logfile=' '--loglevel=')
|
||||
controlargs=('--timeout' '--destination')
|
||||
_arguments \
|
||||
'(-A --app=)'{-A,--app}'[app instance to use (e.g. module.attr_name):APP]' \
|
||||
'(-b --broker=)'{-b,--broker}'[url to broker. default is "amqp://guest@localhost//":BROKER]' \
|
||||
'(--loader)--loader[name of custom loader class to use.:LOADER]' \
|
||||
'(--config)--config[Name of the configuration module:CONFIG]' \
|
||||
'(--workdir)--workdir[Optional directory to change to after detaching.:WORKING_DIRECTORY]' \
|
||||
'(-q --quiet)'{-q,--quiet}'[Don"t show as much output.]' \
|
||||
'(-C --no-color)'{-C,--no-color}'[Don"t display colors.]' \
|
||||
'(--version)--version[show program"s version number and exit]' \
|
||||
'(- : *)'{-h,--help}'[show this help message and exit]' \
|
||||
'*:: :->subcmds' && return 0
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "celery subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
||||
case "$words[1]" in
|
||||
worker)
|
||||
_arguments \
|
||||
'(-C --concurrency=)'{-C,--concurrency=}'[Number of child processes processing the queue. The default is the number of CPUs.]' \
|
||||
'(--pool)--pool=:::(processes eventlet gevent threads solo)' \
|
||||
'(--purge --discard)'{--discard,--purge}'[Purges all waiting tasks before the daemon is started.]' \
|
||||
'(-f --logfile=)'{-f,--logfile=}'[Path to log file. If no logfile is specified, stderr is used.]' \
|
||||
'(--loglevel=)--loglevel=:::(critical error warning info debug)' \
|
||||
'(-N --hostname=)'{-N,--hostname=}'[Set custom hostname, e.g. "foo.example.com".]' \
|
||||
'(-B --beat)'{-B,--beat}'[Also run the celerybeat periodic task scheduler.]' \
|
||||
'(-s --schedule=)'{-s,--schedule=}'[Path to the schedule database if running with the -B option. Defaults to celerybeat-schedule.]' \
|
||||
'(-S --statedb=)'{-S,--statedb=}'[Path to the state database.Default: None]' \
|
||||
'(-E --events)'{-E,--events}'[Send events that can be captured by monitors like celeryev, celerymon, and others.]' \
|
||||
'(--time-limit=)--time-limit=[nables a hard time limit (in seconds int/float) for tasks]' \
|
||||
'(--soft-time-limit=)--soft-time-limit=[Enables a soft time limit (in seconds int/float) for tasks]' \
|
||||
'(--maxtasksperchild=)--maxtasksperchild=[Maximum number of tasks a pool worker can execute before it"s terminated and replaced by a new worker.]' \
|
||||
'(-Q --queues=)'{-Q,--queues=}'[List of queues to enable for this worker, separated by comma. By default all configured queues are enabled.]' \
|
||||
'(-I --include=)'{-I,--include=}'[Comma separated list of additional modules to import.]' \
|
||||
'(--pidfile=)--pidfile=[Optional file used to store the process pid.]' \
|
||||
'(--autoscale=)--autoscale=[Enable autoscaling by providing max_concurrency, min_concurrency.]' \
|
||||
'(--autoreload)--autoreload[Enable autoreloading.]' \
|
||||
'(--no-execv)--no-execv[Don"t do execv after multiprocessing child fork.]'
|
||||
compadd -a ifargs
|
||||
;;
|
||||
inspect)
|
||||
_values -s \
|
||||
'active[dump active tasks (being processed)]' \
|
||||
'active_queues[dump queues being consumed from]' \
|
||||
'ping[ping worker(s)]' \
|
||||
'registered[dump of registered tasks]' \
|
||||
'report[get bugreport info]' \
|
||||
'reserved[dump reserved tasks (waiting to be processed)]' \
|
||||
'revoked[dump of revoked task ids]' \
|
||||
'scheduled[dump scheduled tasks (eta/countdown/retry)]' \
|
||||
'stats[dump worker statistics]'
|
||||
compadd -a controlargs ifargs
|
||||
;;
|
||||
control)
|
||||
_values -s \
|
||||
'add_consumer[tell worker(s) to start consuming a queue]' \
|
||||
'autoscale[change autoscale settings]' \
|
||||
'cancel_consumer[tell worker(s) to stop consuming a queue]' \
|
||||
'disable_events[tell worker(s) to disable events]' \
|
||||
'enable_events[tell worker(s) to enable events]' \
|
||||
'pool_grow[start more pool processes]' \
|
||||
'pool_shrink[use less pool processes]' \
|
||||
'rate_limit[tell worker(s) to modify the rate limit for a task type]' \
|
||||
'time_limit[tell worker(s) to modify the time limit for a task type.]'
|
||||
compadd -a controlargs ifargs
|
||||
;;
|
||||
multi)
|
||||
_values -s \
|
||||
'--nosplash[Don"t display program info.]' \
|
||||
'--verbose[Show more output.]' \
|
||||
'--no-color[Don"t display colors.]' \
|
||||
'--quiet[Don"t show as much output.]' \
|
||||
'start' 'restart' 'stopwait' 'stop' 'show' \
|
||||
'names' 'expand' 'get' 'kill'
|
||||
compadd -a ifargs
|
||||
;;
|
||||
amqp)
|
||||
_values -s \
|
||||
'queue.declare' 'queue.purge' 'exchange.delete' 'basic.publish' \
|
||||
'exchange.declare' 'queue.delete' 'queue.bind' 'basic.get'
|
||||
;;
|
||||
list)
|
||||
_values -s, 'bindings'
|
||||
;;
|
||||
shell)
|
||||
_values -s \
|
||||
'--ipython[force iPython.]' \
|
||||
'--bpython[force bpython.]' \
|
||||
'--python[force default Python shell.]' \
|
||||
'--without-tasks[don"t add tasks to locals.]' \
|
||||
'--eventlet[use eventlet.]' \
|
||||
'--gevent[use gevent.]'
|
||||
compadd -a ifargs
|
||||
;;
|
||||
beat)
|
||||
_arguments \
|
||||
'(-s --schedule=)'{-s,--schedule=}'[Path to the schedule database. Defaults to celerybeat-schedule.]' \
|
||||
'(-S --scheduler=)'{-S,--scheduler=}'[Scheduler class to use. Default is celery.beat.PersistentScheduler.]' \
|
||||
'(--max-interval)--max-interval[]'
|
||||
compadd -a dopts fargs
|
||||
;;
|
||||
events)
|
||||
_arguments \
|
||||
'(-d --dump)'{-d,--dump}'[Dump events to stdout.]' \
|
||||
'(-c --camera=)'{-c,--camera=}'[Take snapshots of events using this camera.]' \
|
||||
'(-F --frequency=)'{-F,--frequency=}'[Camera: Shutter frequency. Default is every 1.0 seconds.]' \
|
||||
'(-r --maxrate=)'{-r,--maxrate=}'[Camera: Optional shutter rate limit (e.g. 10/m).]'
|
||||
compadd -a dopts fargs
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
60
.zprezto/modules/completion/external/src/_choc
vendored
Normal file
60
.zprezto/modules/completion/external/src/_choc
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
#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
|
274
.zprezto/modules/completion/external/src/_cmake
vendored
Normal file
274
.zprezto/modules/completion/external/src/_cmake
vendored
Normal file
@@ -0,0 +1,274 @@
|
||||
#compdef cmake
|
||||
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for CMake (http://www.cmake.org).
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Scott M. Kroll <skroll@gmail.com>
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
# 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
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
_cmake() {
|
||||
local context state line curcontext="$curcontext" cmake_args
|
||||
|
||||
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]'
|
||||
)
|
||||
|
||||
local cmake_build_options;cmake_build_options=(
|
||||
'-C[Pre-load a script to populate the cache]:script:_files'
|
||||
'*-D-[Create a cmake cache entry]:property:_cmake_define_property'
|
||||
'-U[Remove matching entries from CMake cache]:globbing expression'
|
||||
'-G[Specify a makefile generator]:generator:_cmake_generators'
|
||||
'-T[Specify toolset name if supported by generator]:toolset name'
|
||||
'(-Wno-dev -Wdev)-Wno-dev[Suppress developer warnings]'
|
||||
'(-Wno-dev -Wdev)-Wdev[Enable developer warnings]'
|
||||
'-i[Run in wizard mode]'
|
||||
'-L-[List cache variables]::_values "options" "[non-advanced cache variables]" "A[advanced cache variables]" "H[non-advanced cached variables with help]" "AH[advanced cache variables with help]"'
|
||||
'--trace[Put cmake in trace mode]'
|
||||
':cmake project:_files -/'
|
||||
)
|
||||
|
||||
local cmake_command_actions;cmake_command_actions=(
|
||||
'-E[CMake command mode]:*:command'
|
||||
)
|
||||
|
||||
_arguments -C -s \
|
||||
- help \
|
||||
"$cmake_help_actions[@]" \
|
||||
- command \
|
||||
"$cmake_command_actions[@]" \
|
||||
- build_opts \
|
||||
"$cmake_build_options[@]" && return 0
|
||||
}
|
||||
|
||||
# -------------------
|
||||
# _cmake_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_RLEASE:${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_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'
|
||||
)
|
||||
|
||||
_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_*_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
|
||||
}
|
||||
|
||||
|
||||
_cmake "$@"
|
||||
|
81
.zprezto/modules/completion/external/src/_coffee
vendored
Normal file
81
.zprezto/modules/completion/external/src/_coffee
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
#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
|
76
.zprezto/modules/completion/external/src/_composer
vendored
Normal file
76
.zprezto/modules/completion/external/src/_composer
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
#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
|
53
.zprezto/modules/completion/external/src/_console
vendored
Normal file
53
.zprezto/modules/completion/external/src/_console
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
#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)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_console_get_command_list () {
|
||||
php console --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }'
|
||||
}
|
||||
|
||||
_console () {
|
||||
if [ -f console ]; then
|
||||
compadd `_console_get_command_list`
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _console php console
|
||||
compdef _console console
|
105
.zprezto/modules/completion/external/src/_cpanm
vendored
Normal file
105
.zprezto/modules/completion/external/src/_cpanm
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
#compdef cpanm
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for cpanm (http://search.cpan.org/dist/App-cpanminus/lib/App/cpanminus.pm).
|
||||
#
|
||||
# Source: https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Ryushi (https://github.com/rshhh)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local arguments curcontext="$curcontext"
|
||||
typeset -A opt_args
|
||||
|
||||
|
||||
arguments=(
|
||||
|
||||
# Commands
|
||||
# '(--install -i)'{--install,-i}'[Installs the modules]'
|
||||
'(- :)--self-upgrade[Upgrades itself]'
|
||||
'(- :)--info[Displays distribution info on CPAN]'
|
||||
'(--installdeps)--installdeps[Only install dependencies]'
|
||||
'(--look)--look[Download/unpack the distribution and then open the directory with your shell]'
|
||||
'(--uninstall -U)'{--uninstall,-U}'[Uninstalls the modules]'
|
||||
'(- :)'{--help,-h}'[Displays help information]'
|
||||
'(- :)'{--version,-V}'[Displays software version]'
|
||||
|
||||
# Options
|
||||
{--force,-f}'[Force install]'
|
||||
{--notest,-n}'[Do not run unit tests]'
|
||||
'(--test-only)--test-only[Run the test only and do not install the module]'
|
||||
{--sudo,-S}'[sudo to run install commands]'
|
||||
'(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]'
|
||||
'(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]'
|
||||
{--local-lib,-l}'[Specify the install base to install modules]'
|
||||
{--local-lib-contained,-L}'[Specify the install base to install all non-core modules]'
|
||||
'(--self-contained)--self-contained[Assume no non-core modules are installed on the system]'
|
||||
'--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls'
|
||||
'--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]'
|
||||
'--mirror-index[Specifies the file path for module search index]:FILES:_files'
|
||||
'--prompt[Prompt when configure/build/test fails]'
|
||||
'(--dev)--dev[Search for a newer developer release as well]'
|
||||
'--reinstall[Reinstall the distribution even if you already have the latest version installed]'
|
||||
'--interactive[Turn on interactive configure]'
|
||||
'(--pp --pureperl)'{--pp,--pureperl}'[Prefer Pure perl build of modules]'
|
||||
'(--with-recommends)--with-recommends[Installs dependencies declared as "recommends"]'
|
||||
'(--with-suggests)--with-suggests[Installs dependencies declared as "suggests"]'
|
||||
'(--with-feature)--with-feature[Specifies the feature to enable]'
|
||||
'(--without-feature)--without-feature[Specifies the feature to disable]'
|
||||
'(--with-all-features)--with-all-features[Enables all the optional features]'
|
||||
'(--configure-timeout)--configure-timeout[Specify the timeout length to wait for configure]'
|
||||
'(--build-timeout)--build-timeout[Specify the timeout length to wait for build]'
|
||||
'(--test-timeout)--test-timeout[Specify the timeout length to wait for test]'
|
||||
'(--configure-args)--configure-args[Pass arguments for configure commands]'
|
||||
'(--build-args)--build-args[Pass arguments for build commands]'
|
||||
'(--test-args)--test-args[Pass arguments for test commands]'
|
||||
'(--install-args)--install-args[Pass arguments for install commands]'
|
||||
|
||||
'--scandeps[Scan the dependencies of given modules and output the tree in a text format]'
|
||||
'--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)'
|
||||
|
||||
'--save-dists[Specify the optional directory path to copy downloaded tarballs]'
|
||||
'(--uninst-shadows)--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]'
|
||||
|
||||
'(--cascade-search)--cascade-search[Specifies whether to cascade search]'
|
||||
'(--skip-installed)--skip-installed[Specifies modules which latest version are already installed]'
|
||||
'(--skip-satisfied)--skip-satisfied[Specifies module and version for skipping installation]'
|
||||
'(--verify)--verify[Verify the integrity of distribution files]'
|
||||
'(--no-report-perl-version)--report-perl-version[Report locally installed perl version as part of User-Agent]'
|
||||
'(--report-perl-version)--no-report-perl-version[Disable --report-perl-version]'
|
||||
'--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]'
|
||||
'(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]'
|
||||
'(--man-pages)--no-man-pages[Do not generate man pages]'
|
||||
|
||||
|
||||
# Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP,
|
||||
# Wget, cURL and HTTP::Tiny (in that order) and uses the first one available.
|
||||
# (So that the exclusions are not enabled here for the completion)
|
||||
'(--lwp)--lwp[Use LWP module to download stuff]'
|
||||
'(--wget)--wget[Use GNU Wget (if available) to download stuff]'
|
||||
'(--curl)--curl[Use cURL (if available) to download stuff]'
|
||||
|
||||
# Other completions
|
||||
'*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"'
|
||||
# '*::args: _normal' # this looks for default files (any files)
|
||||
)
|
||||
_arguments -s $arguments \
|
||||
&& return 0
|
||||
|
||||
return 1
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
65
.zprezto/modules/completion/external/src/_debuild
vendored
Normal file
65
.zprezto/modules/completion/external/src/_debuild
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
#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
|
35
.zprezto/modules/completion/external/src/_dget
vendored
Normal file
35
.zprezto/modules/completion/external/src/_dget
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
#compdef dget
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for dget
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Kris Shannon <kris@staff.sisgroup.com.au>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_dget() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments -A "-*" \
|
||||
'(-h --help)'{-h,--help}'[Show help message]' \
|
||||
'(-V --version)'{-v,--version}'[Print license, copyright, and version information and exit]' \
|
||||
'(-q --quiet)'{-q,--quiet}'[Suppress wget/curl output]' \
|
||||
'(-d --download-only --build)'{-d,--download-only}'[Do not extract downloaded source]' \
|
||||
'(-x --extract)'{-x,--extract}'[Unpack downloaded source]' \
|
||||
'(-u --allow-unauthenticated)'{-u,--allow-unauthenticated}'[Make no attempt to verify source package signature]' \
|
||||
'(-d --download-only --build)--build[Build package with dpkg-buildpackage after download]' \
|
||||
'--path[Check this directory in addition to the apt archive]:DIR:_files -/' \
|
||||
'(--insecure)--insecure[Do not check SSL certificates when downloading]' \
|
||||
'(--no-cache)--no-cache[Disable server-side HTTP cache]' \
|
||||
"(--no-conf)--no-conf[Don't read devscripts config files]" \
|
||||
'1:dsc url:_urls'
|
||||
}
|
||||
|
||||
_dget "$@"
|
78
.zprezto/modules/completion/external/src/_dhcpcd
vendored
Normal file
78
.zprezto/modules/completion/external/src/_dhcpcd
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
#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
|
53
.zprezto/modules/completion/external/src/_ditz
vendored
Normal file
53
.zprezto/modules/completion/external/src/_ditz
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
#compdef ditz
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Ditz (http://ditz.rubyforge.org).
|
||||
#
|
||||
# Source: https://github.com/technolize/zsh-completion-funcs
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * technolize (https://github.com/technolize)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local ME=ditz
|
||||
local COMMANDS=--commands
|
||||
local OPTIONS='<options>'
|
||||
|
||||
if (($CURRENT == 2)); then
|
||||
# We're completing the first word after the tool: the command.
|
||||
_wanted command expl "$ME command" \
|
||||
compadd -- $( "$ME" "$COMMANDS" )
|
||||
else
|
||||
# Find the options/files/URL/etc. for the current command by using the tool itself.
|
||||
case "${words[$CURRENT]}"; in
|
||||
-*)
|
||||
_wanted args expl "Arguments for $ME ${words[2]}" \
|
||||
compadd -- $( "$ME" "${words[2]}" "$OPTIONS" ; _files )
|
||||
;;
|
||||
ht*|ft*)
|
||||
_arguments '*:URL:_urls'
|
||||
;;
|
||||
/*|./*|\~*|../*)
|
||||
_arguments '*:file:_files'
|
||||
;;
|
||||
*)
|
||||
_wanted args expl "Arguments for $ME ${words[2]}" \
|
||||
compadd -- $( "$ME" "${words[2]}" "$OPTIONS" )
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
483
.zprezto/modules/completion/external/src/_docker
vendored
Normal file
483
.zprezto/modules/completion/external/src/_docker
vendored
Normal file
@@ -0,0 +1,483 @@
|
||||
#compdef docker
|
||||
#
|
||||
# zsh completion for docker (http://docker.com)
|
||||
#
|
||||
# version: 0.3.0
|
||||
# github: https://github.com/felixr/docker-zsh-completion
|
||||
#
|
||||
# contributors:
|
||||
# - Felix Riedel
|
||||
# - Vincent Bernat
|
||||
#
|
||||
# license:
|
||||
#
|
||||
# Copyright (c) 2013, Felix Riedel
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the <organization> nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
__docker_get_containers() {
|
||||
local kind expl
|
||||
declare -a running stopped lines args
|
||||
|
||||
kind=$1
|
||||
shift
|
||||
[[ $kind = (stopped|all) ]] && args=($args -a)
|
||||
|
||||
lines=(${(f)"$(_call_program commands docker ps ${args})"})
|
||||
|
||||
# Parse header line to find columns
|
||||
local i=1 j=1 k header=${lines[1]}
|
||||
declare -A begin end
|
||||
while (( $j < ${#header} - 1 )) {
|
||||
i=$(( $j + ${${header[$j,-1]}[(i)[^ ]]} - 1))
|
||||
j=$(( $i + ${${header[$i,-1]}[(i) ]} - 1))
|
||||
k=$(( $j + ${${header[$j,-1]}[(i)[^ ]]} - 2))
|
||||
begin[${header[$i,$(($j-1))]}]=$i
|
||||
end[${header[$i,$(($j-1))]}]=$k
|
||||
}
|
||||
lines=(${lines[2,-1]})
|
||||
|
||||
# Container ID
|
||||
local line
|
||||
local s
|
||||
for line in $lines; do
|
||||
s="${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}"
|
||||
s="$s:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}"
|
||||
s="$s, ${${${line[$begin[IMAGE],$end[IMAGE]]}/:/\\:}%% ##}"
|
||||
if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then
|
||||
stopped=($stopped $s)
|
||||
else
|
||||
running=($running $s)
|
||||
fi
|
||||
done
|
||||
|
||||
# Names
|
||||
local name
|
||||
local -a names
|
||||
for line in $lines; do
|
||||
names=(${(ps:,:)${${line[${begin[NAMES]},-1]}%% *}})
|
||||
for name in $names; do
|
||||
s="${name}:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}"
|
||||
s="$s, ${${${line[$begin[IMAGE],$end[IMAGE]]}/:/\\:}%% ##}"
|
||||
if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then
|
||||
stopped=($stopped $s)
|
||||
else
|
||||
running=($running $s)
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
[[ $kind = (running|all) ]] && _describe -t containers-running "running containers" running
|
||||
[[ $kind = (stopped|all) ]] && _describe -t containers-stopped "stopped containers" stopped
|
||||
}
|
||||
|
||||
__docker_stoppedcontainers() {
|
||||
__docker_get_containers stopped "$@"
|
||||
}
|
||||
|
||||
__docker_runningcontainers() {
|
||||
__docker_get_containers running "$@"
|
||||
}
|
||||
|
||||
__docker_containers () {
|
||||
__docker_get_containers all "$@"
|
||||
}
|
||||
|
||||
__docker_images () {
|
||||
local expl
|
||||
declare -a images
|
||||
images=(${${${${(f)"$(_call_program commands docker images)"}[2,-1]}/ ##/\\:}%% *})
|
||||
images=(${${images%\\:<none>}#<none>} ${${${(f)"$(_call_program commands docker images)"}[2,-1]}/(#b)([^ ]##) ##([^ ]##) ##([^ ]##)*/${match[3]}:${(r:15:: :::)match[2]} in ${match[1]}})
|
||||
_describe -t docker-images "images" images
|
||||
}
|
||||
|
||||
__docker_tags() {
|
||||
local expl
|
||||
declare -a tags
|
||||
tags=(${${${${${(f)"$(_call_program commands docker images)"}#* }## #}%% *}[2,-1]})
|
||||
_describe -t docker-tags "tags" tags
|
||||
}
|
||||
|
||||
__docker_repositories_with_tags() {
|
||||
if compset -P '*:'; then
|
||||
__docker_tags
|
||||
else
|
||||
__docker_repositories -qS ":"
|
||||
fi
|
||||
}
|
||||
|
||||
__docker_search() {
|
||||
# declare -a dockersearch
|
||||
local cache_policy
|
||||
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
|
||||
if [[ -z "$cache_policy" ]]; then
|
||||
zstyle ":completion:${curcontext}:" cache-policy __docker_caching_policy
|
||||
fi
|
||||
|
||||
local searchterm cachename
|
||||
searchterm="${words[$CURRENT]%/}"
|
||||
cachename=_docker-search-$searchterm
|
||||
|
||||
local expl
|
||||
local -a result
|
||||
if ( [[ ${(P)+cachename} -eq 0 ]] || _cache_invalid ${cachename#_} ) \
|
||||
&& ! _retrieve_cache ${cachename#_}; then
|
||||
_message "Searching for ${searchterm}..."
|
||||
result=(${${${(f)"$(_call_program commands docker search ${searchterm})"}%% *}[2,-1]})
|
||||
_store_cache ${cachename#_} result
|
||||
fi
|
||||
_wanted dockersearch expl 'available images' compadd -a result
|
||||
}
|
||||
|
||||
__docker_caching_policy()
|
||||
{
|
||||
oldp=( "$1"(Nmh+1) ) # 1 hour
|
||||
(( $#oldp ))
|
||||
}
|
||||
|
||||
|
||||
__docker_repositories () {
|
||||
local expl
|
||||
declare -a repos
|
||||
repos=(${${${(f)"$(_call_program commands docker images)"}%% *}[2,-1]})
|
||||
_describe -t docker-repos "repositories" repos "$@"
|
||||
}
|
||||
|
||||
__docker_commands () {
|
||||
# local -a _docker_subcommands
|
||||
local cache_policy
|
||||
|
||||
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
|
||||
if [[ -z "$cache_policy" ]]; then
|
||||
zstyle ":completion:${curcontext}:" cache-policy __docker_caching_policy
|
||||
fi
|
||||
|
||||
if ( [[ ${+_docker_subcommands} -eq 0 ]] || _cache_invalid docker_subcommands) \
|
||||
&& ! _retrieve_cache docker_subcommands;
|
||||
then
|
||||
local -a lines
|
||||
lines=(${(f)"$(_call_program commands docker 2>&1)"})
|
||||
_docker_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/ ##/:})
|
||||
_docker_subcommands=($_docker_subcommands 'help:Show help for a command')
|
||||
_store_cache docker_subcommands _docker_subcommands
|
||||
fi
|
||||
_describe -t docker-commands "docker command" _docker_subcommands
|
||||
}
|
||||
|
||||
__docker_subcommand () {
|
||||
local -a _command_args
|
||||
case "$words[1]" in
|
||||
(attach)
|
||||
_arguments \
|
||||
'--no-stdin[Do not attach stdin]' \
|
||||
'--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]' \
|
||||
':containers:__docker_runningcontainers'
|
||||
;;
|
||||
(build)
|
||||
_arguments \
|
||||
'--force-rm[Always remove intermediate containers]' \
|
||||
'--no-cache[Do not use cache when building the image]' \
|
||||
{-q,--quiet}'[Suppress verbose build output]' \
|
||||
'--rm[Remove intermediate containers after a successful build]' \
|
||||
{-t,--tag=-}'[Repository, name and tag to be applied]:repository:__docker_repositories_with_tags' \
|
||||
':path or URL:_directories'
|
||||
;;
|
||||
(commit)
|
||||
_arguments \
|
||||
{-a,--author=-}'[Author]:author: ' \
|
||||
{-m,--message=-}'[Commit message]:message: ' \
|
||||
{-p,--pause}'[Pause container during commit]' \
|
||||
'--run=-[Configuration automatically applied when the image is run]:configuration: ' \
|
||||
':container:__docker_containers' \
|
||||
':repository:__docker_repositories_with_tags'
|
||||
;;
|
||||
(cp)
|
||||
_arguments \
|
||||
':container:->container' \
|
||||
':hostpath:_files'
|
||||
case $state in
|
||||
(container)
|
||||
if compset -P '*:'; then
|
||||
_files
|
||||
else
|
||||
__docker_containers -qS ":"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(diff|export)
|
||||
_arguments '*:containers:__docker_containers'
|
||||
;;
|
||||
(events)
|
||||
_arguments \
|
||||
'--since=-[Events created since this timestamp]:timestamp: ' \
|
||||
'--until=-[Events created until this timestamp]:timestamp: '
|
||||
;;
|
||||
(exec)
|
||||
_arguments \
|
||||
{-d,--detach}'[Detached mode: leave the container running in the background]' \
|
||||
{-i,--interactive}'[Keep stdin open even if not attached]' \
|
||||
{-t,--tty}'[Allocate a pseudo-tty]' \
|
||||
':containers:__docker_runningcontainers'
|
||||
;;
|
||||
(history)
|
||||
_arguments \
|
||||
'--no-trunc[Do not truncate output]' \
|
||||
{-q,--quiet}'[Only show numeric IDs]' \
|
||||
'*:images:__docker_images'
|
||||
;;
|
||||
(images)
|
||||
_arguments \
|
||||
{-a,--all}'[Show all images]' \
|
||||
'*'{-f,--filter=-}'[Filter values]:filter: ' \
|
||||
'--no-trunc[Do not truncate output]' \
|
||||
{-q,--quiet}'[Only show numeric IDs]' \
|
||||
'--tree[Output graph in tree format]' \
|
||||
'--viz[Output graph in graphviz format]' \
|
||||
':repository:__docker_repositories'
|
||||
;;
|
||||
(inspect)
|
||||
_arguments \
|
||||
{-f,--format=-}'[Format the output using the given go template]:template: ' \
|
||||
'*:containers:__docker_containers'
|
||||
;;
|
||||
(import)
|
||||
_arguments \
|
||||
':URL:(- http:// file://)' \
|
||||
':repository:__docker_repositories_with_tags'
|
||||
;;
|
||||
(info)
|
||||
;;
|
||||
(import)
|
||||
_arguments \
|
||||
':URL:(- http:// file://)' \
|
||||
':repository:__docker_repositories_with_tags'
|
||||
;;
|
||||
(insert)
|
||||
_arguments '1:containers:__docker_containers' \
|
||||
'2:URL:(http:// file://)' \
|
||||
'3:file:_files'
|
||||
;;
|
||||
(kill)
|
||||
_arguments \
|
||||
{-s,--signal=-}'[Signal to send]:signal:_signals' \
|
||||
'*:containers:__docker_runningcontainers'
|
||||
;;
|
||||
(load)
|
||||
_arguments \
|
||||
{-i,--input=-}'[Read from tar archive file]:tar:_files'
|
||||
;;
|
||||
(login)
|
||||
_arguments \
|
||||
{-e,--email=-}'[Email]:email: ' \
|
||||
{-p,--password=-}'[Password]:password: ' \
|
||||
{-u,--user=-}'[Username]:username: ' \
|
||||
':server: '
|
||||
;;
|
||||
(logout)
|
||||
_arguments \
|
||||
':server: '
|
||||
;;
|
||||
(logs)
|
||||
_arguments \
|
||||
{-f,--follow}'[Follow log output]' \
|
||||
{-t,--timestamps}'[Show timestamps]' \
|
||||
'*:containers:__docker_containers'
|
||||
;;
|
||||
(port)
|
||||
_arguments \
|
||||
'1:containers:__docker_runningcontainers' \
|
||||
'2:port:_ports'
|
||||
;;
|
||||
(pause|unpause)
|
||||
_arguments \
|
||||
'1:containers:__docker_runningcontainers'
|
||||
;;
|
||||
(start)
|
||||
_arguments \
|
||||
{-a,--attach}'[Attach container'"'"'s stdout/stderr and forward all signals]' \
|
||||
{-i,--interactive}'[Attach container'"'"'s stding]' \
|
||||
'*:containers:__docker_stoppedcontainers'
|
||||
;;
|
||||
(rm)
|
||||
_arguments \
|
||||
{-f,--force}'[Force removal]' \
|
||||
{-l,--link}'[Remove the specified link and not the underlying container]' \
|
||||
{-v,--volumes}'[Remove the volumes associated to the container]' \
|
||||
'*:containers:__docker_stoppedcontainers'
|
||||
;;
|
||||
(rmi)
|
||||
_arguments \
|
||||
{-f,--force}'[Force removal]' \
|
||||
'--no-prune[Do not delete untagged parents]' \
|
||||
'*:images:__docker_images'
|
||||
;;
|
||||
(restart|stop)
|
||||
_arguments \
|
||||
{-t,--time=-}'[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)' \
|
||||
'*:containers:__docker_runningcontainers'
|
||||
;;
|
||||
(top)
|
||||
_arguments \
|
||||
'1:containers:__docker_runningcontainers' \
|
||||
'(-)*:: :->ps-arguments'
|
||||
case $state in
|
||||
(ps-arguments)
|
||||
_ps
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
(ps)
|
||||
_arguments \
|
||||
{-a,--all}'[Show all containers]' \
|
||||
'--before=-[Show only container created before...]:containers:__docker_containers' \
|
||||
'*'{-f,--filter=-}'[Filter values]:filter: ' \
|
||||
{-l,--latest}'[Show only the latest created container]' \
|
||||
'-n[Show n last created containers, include non-running one]:n:(1 5 10 25 50)' \
|
||||
'--no-trunc[Do not truncate output]' \
|
||||
{-q,--quiet}'[Only show numeric IDs]' \
|
||||
{-s,--size}'[Display total file sizes]' \
|
||||
'--since=-[Show only containers created since...]:containers:__docker_containers'
|
||||
;;
|
||||
(tag)
|
||||
_arguments \
|
||||
{-f,--force}'[force]'\
|
||||
':image:__docker_images'\
|
||||
':repository:__docker_repositories_with_tags'
|
||||
;;
|
||||
(create|run)
|
||||
_arguments \
|
||||
{-a,--attach}'[Attach to stdin, stdout or stderr]' \
|
||||
'*--add-host=-[Add a custom host-to-IP mapping]:host\:ip mapping: ' \
|
||||
{-c,--cpu-shares=-}'[CPU shares (relative weight)]:CPU shares:(0 10 100 200 500 800 1000)' \
|
||||
'*--cap-add=-[Add Linux capabilities]:capability: ' \
|
||||
'*--cap-drop=-[Drop Linux capabilities]:capability: ' \
|
||||
'--cidfile=-[Write the container ID to the file]:CID file:_files' \
|
||||
'--cpuset=-[CPUs in which to allow execution]:CPU set: ' \
|
||||
{-d,--detach}'[Detached mode: leave the container running in the background]' \
|
||||
'*--device=-[Add a host device to the container]:device:_files' \
|
||||
'*--dns=-[Set custom dns servers]:dns server: ' \
|
||||
'*--dns-search=-[Set custom DNS search domains]:dns domains: ' \
|
||||
'*'{-e,--environment=-}'[Set environment variables]:environment variable: ' \
|
||||
'--entrypoint=-[Overwrite the default entrypoint of the image]:entry point: ' \
|
||||
'*--env-file=-[Read environment variables from a file]:environment file:_files' \
|
||||
'*--expose=-[Expose a port from the container without publishing it]: ' \
|
||||
{-h,--hostname=-}'[Container host name]:hostname:_hosts' \
|
||||
{-i,--interactive}'[Keep stdin open even if not attached]' \
|
||||
'*--link=-[Add link to another container]:link:->link' \
|
||||
'*--lxc-conf=-[Add custom lxc options]:lxc options: ' \
|
||||
'-m[Memory limit (in bytes)]:limit: ' \
|
||||
'--name=-[Container name]:name: ' \
|
||||
'--net=-[Network mode]:network mode:(bridge none container: host)' \
|
||||
{-P,--publish-all}'[Publish all exposed ports]' \
|
||||
'*'{-p,--publish=-}'[Expose a container'"'"'s port to the host]:port:_ports' \
|
||||
'--privileged[Give extended privileges to this container]' \
|
||||
'--restart=-[Restart policy]:restart policy:(no on-failure always)' \
|
||||
'--rm[Remove intermediate containers when it exits]' \
|
||||
'*--security-opt=-[Security options]:security option: ' \
|
||||
'--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]' \
|
||||
{-t,--tty}'[Allocate a pseudo-tty]' \
|
||||
{-u,--user=-}'[Username or UID]:user:_users' \
|
||||
'*-v[Bind mount a volume]:volume: '\
|
||||
'*--volumes-from=-[Mount volumes from the specified container]:volume: ' \
|
||||
{-w,--workdir=-}'[Working directory inside the container]:directory:_directories' \
|
||||
'(-):images:__docker_images' \
|
||||
'(-):command: _command_names -e' \
|
||||
'*::arguments: _normal'
|
||||
|
||||
case $state in
|
||||
(link)
|
||||
if compset -P '*:'; then
|
||||
_wanted alias expl 'Alias' compadd -E ""
|
||||
else
|
||||
__docker_runningcontainers -qS ":"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
(pull|search)
|
||||
_arguments ':name:__docker_search'
|
||||
;;
|
||||
(push)
|
||||
_arguments ':images:__docker_images'
|
||||
;;
|
||||
(save)
|
||||
_arguments \
|
||||
{-o,--output=-}'[Write to file]:file:_files' \
|
||||
':images:__docker_images'
|
||||
;;
|
||||
(wait)
|
||||
_arguments ':containers:__docker_runningcontainers'
|
||||
;;
|
||||
(help)
|
||||
_arguments ':subcommand:__docker_commands'
|
||||
;;
|
||||
(*)
|
||||
_message 'Unknown sub command'
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
_docker () {
|
||||
# Support for subservices, which allows for `compdef _docker docker-shell=_docker_containers`.
|
||||
# Based on /usr/share/zsh/functions/Completion/Unix/_git without support for `ret`.
|
||||
if [[ $service != docker ]]; then
|
||||
_call_function - _$service
|
||||
return
|
||||
fi
|
||||
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
'-H[tcp://host:port to bind/connect to]:socket: ' \
|
||||
'(-): :->command' \
|
||||
'(-)*:: :->option-or-argument'
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
|
||||
fi
|
||||
case $state in
|
||||
(command)
|
||||
__docker_commands
|
||||
;;
|
||||
(option-or-argument)
|
||||
curcontext=${curcontext%:*:*}:docker-$words[1]:
|
||||
__docker_subcommand
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_docker "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 4
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 4
|
||||
# End:
|
||||
# vim: ft=zsh sw=4 ts=4 et
|
197
.zprezto/modules/completion/external/src/_docker-compose
vendored
Normal file
197
.zprezto/modules/completion/external/src/_docker-compose
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
#compdef docker-compose
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Docker Compose (http://docs.docker.com/compose/).
|
||||
# Adapted from boot2docker completion by hhatto (https://github.com/hhatto)
|
||||
# and docker completion by @aeonazaan and @bobmaerten.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * ilkka (https://github.com/ilkka)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# helper function for getting *.yml (compose) files
|
||||
__yml_files_in_current_dir() {
|
||||
_values 'YAML files' *.yml
|
||||
}
|
||||
|
||||
# helper function for completing services in current project
|
||||
__services() {
|
||||
declare -a services_cmd
|
||||
services_cmd=($(sed -n -E 's/^([^[:space:]][^:]*):/\1/p' docker-compose.yml | tr \\n ' '))
|
||||
_describe 'services' services_cmd
|
||||
}
|
||||
|
||||
# subcommands
|
||||
local -a _docker_compose_cmds
|
||||
|
||||
_docker_compose_cmds=(
|
||||
'build:Build or rebuild services' \
|
||||
'help:Get help on a command' \
|
||||
'kill:Kill containers' \
|
||||
'logs:View output from containers' \
|
||||
'port:Print the public port for a port binding' \
|
||||
'ps:List containers' \
|
||||
'pull:Pulls service images' \
|
||||
'rm:Remove stopped containers' \
|
||||
'run:Run a one-off command' \
|
||||
'scale:Set number of containers for a service' \
|
||||
'start:Start services' \
|
||||
'stop:Stop services' \
|
||||
'restart:Restart services' \
|
||||
'up:Create and start containers'
|
||||
)
|
||||
|
||||
# subcommand completion functions
|
||||
__build() {
|
||||
_arguments \
|
||||
'--no-cache[Do not use cache when building image]'
|
||||
__services
|
||||
}
|
||||
|
||||
__help() {
|
||||
_values 'Get help for subcommand' \
|
||||
'build' \
|
||||
'help' \
|
||||
'kill' \
|
||||
'logs' \
|
||||
'port' \
|
||||
'ps' \
|
||||
'pull' \
|
||||
'rm' \
|
||||
'run' \
|
||||
'scale' \
|
||||
'start' \
|
||||
'stop' \
|
||||
'restart' \
|
||||
'up'
|
||||
}
|
||||
|
||||
__kill() {
|
||||
_arguments \
|
||||
'-s[Signal to send instead of SIGKILL]'
|
||||
__services
|
||||
}
|
||||
|
||||
__logs() {
|
||||
_arguments \
|
||||
'--no-color[Monochrome output]'
|
||||
__services
|
||||
}
|
||||
|
||||
__port() {
|
||||
_arguments \
|
||||
'--protocol:protocol:(tcp udp)' \
|
||||
'--index[Index of container]:index'
|
||||
__services
|
||||
}
|
||||
|
||||
__ps() {
|
||||
_arguments \
|
||||
'-q[Only display IDs]'
|
||||
__services
|
||||
}
|
||||
|
||||
__pull() {
|
||||
_arguments \
|
||||
'--allow-insecure-ssl[Allow insecure connections to the docker registry]'
|
||||
__services
|
||||
}
|
||||
|
||||
__rm() {
|
||||
_arguments \
|
||||
"--force[Don't ask for confirmation]" \
|
||||
'-v[Remove volumes]'
|
||||
__services
|
||||
}
|
||||
|
||||
__run() {
|
||||
_arguments \
|
||||
'--allow-insecure-ssl[Allow insecure connections to the docker registry]' \
|
||||
'-d[Detached mode: Run container in the background, print new container name.]' \
|
||||
'--entrypoint[Override the entrypoint of the image.]:command:()' \
|
||||
'-e[Set an environment variable.]:key=val:()' \
|
||||
"--no-deps[Don't start linked services.]" \
|
||||
'--rm[Remove container after run. Ignored in detached mode.]' \
|
||||
"--service-ports[Run command with the service's ports enabled and mapped to the host.]" \
|
||||
'-T[Disable pseudo-tty allocation.]'
|
||||
__services
|
||||
}
|
||||
|
||||
__scale() {
|
||||
__services
|
||||
}
|
||||
|
||||
__start() {
|
||||
__services
|
||||
}
|
||||
|
||||
__stop() {
|
||||
__services
|
||||
}
|
||||
|
||||
__restart() {
|
||||
__services
|
||||
}
|
||||
|
||||
__up() {
|
||||
_arguments \
|
||||
'--allow-insecure-ssl[Allow insecure connections to the docker registry]' \
|
||||
'-d[Detached mode: Run containers in the background, print new container names.]' \
|
||||
'--no-color[Produce monochrome output.]' \
|
||||
"--no-deps[Don't start linked services.]" \
|
||||
"--no-recreate[If containers already exist, don't recreate them.]" \
|
||||
"--no-build[Don't build an image, even if it's missing]"
|
||||
__services
|
||||
}
|
||||
|
||||
# common args
|
||||
_arguments \
|
||||
'--verbose[Show more output]' \
|
||||
'--version[Print version and exit]' \
|
||||
'--file[Specify an alternate compose file]:__yml_files_in_current_dir' \
|
||||
'--project-name[Specify an alternate project name]:args' \
|
||||
'*:: :->command'
|
||||
|
||||
# start machines!
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands 'docker-compose command' _docker_compose_cmds
|
||||
fi
|
||||
|
||||
local -a _command_args
|
||||
case "$words[1]" in
|
||||
build)
|
||||
__build ;;
|
||||
help)
|
||||
__help ;;
|
||||
kill)
|
||||
__kill ;;
|
||||
logs)
|
||||
__logs ;;
|
||||
port)
|
||||
__port ;;
|
||||
ps)
|
||||
__ps ;;
|
||||
pull)
|
||||
__pull ;;
|
||||
rm)
|
||||
__rm ;;
|
||||
run)
|
||||
__run ;;
|
||||
scale)
|
||||
__scale ;;
|
||||
start)
|
||||
__start ;;
|
||||
stop)
|
||||
__stop ;;
|
||||
restart)
|
||||
__restart ;;
|
||||
up)
|
||||
__up ;;
|
||||
esac
|
||||
|
294
.zprezto/modules/completion/external/src/_docker-machine
vendored
Normal file
294
.zprezto/modules/completion/external/src/_docker-machine
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
#compdef docker-machine
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Docker Machine (http://docs.docker.com/machine/).
|
||||
# Adapted from boot2docker completion by hhatto (https://github.com/hhatto)
|
||||
# and docker completion by @aeonazaan and @bobmaerten.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * ilkka (https://github.com/ilkka)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# helper function for completing available machines
|
||||
__machines() {
|
||||
declare -a machines_cmd
|
||||
machines_cmd=($(docker-machine ls|tail +2|awk '{print $1":"$3"("$4")"}'))
|
||||
_describe 'machines' machines_cmd
|
||||
}
|
||||
|
||||
# subcommands
|
||||
local -a _docker_machine_cmds
|
||||
|
||||
_docker_machine_cmds=(
|
||||
'active:Get or set the active machine' \
|
||||
'create:Create a machine' \
|
||||
'config:Print the connection config for machine' \
|
||||
'inspect:Inspect information about a machine' \
|
||||
'ip:Get the IP address of a machine' \
|
||||
'kill:Kill a machine' \
|
||||
'ls:List machines' \
|
||||
'restart:Restart a machine' \
|
||||
'rm:Remove a machine' \
|
||||
'env:Display the commands to set up the environment for the Docker client' \
|
||||
'ssh:Log into or run a command on a machine with SSH' \
|
||||
'start:Start a machine' \
|
||||
'stop:Stop a machine' \
|
||||
'upgrade:Upgrade a machine to the latest version of Docker' \
|
||||
'url:Get the URL of a machine' \
|
||||
'help:Shows a list of commands or help for one command'
|
||||
)
|
||||
|
||||
# subcommand completion functions
|
||||
__active() {
|
||||
__machines
|
||||
}
|
||||
|
||||
__help() {
|
||||
_values 'Get help for subcommand' \
|
||||
'active' \
|
||||
'create' \
|
||||
'config' \
|
||||
'inspect' \
|
||||
'ip' \
|
||||
'kill' \
|
||||
'ls' \
|
||||
'restart' \
|
||||
'rm' \
|
||||
'env' \
|
||||
'ssh' \
|
||||
'start' \
|
||||
'stop' \
|
||||
'upgrade' \
|
||||
'url' \
|
||||
'help'
|
||||
}
|
||||
|
||||
__create() {
|
||||
_arguments \
|
||||
'--amazonec2-access-key:AWS Access Key:()' \
|
||||
'--amazonec2-ami:AWS machine image:()' \
|
||||
'--amazonec2-instance-type:AWS instance type:()' \
|
||||
'--amazonec2-region:AWS region:()' \
|
||||
'--amazonec2-root-size:AWS root disk size (in GB):()' \
|
||||
'--amazonec2-secret-key:AWS Secret Key:()' \
|
||||
'--amazonec2-security-group:AWS VPC security group:()' \
|
||||
'--amazonec2-session-token:AWS Session Token:()' \
|
||||
'--amazonec2-subnet-id:AWS VPC subnet id:()' \
|
||||
'--amazonec2-vpc-id:AWS VPC id:()' \
|
||||
'--amazonec2-zone:AWS zone for instance (i.e. a,b,c,d,e):()' \
|
||||
'--azure-docker-port:Azure Docker port:()' \
|
||||
'--azure-image:Azure image name. Default is Ubuntu 14.04 LTS x64:()' \
|
||||
'--azure-location:Azure location:()' \
|
||||
'--azure-password:Azure user password:()' \
|
||||
'--azure-publish-settings-file:Azure publish settings file:()' \
|
||||
'--azure-size:Azure size:()' \
|
||||
'--azure-ssh-port:Azure SSH port:()' \
|
||||
'--azure-subscription-cert:Azure subscription cert:()' \
|
||||
'--azure-subscription-id:Azure subscription ID:()' \
|
||||
'--azure-username:Azure username:()' \
|
||||
'--digitalocean-access-token:Digital Ocean access token:()' \
|
||||
'--digitalocean-image:Digital Ocean Image:()' \
|
||||
'--digitalocean-region:Digital Ocean region:()' \
|
||||
'--digitalocean-size:Digital Ocean size:()' \
|
||||
'--google-disk-size:GCE Instance Disk Size (in GB):()' \
|
||||
'--google-machine-type:GCE Machine Type:()' \
|
||||
'--google-project:GCE Project:()' \
|
||||
'--google-scopes:GCE Scopes (comma-separated if multiple scopes):()' \
|
||||
'--google-username:GCE User Name:()' \
|
||||
'--google-zone:GCE Zone:()' \
|
||||
'--openstack-auth-url:OpenStack authentication URL:()' \
|
||||
'--openstack-endpoint-type:OpenStack endpoint type (adminURL, internalURL or publicURL):()' \
|
||||
'--openstack-flavor-id:OpenStack flavor id to use for the instance:()' \
|
||||
'--openstack-flavor-name:OpenStack flavor name to use for the instance:()' \
|
||||
'--openstack-floatingip-pool:OpenStack floating IP pool to get an IP from to assign to the instance:()' \
|
||||
'--openstack-image-id:OpenStack image id to use for the instance:()' \
|
||||
'--openstack-image-name:OpenStack image name to use for the instance:()' \
|
||||
'--openstack-net-id:OpenStack image name to use for the instance:()' \
|
||||
'--openstack-net-name:OpenStack network name the machine will be connected on:()' \
|
||||
'--openstack-password:OpenStack password:()' \
|
||||
'--openstack-region:OpenStack region name:()' \
|
||||
'--openstack-sec-groups:OpenStack comma separated security groups for the machine:()' \
|
||||
'--openstack-ssh-port:OpenStack SSH port:()' \
|
||||
'--openstack-ssh-user:OpenStack SSH user:()' \
|
||||
'--openstack-tenant-id:OpenStack tenant id:()' \
|
||||
'--openstack-tenant-name:OpenStack tenant name:()' \
|
||||
'--openstack-username:OpenStack username:()' \
|
||||
'--rackspace-api-key:Rackspace API key:()' \
|
||||
'--rackspace-docker-install:Set if docker have to be installed on the machine:()' \
|
||||
'--rackspace-endpoint-type:Rackspace endpoint type (adminURL, internalURL or the default publicURL):()' \
|
||||
'--rackspace-flavor-id:Rackspace flavor ID. Default: General Purpose 1GB:()' \
|
||||
'--rackspace-image-id:Rackspace image ID. Default: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM):()' \
|
||||
'--rackspace-region:Rackspace region name:()' \
|
||||
'--rackspace-ssh-port:SSH port for the newly booted machine. Set to 22 by default:()' \
|
||||
'--rackspace-ssh-user:SSH user for the newly booted machine. Set to root by default:()' \
|
||||
'--rackspace-username:Rackspace account username:()' \
|
||||
'--softlayer-api-endpoint:softlayer api endpoint to use:()' \
|
||||
'--softlayer-api-key:softlayer user API key:()' \
|
||||
"--softlayer-cpu:number of CPUs for the machine:()" \
|
||||
'--softlayer-disk-size:Disk size for machine, a value of 0 uses the default size on softlayer:()' \
|
||||
'--softlayer-domain:domain name for machine:()' \
|
||||
'--softlayer-hostname:hostname for the machine:()' \
|
||||
'--softlayer-hourly-billing:set hourly billing for machine - on by default:()' \
|
||||
'--softlayer-image:OS image for machine:()' \
|
||||
'--softlayer-local-disk:use machine local disk instead of softlayer SAN:()' \
|
||||
'--softlayer-memory:Memory in MB for machine:()' \
|
||||
'--softlayer-private-net-only:Use only private networking:()' \
|
||||
'--softlayer-region:softlayer region for machine:()' \
|
||||
'--softlayer-user:softlayer user account name:()' \
|
||||
'--url:URL of host when no driver is selected:()' \
|
||||
'--virtualbox-boot2docker-url:The URL of the boot2docker image. Defaults to the latest available version:()' \
|
||||
'--virtualbox-disk-size:Size of disk for host in MB:()' \
|
||||
'--virtualbox-memory:Size of memory for host in MB:()' \
|
||||
'--vmwarefusion-boot2docker-url:Fusion URL for boot2docker image:()' \
|
||||
'--vmwarefusion-disk-size:Fusion size of disk for host VM (in MB):()' \
|
||||
'--vmwarefusion-memory-size:Fusion size of memory for host VM (in MB):()' \
|
||||
'--vmwarevcloudair-catalog:vCloud Air Catalog (default is Public Catalog):()' \
|
||||
'--vmwarevcloudair-catalogitem:vCloud Air Catalog Item (default is Ubuntu Precise):()' \
|
||||
'--vmwarevcloudair-computeid:vCloud Air Compute ID (if using Dedicated Cloud):()' \
|
||||
'--vmwarevcloudair-cpu-count:vCloud Air VM Cpu Count (default 1):()' \
|
||||
'--vmwarevcloudair-docker-port:vCloud Air Docker port:()' \
|
||||
'--vmwarevcloudair-edgegateway:vCloud Air Org Edge Gateway (Default is <vdcid>):()' \
|
||||
'--vmwarevcloudair-memory-size:vCloud Air VM Memory Size in MB (default 2048):()' \
|
||||
'--vmwarevcloudair-orgvdcnetwork:vCloud Air Org VDC Network (Default is <vdcid>-default-routed):()' \
|
||||
'--vmwarevcloudair-password:vCloud Air password:()' \
|
||||
'--vmwarevcloudair-provision:vCloud Air Install Docker binaries (default is true):()' \
|
||||
'--vmwarevcloudair-publicip:vCloud Air Org Public IP to use:()' \
|
||||
'--vmwarevcloudair-ssh-port:vCloud Air SSH port:()' \
|
||||
'--vmwarevcloudair-username:vCloud Air username:()' \
|
||||
'--vmwarevcloudair-vdcid:vCloud Air VDC ID:()' \
|
||||
'--vmwarevsphere-boot2docker-url:vSphere URL for boot2docker image:()' \
|
||||
'--vmwarevsphere-compute-ip:vSphere compute host IP where the docker VM will be instantiated:()' \
|
||||
'--vmwarevsphere-cpu-count:vSphere CPU number for docker VM:()' \
|
||||
'--vmwarevsphere-datacenter:vSphere datacenter for docker VM:()' \
|
||||
'--vmwarevsphere-datastore:vSphere datastore for docker VM:()' \
|
||||
'--vmwarevsphere-disk-size:vSphere size of disk for docker VM (in MB):()' \
|
||||
'--vmwarevsphere-memory-size:vSphere size of memory for docker VM (in MB):()' \
|
||||
'--vmwarevsphere-network:vSphere network where the docker VM will be attached:()' \
|
||||
'--vmwarevsphere-password:vSphere password:()' \
|
||||
'--vmwarevsphere-pool:vSphere resource pool for docker VM:()' \
|
||||
'--vmwarevsphere-username:vSphere username:()' \
|
||||
'--vmwarevsphere-vcenter:vSphere IP/hostname for vCenter:()' \
|
||||
'--driver:Driver to create machine with.:(amazonec2 azure digitalocean google none openstack rackspace softlayer virtualbox vmwarefusion vmwarevcloudair vmwarevsphere)' \
|
||||
'--swarm:Configure Machine with Swarm:()' \
|
||||
'--swarm-master:Configure Machine to be a Swarm master:()' \
|
||||
'--swarm-discovery:Discovery service to use with Swarm:()' \
|
||||
'--swarm-host:ip/socket to listen on for Swarm master:()' \
|
||||
'--swarm-addr:addr to advertise for Swarm (default: detect and use the machine IP):()'
|
||||
}
|
||||
|
||||
__config() {
|
||||
_arguments \
|
||||
'--swarm[Display the Swarm config instead of the Docker daemon]'
|
||||
__machines
|
||||
}
|
||||
|
||||
__inspect() {
|
||||
__machines
|
||||
}
|
||||
|
||||
__ip() {
|
||||
__machines
|
||||
}
|
||||
|
||||
__env() {
|
||||
_arguments \
|
||||
'--unset[Unset variables instead of setting them]' \
|
||||
'--swarm[Display the Swarm config instead of the Docker daemon]'
|
||||
__machines
|
||||
}
|
||||
|
||||
__kill() {
|
||||
__machines
|
||||
}
|
||||
|
||||
__ls() {
|
||||
_arguments \
|
||||
'--quiet[Enable quiet mode]'
|
||||
}
|
||||
|
||||
__restart() {
|
||||
__machines
|
||||
}
|
||||
|
||||
__start() {
|
||||
__machines
|
||||
}
|
||||
|
||||
__stop() {
|
||||
__machines
|
||||
}
|
||||
|
||||
__rm() {
|
||||
__machines
|
||||
}
|
||||
|
||||
__ssh() {
|
||||
__machines
|
||||
}
|
||||
|
||||
__upgrade() {
|
||||
__machines
|
||||
}
|
||||
|
||||
__url() {
|
||||
__machines
|
||||
}
|
||||
|
||||
# common args
|
||||
_arguments \
|
||||
'--debug[Enable debug mode]' \
|
||||
'--storage-path[Configures storage path]:_files' \
|
||||
'--tls-ca-cert[CA to verify remotes against]:_files' \
|
||||
'--tls-ca-key[Private key to generate certificates]:_files' \
|
||||
'--tls-client-cert[Client cert to use for TLS]:_files' \
|
||||
'--tls-client-key[Private key used in client TLS auth]:_files' \
|
||||
'--help[show help]' \
|
||||
'--version[print the version]' \
|
||||
'*:: :->command'
|
||||
|
||||
# start machines!
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands 'docker-machine command' _docker_machine_cmds
|
||||
fi
|
||||
|
||||
local -a _command_args
|
||||
case "$words[1]" in
|
||||
active)
|
||||
__active ;;
|
||||
create)
|
||||
__create ;;
|
||||
config)
|
||||
__config ;;
|
||||
inspect)
|
||||
__inspect ;;
|
||||
ip)
|
||||
__ip ;;
|
||||
kill)
|
||||
__kill ;;
|
||||
ls)
|
||||
__ls ;;
|
||||
restart)
|
||||
__restart ;;
|
||||
rm)
|
||||
__rm ;;
|
||||
env)
|
||||
__env ;;
|
||||
ssh)
|
||||
__ssh ;;
|
||||
start)
|
||||
__start ;;
|
||||
stop)
|
||||
__stop ;;
|
||||
upgrade)
|
||||
__upgrade ;;
|
||||
url)
|
||||
__url ;;
|
||||
help)
|
||||
__help ;;
|
||||
esac
|
58
.zprezto/modules/completion/external/src/_docpad
vendored
Normal file
58
.zprezto/modules/completion/external/src/_docpad
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
#compdef docpad
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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
|
166
.zprezto/modules/completion/external/src/_drush
vendored
Normal file
166
.zprezto/modules/completion/external/src/_drush
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
#compdef drush
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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
|
44
.zprezto/modules/completion/external/src/_dzen2
vendored
Normal file
44
.zprezto/modules/completion/external/src/_dzen2
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
#compdef dzen2
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for dzen2 0.8.5 ( https://github.com/robm/dzen )
|
||||
# Last updated: 31.03.2013
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Valodim ( https://github.com/Valodim )
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Notes
|
||||
# -----
|
||||
#
|
||||
# the _x_color completer has rather outdated paths, a zstyle like this helps
|
||||
# get the x colors right (the list is rather long, then)
|
||||
#
|
||||
# zstyle ":completion:*:colors" path '/etc/X11/rgb.txt'
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'-fg[Set foreground color]:foreground color:_x_color' \
|
||||
'-bg[Set background color]:background color:_x_color' \
|
||||
'-fn[Set font]:font:_x_font' \
|
||||
'-ta[Set alignment of title window content]:alignment:( l c r )' \
|
||||
'-tw[Set title window width]:width (pixels)' \
|
||||
'-sa[Set alignment of slave window]:alignment:( l c r )' \
|
||||
'-l[Number of lines to display in slave window]:lines' \
|
||||
'-e[Set up events and actions]:event string' \
|
||||
'-m[Start up in menu mode]' \
|
||||
'-u[Update contents of title and slave window simultaneously]' \
|
||||
'-p[Persist EOF]:timeout (seconds)' \
|
||||
'-x[Set x position on the screen]:x position (pixels)' \
|
||||
'-y[Set y position on the screen]:y position (pixels)' \
|
||||
'-h[Set line height]:line height (pixels)' \
|
||||
'-w[Set window width]:width (pixels)' \
|
||||
'-xs[Set the Xinerama screen number where dzen should appear]:screen number' \
|
||||
'-v[Display version information]' && return 0
|
139
.zprezto/modules/completion/external/src/_emulator
vendored
Normal file
139
.zprezto/modules/completion/external/src/_emulator
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
#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
|
51
.zprezto/modules/completion/external/src/_exportfs
vendored
Normal file
51
.zprezto/modules/completion/external/src/_exportfs
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
#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 "$@"
|
83
.zprezto/modules/completion/external/src/_fab
vendored
Normal file
83
.zprezto/modules/completion/external/src/_fab
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
#compdef fab
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Fabric (http://fabfile.org)
|
||||
#
|
||||
# Source: https://github.com/vhbit/fabric-zsh-autocomplete
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Valerii Hiora (https://github.com/vhbit)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local curcontext=$curcontext state line
|
||||
declare -A opt_args
|
||||
|
||||
declare target_list
|
||||
target_list=(`fab --shortlist 2>/dev/null`)
|
||||
|
||||
_targets() {
|
||||
_describe -t commands "fabric targets" target_list
|
||||
}
|
||||
|
||||
output_levels=(
|
||||
'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.'
|
||||
'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!'
|
||||
'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.'
|
||||
'running: Printouts of commands being executed or files transferred, e.g. [myserver] run: ls /var/www. Also controls printing of tasks being run, e.g. [myserver] Executing task ''foo''.'
|
||||
'stdout: Local, or remote, stdout, i.e. non-error output from commands.'
|
||||
'stderr: Local, or remote, stderr, i.e. error-related output from commands.'
|
||||
'user: User-generated output, i.e. local output printed by fabfile code via use of the fastprint or puts functions.'
|
||||
)
|
||||
|
||||
_arguments -w -S -C \
|
||||
'(-)'{-h,--help}'[show this help message and exit]: :->noargs' \
|
||||
'(-)'{-V,--version}'[show program''s version number and exit]: :->noargs' \
|
||||
'(-)--list[print list of possible commands and exit]: :->noargs' \
|
||||
'(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \
|
||||
'(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \
|
||||
'(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \
|
||||
"(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \
|
||||
'(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \
|
||||
'(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \
|
||||
'(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \
|
||||
'(-p+ --password=-)'{-p+,--password=-}'[password for use with authentication and/or sudo]: :' \
|
||||
'(-H+ --hosts=-)'{-H+,--hosts=-}'[comma separated list of hosts to operate on]: :' \
|
||||
'(-R+ --roles=-)'{-R+,--roles=-}'[comma separated list of roles to operate on]: :' \
|
||||
'(-a --no-agent)'{-a,--no-agent}'[don''t use the running SSH agent]' \
|
||||
'(-k --no-keys)'{-k,--no-keys}'[don''t load private key files from ~/.ssh/]' \
|
||||
'(-w --warn-only)'{-w,--warn-only}'[warn instead of abort, when commands fail]' \
|
||||
'-i+[path to SSH private key file. May be repeated]: :_files' \
|
||||
"(-f+ --fabfile=)"{-f+,--fabfile=}"[Python module file to import]: :_files -g *.py" \
|
||||
'(-c+ --config=-)'{-c+,--config=-}'[specify location of config file to use]: :_files' \
|
||||
'(-s+ --shell=-)'{-s+,--shell=-}'[specify a new shell, defaults to ''/bin/bash -l -c'']: :' \
|
||||
'(--hide=-)--hide=-[comma-separated list of output levels to hide]: :->levels' \
|
||||
'(--show=-)--show=-[comma-separated list of output levels to show]: :->levels' \
|
||||
'*::: :->subcmds' && return 0
|
||||
|
||||
if [[ CURRENT -ge 1 ]]; then
|
||||
case $state in
|
||||
noargs)
|
||||
_message "nothing to complete";;
|
||||
levels)
|
||||
_describe -t commands "output levels" output_levels;;
|
||||
*)
|
||||
_targets;;
|
||||
esac
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
# 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
|
48
.zprezto/modules/completion/external/src/_gas
vendored
Normal file
48
.zprezto/modules/completion/external/src/_gas
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
#compdef gas
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for gas (https://github.com/walle/gas).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Fredrik Wallgren <fredrik.wallgren@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local curcontext="$curcontext" state line cmds ret=1
|
||||
|
||||
_arguments -C \
|
||||
'(- 1 *)'{-v,--version}'[display version information]' \
|
||||
'(-h|--help)'{-h,--help}'[show help information]' \
|
||||
'1: :->cmds' \
|
||||
'*: :->args' && ret=0
|
||||
|
||||
case "$state" in
|
||||
(cmds)
|
||||
cmds=(
|
||||
"version:Prints Gas's version"
|
||||
"use:Uses author"
|
||||
"show:Shows your current user"
|
||||
"list:Lists your authors"
|
||||
"import:Imports current user to gasconfig"
|
||||
"help:Describe available tasks or one specific task"
|
||||
"delete:Deletes author"
|
||||
"add:Adds author to gasconfig"
|
||||
)
|
||||
_describe -t commands 'gas command' cmds && ret=0
|
||||
;;
|
||||
(args)
|
||||
case "$line[1]" in
|
||||
(use|delete)
|
||||
_values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
73
.zprezto/modules/completion/external/src/_geany
vendored
Normal file
73
.zprezto/modules/completion/external/src/_geany
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
#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
|
499
.zprezto/modules/completion/external/src/_gem
vendored
Normal file
499
.zprezto/modules/completion/external/src/_gem
vendored
Normal file
@@ -0,0 +1,499 @@
|
||||
#compdef gem gem1.9 macgem
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for gem (http://rubygems.org).
|
||||
#
|
||||
# Source: https://gist.github.com/164465
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Alex Vollmer (https://github.com/alexvollmer)
|
||||
# * Tim Pope (https://github.com/tpope)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]"
|
||||
"(-V --verbose)"{-V,--verbose}"[Set the verbose level of output]"
|
||||
"(-q --quiet)"{-q,--quiet}"[Silence commands]"
|
||||
"--config-file[Use this config file instead of default]:file:_files"
|
||||
"--backtrace[Show stack backtrace on errors]"
|
||||
"--debug[Turn on Ruby debugging]"
|
||||
$nul_arg
|
||||
)
|
||||
|
||||
__all_gems() {
|
||||
_gem_names=($(${service} list | awk '{print $1}'))
|
||||
compadd "$@" -k _gem_names
|
||||
}
|
||||
|
||||
__all_gems_all() {
|
||||
_gem_names=($(gem list | awk '{print $1}') "--all")
|
||||
compadd "$@" -k _gem_names
|
||||
}
|
||||
|
||||
__gem_help_arguments() {
|
||||
_args=("commands"
|
||||
"examples"
|
||||
"build"
|
||||
"cert"
|
||||
"check"
|
||||
"cleanup"
|
||||
"contents"
|
||||
"dependency"
|
||||
"environment"
|
||||
"fetch"
|
||||
"generate_index"
|
||||
"help"
|
||||
"install"
|
||||
"list"
|
||||
"lock"
|
||||
"mirror"
|
||||
"outdated"
|
||||
"owner"
|
||||
"pristine"
|
||||
"push"
|
||||
"query"
|
||||
"rdoc"
|
||||
"search"
|
||||
"server"
|
||||
"sources"
|
||||
"specification"
|
||||
"stale"
|
||||
"tumble"
|
||||
"uninstall"
|
||||
"unpack"
|
||||
"update"
|
||||
"which")
|
||||
compadd "$@" -k _args
|
||||
}
|
||||
|
||||
__gem_trust_policies() {
|
||||
_args=("NoSecurity"
|
||||
"LowSecurity"
|
||||
"MediumSecurity"
|
||||
"HighSecurity")
|
||||
compadd "$@" -k _args
|
||||
}
|
||||
|
||||
_gem_build() {
|
||||
_arguments \
|
||||
*:file:_files -f \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_cert() {
|
||||
_arguments \
|
||||
"(-a --add)"{-a,--add}"[Add a trusted certificate.]":file:_files \
|
||||
"(-l --list)"{-l,--list}"[List trusted certificates.]" \
|
||||
"(-r --remove)"{-r,--remove}"[Remove trusted certificates containing STRING.]" \
|
||||
"(-b --build)"{-b,--build}"[Build private key and self-signed certificate for EMAIL_ADDR.]" \
|
||||
"(-C --certificate)"{-C,--certificate}"[Certificate for --sign command.]":file:_files \
|
||||
"(-K --private-key)"{-K,--private-key}"[Private key for --sign command.]":file:_files \
|
||||
"(-s --sign)"{-s,--sign}"[Sign a certificate with my key and certificate.]":file:_files \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_check() {
|
||||
_arguments \
|
||||
"--verify[Verify gem file against its internal checksum]":file:_files \
|
||||
"(-a --alien)"{-a,--alien}"[Report 'unmanaged' or rogue files in the gem repository]" \
|
||||
"(-v --verbose)"{-v,--verbose}"[Spew more words]" \
|
||||
"(-t --test)"{-t,--test}"[Run unit tests for gem]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to run tests for]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_cleanup() {
|
||||
_arguments \
|
||||
"*:gemname:__all_gems" \
|
||||
"(-d --dryrun)"{-d,--dryrun}"[]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_contents() {
|
||||
_arguments \
|
||||
"*:gemname:__all_gems" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to contents]" \
|
||||
"--all[Contents for all gems]" \
|
||||
"(-s --spec-dir)"{-s,--spec-dir}"[Search for gems under specific paths]" \
|
||||
"(-l --no-lib-only)"{-l,--no-lib-only}"[Only return files in the Gem's lib_dirs]" \
|
||||
"--no-prefix[Don't include installed path prefix]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_dependency() {
|
||||
_arguments \
|
||||
":gemname:__all_gems" \
|
||||
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
|
||||
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
|
||||
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
|
||||
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
|
||||
"--source[Use URL as the remote source for gems]" \
|
||||
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to dependency]" \
|
||||
"--platform[Specify the platform of gem to dependency]" \
|
||||
"(-R --no-reverse-dependencies)"{-R,--no-reverse-dependencies}"[Include reverse dependencies in the output]" \
|
||||
"(-p --pipe)"{-p,--pipe}"[Pipe Format (name --version ver)]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_environment() {
|
||||
typeset -g _environment_arg=
|
||||
_environment_arg='::environment:((packageversion\:"display the package version"
|
||||
gemdir\:"display the path where gems are installed"
|
||||
gempath\:"display path used to search for gems"
|
||||
version\:"display the gem format version"
|
||||
remotesources\:"display the remote gem servers"))'
|
||||
_arguments \
|
||||
$_environment_arg \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_fetch() {
|
||||
_arguments \
|
||||
"*:gemname:__all_gems" \
|
||||
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
|
||||
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
"--source[Use URL as the remote source for gems]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to fetch]" \
|
||||
"--platform[Specify the platform of gem to fetch]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_generate_index() {
|
||||
_arguments \
|
||||
"(-d --directory=DIRNAME)"{-d,--directory=-}"[repository base dir containing gems subdir]":directory:_directories \
|
||||
"--no-legacy[Generate indexes for RubyGems older than 1.2.0]" \
|
||||
"--no-modern[Generate indexes for RubyGems newer than 1.2.0]" \
|
||||
"--update[Update modern indexes with gems added since the last update]" \
|
||||
"--rss-gems-host=-[Host name where gems are served from, used for GUID and enclosure values]" \
|
||||
"--rss-host=-[Host name for more gems information, used for RSS feed link]" \
|
||||
"--rss-title=-[Set title for RSS feed]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_help() {
|
||||
_arguments \
|
||||
":argument:__gem_help_arguments" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_install() {
|
||||
_arguments \
|
||||
"*:gemname:__all_gems" \
|
||||
"(-i --install-dir)"{-i,--install-dir}"[Gem repository directory to get installed gems]":directory:_directories \
|
||||
"(-n --bindir)"{-n,--bindir}"[Directory where binary files are located]":directory:_directories \
|
||||
"(-d --no-rdoc)"{-d,--no-rdoc}"[Generate RDoc documentation for the gem on install]" \
|
||||
"--no-ri[Generate RI documentation for the gem on install]" \
|
||||
"(-E --no-env-shebang)"{-E,--no-env-shebang}"[Rewrite the shebang line on installed scripts to use /usr/bin/env]" \
|
||||
"(-f --no-force)"{-f,--no-force}"[Force gem to install, bypassing dependency checks]" \
|
||||
"(-t --no-test)"{-t,--no-test}"[Run unit tests prior to installation]" \
|
||||
"(-w --no-wrappers)"{-w,--no-wrappers}"[Use bin wrappers for executables Not available on dosish platforms]" \
|
||||
"(-P --trust-policy)"{-P,--trust-policy}"[Specify gem trust policy]:trust policy:__gem_trust_policies" \
|
||||
"--ignore-dependencies[Do not install any required dependent gems]" \
|
||||
"(-y --include-dependencies)"{-y,--include-dependencies}"[Unconditionally install the required dependent gems]" \
|
||||
"--no-format-executable[Make installed executable names match ruby. If ruby is ruby18, foo_exec will be foo_exec18]" \
|
||||
"--no-user-install[Install in user's home directory instead of GEM_HOME. Defaults to using home only if GEM_HOME is not writable.]" \
|
||||
"--development[Install any additional development dependencies]" \
|
||||
"--prerelease[Install prerelease versions of a gem if available. Defaults to skipping prereleases.]" \
|
||||
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
|
||||
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
|
||||
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
|
||||
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
|
||||
"--source[Use URL as the remote source for gems]" \
|
||||
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
|
||||
"--platform[Specify the platform of gem to install]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to install]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_list() {
|
||||
_arguments \
|
||||
":gem name: " \
|
||||
"(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to list]" \
|
||||
"(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
|
||||
"--no-versions[Display only gem names]" \
|
||||
"(-a --all)"{-a,--all}"[Display all gem versions]" \
|
||||
"--prerelease[Display prerelease versions]" \
|
||||
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
|
||||
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
|
||||
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
|
||||
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
|
||||
"--source[Use URL as the remote source for gems]" \
|
||||
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_lock() {
|
||||
_arguments \
|
||||
":gemname:__all_gems" \
|
||||
"(-s --no-strict)"{-s,--no-strict}"[fail if unable to satisfy a dependency]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_mirror() {
|
||||
_arguments \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_open() {
|
||||
_arguments \
|
||||
"*:gemname:__all_gems" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to open]"
|
||||
}
|
||||
|
||||
_gem_outdated() {
|
||||
_arguments \
|
||||
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
|
||||
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
|
||||
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
|
||||
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
|
||||
"--source[Use URL as the remote source for gems]" \
|
||||
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
|
||||
"--platform[Specify the platform of gem to outdated]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_owner() {
|
||||
_arguments \
|
||||
"(-a --add)"{-a,--add}"[Add an owner]" \
|
||||
"(-r --remove)"{-r,--remove}"[Remove an owner]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_pristine() {
|
||||
_arguments \
|
||||
":gem name:__all_gems_all" \
|
||||
"--all[Restore all installed gems to pristine condition]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to restore to pristine condition]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_push() {
|
||||
_arguments \
|
||||
*:file:_files -f \
|
||||
"(-p --http-proxy)"{-p,--http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_query() {
|
||||
_arguments \
|
||||
"(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to query]" \
|
||||
"(-n --name-matches)"{-n,--name-matches}"[Name of gem(s) to query on matches the provided REGEXP]" \
|
||||
"(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
|
||||
"--no-versions[Display only gem names]" \
|
||||
"(-a --all)"{-a,--all}"[Display all gem versions]" \
|
||||
"--prerelease[Display prerelease versions]" \
|
||||
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
|
||||
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
|
||||
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
|
||||
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
|
||||
"--source[Use URL as the remote source for gems]" \
|
||||
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_rdoc() {
|
||||
_arguments \
|
||||
":gem name:__all_gems_all" \
|
||||
"--all[Generate RDoc/RI documentation for all installed gems]" \
|
||||
"--no-rdoc[Include RDoc generated documents]" \
|
||||
"--no-ri[Include RI generated documents]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to rdoc]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_search() {
|
||||
_arguments \
|
||||
":gem name::" \
|
||||
"(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to search]" \
|
||||
"(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
|
||||
"--no-versions[Display only gem names]" \
|
||||
"(-a --all)"{-a,--all}"[Display all gem versions]" \
|
||||
"--prerelease[Display prerelease versions]" \
|
||||
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
|
||||
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
|
||||
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
|
||||
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
|
||||
"--source[Use URL as the remote source for gems]" \
|
||||
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_server() {
|
||||
_arguments \
|
||||
"(-p --port=PORT)"{-p,--port=-}"[port to listen on]" \
|
||||
"(-d --dir=GEMDIR)"{-d,--dir=-}"[directory from which to serve gems]":directory:_directories \
|
||||
"--no-daemon[run as a daemon]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_sources() {
|
||||
_arguments \
|
||||
"(-a --add)"{-a,--add}"[Add source]" \
|
||||
"(-l --list)"{-l,--list}"[List sources]" \
|
||||
"(-r --remove)"{-r,--remove}"[Remove source]" \
|
||||
"(-c --clear-all)"{-c,--clear-all}"[Remove all sources (clear the cache)]" \
|
||||
"(-u --update)"{-u,--update}"[Update source cache]" \
|
||||
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_specification() {
|
||||
_arguments \
|
||||
":gemname:__all_gems" \
|
||||
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
|
||||
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
|
||||
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
|
||||
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
|
||||
"--source[Use URL as the remote source for gems]" \
|
||||
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to examine]" \
|
||||
"--platform[Specify the platform of gem to specification]" \
|
||||
"--all[Output specifications for all versions of the gem]" \
|
||||
"--ruby[Output ruby format]" \
|
||||
"--yaml[Output RUBY format]" \
|
||||
"--marshal[Output Marshal format]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_stale() {
|
||||
_arguments \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_tumble() {
|
||||
_arguments \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_uninstall() {
|
||||
_arguments \
|
||||
"*:gemname:__all_gems" \
|
||||
"(-a --no-all)"{-a,--no-all}"[Uninstall all matching versions]" \
|
||||
"(-I --no-ignore-dependencies)"{-I,--no-ignore-dependencies}"[Ignore dependency requirements while uninstalling]" \
|
||||
"(-x --no-executables)"{-x,--no-executables}"[Uninstall applicable executables without confirmation]" \
|
||||
"(-i --install-dir)"{-i,--install-dir}"[Directory to uninstall gem from]":directory:_directories \
|
||||
"(-n --bindir)"{-n,--bindir}"[Directory to remove binaries from]":directory:_directories \
|
||||
"--no-user-install[Uninstall from user's home directory in addition to GEM_HOME.]" \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to uninstall]" \
|
||||
"--platform[Specify the platform of gem to uninstall]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_unpack() {
|
||||
_arguments \
|
||||
":gemname:__all_gems" \
|
||||
"--target=-[target directory for unpacking]":directory:_directories \
|
||||
"(-v --version)"{-v,--version}"[Specify version of gem to unpack]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_update() {
|
||||
_arguments \
|
||||
"*:gemname:__all_gems" \
|
||||
"(-i --install-dir)"{-i,--install-dir}"[Gem repository directory to get installed gems]":directory:_directories \
|
||||
"(-n --bindir)"{-n,--bindir}"[Directory where binary files are located]":directory:_directories \
|
||||
"(-d --no-rdoc)"{-d,--no-rdoc}"[Generate RDoc documentation for the gem on install]" \
|
||||
"--no-ri[Generate RI documentation for the gem on install]" \
|
||||
"(-E --no-env-shebang)"{-E,--no-env-shebang}"[Rewrite the shebang line on installed scripts to use /usr/bin/env]" \
|
||||
"(-f --no-force)"{-f,--no-force}"[Force gem to install, bypassing dependency checks]" \
|
||||
"(-t --no-test)"{-t,--no-test}"[Run unit tests prior to installation]" \
|
||||
"(-w --no-wrappers)"{-w,--no-wrappers}"[Use bin wrappers for executables Not available on dosish platforms]" \
|
||||
"(-P --trust-policy)"{-P,--trust-policy}"[Specify gem trust policy]:trust policy:__gem_trust_policies" \
|
||||
"--ignore-dependencies[Do not install any required dependent gems]" \
|
||||
"(-y --include-dependencies)"{-y,--include-dependencies}"[Unconditionally install the required dependent gems]" \
|
||||
"--no-format-executable[Make installed executable names match ruby. If ruby is ruby18, foo_exec will be foo_exec18]" \
|
||||
"--no-user-install[Install in user's home directory instead of GEM_HOME. Defaults to using home only if GEM_HOME is not writable.]" \
|
||||
"--development[Install any additional development dependencies]" \
|
||||
"--prerelease[Install prerelease versions of a gem if available. Defaults to skipping prereleases.]" \
|
||||
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
|
||||
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
|
||||
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
|
||||
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
|
||||
"--source[Use URL as the remote source for gems]" \
|
||||
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
|
||||
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
|
||||
"--system[Update the RubyGems system software]" \
|
||||
"--platform[Specify the platform of gem to update]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_which() {
|
||||
_arguments \
|
||||
*:file:_files -f \
|
||||
"(-a --no-all)"{-a,--no-all}"[show all matching files]" \
|
||||
"(-g --no-gems-first)"{-g,--no-gems-first}"[search gems before non-gems]" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
_gem_migrate() {
|
||||
_arguments \
|
||||
"*:gemname:__all_gems" \
|
||||
$gem_general_flags && ret=0
|
||||
}
|
||||
|
||||
if (( CURRENT > 2 )); then
|
||||
(( CURRENT-- ))
|
||||
shift words
|
||||
_call_function 1 _gem_${words[1]}
|
||||
else
|
||||
_values "gem command" \
|
||||
"build[Build a gem from a gemspec]" \
|
||||
"cert[Manage RubyGems certificates and signing settings]" \
|
||||
"check[Check installed gems]" \
|
||||
"cleanup[Clean up old versions of installed gems in the local repository]" \
|
||||
"contents[Display the contents of the installed gems]" \
|
||||
"dependency[Show the dependencies of an installed gem]" \
|
||||
"environment[Display information about the RubyGems environment]" \
|
||||
"fetch[Download a gem and place it in the current directory]" \
|
||||
"generate_index[Generates the index files for a gem server directory]" \
|
||||
"help[Provide help on the 'gem' command]" \
|
||||
"install[Install a gem into the local repository]" \
|
||||
"list[Display gems whose name starts with STRING]" \
|
||||
"lock[Generate a lockdown list of gems]" \
|
||||
"migrate[Migrate a gem you own from Rubyforge to Gemcutter]" \
|
||||
"mirror[Mirror a gem repository]" \
|
||||
"open[Open a gem in your editor]" \
|
||||
"outdated[Display all gems that need updates]" \
|
||||
"owner[Manage gem owners on Gemcutter]" \
|
||||
"pristine[Restores installed gems to pristine condition from files located in the gem cache]" \
|
||||
"push[Push a gem up to Gemcutter]" \
|
||||
"query[Query gem information in local or remote repositories]" \
|
||||
"rdoc[Generates RDoc for pre-installed gems]" \
|
||||
"search[Display all gems whose name contains STRING]" \
|
||||
"server[Documentation and gem repository HTTP server]" \
|
||||
"sources[Manage the sources and cache file RubyGems uses to search for gems]" \
|
||||
"specification[Display gem specification (in yaml)]" \
|
||||
"stale[List gems along with access times]" \
|
||||
"tumble[Enable or disable Gemcutter as your primary gem source]" \
|
||||
"uninstall[Uninstall gems from the local repository]" \
|
||||
"unpack[Unpack an installed gem to the current directory]" \
|
||||
"update[Update the named gems (or all installed gems) in the local repository]" \
|
||||
"which[Find the location of a library file you can require]"
|
||||
fi
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
|
||||
|
618
.zprezto/modules/completion/external/src/_ghc
vendored
Normal file
618
.zprezto/modules/completion/external/src/_ghc
vendored
Normal file
@@ -0,0 +1,618 @@
|
||||
#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
|
66
.zprezto/modules/completion/external/src/_gist
vendored
Normal file
66
.zprezto/modules/completion/external/src/_gist
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
#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
|
424
.zprezto/modules/completion/external/src/_git-flow
vendored
Normal file
424
.zprezto/modules/completion/external/src/_git-flow
vendored
Normal file
@@ -0,0 +1,424 @@
|
||||
#compdef git-flow
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for git-flow (http://github.com/nvie/gitflow).
|
||||
#
|
||||
# Source: https://github.com/bobthecow/git-flow-completion
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Justin Hileman (https://github.com/bobthecow)
|
||||
# * Yusuke Muraoka (https://github.com/jbking)
|
||||
# * Vincent Driessen (https://github.com/nvie)
|
||||
# * Zifei Tong (https://github.com/chevalun)
|
||||
# * 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
|
108
.zprezto/modules/completion/external/src/_git-pulls
vendored
Normal file
108
.zprezto/modules/completion/external/src/_git-pulls
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
#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
|
58
.zprezto/modules/completion/external/src/_git-wtf
vendored
Normal file
58
.zprezto/modules/completion/external/src/_git-wtf
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
#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
|
272
.zprezto/modules/completion/external/src/_github
vendored
Normal file
272
.zprezto/modules/completion/external/src/_github
vendored
Normal file
@@ -0,0 +1,272 @@
|
||||
#compdef github gh
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Github gem 0.6.2 (https://github.com/defunkt/github-gem).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud (https://github.com/nicoulaj)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_github() {
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext"
|
||||
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
'1:cmd:->cmds' \
|
||||
'*::arg:->args' \
|
||||
&& ret=0
|
||||
|
||||
case "$state" in
|
||||
(cmds)
|
||||
local commands; commands=(
|
||||
'admin:open this repo'\''s Admin panel a web browser'
|
||||
'browse:open this repo in a web browser'
|
||||
'clone:clone a repo'
|
||||
'config:automatically set configuration info, or pass args to specify'
|
||||
'create:create a new, empty GitHub repository'
|
||||
'create-from-local:create a new GitHub repository from the current local repository'
|
||||
'fetch:fetch from a remote to a local branch'
|
||||
'fetch_all:fetch all refs from a user'
|
||||
'fork:forks a GitHub repository'
|
||||
'home:open this repo'\''s master branch in a web browser'
|
||||
'ignore:ignore a SHA'
|
||||
'info:info about this project'
|
||||
'issues:project issues tools'
|
||||
'network:project network tools'
|
||||
'open:open the given user/project in a web browser'
|
||||
'pull:pull from a remote'
|
||||
'pull-request:generate the text for a pull request'
|
||||
'search:search GitHub for the given repository name'
|
||||
'track:track another user'\''s repository'
|
||||
)
|
||||
_describe -t commands 'command' commands && ret=0
|
||||
;;
|
||||
(args)
|
||||
curcontext="${curcontext%:*:*}:github-cmd-$words[1]:"
|
||||
case $words[1] in
|
||||
(admin|fetch|fetch_all|home|info)
|
||||
_message 'no more arguments' && ret=0
|
||||
;;
|
||||
(browse)
|
||||
_arguments \
|
||||
'1: :_github_users' \
|
||||
'2: :_github_branches' \
|
||||
&& ret=0
|
||||
;;
|
||||
(clone)
|
||||
_arguments \
|
||||
'1: :_github_users' \
|
||||
'2: :_github_repos' \
|
||||
'3: :_files -/' \
|
||||
'--search[search for user or repo and clone selected repository]:user or repo' \
|
||||
'--ssh[clone using the git@github.com style url]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(config)
|
||||
_arguments \
|
||||
'1: :_github_users' \
|
||||
'2: :_github_repos' \
|
||||
&& ret=0
|
||||
;;
|
||||
(create)
|
||||
_arguments \
|
||||
'1:repo name' \
|
||||
'--markdown[create README.markdown]' \
|
||||
'--mdown[create README.mdown]' \
|
||||
'--private[create private repository]' \
|
||||
'--rdoc[create README.rdoc]' \
|
||||
'--rst[create README.rst]' \
|
||||
'--textile[create README.textile]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(create-from-local)
|
||||
_arguments \
|
||||
'--private[create private repository]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(fork)
|
||||
_arguments \
|
||||
'1: :_github_user_slash_repos' \
|
||||
&& ret=0
|
||||
;;
|
||||
(ignore)
|
||||
_arguments \
|
||||
'1: :_github_network_commits' \
|
||||
&& ret=0
|
||||
;;
|
||||
(issues)
|
||||
_arguments -C \
|
||||
'1:issue-status:->issue-statuses' \
|
||||
'2:: :_github_users' \
|
||||
'--after[only show issues updated after a certain date]:date' \
|
||||
'--label[only show issues with a certain label]:label' \
|
||||
&& ret=0
|
||||
case "$state" in
|
||||
(issue-statuses)
|
||||
local statuses; statuses=(
|
||||
'open:show open issues'
|
||||
'closed:show closed issues'
|
||||
)
|
||||
_describe -t statuses 'status' statuses && ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(network)
|
||||
_arguments -C \
|
||||
'1:network-subcommand:->network-subcommands' \
|
||||
'*::network-arg:->network-args' \
|
||||
'(--after)--before[only show commits before a certain date]:date' \
|
||||
'(--before)--after[only show commits after a certain date]:date' \
|
||||
'--applies[filter commits to patches that apply cleanly]' \
|
||||
'--author[filter commits on a email address of author]:author' \
|
||||
'--cache[use the network data even if it'\''s expired]' \
|
||||
'--common[show common branch point]' \
|
||||
'--limit[only look through the first X heads - useful for really large projects]:number' \
|
||||
'--noapply[filter commits to patches that do not apply cleanly]' \
|
||||
'--nocache[do not use the cached network data]' \
|
||||
'--project[filter commits on a certain project]:project' \
|
||||
'--shas[only show shas]' \
|
||||
'--sort[how to sort : date, branch, author]:sort type:((date\:sort\ by\ date\ \(default\) branch\:sort\ by\ branch author\:sort\ by\ author))' \
|
||||
'--thisbranch[look at branches that match the current one]' \
|
||||
&& ret=0
|
||||
case "$state" in
|
||||
(network-subcommands)
|
||||
local subcommands; subcommands=(
|
||||
'web:open network in a web browser'
|
||||
'list:list network members'
|
||||
'fetch:fetch network members commits'
|
||||
'commits:list network members commits'
|
||||
)
|
||||
_describe -t subcommands 'subcommand' subcommands && ret=0
|
||||
;;
|
||||
(network-args)
|
||||
case $words[1] in
|
||||
(web)
|
||||
_arguments \
|
||||
'1: :_github_users' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(open)
|
||||
_arguments \
|
||||
'1: :_github_user_slash_repos' \
|
||||
&& ret=0
|
||||
;;
|
||||
(pull)
|
||||
_arguments \
|
||||
'1: :_github_users' \
|
||||
'2: :_github_branches' \
|
||||
'--merge[automatically merge remote'\''s changes into your master]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(pull-request)
|
||||
_arguments \
|
||||
'1: :_github_users' \
|
||||
'2: :_github_branches' \
|
||||
&& ret=0
|
||||
;;
|
||||
(search)
|
||||
_arguments \
|
||||
'1:query' \
|
||||
&& ret=0
|
||||
;;
|
||||
(track)
|
||||
_arguments \
|
||||
'1:: :((remote))' \
|
||||
'*: :_github_user_slash_repos' \
|
||||
{--private,--ssh}'[use git@github.com: instead of git://github.com/]' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_github_users] )) ||
|
||||
_github_users() {
|
||||
_alternative \
|
||||
'users:user:_users' \
|
||||
'github-network-users:github network user:_github_network_users'
|
||||
}
|
||||
|
||||
(( $+functions[_github_network_users] )) ||
|
||||
_github_network_users() {
|
||||
local users; users=(${(f)"$(_call_program users $service network list 2>/dev/null)"})
|
||||
_describe -t github-network-users 'github network user' users "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_github_repos] )) ||
|
||||
_github_repos() {
|
||||
_message -e repos 'repo'
|
||||
}
|
||||
|
||||
(( $+functions[_github_branches] )) ||
|
||||
_github_branches() {
|
||||
_message -e branches 'branch'
|
||||
}
|
||||
|
||||
(( $+functions[_github_user_slash_repos] )) ||
|
||||
_github_user_slash_repos() {
|
||||
local ret=1
|
||||
if compset -P '*/'; then
|
||||
_wanted repos expl 'repo' _github_repos && ret=0
|
||||
else
|
||||
_wanted users expl 'user' _github_users -qS/ && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_github_network_commits] )) ||
|
||||
_github_network_commits() {
|
||||
local commits; commits=(${${(f)"$(_call_program commits $service network commits 2>/dev/null)"}%%[[:blank:]]*})
|
||||
_describe -t commits 'commit' commits "$@"
|
||||
}
|
||||
|
||||
_github "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
63
.zprezto/modules/completion/external/src/_glances
vendored
Normal file
63
.zprezto/modules/completion/external/src/_glances
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
#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 "$@"
|
69
.zprezto/modules/completion/external/src/_google
vendored
Normal file
69
.zprezto/modules/completion/external/src/_google
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
#compdef google
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for googlecl (https://code.google.com/p/googlecl/)
|
||||
#
|
||||
# Source: https://raw.github.com/dadrc/zsh-cfg/master/completions/_google
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * dadrc (https://github.com/dadrc)
|
||||
# * Ben O'Hara (https://github.com/benohara)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_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
|
135
.zprezto/modules/completion/external/src/_gradle
vendored
Normal file
135
.zprezto/modules/completion/external/src/_gradle
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
#compdef gradle gradlew
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Gradle 1.0-milestone-5 (http://www.gradle.org).
|
||||
#
|
||||
# Status: incomplete (see TODO/FIXME tags)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_gradle() {
|
||||
typeset -A opt_args
|
||||
local context state line
|
||||
|
||||
local curcontext="$curcontext"
|
||||
|
||||
_arguments \
|
||||
'(- 1 *)'{-?,-h,--help}'[show help message]' \
|
||||
'(-a --no-rebuild)'{-a,--no-rebuild}'[do not rebuild project dependencies]' \
|
||||
'(-b --build-file)'{-b,--build-file}'[specify the build file]:build file:_gradle_scripts' \
|
||||
'(-C --cache)'{-C,--cache}'[specify how compiled build scripts should be cached]:cache strategy:((rebuild\:rebuild\ the\ cache on\:use\ the\ cache\ \(default\)))' \
|
||||
'(-c --settings-file)'{-c,--settings-file}'[specify the settings file]:settings file:_gradle_scripts' \
|
||||
'*'{-D-,--system-prop}'[set system property of the JVM]:property:_gradle_properties' \
|
||||
'(-d --debug -q --quiet -i --info)'{-d,--debug}'[log in debug mode (includes normal stacktrace)]' \
|
||||
'(--foreground --no-daemon --stop)--daemon[use the Gradle daemon to run the build, starts the daemon if not running]' \
|
||||
'(-e --embedded)'{-e,--embedded}'[specify an embedded build script]:embedded build script' \
|
||||
'(--daemon --no-daemon --stop)--foreground[start the Gradle daemon in the foreground]' \
|
||||
'(-g --gradle-user-home)'{-g,--gradle-user-home}'[specify the gradle user home directory]: :_files -/' \
|
||||
'--gui[launch a GUI application]' \
|
||||
'(-I --init-script)'{-I,--init-script}'[specify an initialization script]:init script:_gradle_scripts' \
|
||||
'(-i --info -q --quiet -d --debug)'{-i,--info}'[set log level to info]' \
|
||||
'(-m --dry-run)'{-m,--dry-run}'[run the builds with all task actions disabled]' \
|
||||
'(-n --dependencies)'{-n,--dependencies}'[show list of all project dependencies]' \
|
||||
'--no-color[do not use color in the console output]' \
|
||||
'(--daemon --foreground --stop)--no-daemon[do not use the Gradle daemon to run the build]' \
|
||||
'--no-opt[ignore any task optimization]' \
|
||||
'*'{-P-,--project-prop}'[set project property for the build script]:property:_gradle_properties' \
|
||||
'(-p --project-dir)'{-p,--project-dir}'[specify the start directory for Gradle]: :_files -/' \
|
||||
'--profile[profile build execution time and generate a report in the <build_dir>/reports/profile directory]' \
|
||||
'(-q --quiet -d --debug -i --info)'{-q,--quiet}'[log errors only]' \
|
||||
'(-r --properties)'{-r,--properties}'[show list of all available project properties]' \
|
||||
'(-S --full-stacktrace)'{-S,--full-stacktrace}'[print out the full (very verbose) stacktrace for any exceptions]' \
|
||||
'(-s --stacktrace)'{-s,--stacktrace}'[print out the stacktrace also for user exceptions]' \
|
||||
'(--daemon --foreground)--stop[stop the Gradle daemon if it is running]' \
|
||||
'(-t --tasks)'{-t,--tasks}'[show list of available tasks]' \
|
||||
'(-u --no-search-upward)'{-u,--no-search-upward}'[don'\''t search in parent folders for a settings.gradle file]' \
|
||||
'(-v --version)'{-v,--version}'[print version info]' \
|
||||
'(-x --exclude-task)*'{-x,--exclude-task}'[specify a task to be excluded from execution]:task:_gradle_tasks' \
|
||||
'*: :_gradle_tasks'
|
||||
}
|
||||
|
||||
(( $+functions[_gradle_tasks] )) ||
|
||||
_gradle_tasks() {
|
||||
local alternatives task_group task_group_name task_group_tasks
|
||||
local project="${PREFIX%:*}"
|
||||
alternatives=("project:project:_gradle_projects -qS:")
|
||||
for task_group in ${(M)${(ps:\n\n:)"$($service --daemon --quiet --no-color ${project}:tasks 2>/dev/null)"}:#*[[:space:]]\-[[:space:]]*}; do
|
||||
task_group_name="${${${task_group%%---*}%[[:space:]]tasks[[:space:]]*}:l}"
|
||||
task_group_tasks=(${(q)${(f)${task_group##*---}}/[[:space:]]\-[[:space:]]/:})
|
||||
alternatives+=("${task_group_name//[[:space:]]/-}-task:${task_group_name} task:((${task_group_tasks[@]}))")
|
||||
done
|
||||
_alternative "${alternatives[@]}"
|
||||
}
|
||||
|
||||
(( $+functions[_gradle_projects] )) ||
|
||||
_gradle_projects() {
|
||||
local project="${PREFIX%:*}"
|
||||
local projects; projects=(${${${(M)${(f)"$($service --daemon --quiet --no-color ${project}:projects 2>/dev/null)"}:#*--- Project\ \':*}#*\'}%\'*})
|
||||
_multi_parts $@ : projects
|
||||
}
|
||||
|
||||
(( $+functions[_gradle_scripts] )) ||
|
||||
_gradle_scripts() {
|
||||
_files -g '*.gradle*'
|
||||
}
|
||||
|
||||
(( $+functions[_gradle_properties] )) ||
|
||||
_gradle_properties() {
|
||||
local ret=1
|
||||
if compset -P '*='; then
|
||||
_message -e property-values 'property value' && ret=0
|
||||
else
|
||||
_wanted property-names expl 'property name' _gradle_property_names -qS= && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_gradle_property_names] )) ||
|
||||
_gradle_property_names() {
|
||||
local property_names; property_names=(${${(M)${(f)"$($service --daemon --quiet --no-color :properties 2>/dev/null)"}:#*:*}%%:*})
|
||||
_describe -t property_names 'property name' property_names "$@"
|
||||
}
|
||||
|
||||
_gradle "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
209
.zprezto/modules/completion/external/src/_heroku
vendored
Normal file
209
.zprezto/modules/completion/external/src/_heroku
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
#compdef heroku
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for the Heroku client gem (https://github.com/heroku/heroku)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Ali B. (http://awhitebox.com)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
"account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
|
||||
"addons":"list installed addons"
|
||||
"addons\:list":"list all available addons"
|
||||
"addons\:add":"install an addon"
|
||||
"addons\:upgrade":"upgrade an existing addon"
|
||||
"addons\:downgrade":"downgrade an existing addon"
|
||||
"addons\:remove":"uninstall an addon"
|
||||
"addons\:open":"open an addon's dashboard in your browser"
|
||||
"apps":"list your apps"
|
||||
"apps\:info":"show detailed app information"
|
||||
"apps\:create":"create a new app"
|
||||
"apps\:rename":"rename the app"
|
||||
"apps\:open":"open the app in a web browser"
|
||||
"apps\:destroy":"permanently destroy an app"
|
||||
"auth\:login":"log in with your heroku credentials"
|
||||
"auth\:logout":"clear local authentication credentials"
|
||||
"config":"display a config vars for an app"
|
||||
"config\:get":"display a config value for an app"
|
||||
"config\:set":"set one or more config vars"
|
||||
"config\:unset":"unset one or more config vars"
|
||||
"db\:push":"push local data up to your app"
|
||||
"db\:pull":"pull heroku data down into your local database"
|
||||
"domains":"list custom domains for an app"
|
||||
"domains\:add":"add a custom domain to an app"
|
||||
"domains\:remove":"remove a custom domain from an app"
|
||||
"domains\:clear":"remove all custom domains from an app"
|
||||
"help":"list available commands or display help for a specific command"
|
||||
"keys":"display keys for the current user"
|
||||
"keys\:add":"add a key for the current user"
|
||||
"keys\:remove":"remove a key from the current user"
|
||||
"keys\:clear":"remove all authentication keys from the current user"
|
||||
"logs":"display recent log output"
|
||||
"logs\:cron":"DEPRECATED: display cron logs from legacy logging"
|
||||
"logs\:drains":"manage syslog drains"
|
||||
"maintenance\:on":"put the app into maintenance mode"
|
||||
"maintenance\:off":"take the app out of maintenance mode"
|
||||
"open":"open app in a web browser"
|
||||
"pg\:info":"display database information"
|
||||
"pg\:ingress":"allow direct connections to the database from this IP for one minute"
|
||||
"pg\:promote":"sets DATABASE as your DATABASE_URL"
|
||||
"pg\:psql":"open a psql shell to the database"
|
||||
"pg\:reset":"delete all data in DATABASE"
|
||||
"pg\:unfollow":"stop a replica from following and make it a read/write database"
|
||||
"pg\:wait":"monitor database creation, exit when complete"
|
||||
"pgbackups":"list captured backups"
|
||||
"pgbackups\:url":"get a temporary URL for a backup"
|
||||
"pgbackups\:capture":"capture a backup from a database id"
|
||||
"pgbackups\:restore":"restore a backup to a database"
|
||||
"pgbackups\:destroy":"destroys a backup"
|
||||
"plugins":"list installed plugins"
|
||||
"plugins\:install":"install a plugin"
|
||||
"plugins\:uninstall":"uninstall a plugin"
|
||||
"plugins\:update":"updates all plugins or a single plugin by name"
|
||||
"ps\:dynos":"scale to QTY web processes"
|
||||
"ps\:workers":"scale to QTY background processes"
|
||||
"ps":"list processes for an app"
|
||||
"ps\:restart":"restart an app process"
|
||||
"ps\:scale":"scale processes by the given amount"
|
||||
"releases":"list releases"
|
||||
"releases\:info":"view detailed information for a release"
|
||||
"rollback":"roll back to an older release"
|
||||
"run":"run an attached process"
|
||||
"run\:rake":"remotely execute a rake command"
|
||||
"run\:console":"open a remote console session"
|
||||
"sharing":"list collaborators on an app"
|
||||
"sharing\:add":"add a collaborator to an app"
|
||||
"sharing\:remove":"remove a collaborator from an app"
|
||||
"sharing\:transfer":"transfer an app to a new owner"
|
||||
"ssl":"list certificates for an app"
|
||||
"ssl\:add":"add an ssl certificate to an app"
|
||||
"ssl\:remove":"remove an ssl certificate from an app"
|
||||
"ssl\:clear":"remove all ssl certificates from an app"
|
||||
"stack":"show the list of available stacks"
|
||||
"stack\:migrate":"prepare migration of this app to a new stack"
|
||||
"version":"show heroku client version"
|
||||
)
|
||||
|
||||
_arguments '*:: :->command'
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "heroku command" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
||||
local -a _command_args
|
||||
case "$words[1]" in
|
||||
apps:info)
|
||||
_command_args=(
|
||||
'(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
|
||||
)
|
||||
;;
|
||||
apps:create)
|
||||
_command_args=(
|
||||
'(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
|
||||
'(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \
|
||||
'(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \
|
||||
)
|
||||
;;
|
||||
config)
|
||||
_command_args=(
|
||||
'(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
|
||||
)
|
||||
;;
|
||||
db:push)
|
||||
_command_args=(
|
||||
'(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
|
||||
'(-d|--debug)'{-d,--debug}'[enable debugging output]' \
|
||||
'(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \
|
||||
'(-f|--filter)'{-f,--filter}'[only push certain tables]' \
|
||||
'(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
|
||||
'(-t|--tables)'{-t,--tables}'[only push the specified tables]' \
|
||||
)
|
||||
;;
|
||||
db:pull)
|
||||
_command_args=(
|
||||
'(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
|
||||
'(-d|--debug)'{-d,--debug}'[enable debugging output]' \
|
||||
'(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \
|
||||
'(-f|--filter)'{-f,--filter}'[only pull certain tables]' \
|
||||
'(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
|
||||
'(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \
|
||||
)
|
||||
;;
|
||||
keys)
|
||||
_command_args=(
|
||||
'(-l|--long)'{-l,--long}'[display extended information for each key]' \
|
||||
)
|
||||
;;
|
||||
logs)
|
||||
_command_args=(
|
||||
'(-n|--num)'{-n,--num}'[the number of lines to display]' \
|
||||
'(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \
|
||||
'(-s|--source)'{-s,--source}'[only display logs from the given source]' \
|
||||
'(-t|--tail)'{-t,--tail}'[continually stream logs]' \
|
||||
)
|
||||
;;
|
||||
pgbackups:capture)
|
||||
_command_args=(
|
||||
'(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
|
||||
)
|
||||
;;
|
||||
stack)
|
||||
_command_args=(
|
||||
'(-a|--all)'{-a,--all}'[include deprecated stacks]' \
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
_arguments \
|
||||
$_command_args \
|
||||
'(-a|--app)'{-a,--app}'[the app name]' \
|
||||
'(-r|--remote)'{-r,--remote}'[the git remote name]:remote:->remotes' \
|
||||
&& return 0
|
||||
|
||||
__heroku_git_remotes () {
|
||||
local expl gitdir remotes
|
||||
|
||||
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
|
||||
__heroku_git_command_successful || return
|
||||
|
||||
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
|
||||
__heroku_git_command_successful || return
|
||||
|
||||
# TODO: Should combine the two instead of either or.
|
||||
if (( $#remotes > 0 )); then
|
||||
_wanted remotes expl remote compadd $* - $remotes
|
||||
else
|
||||
_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
|
||||
fi
|
||||
}
|
||||
|
||||
__heroku_git_command_successful () {
|
||||
if (( ${#pipestatus:#0} > 0 )); then
|
||||
_message 'not a git repository'
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
case $state in
|
||||
(remotes)
|
||||
__heroku_git_remotes && return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
177
.zprezto/modules/completion/external/src/_hledger
vendored
Normal file
177
.zprezto/modules/completion/external/src/_hledger
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
#compdef hledger
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for hleder 0.23.2 ( http://hledger.org/ )
|
||||
# Last updated: 16.11.2014
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Valodim ( https://github.com/Valodim )
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Notes
|
||||
# -----
|
||||
#
|
||||
# account completion depends on availability of a ~/.hledger.journal file
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local curcontext="$curcontext" curstate state line expl grp cmd ret=1
|
||||
typeset -a args
|
||||
typeset -A opt_args
|
||||
|
||||
args=(
|
||||
'(- *)'{-h,--help}'[print help information]'
|
||||
'(-f --file)'{-f,--file}'=[use a different input file]:input file:_files'
|
||||
'--rules-file=[CSV conversion rules file]:rules file:_files'
|
||||
'--alias=[display accounts named OLD as NEW]:alias specification'
|
||||
'(-b --begin)'{-b,--begin}'=[include postings/txns on or after this date]:date'
|
||||
'(-e --end)'{-e,--end}'=[include postings/txns before this date]:date'
|
||||
'(-D --daily)'{-D,--daily}'[multiperiod/multicolumn report by day]'
|
||||
'(-W --weekly)'{-W,--weekly}'[multiperiod/multicolumn report by week]'
|
||||
'(-M --monthly)'{-M,--monthly}'[multiperiod/multicolumn report by month]'
|
||||
'(-Q --quarterly)'{-Q,--quarterly}'[multiperiod/multicolumn report by quarter]'
|
||||
'(-Y --yearly)'{-Y,--yearly}'[multiperiod/multicolumn report by year]'
|
||||
'(-p --period)'{-p,--period}'=[set start date, end date, and/or reporting interval all at once]'
|
||||
'(-C --cleared)'{-C,--cleared}'[include only cleared postings/txns]'
|
||||
'(-U --uncleared)'{-U,--uncleared}'[include only uncleared postings/txns]'
|
||||
'(-R --real)'{-R,--real}'[include only non-virtual postings]'
|
||||
'(--depth)--depth=[hide accounts/postings deeper than N]:depth'
|
||||
'(-E --empty)'{-E,--empty}'[show empty/zero things which are normally omitted]'
|
||||
'(-B --cost)'{-B,--cost}'[show amounts in their cost price'\''s commodity]'
|
||||
)
|
||||
|
||||
_arguments -C "$args[@]" -A "-*" \
|
||||
'(- *)--version[print version information]' \
|
||||
'--debug[show debug output]' \
|
||||
'1: :->cmds' \
|
||||
'*:: :->args' && ret=0
|
||||
|
||||
while (( $#state )); do
|
||||
curstate=$state
|
||||
shift state
|
||||
case $curstate in
|
||||
cmds)
|
||||
typeset -a cmds
|
||||
cmds=(
|
||||
'print:show transaction entries'
|
||||
'accounts:show account names'
|
||||
'balance:show accounts and balances (bal)'
|
||||
'register:show postings and running total (reg)'
|
||||
'incomestatement:show an income statement (is)'
|
||||
'balancesheet:show a balance sheet (bs)'
|
||||
'cashflow:show a cashflow statement (cf)'
|
||||
'activity:show an ascii barchart of posting counts per interval'
|
||||
'stats:show some journal statistics'
|
||||
)
|
||||
_describe 'subcommands' cmds && ret=0
|
||||
;;
|
||||
args)
|
||||
: $words
|
||||
local cmd=$words[1]
|
||||
(( $+cmd )) || return 1
|
||||
# curcontext="${curcontext%:*:*}:$service-$cmd:"
|
||||
case $cmd in
|
||||
accounts)
|
||||
args+=(
|
||||
'(--tree)--tree[show accounts as a tree (default in simple reports)]'
|
||||
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
|
||||
'(--drop)--drop=[flat mode, omit N leading account name parts]:drop n'
|
||||
)
|
||||
;;
|
||||
activity)
|
||||
;;
|
||||
bal|balance)
|
||||
args+=(
|
||||
'(--tree)--tree[show accounts as a tree (default in simple reports)]'
|
||||
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
|
||||
'(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n'
|
||||
'(--format)--format=[in tree mode, use this custom line format]:custom line format'
|
||||
'(--no-elide)--no-elide[tree mode, do not squash boring parent accounts]'
|
||||
'(--no-total)--no-total[do not show the final total]'
|
||||
'(--cumulative)--cumulative[multicolumn mode, show accumulated ending balances]'
|
||||
'(-H --historical)'{-H,--historical}'[multicolumn mode, show historical ending balances]'
|
||||
)
|
||||
;;
|
||||
cashflow|cf|balancesheet|bs|incomestatement|is)
|
||||
args+=(
|
||||
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
|
||||
'(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n'
|
||||
)
|
||||
;;
|
||||
print)
|
||||
;;
|
||||
register|reg)
|
||||
args+=(
|
||||
'(-H --historical)'{-H,--historical}'[include prior postings in the running total]'
|
||||
'(-A --average)'{-A,--average}'[show a running average instead of the running total]'
|
||||
'(-r --related)'{-r,--related}'[show postings'\'' siblings instead]'
|
||||
'(-w --width)'{-w,--width}'=[set output width to 120, or N]:width (default 80)'
|
||||
)
|
||||
;;
|
||||
stats)
|
||||
;;
|
||||
# fallback to _default
|
||||
*) _arguments -C -A "-*" "$args[@]" \
|
||||
'*: :_default' && ret=0
|
||||
continue
|
||||
esac
|
||||
_arguments -C -A "-*" "$args[@]" \
|
||||
'*:query patterns:->query' && ret=0
|
||||
;;
|
||||
query)
|
||||
|
||||
local -a accs keywords
|
||||
keywords=(
|
||||
'code\::match by transaction code'
|
||||
'desc\::match transaction descriptions'
|
||||
'tag\::match by tag name'
|
||||
'depth\::match at or above depth'
|
||||
'status\::match cleared/uncleared transactions'
|
||||
'real\::match real/virtual transactions'
|
||||
'empty\::match if amount is/is not zero'
|
||||
'amt\::match transaction amount'
|
||||
)
|
||||
if compset -P 'amt:'; then
|
||||
_message 'match amount (<, <=, >, >=, add sign for non-absolute match)' && ret=0
|
||||
continue
|
||||
fi
|
||||
if compset -P '(#b)(code|desc|tag|depth|status|real|empty):'; then
|
||||
_message "'$match[1]' parameter" && ret=0
|
||||
continue
|
||||
fi
|
||||
|
||||
accs=( ${(f)"$(_call_program hledger hledger accounts $PREFIX 2>/dev/null)"} )
|
||||
if (( $? )); then
|
||||
_message "error fetching accounts from hledger"
|
||||
fi
|
||||
|
||||
# decided against partial matching here. these lines can
|
||||
# be uncommented to complete subaccounts hierarchically
|
||||
# (add -S '' -q to the compadd below, too)
|
||||
# if compset -P '(#b)(*):'; then
|
||||
# accs=( ${(M)accs:#$match[1]:*} )
|
||||
# accs=( ${accs#$IPREFIX} )
|
||||
# fi
|
||||
# accs=( ${accs%%:*} )
|
||||
|
||||
_wanted accounts expl "accounts" compadd -a accs && ret=0
|
||||
_describe "matcher keywords" keywords -S '' && ret=0
|
||||
|
||||
# not is special, it doesn't need the -S ''
|
||||
keywords=(
|
||||
'not:negate expression'
|
||||
)
|
||||
_describe "matcher keywords" keywords && ret=0
|
||||
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
return ret
|
177
.zprezto/modules/completion/external/src/_httpie
vendored
Normal file
177
.zprezto/modules/completion/external/src/_httpie
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
#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>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# -*- 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 header content"
|
||||
elif compset -P '@'; then
|
||||
_files
|
||||
elif compset -P ':='; then
|
||||
_message "$name raw json data"
|
||||
elif compset -P '=='; then
|
||||
_message "$name url parameter value"
|
||||
elif compset -P '='; then
|
||||
_message "$name data field value"
|
||||
else
|
||||
typeset -a ops
|
||||
ops=(
|
||||
'=:data field'
|
||||
'\::header'
|
||||
'==:request parameter'
|
||||
'@:data file field'
|
||||
'\:=:raw json field'
|
||||
)
|
||||
_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
|
70
.zprezto/modules/completion/external/src/_id3
vendored
Normal file
70
.zprezto/modules/completion/external/src/_id3
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
#compdef id3
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for id3, based on v0.15
|
||||
#
|
||||
# Last updated: 03.04.2013
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Valodim ( https://github.com/Valodim )
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_id3_genre () {
|
||||
|
||||
setopt localoptions extendedglob
|
||||
|
||||
local -A _id3_genres
|
||||
# got them cached?
|
||||
if _cache_invalid id3-genres || ! _retrieve_cache id3-genres ; then
|
||||
|
||||
# generate from id3 -L otherwise
|
||||
local tmp
|
||||
for line in ${${${(f)"$(_call_program id3genre id3 -L)"}## #}}; do
|
||||
tmp=( ${(s,: ,)line} )
|
||||
_id3_genres[${tmp[1]}]=$tmp[2]
|
||||
# alternate display string, which I decided against in the end
|
||||
# to preserve reasonable alphabetic sorting
|
||||
# "${(l:3:: :)${tmp[1]}}: ${tmp[2]}"
|
||||
done
|
||||
|
||||
# store if we got any
|
||||
(( $#_id3_genres > 0 )) && _store_cache id3-genres _id3_genres
|
||||
fi
|
||||
|
||||
# bail if we don't
|
||||
(( $#_id3_genres > 0 )) || { _message "could not fetch genres"; return }
|
||||
|
||||
_wanted id3genres expl 'Genres' \
|
||||
compadd -d _id3_genres -k _id3_genres && return 0
|
||||
|
||||
}
|
||||
|
||||
# only show files if at least one argument or something has been provided
|
||||
local showfiles=''
|
||||
(( CURRENT <= 2 )) && showfiles='!'
|
||||
|
||||
_arguments \
|
||||
- tagging \
|
||||
'-t[modify title tag]:title' \
|
||||
'-T[modify track tag]:track' \
|
||||
'-a[modify artist tag]:artist' \
|
||||
'-A[modify album tag]:album' \
|
||||
'-y[modify year tag]:year' \
|
||||
'-c[modify comment tag]:comment' \
|
||||
'-g[modify genre tag]:genre:_id3_genre' \
|
||||
'(-)-l[lists tags]' \
|
||||
'-R[use rfc822-style format for output]' \
|
||||
'(-)-d[delete id3 tag]' \
|
||||
$showfiles'*:mp3 file:_files -g \*.mp3' \
|
||||
- meta \
|
||||
'(- *)-L[list all genres]' \
|
||||
'(- *)-h[display help info]' \
|
||||
'(- *)-v[print version info]' && return 0
|
||||
|
116
.zprezto/modules/completion/external/src/_id3v2
vendored
Normal file
116
.zprezto/modules/completion/external/src/_id3v2
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
#compdef id3v2
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for id3v2, based on v0.1.12
|
||||
#
|
||||
# Last updated: 05.04.2013
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Valodim ( https://github.com/Valodim )
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_id3v2_genre () {
|
||||
|
||||
setopt localoptions extendedglob
|
||||
|
||||
local -A _id3v2_genres
|
||||
# got them cached?
|
||||
if _cache_invalid id3v2-genres || ! _retrieve_cache id3v2-genres ; then
|
||||
|
||||
# generate from id3 -L otherwise
|
||||
local tmp
|
||||
for line in ${${${(f)"$(_call_program id3v2genres id3v2 -L)"}## #}}; do
|
||||
tmp=( ${(s,: ,)line} )
|
||||
_id3v2_genres[${tmp[1]}]=$tmp[2]
|
||||
# alternate display string, which I decided against in the end
|
||||
# to preserve reasonable alphabetic sorting
|
||||
# "${(l:3:: :)${tmp[1]}}: ${tmp[2]}"
|
||||
done
|
||||
|
||||
# store if we got any
|
||||
(( $#_id3v2_genres > 0 )) && _store_cache id3v2-genres _id3v2_genres
|
||||
fi
|
||||
|
||||
# bail if we don't
|
||||
(( $#_id3v2_genres > 0 )) || { _message "could not fetch genres"; return }
|
||||
|
||||
_wanted id3v2genres expl 'Genres' \
|
||||
compadd -d _id3v2_genres -k _id3v2_genres && return 0
|
||||
|
||||
}
|
||||
|
||||
# this function assumes _id3v2_frames is defined!
|
||||
_id3v2_frame () {
|
||||
|
||||
(( $#_id3v2_frames > 0 )) || { _message "could not fetch genres"; return }
|
||||
local -a framenames
|
||||
framenames=( ${_id3v2_frames#--} )
|
||||
_describe -t framenames 'id3v2 frames' framenames
|
||||
|
||||
}
|
||||
|
||||
_id3v2 () {
|
||||
|
||||
setopt localoptions extendedglob
|
||||
|
||||
# previous word was a frame name? this is an argument, then.
|
||||
if [[ $words[$CURRENT-1] == --[A-Z](#c4) ]]; then
|
||||
_message 'frame value'
|
||||
return 0
|
||||
fi
|
||||
|
||||
# load frame names
|
||||
local -a _id3v2_frames
|
||||
if _cache_invalid id3v2-frames || ! _retrieve_cache id3v2-frames ; then
|
||||
_id3v2_frames=( ${${${(f)"$(_call_program id3v2frames id3v2 -f)"}## #}/ /:} )
|
||||
(( $#_id3v2_frames > 0 )) && _store_cache id3v2-frames _id3v2_frames
|
||||
fi
|
||||
|
||||
local ret=1
|
||||
|
||||
# if we already have a -- prefix, show all those frames
|
||||
if [[ -prefix -- ]] && (( $#_id3v2_frames > 0 )); then
|
||||
_describe -t frames 'id3v2 frames' _id3v2_frames && ret=0
|
||||
fi
|
||||
|
||||
local showfiles=''
|
||||
(( CURRENT <= 2 )) && showfiles='!'
|
||||
|
||||
# regular arguments either way
|
||||
_arguments \
|
||||
- tagging \
|
||||
'(-s --delete-v1 -d --delete-v2)'{-s,--delete-v1}'[deletes id3v1 tags]' \
|
||||
'(-s --delete-v1 -d --delete-v2)'{-d,--delete-v2}'[deletes id3v2 tags]' \
|
||||
'(-C --convert)'{-C,--convert}'[converts id3v1 tag to id3v2]' \
|
||||
'(-1 --id3v1-only -2 --id3v2-only)'{-1,--id3v1-only}'[write only id3v1 tag]' \
|
||||
'(-1 --id3v1-only -2 --id3v2-only)'{-2,--id3v2-only}'[write only id3v2 tag]' \
|
||||
'(-r --remove-frame)'{-r,--remove-frame}'[removes specified id3v2 frame]:frame id:_id3v2_frame' \
|
||||
'(-a --artist)'{-a,--artist}'[set artist]:artist' \
|
||||
'(-A --album)'{-A,--album}'[set album title]:album' \
|
||||
'(-t --song)'{-t,--song}'[set song title]:song title' \
|
||||
'(-c --comment)'{-c,--comment}'[set comment field]' \
|
||||
'(-g --genre)'{-g,--genre}'[set the genre number]:genre:_id3v2_genre' \
|
||||
'(-y --year)'{-y,--year}'[set the year]:year' \
|
||||
'(-T --track)'{-T,--track}'[set the track number/(optional) total tracks]:track number (current/total)' \
|
||||
'(-R --list-rfc822)'{-R,--list-rfc822}'[lists using an rfc822-style format for output]' \
|
||||
'(-)'{-D,--delete-all}'[deletes both id3v1 and id3v2 tags]' \
|
||||
'(-)'{-l,--list}'[lists the tag(s) on the file(s)]' \
|
||||
$showfiles'*:mp3 file:_files -g "*.mp3"' \
|
||||
- meta \
|
||||
'(- *)'{-f,--list-frames}'[display all possible frames for id3v2]' \
|
||||
'(- *)'{-L,--list-genres}'[lists all id3v1 genres]' \
|
||||
'(- *)'{-h,--help}'[display help and exit]' \
|
||||
'(- *)'{-v,--version}'[display version information and exit]' && ret=0
|
||||
|
||||
return ret
|
||||
|
||||
}
|
||||
|
||||
_id3v2 "$@"
|
247
.zprezto/modules/completion/external/src/_iw
vendored
Normal file
247
.zprezto/modules/completion/external/src/_iw
vendored
Normal file
@@ -0,0 +1,247 @@
|
||||
#compdef iw
|
||||
|
||||
# Some parameters to hold patterns that will be used later.
|
||||
local xp='[[:xdigit:]][[:xdigit:]]'
|
||||
local -a bssid devices flags fouraddr fouronoff frequency high_throughput ifacename ifacetype ifacetypes
|
||||
local -a matchany matchnum key lladdr lladdrs meshid meshidval ssid value
|
||||
# matches any word
|
||||
matchany=(/$'[^\0]##\0'/)
|
||||
# matches any number
|
||||
matchnum=(/$'[[:digit:]]##\0'/)
|
||||
# matches any BSSID
|
||||
bssid=($matchany ':bssid:BSSID:')
|
||||
# matches any devices
|
||||
devices=( /$'[[:alpha:]]##[[:digit:]]##(\.[[:digit:]]##)#\0'/ ':interfaces:network_interface:_net_interfaces' )
|
||||
# matches the word 'flags' followed by a list of some of the following words: none fcsfail control otherbss cook
|
||||
flags=(/$'flags\0'/ ':flags:flags:(flags)' $matchany ':flags:flags:(none fcsfail control otherbss cook)' \#)
|
||||
# matches the word '4addr' followed by either 'on' or 'off'
|
||||
fouronoff=(/$'(on|off)\0'/ ':4addr:4addr:(on off)')
|
||||
fouraddr=( /$'4addr\0'/ ':4addr:4addr:(4addr)' $fouronoff )
|
||||
# matches any number (description is 'frequency')
|
||||
frequency=($matchnum ':freq:frequency:')
|
||||
# matches one of HT20 HT40+ or HT40-
|
||||
high_throughput=(/$'HT[0-9]##(+|-)#\0'/ ':HT:high throughput:(HT20 HT40+ HT40-)')
|
||||
# matches any name (description is 'name')
|
||||
ifacename=($matchany ':name:name:')
|
||||
# matches the word 'type' followed by one of: managed ibss monitor mesh wds
|
||||
ifacetypes=(/$'(managed|ibss|monitor|mesh|wds)\0'/ ':type:type:(managed ibss monitor mesh wds)')
|
||||
ifacetype=(/$'type\0'/ ':type:type:(type)' $ifacetypes)
|
||||
# matches any word (description is 'key')
|
||||
key=($matchany ':key:key:')
|
||||
# matches a MAC address (i.e. a sequence of six 2-digit numbers separated by spaces), $xp is defined earlier.
|
||||
lladdr=(/"${xp}:${xp}:${xp}:${xp}:${xp}:${xp}"$'\0'/ ':lladdress:link layer (MAC) address:')
|
||||
# as above but with a different description
|
||||
lladdrs=(/"${xp}:${xp}:${xp}:${xp}:${xp}:${xp}"$'\0'/ ':lladdress:link layer (MAC) addresses (use - to match any octet):' \#)
|
||||
# matches the word 'mesh_id' followed by a number
|
||||
meshidval=($matchnum ':meshid:mesh ID:')
|
||||
meshid=(/$'mesh_id\0'/ ':meshid:meshid:(mesh_id)' $meshidval)
|
||||
# matches any word (description 'SSID')
|
||||
ssid=($matchany ':ssid:SSID:')
|
||||
# matches any word (description 'value')
|
||||
value=($matchany ':val:value:')
|
||||
# matches any number (description 'value')
|
||||
numvalue=($matchnum ':val:value:')
|
||||
|
||||
# Use the _regex_words function to create a variable containing command words to go after "iw reg"
|
||||
local -a reg_cmds
|
||||
_regex_words regulatory-commands "reg command" \
|
||||
'g*et:print out the kernels current regulatory domain information'\
|
||||
's*et:notify the kernel about the current regulatory domain'
|
||||
reg_cmds=("$reply[@]")
|
||||
|
||||
# Options for to go after "iw event"
|
||||
local -a event_opts
|
||||
_regex_words event-options "event option" \
|
||||
'-t:print timestamp' \
|
||||
'-r:print relative timestamp' \
|
||||
'-f:print full frame for auth/assoc etc'
|
||||
event_opts=("$reply[@]")
|
||||
|
||||
# Commands to go after "iw phy <DEV> wowlan enable"
|
||||
local -a phy_wowlan_enable_cmds
|
||||
_regex_words phy-wowlan-enable-commands "phy WoWLAN enable commands" \
|
||||
'4*way-handshake:enable WoWLAN with 4way handshake trigger' \
|
||||
'a*ny:enable WoWLAN with any trigger' \
|
||||
'd*isconnect:enable WoWLAN with disconnect trigger' \
|
||||
'e*ap-identity-request:enable WoWLAN with EAP identity request trigger' \
|
||||
'g*tk-rekey-failure:enable WoWLAN with gtk rekey failure trigger' \
|
||||
'm*agic-packet:enable WoWLAN with magic packet trigger' \
|
||||
'p*atterns:MAC address triggers:$lladdrs' \
|
||||
'r*fkill-release:enable WoWLAN with rfkill release trigger'
|
||||
phy_wowlan_enable_cmds=("$reply[@]")
|
||||
|
||||
# Commands to go after "iw phy <DEV> wowlan"
|
||||
local -a phy_wowlan_cmds
|
||||
_regex_words phy-wowlan-commands "phy WoWLAN commands" \
|
||||
's*how:show WoWLAN status' \
|
||||
'd*isable:disable WoWLAN' \
|
||||
'e*nable:enable WoWLAN:$phy_wowlan_enable_cmds'
|
||||
phy_wowlan_cmds=("$reply[@]")
|
||||
|
||||
# Some parameters to hold patterns that will be used for "iw phy set" commands
|
||||
# (not perfect, but mostly OK).
|
||||
local -a phy_set_antenna phy_set_channel phy_set_coverage phy_set_frag phy_set_freq phy_set_distance
|
||||
local -a phy_set_name phy_set_netns phy_set_rts phy_set_txpower phy_txpower_opt
|
||||
phy_set_antenna=($matchany ':antenna:bitmap:')
|
||||
phy_set_channel=($matchnum ':channel:channel (1-14):' $high_throughput)
|
||||
phy_set_coverage=($matchnum ':coverage:coverage class (0-255):')
|
||||
phy_set_distance=($matchnum ':distance:valid values\: 0 - 114750:')
|
||||
phy_set_frag=(/$'([0-9]##|off)\0'/ ':channel:channel (1-14):(1 2 3 4 5 6 7 8 9 10 11 12 13 14 off)')
|
||||
phy_set_freq=($frequency $high_throughput)
|
||||
phy_set_name=($matchany ':name:device name:')
|
||||
phy_set_netns=($matchany ':netns:network namespace:')
|
||||
phy_set_rts=($matchnum ':rts:rts threshold:')
|
||||
phy_txpower_opt=($matchany ':txpower:tx power in mBm:')
|
||||
_regex_words phy-set-txpower "set txpower" \
|
||||
'a*uto:auto:' \
|
||||
'f*ixed:fixed:$phy_txpower_opt' \
|
||||
'l*imit:limit:$phy_txpower_opt'
|
||||
phy_set_txpower=("$reply[@]")
|
||||
|
||||
# Commands to go after "iw phy <DEV> set"
|
||||
local -a phy_set_cmds
|
||||
_regex_words phy-set-commands "phy set commands" \
|
||||
'a*ntenna:set a bitmap of allowed antennas to use for TX and RX:$phy_set_antenna' \
|
||||
'ch*annel:set channel:$phy_set_channel' \
|
||||
'co*verage:set coverage class (1 for every 3 usec of air propagation time):$phy_set_coverage' \
|
||||
'd*istance:set appropriate coverage class for given link distance in meters:$phy_set_distance' \
|
||||
'fra*g:set fragmentation threshold:$phy_set_frag' \
|
||||
'fre*q:set frequency/channel the hardware is using, including HT configuration:$phy_set_freq' \
|
||||
'na*me:rename this wireless device:$phy_set_name' \
|
||||
'ne*tns:set network namespace:$phy_set_netns' \
|
||||
'r*ts:set rts threshold:$phy_set_rts' \
|
||||
't*xpower:specify transmit power level and setting type:$phy_set_txpower'
|
||||
phy_set_cmds=("$reply[@]")
|
||||
|
||||
# Commands to go after "iw phy <DEV> interface"
|
||||
local -a phy_interface_cmds
|
||||
# This needs work (should not offer meshid, fouraddr of flags more than once, and need to accomodate multiple flag options)
|
||||
phy_interface_cmds=(\( /$'add\0'/ ':add:add a new virtual interface with the given configuration:(add)' $ifacename $ifacetype \
|
||||
\( $meshid \| $fouraddr \| $flags \) \# \))
|
||||
|
||||
# Commands to go after "iw phy <DEV>"
|
||||
local -a phy_cmds
|
||||
_regex_words phy-commands "phy command" \
|
||||
's*et:set/configure interface properties:$phy_set_cmds' \
|
||||
'inf*o:show capabilities for the specified wireless device' \
|
||||
'int*erface:add a new virtual interface with the given configuration:$phy_interface_cmds' \
|
||||
'w*owlan:WoWLAN commands:$phy_wowlan_cmds'
|
||||
phy_cmds=("$reply[@]")
|
||||
|
||||
# Parameters to hold patterns for dev commands
|
||||
local -a dev_cmds_connect dev_cmds_cqm dev_cmds_get dev_cmds_ibss dev_cmds_interface dev_cmds_mesh dev_cmds_scan_options
|
||||
local -a dev_cmds_mpath dev_cmds_offchannel dev_cmds_roc dev_cmds_scan dev_cmds_set dev_cmds_station dev_cmds_survey
|
||||
dev_cmds_connect=($ssid $frequency $bssid $key)
|
||||
dev_cmds_cqm=(/$'rssi\0'/ ':rssi:rssi:(rssi)' $matchnum ':thresh:threshold:' $matchnum ':hysteresis:hysteresis:')
|
||||
dev_cmds_get=(/$'(mesh_param|power_save)\0'/ ':get:parameter:(mesh_param power_save)' $value)
|
||||
# TODO: THIS NEEDS WORK! THE FINAL OPTIONS FOR JOIN NEED WORK
|
||||
# dev <devname> ibss join <SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [beacon-interval <TU>] [basic-rates <rate in Mbps,rate2,...>] [mcast-rate <rate in Mbps>] [key d:0:abcde]
|
||||
dev_cmds_ibss=(\( /$'leave\0'/ ':cmd:command:((leave:"Leave the IBSS cell"))' \| \( /$'join\0'/ ':cmd:command:((join\:"Join an IBSS cell"))' $ssid $frequency \( /$'fixed-freq\0'/ ':opt:option:((fixed-freq\:"fixed frequency (no args)"))' \| $bssid \| /$'beacon-interval\0'/ ':opt:option:((beacon-interval\:"beacon interval (takes single arg)"))' $numvalue \| /$'basic-rates\0'/ ':opt:option:((basic-rates\:"basic rates (comma separated list of rates)"))' $numvalue \| /$'mcast-rate\0'/ ':opt:option:((mcast-rate\:"multicast rate (takes single arg)"))' $numvalue \| $key \) \# \) \))
|
||||
dev_cmds_interface=(/$'add\0'/ ':add:add:(add)' $ifacename $ifacetype \( $meshid \| $fouraddr \| $flags \) \# )
|
||||
dev_cmds_mesh=(\( /$'leave\0'/ ':leave:leave a mesh:(leave)' \| /$'join\0'/ ':join:join a mesh:(join)' \
|
||||
$matchnum ':meshid:mesh ID:' $matchany ':parameter:mesh parameters [<param>=<value>]*:' \# \))
|
||||
dev_cmds_mpath=(\( /$'(del|get)\0'/ ':mpath:mesh path command:((del\:"remove the mesh path to the given node" \
|
||||
get\:"get information on mesh path to the given node"))' $lladdr \| /$'(new|set)\0'/ ':mpath:mesh path \
|
||||
command:((new\:"create a new mesh path (instead of relying on automatic discovery)" set\:"set an existing mesh \
|
||||
paths next hop"))' $lladdr /$'next_hop\0'/ ':nexthop:next hop:(next_hop)' $lladdr \| /$'dump\0'/ ':mpath:mesh path \
|
||||
command:((dump\:"list known mesh paths"))' \))
|
||||
dev_cmds_offchannel=($frequency $matchnum ':duration:duration:')
|
||||
dev_cmds_roc=(/$'start\0'/ ':start:start:(start)' $frequency $matchnum ':time:time:')
|
||||
dev_cmds_scan_options=(/$'freq\0'/ ':freq:freq:(freq)' $frequency $frequency \# /$'ies\0'/ ':ies:ies:(ies)' $lladdr \( /$'ssid\0'/ ':ssid:ssid:(ssid)' $ssid \# \| /$'passive\0'/ ':opt:passive:(passive)' \))
|
||||
dev_cmds_scan=(\( $dev_cmds_scan_options \| $matchany -'! [[ $match[1] =~ "dump|trigger" ]]' ':opt:option:((-u\:"include unknown data in results" \:""))' $dev_cmds_scan_options \| /$'dump\0'/ ':cmd:command:((dump\:"dump the current scan results"))' $matchany ':opt:option:((-u\:"include unknown data in results" \:""))' \| /$'trigger\0'/ ':cmd:command:((trigger\:"trigger a scan on the given frequencies with probing for the given SSIDs (or wildcard if not given) unless passive scanning is requested"))' $dev_cmds_scan_options \))
|
||||
local -a dev_cmds_set_bitrates dev_cmds_set_freq dev_cmds_set_mesh_param
|
||||
local -a dev_cmds_set_monitor dev_cmds_set_peer dev_cmds_set_power_save
|
||||
local -a dev_cmds_set_type dev_cmds_set_txpower
|
||||
# dev <devname> set bitrates [legacy-<2.4|5> <legacy rate in Mbps>*]
|
||||
dev_cmds_set_bitrates=(/$'legacy-*\0'/ ':opt:legacy:(legacy-2.4 legacy-2.5)' $matchnum ':rate:legacy rate in Mbps:')
|
||||
# dev <devname> set freq <freq> [HT20|HT40+|HT40-]
|
||||
dev_cmds_set_freq=($frequency $high_throughput)
|
||||
# dev <devname> set mesh_param <param>=<value> [<param>=<value>]*
|
||||
dev_cmds_set_mesh_param=( $matchany ':val:param=value:' \# )
|
||||
# dev <devname> set monitor <flag>*
|
||||
dev_cmds_set_monitor=( $matchany ':flag:flag:((none\:"no special flags" fcsfail\:"show frames with FCS errors"\
|
||||
control\:"show control frames" otherbss\:"show frames from other BSSes" cook\:"use cooked mode"))' \# )
|
||||
# dev <devname> set peer <MAC address>
|
||||
dev_cmds_set_peer=($lladdr)
|
||||
# dev <devname> set power_save <on|off>
|
||||
dev_cmds_set_power_save=(/$'(on|off)\0'/ ':opt:power save mode:(on off)')
|
||||
|
||||
_regex_words setcmds "dev set commands" \
|
||||
'4*addr:set interface 4addr (WDS) mode:$fouronoff'\
|
||||
'b*itrates:set/clear specified rate masks:$dev_cmds_set_bitrates'\
|
||||
'c*hannel:set channel:$phy_set_channel'\
|
||||
'f*req:set frequency:$dev_cmds_set_freq'\
|
||||
'mesh_param:set mesh parameters:$dev_cmds_set_mesh_param'\
|
||||
'meshid:set mesh id:$meshidval'\
|
||||
'mo*nitor:set monitor flags:$dev_cmds_set_monitor'\
|
||||
'pe*er:set interface WDS peer MAC address:$dev_cmds_set_peer'\
|
||||
'po*wer_save:set power save on/off:$dev_cmds_set_power_save'\
|
||||
'tx*power:set transmission power:$phy_set_txpower'\
|
||||
'ty*pe:set type:$ifacetypes'
|
||||
dev_cmds_set=("$reply[@]")
|
||||
|
||||
local -a dev_cmds_station_plink dev_cmds_station_vlan
|
||||
dev_cmds_station_plink=(/$'(open|block)\0'/ ':opt::(open block)')
|
||||
dev_cmds_station_vlan=($matchnum ':val:ifindex:')
|
||||
|
||||
local -a dev_cmds_station_set
|
||||
_regex_words stationsetcmds "dev station set commands"\
|
||||
'plink_action:set peer link action:$dev_cmds_station_plink'\
|
||||
'vlan:set AP VLAN:$dev_cmds_station_vlan'
|
||||
dev_cmds_station_set=(\( $lladdr \) "$reply[@]")
|
||||
|
||||
_regex_words stationcmds "dev station commands" \
|
||||
'del:remove the given station entry (use with caution!):$lladdr'\
|
||||
'dump:list all stations known, e.g. the AP on managed interfaces:'\
|
||||
'get:get information for a specific station:$lladdr'\
|
||||
'set:set AP VLAN or mesh peer link action:$dev_cmds_station_set'
|
||||
dev_cmds_station=("$reply[@]")
|
||||
|
||||
dev_cmds_survey=(/$'dump\0'/ ':dump:list all gathered channel survey data:(dump)')
|
||||
|
||||
local -a dev_cmds
|
||||
_regex_words dev-commands "dev commands" \
|
||||
'co*nnect:join a network:$dev_cmds_connect' \
|
||||
'cq*m:set connection quality monitor RSSI threshold:$dev_cmds_cqm' \
|
||||
'de*l:remove this virtual interface' \
|
||||
'di*sconnect:disconnect from the current network' \
|
||||
'g*et:retrieve mesh parameter / power save state:$dev_cmds_get' \
|
||||
'ib*ss:join/leave IBSS cell:$dev_cmds_ibss' \
|
||||
'inf*o:show information for this interface' \
|
||||
'int*erface:add an interface:$dev_cmds_interface' \
|
||||
'l*ink:print information about the current link, if any' \
|
||||
'me*sh:join/leave a mesh:$dev_cmds_mesh' \
|
||||
'mp*ath:mesh path commands:$dev_cmds_mpath' \
|
||||
'o*ffchannel:leave operating channel and go to the given channel for a while:$dev_cmds_offchannel' \
|
||||
'r*oc:roc:$dev_cmds_roc' \
|
||||
'sc*an:scan:$dev_cmds_scan' \
|
||||
'se*t:set interface parameter:$dev_cmds_set' \
|
||||
'st*ation:station commands:$dev_cmds_station' \
|
||||
'su*rvey:list all gathered channel survey data:$dev_cmds_survey'
|
||||
dev_cmds=( $devices "$reply[@]")
|
||||
|
||||
# Arguments to _regex_arguments, built up in array $args.
|
||||
local -a args reply
|
||||
# Command word. Don't care what that is.
|
||||
args=( $matchany )
|
||||
|
||||
local -a phydevs
|
||||
phy_devs=( \( $(iw list|grep '^[[:alnum:]]\+'|cut -f 2 -d ' ') \) )
|
||||
phy_cmds=( \( $matchany ":test:test:$phy_devs[*]" \) "$phy_cmds[@]" )
|
||||
|
||||
_regex_words commands "iw command" \
|
||||
'd*ev:commands to control/list the software devices:$dev_cmds' \
|
||||
'e*vent:monitor events from the kernel:$event_opts' \
|
||||
'h*elp:print usage for each command' \
|
||||
'l*ist:list all wireless devices and their capabilities' \
|
||||
'p*hy:commands to control the physical device:$phy_cmds' \
|
||||
'r*eg:get/set regulatory domain:$reg_cmds'
|
||||
args+=("$reply[@]")
|
||||
|
||||
_regex_arguments _iw "${args[@]}"
|
||||
|
||||
_iw "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode:shell-script
|
||||
# End:
|
145
.zprezto/modules/completion/external/src/_jekyll
vendored
Normal file
145
.zprezto/modules/completion/external/src/_jekyll
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
#compdef jekyll
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for jekyll(http://jekyllrb.com)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * farseer90718 (https://github.com/farseer90718)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local ret=1 state
|
||||
|
||||
local -a common_ops
|
||||
common_ops=(
|
||||
{-v,--version}"[Display version information]"
|
||||
{-h,--help}"[Display help documentation]"
|
||||
{-p,--plugins}"[Plugins directory (defautls to ./_plugins)]: :_directories"
|
||||
{-s,--source}"[Source directory (defaults to ./)]: :_directories"
|
||||
{-d,--destination}"[Destination directory (defautls to ./_site)]: :_directories"
|
||||
"--layouts=[Layouts directory (defaults to ./_layouts)]: :_directories"
|
||||
"--safe=[Safe mode (defaults to false)]"
|
||||
)
|
||||
|
||||
typeset -A opt_args
|
||||
_arguments \
|
||||
':subcommand:->subcommand' \
|
||||
$common_ops \
|
||||
'*::options:->options' && ret=0
|
||||
|
||||
case $state in
|
||||
subcommand)
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
"build:Build your site"
|
||||
"docs:Launch local server with docs for jekyll"
|
||||
"doctor:Search site and print specific deprecation warnings"
|
||||
"help:Display global or [command] help documentation"
|
||||
"import:Import your old blog to Jekyll"
|
||||
"new:Creates a new Jekyll site scaffold in PATH"
|
||||
"serve:Serve your site locally"
|
||||
)
|
||||
|
||||
_describe -t subcommands 'jekyll subcommand' subcommands && ret=0
|
||||
;;
|
||||
|
||||
options)
|
||||
local -a args
|
||||
args=(
|
||||
$common_ops
|
||||
)
|
||||
|
||||
local -a config
|
||||
config=(
|
||||
"--config[Custom configuration file]: :_files"
|
||||
)
|
||||
local -a help
|
||||
help=(
|
||||
{-h,--help}"[Display help information]"
|
||||
)
|
||||
local -a build
|
||||
build=(
|
||||
{-w,--watch}"[Watch for changes and rebuild]"
|
||||
"--limit_posts[Limits the number of posts to parse and publish]"
|
||||
"--future[Publishes posts with a future date]"
|
||||
"--lsi[Use LSI for improved related posts]"
|
||||
"--drafts[Render posts in the _drafts folder]"
|
||||
)
|
||||
|
||||
case $words[1] in
|
||||
help)
|
||||
args=()
|
||||
compadd "$@" build docs doctor help import new serve
|
||||
;;
|
||||
|
||||
build)
|
||||
args+=(
|
||||
$build
|
||||
$config
|
||||
)
|
||||
;;
|
||||
|
||||
docs)
|
||||
args=(
|
||||
{-p,--port}"[Port to listen on]: :_ports"
|
||||
{-u,--host}"[Host to bind to]: :_hosts"
|
||||
$help
|
||||
)
|
||||
;;
|
||||
|
||||
doctor)
|
||||
args+=(
|
||||
$config
|
||||
)
|
||||
;;
|
||||
|
||||
import)
|
||||
args=(
|
||||
"--source[Source file or URL to migrate from]:url"
|
||||
"--file[File to migrate from]: :_files"
|
||||
"--dbname[Database name to migrate from]:database"
|
||||
"--user[Username to use when migrating]:user"
|
||||
"--pass[Password to use when migrating]:password"
|
||||
"--host[Host address to use when migrating]:url"
|
||||
$help
|
||||
)
|
||||
;;
|
||||
|
||||
new)
|
||||
args=(
|
||||
": :_directories"
|
||||
"--force[Force creation even if PATH already exists]"
|
||||
"--blank[Creates scaffolding but with empty files]"
|
||||
$help
|
||||
)
|
||||
;;
|
||||
|
||||
serve)
|
||||
args+=(
|
||||
$build
|
||||
$config
|
||||
{-P,--port}"[Port to listen on]: :_posts"
|
||||
{-H,--host}"[Host to bind to]: :_hosts"
|
||||
{-b,--baseurl}"[Base URL]:url"
|
||||
)
|
||||
|
||||
esac
|
||||
|
||||
_arguments $args && ret=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
74
.zprezto/modules/completion/external/src/_jmeter
vendored
Normal file
74
.zprezto/modules/completion/external/src/_jmeter
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
#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
|
67
.zprezto/modules/completion/external/src/_jmeter-plugins
vendored
Normal file
67
.zprezto/modules/completion/external/src/_jmeter-plugins
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
#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
|
125
.zprezto/modules/completion/external/src/_jonas
vendored
Normal file
125
.zprezto/modules/completion/external/src/_jonas
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
#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
|
84
.zprezto/modules/completion/external/src/_jq
vendored
Normal file
84
.zprezto/modules/completion/external/src/_jq
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
#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
|
||||
|
85
.zprezto/modules/completion/external/src/_kitchen
vendored
Normal file
85
.zprezto/modules/completion/external/src/_kitchen
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
#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 "$@"
|
214
.zprezto/modules/completion/external/src/_knife
vendored
Normal file
214
.zprezto/modules/completion/external/src/_knife
vendored
Normal file
@@ -0,0 +1,214 @@
|
||||
#compdef knife
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Chef's knife (http://www.opscode.com/chef).
|
||||
#
|
||||
# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/knife
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Frank Louwers (https://github.com/franklouwers)
|
||||
# * 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" 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
|
||||
;;
|
||||
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
|
275
.zprezto/modules/completion/external/src/_language_codes
vendored
Normal file
275
.zprezto/modules/completion/external/src/_language_codes
vendored
Normal file
@@ -0,0 +1,275 @@
|
||||
#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
|
62
.zprezto/modules/completion/external/src/_lein
vendored
Normal file
62
.zprezto/modules/completion/external/src/_lein
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
#compdef lein
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Leiningen (https://github.com/technomancy/leiningen)
|
||||
#
|
||||
# Source: https://github.com/technolize/zsh-completion-funcs
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * technolize (https://github.com/technolize)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local ret=1 state
|
||||
_arguments ':subcommand:->subcommand' && ret=0
|
||||
|
||||
case $state in
|
||||
subcommand)
|
||||
subcommands=(
|
||||
"check:Check syntax and warn on reflection."
|
||||
"classpath:Print the classpath of the current project."
|
||||
"clean:Remove all files from project's target-path."
|
||||
"compile:Compile Clojure source into .class files."
|
||||
"deploy:Build and deploy jar to remote repository."
|
||||
"deps:Download all dependencies."
|
||||
"do:Higher-order task to perform other tasks in succession."
|
||||
"help:Display a list of tasks or help for a given task."
|
||||
"install:Install the current project to the local repository."
|
||||
"jack-in:Jack in to a Clojure SLIME session from Emacs."
|
||||
"jar:Package up all the project's files into a jar file."
|
||||
"javac:Compile Java source files."
|
||||
"new:Generate project scaffolding based on a template."
|
||||
"pom:Write a pom.xml file to disk for Maven interoperability."
|
||||
"pprint:Pretty-print a representation of the project map."
|
||||
"repl:Start a repl session either with the current project or standalone."
|
||||
"retest:Run only the test namespaces which failed last time around."
|
||||
"run:Run a -main function with optional command-line arguments."
|
||||
"search:Search remote maven repositories for matching jars."
|
||||
"show-profiles:List all available profiles or display one if given an argument."
|
||||
"test:Run the project's tests."
|
||||
"trampoline:Run a task without nesting the project's JVM inside Leiningen's."
|
||||
"uberjar:Package up the project files and dependencies into a jar file."
|
||||
"upgrade:Upgrade Leiningen to specified version or latest stable."
|
||||
"version:Print version for Leiningen and the current JVM."
|
||||
"with-profile:Apply the given task with the profile(s) specified."
|
||||
)
|
||||
_describe -t subcommands 'leiningen subcommands' subcommands && ret=0
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
61
.zprezto/modules/completion/external/src/_logger
vendored
Normal file
61
.zprezto/modules/completion/external/src/_logger
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
#compdef logger
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for logger (from bsdutils).
|
||||
#
|
||||
# Last updated: 26.02.2013
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Valodim ( https://github.com/Valodim )
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_logger_priority() {
|
||||
local expl
|
||||
|
||||
if compset -P '*.'; then
|
||||
# hidden aliases.. not quite sure how this is supposed to work :\
|
||||
# compadd -n panic warning error
|
||||
|
||||
# just this one tag
|
||||
_wanted priority expl "Priority" \
|
||||
compadd -- debug info notice warn err crit alert emerg
|
||||
return 0
|
||||
fi
|
||||
|
||||
_wanted facility expl "Facility" \
|
||||
compadd -S '.' -- kern user mail daemon auth syslog lpr news \
|
||||
uucp cron security ftp ntp logaudit logalert clock \
|
||||
local0 local1 local2 local3 local4 local5 local6 local7
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
_logger() {
|
||||
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -S -s \
|
||||
{-d,--udp}'[use UDP (TCP is default)]' \
|
||||
{-i,--id}'[log the process ID too]' \
|
||||
{-f,--file}'[log the contents of this file]:Logfile:_files' \
|
||||
'(-)'{-h,--help}'[display this help text and exit]' \
|
||||
{-n,--server}'[write to this remote syslog server]:Server:_hosts' \
|
||||
{-P,--port}'[use this UDP port]:UDP Port' \
|
||||
{-p,--priority}'[mark given message with this priority]:Priority:_logger_priority' \
|
||||
{-s,--stderr}'[output message to standard error as well]' \
|
||||
{-t,--tag}'[mark every line with this tag]:Tag' \
|
||||
{-u,--socket}'[write to this Unix socket]:Socket:_files -W *(=)' \
|
||||
'(-)'{-V,--version}'[output version information and exit]' \
|
||||
'*:Message:' && return 0
|
||||
|
||||
}
|
||||
|
||||
_logger "$@"
|
314
.zprezto/modules/completion/external/src/_lunar
vendored
Normal file
314
.zprezto/modules/completion/external/src/_lunar
vendored
Normal file
@@ -0,0 +1,314 @@
|
||||
#compdef lunar lin lrm lvu
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Lunar (http://www.lunar-linux.org)
|
||||
#
|
||||
# Source: https://github.com/Valodim/lunar-zsh-completion
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Valodim (https://github.com/Valodim)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# completion for lunar itself (different name, see below)
|
||||
_lunar_comp() {
|
||||
local suf ret=1 curcontext="$curcontext"
|
||||
local -a vals state line expl
|
||||
|
||||
# regular arguments, this will probably just hand down to the * command below
|
||||
_arguments -C \
|
||||
'(- :)-d[Enables debug messages]' \
|
||||
'(- :)-h[Display help text]' \
|
||||
'(- :)-v[Increases the level of message output]' \
|
||||
'*::command:->command' && return 0
|
||||
|
||||
# complete the first word, ie. subcommand
|
||||
if (( CURRENT == 1 )); then
|
||||
local -a lunar_commands
|
||||
# all lunar subcommands
|
||||
lunar_commands=(
|
||||
'prune:Removes old sources and install/compile logs'
|
||||
'renew:Checks ver. against moonbase & recompiles if necessary'
|
||||
'update:Fetches latest moonbase and then does a "renew"'
|
||||
'rebuild:Recompiles all installed modules'
|
||||
'optimize:Shortcut to the optimization menu'
|
||||
'fix:Check and fix all modules and internal state of lunar'
|
||||
'nofix:Check but do not fix modules and internal state'
|
||||
'fixdepends:Check and fix the dependency database of lunar'
|
||||
'set:Check internal variable(s) and assign their values'
|
||||
'unset:Unsets an internal variable'
|
||||
'resurrect:Force modulename(s) to be unpacked from /var/cache'
|
||||
'install:Install a checklist of modules'
|
||||
'remove:Remove a checklist of modules'
|
||||
'hold:Place a hold on a checklist of modules'
|
||||
'unhold:Remove a hold on a checklist of modules'
|
||||
'exile:Remove a module a/o prevent it from being resurrected'
|
||||
'unexile:Allows a module to be compiled|resurrected again')
|
||||
|
||||
# just show the commands with description
|
||||
_describe -t commands 'lunar command' lunar_commands && ret=0
|
||||
return ret
|
||||
else
|
||||
|
||||
# at this point, we have to decide what to complete for specific subcommands
|
||||
|
||||
# make a list of subcommands with no further arguments for later
|
||||
local -a lunar_no_args
|
||||
lunar_no_args=( prune renew update rebuild optimize fix nofix fixdepends )
|
||||
|
||||
# update the current context
|
||||
curcontext="${curcontext%:*:*}:lunar-$words[1]:"
|
||||
# if there is a specific function of the form _lunar-subcommand
|
||||
if (( $+functions[_lunar-$words[1]] )); then
|
||||
# call that for completion
|
||||
_call_function ret _lunar-$words[1]
|
||||
elif [[ -n "${lunar_no_args[(r)${words[1]}]}" ]]; then
|
||||
# all commands from the array above take no further arguments
|
||||
_message "lunar ${words[1]} requires no arguments"
|
||||
else
|
||||
# by default, complete modules
|
||||
_lunar_modules
|
||||
fi
|
||||
return ret
|
||||
fi
|
||||
}
|
||||
|
||||
# specific completion for lunar set
|
||||
_lunar-set() {
|
||||
# second argument: all lunar variables
|
||||
if (( CURRENT == 2 )); then
|
||||
local vars
|
||||
vars=( ${(f)"$(cat /var/lib/lunar/unset.sh | cut -d' ' -f2)"} )
|
||||
_describe -t modules 'lunar variable' vars && return 0
|
||||
# third argument: some value
|
||||
elif (( CURRENT == 3 )); then
|
||||
_message "value"
|
||||
# no further argument
|
||||
else
|
||||
_message "no further arguments"
|
||||
fi
|
||||
}
|
||||
|
||||
_lunar-unset() {
|
||||
local vars
|
||||
vars=( ${(f)"$(cat /var/lib/lunar/unset.sh | cut -d' ' -f2)"} )
|
||||
_describe -t modules 'lunar variable' vars && return 0
|
||||
}
|
||||
|
||||
_lunar-unhold() {
|
||||
local vals
|
||||
vals=( ${(f)"$(lvu held | sort | uniq)"} )
|
||||
_describe -t modules 'held modules' vals && return 0
|
||||
}
|
||||
|
||||
_lunar-unexile() {
|
||||
local vals
|
||||
vals=( ${(f)"$(lvu exiled | sort | uniq)"} )
|
||||
_describe -t modules 'exiled modules' vals && return 0
|
||||
}
|
||||
|
||||
_lrm() {
|
||||
_arguments \
|
||||
'(-d --debug)'{-d,--debug}'[Enables debug messages]' \
|
||||
'(-D --downgrade)'{-D,--downgrade}'[downgrades a module]:module:_lunar_modules:version' \
|
||||
'(-h --help)'{-h,--help}'[Displays this help text]' \
|
||||
'(-k --keepconfig)'{-k,--keepconfig}'[remove module(s) but keep dependencies and config]' \
|
||||
'(-n --nosustain)'{-n,--nosustain}'[removes module(s) even if they are sustained]' \
|
||||
'(-u --upgrade)'{-u,--upgrade}'[remove the module but do not run scripts etc.]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Increases the level of message output]' \
|
||||
'(-p --purge)'{-p,--purge}'[Delete all modules that depend on the module(s) being removed as well]' \
|
||||
'*:module:_lunar_installed_modules' && return 0
|
||||
}
|
||||
|
||||
_lin() {
|
||||
_arguments \
|
||||
'(-c --compile)'{-c,--compile}'[Ignore /var/cache/lunar and compiles]' \
|
||||
'(-d --debug)'{-d,--debug}'[Enables debug messages]' \
|
||||
'--deps[Configure modules and determine dependencies]' \
|
||||
'(-f --from)'{-f,--from}'[Specify an alternate for /var/spool/lunar]:directory:_files -/' \
|
||||
'(-h --help)'{-h,--help}'[Displays help text]' \
|
||||
'--opts[Add custom configure options to the module]:configure option string' \
|
||||
'(-p --probe)'{-p,--probe}'[Only lin if not already installed]' \
|
||||
'(-r --reconfigure)'{-r,--reconfigure}'[Select new dependencies for modules]' \
|
||||
'(-R --resurrect)'{-R,--resurrect}'[Force to be unpacked from /var/cache/lunar]' \
|
||||
'(-s --silent)'{-s,--silent}'[Decreases the level of message output]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Increases the level of message output]' \
|
||||
'(-w --want)'{-w,--want}'[Try to install a different version]:wanted version' \
|
||||
'*:module:_lunar_modules' && return 0
|
||||
}
|
||||
|
||||
# completion for lvu, very similar to the lunar one above (therefore uncommented)
|
||||
_lvu() {
|
||||
local suf ret=1 curcontext="$curcontext"
|
||||
local -a vals state line expl
|
||||
|
||||
_arguments -C \
|
||||
'(- :)-d[Enables debug messages]' \
|
||||
'(- :)-h[Display help text]' \
|
||||
'(- :)-v[Increases the level of message output]' \
|
||||
'*::command:->command' && return 0
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
local -a lvu_commands
|
||||
lvu_commands=(
|
||||
'what:display a module''s description'
|
||||
'short:display a module''s short description'
|
||||
'where:display a module''s section'
|
||||
'cd:change directory to module and execs a new shell'
|
||||
'alien:discover untracked files'
|
||||
'from:discover what installed a given file'
|
||||
'leafs:display installed modules that have no explicit dependencies on them'
|
||||
'orphans:display installed modules that are missing dependencies'
|
||||
'conflicts:display conflicting files'
|
||||
'held:display held modules'
|
||||
'exiled:display exiled modules'
|
||||
'expired:display a list of modules which need an update'
|
||||
'info:display terse summary information about module'
|
||||
'search:searches all modules long descriptions for phrase.'
|
||||
'service:displays modules that provide that service'
|
||||
'website:display a module''s website'
|
||||
'install:display an install log'
|
||||
'size:find and show installed size of a module or ALL (slow)'
|
||||
'installed:display installed modules/version of module'
|
||||
'compile:display a compile log'
|
||||
'compiler:display the compiler version used'
|
||||
'links:display a list of modules that this module links to'
|
||||
'sources:display source files for a module'
|
||||
'urls:display all URLs for a module'
|
||||
'maintainer:display maintainer for a module'
|
||||
'version:display version of module in moonbase'
|
||||
'new:attempt to create a new module from scratch'
|
||||
'edit:copy a module to zlocal for editing'
|
||||
'diff:view changes on edited module'
|
||||
'submit:attempt to submit a module to the lunar ML'
|
||||
'unedit:delete zlocal copy of a module'
|
||||
'sum:display checksums'
|
||||
'md5sum:display md5sums'
|
||||
'export:make snapshot of box''s configuration.'
|
||||
'import:restores an exported snapshot.'
|
||||
'section:display moonbase sections'
|
||||
'moonbase:display text listing of the moonbase'
|
||||
'html:display html listing of the moonbase'
|
||||
'updatelog:display summary log of previous lunar update'
|
||||
'activity:display main log file'
|
||||
'newer:display available modules newer than Aug 01, 2003'
|
||||
'older:display modules installed before Jan 01, 2003'
|
||||
'voyeur:peak into module compilation'
|
||||
'pam:display installed modules that are Linux-PAM aware'
|
||||
'depends:displays installed modules that explicitly or recursively depend on this module.'
|
||||
'tree:displays a tree of the module''s dependencies'
|
||||
'stree:same as ''tree'' but highly abbreviated'
|
||||
'eert:same as ''tree'' but reverse and installed deps only'
|
||||
'leert:full reverse dependency tree')
|
||||
|
||||
_describe -t commands 'lvu command' lvu_commands && ret=0
|
||||
|
||||
return ret
|
||||
elif (( CURRENT == 2 )); then
|
||||
local -a lvu_no_args
|
||||
lvu_no_args=( alien leafs orphans conflicts held exiled expired export moonbase html updatelog pam )
|
||||
|
||||
curcontext="${curcontext%:*:*}:lvu-$words[1]:"
|
||||
if (( $+functions[_lvu-$words[1]] )); then
|
||||
_call_function ret _lvu-$words[1]
|
||||
elif [[ -n "${lvu_no_args[(r)${words[1]}]}" ]]; then
|
||||
_message "lvu ${words[1]} requires no arguments"
|
||||
else
|
||||
_lunar_modules
|
||||
fi
|
||||
return ret
|
||||
else
|
||||
_message "No further arguments"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
_lvu-service() {
|
||||
_alternative \
|
||||
'service:service name:_lvu-service-service' \
|
||||
'port:port number:_guard "[0-9]#" "port number"'
|
||||
}
|
||||
|
||||
_lvu-service-service() {
|
||||
local vals
|
||||
vals=( ${(f)"$(cat /etc/services | grep -E -o '^(\w+)' | sort | uniq)"} )
|
||||
_describe -t modules 'service' vals && return 0
|
||||
}
|
||||
|
||||
_lvu-diff() {
|
||||
local vals
|
||||
vals=( /var/lib/lunar/moonbase/zlocal/*(/:t) )
|
||||
_describe -t modules 'moonbase module from zlocal' vals && return 0
|
||||
}
|
||||
|
||||
_lvu-unedit() {
|
||||
local vals
|
||||
vals=( /var/lib/lunar/moonbase/zlocal/*(/:t) )
|
||||
_describe -t modules 'moonbase module from zlocal' vals && return 0
|
||||
}
|
||||
|
||||
_lvu-newer() {
|
||||
_message "date string"
|
||||
}
|
||||
|
||||
_lvu-older() {
|
||||
_message "date string"
|
||||
}
|
||||
|
||||
_lvu-import() {
|
||||
_files
|
||||
}
|
||||
|
||||
_lvu-from() {
|
||||
_files
|
||||
}
|
||||
|
||||
_lvu-new() {
|
||||
_message "module name"
|
||||
}
|
||||
|
||||
_lvu-search() {
|
||||
_message "search string"
|
||||
}
|
||||
|
||||
# specific completion for moonbase modules
|
||||
_lunar_modules() {
|
||||
local vals
|
||||
vals=( /var/lib/lunar/moonbase/*/*(/:t) )
|
||||
_describe -t modules 'moonbase module' vals && return 0
|
||||
}
|
||||
|
||||
# specific completion for moonbase modules
|
||||
_lunar_installed_modules() {
|
||||
local vals
|
||||
vals=( ${(f)"$(lvu installed | cut -d':' -f1)"} )
|
||||
_describe -t modules 'moonbase installed module' vals && return 0
|
||||
}
|
||||
|
||||
# hub function called for completion
|
||||
_lunar() {
|
||||
# decide which completion to use
|
||||
case "$service" in
|
||||
lin) _lin "$@";;
|
||||
lrm) _lrm "$@";;
|
||||
lvu) _lvu "$@";;
|
||||
lunar) _lunar_comp "$@";;
|
||||
*) _message "unknown command $service";;
|
||||
esac
|
||||
}
|
||||
|
||||
_lunar "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
49
.zprezto/modules/completion/external/src/_lunchy
vendored
Normal file
49
.zprezto/modules/completion/external/src/_lunchy
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
#compdef lunchy
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for lunchy (https://github.com/mperham/lunchy).
|
||||
#
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Blake Walters (https://github.com/markupboy)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local state line cmds ret=1
|
||||
|
||||
_arguments -C '1: :->cmds' '*: :->args'
|
||||
|
||||
case $state in
|
||||
cmds)
|
||||
local -a cmds
|
||||
cmds=(
|
||||
'ls:list available agents'
|
||||
'start:start an agent'
|
||||
'stop:stop an agent'
|
||||
'restart:restart an agent'
|
||||
'status:get the status of agent[s]'
|
||||
'install:install an agents plist file'
|
||||
'edit:edit an agent'
|
||||
)
|
||||
_describe -t commands 'lunchy command' cmds && ret=0
|
||||
;;
|
||||
args)
|
||||
case $line[1] in
|
||||
(install)
|
||||
;;
|
||||
(restart|stop)
|
||||
_values 'items' `lunchy status | awk '{print $3}' ` 2>/dev/null && ret=0
|
||||
;;
|
||||
*)
|
||||
_values 'items' `lunchy ls` 2>/dev/null && ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
270
.zprezto/modules/completion/external/src/_manage.py
vendored
Normal file
270
.zprezto/modules/completion/external/src/_manage.py
vendored
Normal file
@@ -0,0 +1,270 @@
|
||||
#compdef manage.py django-admin.py
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Django's manage.py (https://www.djangoproject.com).
|
||||
#
|
||||
# Source: https://github.com/technolize/zsh-completion-funcs
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * technolize (https://github.com/technolize)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_managepy-cleanup(){}
|
||||
_managepy-compilemessages(){}
|
||||
|
||||
_managepy-createcachetable(){
|
||||
_arguments -s : \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-dbshell(){
|
||||
_arguments -s : \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-diffsettings(){
|
||||
_arguments -s : \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-dumpdata(){
|
||||
_arguments -s : \
|
||||
'--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
|
||||
'--indent=-[specifies the indent level to use when pretty-printing output.]:' \
|
||||
$nul_args \
|
||||
'*::appname:_applist' && ret=0
|
||||
}
|
||||
|
||||
_managepy-flush(){
|
||||
_arguments -s : \
|
||||
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
|
||||
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-help(){
|
||||
_arguments -s : \
|
||||
'*:command:_managepy_cmds' \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy_cmds(){
|
||||
local line
|
||||
local -a cmd
|
||||
_call_program help-command ./manage.py help \
|
||||
|& sed -n '/^ /s/[(), ]/ /gp' \
|
||||
| while read -A line; do cmd=($line $cmd) done
|
||||
_describe -t managepy-command 'manage.py command' cmd
|
||||
}
|
||||
|
||||
_managepy-inspectdb(){
|
||||
_arguments -s : \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-loaddata(){
|
||||
_arguments -s : \
|
||||
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
|
||||
'*::file:_files' \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-makemessages(){}
|
||||
|
||||
_managepy-reset(){
|
||||
_arguments -s : \
|
||||
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
|
||||
'*::appname:_applist' \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-runfcgi(){
|
||||
local state
|
||||
|
||||
local fcgi_opts
|
||||
fcgi_opts=(
|
||||
'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
|
||||
'host[hostname to listen on..]:'
|
||||
'port[port to listen on.]:'
|
||||
'socket[UNIX socket to listen on.]::file:_files'
|
||||
'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
|
||||
'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
|
||||
'maxspare[max number of spare processes / threads.]:'
|
||||
'minspare[min number of spare processes / threads.]:'
|
||||
'maxchildren[hard limit number of processes / threads.]:'
|
||||
'daemonize[whether to detach from terminal.]:boolean:(False True)'
|
||||
'pidfile[write the spawned process-id to this file.]:file:_files'
|
||||
'workdir[change to this directory when daemonizing.]:directory:_files'
|
||||
'outlog[write stdout to this file.]:file:_files'
|
||||
'errlog[write stderr to this file.]:file:_files'
|
||||
)
|
||||
|
||||
_arguments -s : \
|
||||
$nul_args \
|
||||
'*: :_values "FCGI Setting" $fcgi_opts' && ret=0
|
||||
}
|
||||
|
||||
_managepy-runserver(){
|
||||
_arguments -s : \
|
||||
'--noreload[tells Django to NOT use the auto-reloader.]' \
|
||||
'--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-shell(){
|
||||
_arguments -s : \
|
||||
'--plain[tells Django to use plain Python, not IPython.]' \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-sql(){}
|
||||
_managepy-sqlall(){}
|
||||
_managepy-sqlclear(){}
|
||||
_managepy-sqlcustom(){}
|
||||
_managepy-sqlflush(){}
|
||||
_managepy-sqlindexes(){}
|
||||
_managepy-sqlinitialdata(){}
|
||||
_managepy-sqlreset(){}
|
||||
_managepy-sqlsequencereset(){}
|
||||
_managepy-startapp(){}
|
||||
|
||||
_managepy-startproject(){
|
||||
_arguments -s : \
|
||||
"(-v --verbosity)"{-v,--verbosity}"[Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output.]:Verbosity:((0\:minimal 1\:normal 2\:verbose 4\:very\ verbose))" \
|
||||
'--template[The path or URL to load the template from.]:file:_files' \
|
||||
"(-e --extension)"{-e,--extension}"[The file extension(s) to render (default: "py"). Separate multiple extensions with commas, or use -e multiple times.]" \
|
||||
"(-n --name)"{-n,--name}"[The file name(s) to render. Separate multiple extensions with commas, or use -n multiple times. --version show program\'s version number and exit]:file:_files" \
|
||||
$nul_args \
|
||||
'*::args:_gnu_generic'
|
||||
}
|
||||
|
||||
_managepy-syncdb() {
|
||||
_arguments -s : \
|
||||
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
|
||||
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-test() {
|
||||
_arguments -s : \
|
||||
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
|
||||
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
|
||||
'*::appname:_applist' \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-testserver() {
|
||||
_arguments -s : \
|
||||
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
|
||||
'--addrport=-[port number or ipaddr:port to run the server on.]' \
|
||||
'*::fixture:_files' \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-validate() {
|
||||
_arguments -s : \
|
||||
$nul_args && ret=0
|
||||
}
|
||||
|
||||
_managepy-changepassword(){}
|
||||
_managepy-createsuperuser(){}
|
||||
_managepy-collectstatic(){}
|
||||
_managepy-findstatic(){}
|
||||
|
||||
_managepy-commands() {
|
||||
local -a commands
|
||||
|
||||
commands=(
|
||||
'cleanup:Can be run as a cronjob or directly to clean out old data from the database (only expired sessions at the moment).'
|
||||
'compilemessages:Compiles .po files to .mo files for use with builtin gettext support.'
|
||||
'createcachetable:creates the table needed to use the SQL cache backend.'
|
||||
'dbshell:runs the command-line client for the current DATABASE_ENGINE.'
|
||||
"diffsettings:displays differences between the current settings.py and Django's default settings."
|
||||
'dumpdata:Output the contents of the database as a fixture of the given format.'
|
||||
'flush:Executes ``sqlflush`` on the current database.'
|
||||
'help:manage.py help.'
|
||||
'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
|
||||
'loaddata:Installs the named fixture(s) in the database.'
|
||||
'makemessages:Runs over the entire source tree of the current directory and pulls out all strings marked for translation.'
|
||||
'reset:Executes ``sqlreset`` for the given app(s) in the current database.'
|
||||
'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
|
||||
'runserver:Starts a lightweight Web server for development.'
|
||||
'shell:Runs a Python interactive interpreter.'
|
||||
'sql:Prints the CREATE TABLE SQL statements for the given app name(s).'
|
||||
'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).'
|
||||
'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).'
|
||||
'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).'
|
||||
'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.'
|
||||
'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).'
|
||||
"sqlinitialdata:RENAMED: see 'sqlcustom'"
|
||||
'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).'
|
||||
'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).'
|
||||
"startapp:Creates a Django app directory structure for the given app name in this project's directory."
|
||||
"startproject:Creates a Django project directory structure for the given project name in the current directory or the given destination."
|
||||
"syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
|
||||
'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.'
|
||||
'testserver:Runs a development server with data from the given fixture(s).'
|
||||
'validate:Validates all installed models.'
|
||||
)
|
||||
if [[ $words[1] =~ "manage.py$" ]]; then
|
||||
commands=($commands
|
||||
"changepassword:Change a user's password for django.contrib.auth."
|
||||
'createsuperuser:Used to create a superuser.'
|
||||
'collectstatic:Collect static files in a single location.'
|
||||
'findstatic:Finds the absolute paths for the given static file(s).'
|
||||
)
|
||||
fi
|
||||
|
||||
_describe -t commands 'manage.py command' commands && ret=0
|
||||
}
|
||||
|
||||
_applist() {
|
||||
local line
|
||||
local -a apps
|
||||
_call_program help-command "python -c \"import os.path as op, re, settings, sys;\\
|
||||
bn=op.basename(op.abspath(op.curdir));[sys\\
|
||||
.stdout.write(str(re.sub(r'^%s\.(.*?)$' %
|
||||
bn, r'\1', i)) + '\n') for i in settings.\\
|
||||
INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \
|
||||
| while read -A line; do apps=($line $apps) done
|
||||
_values 'Application' $apps && ret=0
|
||||
}
|
||||
|
||||
_manage.py() {
|
||||
local -a nul_args
|
||||
nul_args=(
|
||||
'--settings=-[the Python path to a settings module.]:file:_files'
|
||||
'--pythonpath=-[a directory to add to the Python path.]::directory:_directories'
|
||||
'--traceback[print traceback on exception.]'
|
||||
"--version[show program's version number and exit.]"
|
||||
{-h,--help}'[show this help message and exit.]'
|
||||
)
|
||||
|
||||
local curcontext=$curcontext ret=1
|
||||
|
||||
if ((CURRENT == 2)); then
|
||||
_managepy-commands
|
||||
else
|
||||
shift words
|
||||
(( CURRENT -- ))
|
||||
curcontext="${curcontext%:*:*}:managepy-$words[1]:"
|
||||
_call_function ret _managepy-$words[1]
|
||||
fi
|
||||
}
|
||||
|
||||
_manage.py "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
136
.zprezto/modules/completion/external/src/_middleman
vendored
Normal file
136
.zprezto/modules/completion/external/src/_middleman
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
#compdef middleman
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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
|
43
.zprezto/modules/completion/external/src/_mina
vendored
Normal file
43
.zprezto/modules/completion/external/src/_mina
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
#compdef mina
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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
|
35
.zprezto/modules/completion/external/src/_mosh
vendored
Normal file
35
.zprezto/modules/completion/external/src/_mosh
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
#compdef mosh
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for mosh (http://mosh.mit.edu).
|
||||
#
|
||||
# Source: https://gist.github.com/2242920
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Ben O'Hara (https://github.com/benohara)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'--client=:client helper:_command_names -e' \
|
||||
'--server=:server helper:_files' \
|
||||
'--ssh=:ssh command to run:_files' \
|
||||
'(-a -n)--predict=:when:(adaptive always never)' \
|
||||
'(--predict -n)-a[predict always]' \
|
||||
'(--predict -a)-n[predict never]' \
|
||||
{-p,--port=}':port:_ports' \
|
||||
':remote:_hosts' \
|
||||
':remote command:_command_names -e'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
86
.zprezto/modules/completion/external/src/_mussh
vendored
Normal file
86
.zprezto/modules/completion/external/src/_mussh
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
#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
|
628
.zprezto/modules/completion/external/src/_mvn
vendored
Normal file
628
.zprezto/modules/completion/external/src/_mvn
vendored
Normal file
@@ -0,0 +1,628 @@
|
||||
#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'
|
||||
)
|
||||
_describe -t 'common-property-names' 'common property name' properties $@
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_plugin_goal_property_names] )) ||
|
||||
_mvn_plugin_goal_property_names() {
|
||||
local plugin_colon_goal="$@[-1]" update_policy ret=1
|
||||
|
||||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_properties_caching_policy
|
||||
|
||||
unset _properties
|
||||
if ( [[ ${+_properties} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin_colon_goal}" ) && ! _retrieve_cache "mvn/plugins/${plugin_colon_goal}"; then
|
||||
# FIXME Does not work for:
|
||||
# android:apk (new line before expression)
|
||||
# ear:ear (unknown cause)
|
||||
_properties=(${(M)${(ps:,,,:)${${${${(pj: :)${${${(f)${"$(_call_program properties $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=${plugin_colon_goal%:*} -Dgoal=${plugin_colon_goal##*:} -Ddetail)"#*Available parameters:}%%\[INFO\]*}//# [a-z]*/,,,}##*Expression: \$\{}}//\}[[:space:]]##/:}//[[:space:]]##/ }//[[:space:]]#,,,[[:space:]]#/,,,}}:#[a-zA-Z]##:*})
|
||||
[[ $#_properties -gt 0 ]] && _store_cache "mvn/plugins/${plugin_colon_goal}" _properties
|
||||
fi
|
||||
|
||||
[[ $#_properties -gt 0 ]] && _describe -t "${plugin_colon_goal//:/-}-property-names" "${plugin_colon_goal} property name" _properties $@[0,-2] && ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_property_values] )) ||
|
||||
_mvn_property_values() {
|
||||
local ret=1
|
||||
setopt localoptions extendedglob
|
||||
case $@[-1] in
|
||||
((#i)*pomFile*) _wanted pom-files expl 'POM file' _mvn_pom_files && ret=0;;
|
||||
((#i)*file*) _wanted files expl 'file' _files && ret=0;;
|
||||
((#i)*groupId*) _wanted groupIds expl 'groupId' _mvn_groupIds && ret=0;;
|
||||
((#i)*artifactId*) _wanted artifactIds expl 'artifactId' _mvn_groupId_artifactIds ${${(M)${(ps.:.)opt_args[(K)-D]}:#groupId=*}#groupId=} && ret=0;;
|
||||
((#i)*version*) _wanted versions expl 'version' _mvn_artifact_versions ${${(M)${(ps.:.)opt_args[(K)-D]}:#groupId=*}#groupId=}:${${(M)${(ps.:.)opt_args[(K)-D]}:#artifactId=*}#artifactId=} && ret=0;;
|
||||
((#i)*repositoryId*) _message -e repositoryIds 'repositoryId' && ret=0;; # TODO Not implemented
|
||||
((#i)*classifier*) _message -e classifiers 'classifier' && ret=0;;
|
||||
((#i)*scope*) _wanted scopes expl 'scope' _mvn_scopes && ret=0;;
|
||||
((#i)*url*) _wanted urls expl 'url' _urls && ret=0;; # TODO Use _alternative and add repository urls from settings + projects
|
||||
((#i)*(password|passphrase)*) _wanted passwords expl password _mvn_passwords && ret=0;;
|
||||
((#i)*(createChecksum|generatePom|maven.test.skip)*) _wanted booleans expl 'boolean' _mvn_booleans && ret=0;;
|
||||
((#i)*user*) _wanted users expl 'user' _users && ret=0;; # TODO Use _alternative and add repository usernames from settings + projects
|
||||
((#i)*plugin*) _wanted plugin expl 'plugin' _mvn_plugins && ret=0;;
|
||||
(*) _default && ret=0;;
|
||||
esac
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_scopes] )) ||
|
||||
_mvn_scopes() {
|
||||
local scopes; scopes=(
|
||||
'compile:default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.'
|
||||
'provided:much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.'
|
||||
'runtime:indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath.'
|
||||
'test:indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.'
|
||||
'system:similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.'
|
||||
'import:only used on a dependency of type pom in the <dependencyManagement> section. It indicates that the specified POM should be replaced with the dependencies in that POM'\''s <dependencyManagement> section. Since they are replaced, dependencies with a scope of import do not actually participate in limiting the transitivity of a dependency.'
|
||||
)
|
||||
_describe -t scopes 'scope' scopes
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_thread_counts] )) ||
|
||||
_mvn_thread_counts() {
|
||||
local thread_counts; thread_counts=(
|
||||
'1:build with 1 thread' '1C:build with 1 thread per CPU core'
|
||||
'2:build with 2 threads' '2C:build with 2 threads per CPU core'
|
||||
'3:build with 3 threads' '3C:build with 3 threads per CPU core'
|
||||
'4:build with 4 threads' '4C:build with 4 threads per CPU core'
|
||||
'5:build with 5 threads' '5C:build with 5 threads per CPU core'
|
||||
'6:build with 6 threads' '6C:build with 6 threads per CPU core'
|
||||
'7:build with 7 threads' '7C:build with 7 threads per CPU core'
|
||||
'8:build with 8 threads' '8C:build with 8 threads per CPU core'
|
||||
)
|
||||
_describe -t thread-counts 'thread count' thread_counts
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_reactors] )) ||
|
||||
_mvn_reactors() {
|
||||
_message -e reactors 'reactor' # FIXME No idea what kind of value the "--reactor" option is supposed to take
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_passwords] )) ||
|
||||
_mvn_passwords() {
|
||||
_message -e passwords 'password'
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_pom_files] )) ||
|
||||
_mvn_pom_files() {
|
||||
_files -g '*pom*\.xml*'
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_toolchains_files] )) ||
|
||||
_mvn_toolchains_files() {
|
||||
_files -g '*toolchains*\.xml*'
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_settings_files] )) ||
|
||||
_mvn_settings_files() {
|
||||
_files -g '*settings*\.xml*'
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_log_files] )) ||
|
||||
_mvn_log_files() {
|
||||
_files
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_booleans] )) ||
|
||||
_mvn_booleans() {
|
||||
local booleans; booleans=(
|
||||
'true:"true" boolean value'
|
||||
'false:"false" boolean value'
|
||||
)
|
||||
_describe -t booleans 'boolean' booleans
|
||||
}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Helper functions
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
__mvn_get_pom_file() {
|
||||
print ${~opt_args[-f]:-${opt_args[--file]:-pom.xml}}
|
||||
}
|
||||
|
||||
__mvn_get_parent_pom_file() {
|
||||
local pom_file=$(__mvn_get_pom_file)
|
||||
while [[ -f ${pom_file:a:h:h}/pom.xml ]]; do
|
||||
pom_file=${pom_file:a:h:h}/pom.xml;
|
||||
done
|
||||
print $pom_file
|
||||
}
|
||||
|
||||
__mvn_get_settings_file() {
|
||||
print ${~opt_args[-s]:-${opt_args[--settings]:-$HOME/.m2/settings.xml}}
|
||||
}
|
||||
|
||||
__mvn_get_repository_location() {
|
||||
print ${${${${(M)"$(<$(__mvn_get_settings_file))":#*<localRepository>*}:-$HOME/.m2/repository}##*<localRepository>}%%<\/localRepository>*}
|
||||
}
|
||||
|
||||
__mvn_get_plugin_prefix() {
|
||||
print ${${${${@#*.*:}%%:*}%-plugin}/-#maven-#}
|
||||
}
|
||||
|
||||
__mvn_get_cache_dir() {
|
||||
local cache_dir
|
||||
zstyle -s ":completion:${curcontext}:" cache-path cache_dir
|
||||
print ${cache_dir:-${ZDOTDIR:-$HOME}/.zcompcache}
|
||||
}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Caching policies
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
(( $+functions[_mvn_goals_caching_policy] )) ||
|
||||
_mvn_goals_caching_policy() {
|
||||
# Rebuild if cache is older than one month.
|
||||
local -a oldp
|
||||
oldp=( "$1"(NmM+1) )
|
||||
(( $#oldp ))
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_properties_caching_policy] )) ||
|
||||
_mvn_properties_caching_policy() {
|
||||
_mvn_goals_caching_policy
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_groupIds_caching_policy] )) ||
|
||||
_mvn_groupIds_caching_policy() {
|
||||
_mvn_goals_caching_policy
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_profiles_caching_policy] )) ||
|
||||
_mvn_profiles_caching_policy() {
|
||||
# Rebuild if cached file more recent than cache.
|
||||
local cached_file="${1#$(__mvn_get_cache_dir)}"
|
||||
[[ -f $cached_file && $cached_file -nt "$1" ]] && return 0
|
||||
|
||||
# Rebuild if cache is older than one week.
|
||||
local -a oldp
|
||||
oldp=( "$1"(Nmw+1) )
|
||||
(( $#oldp )) && return 0
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
_mvn "$@"
|
||||
|
||||
# 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
|
56
.zprezto/modules/completion/external/src/_nl
vendored
Normal file
56
.zprezto/modules/completion/external/src/_nl
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
#compdef nl
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for GNU nl (coreutils 8.13).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * github.com/RobSis
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local arguments style_values format_values ret=1
|
||||
|
||||
style_values=(
|
||||
"a:number all lines"
|
||||
"t:number only nonempty lines"
|
||||
"n:number no lines"
|
||||
"pBRE:number only lines that contain a match for the basic regular expression, BRE"
|
||||
)
|
||||
|
||||
format_values=(
|
||||
"ln:left justified, no leading zeros"
|
||||
"rn:right justified, no leading zeros"
|
||||
"rz:right justified, leading zeros"
|
||||
)
|
||||
|
||||
_arguments -C -s -S \
|
||||
{-b+,--body-numbering=}'[use STYLE for given number of lines]:style:->style' \
|
||||
{-d+,--section-delimiter=}'[use CC for separating logical pages]' \
|
||||
{-f+,--footer-numbering=}'[use STYLE for numbering footer lines]:style:->style' \
|
||||
{-h+,--header-numbering=}'[use STYLE for numbering header lines]:style:->style' \
|
||||
{-i+,--line-increment=}'[line number increment at each line]' \
|
||||
{-l+,--join-blank-lines=}'[group of NUMBER empty lines counted as one]' \
|
||||
{-n+,--number-format=}'[insert line numbers according to FORMAT]:format:->format' \
|
||||
{-p,--no-renumber}'[do not reset line numbers at logical pages]' \
|
||||
{-s+,--number-separator=}'[add STRING after (possible) line number]' \
|
||||
{-v+,--starting-line-number=}'[first line number on each logical page]' \
|
||||
{-w+,--number-width=}'[use NUMBER columns for line numbers]' \
|
||||
--help'[display help and exit]' \
|
||||
--version'[output version information and exit]' \
|
||||
'*:filename:_files' && ret=0
|
||||
|
||||
case "$state" in
|
||||
(style)
|
||||
_describe -t style style style_values && ret=0
|
||||
;;
|
||||
(format)
|
||||
_describe -t format format format_values && ret=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return $ret
|
66
.zprezto/modules/completion/external/src/_node
vendored
Normal file
66
.zprezto/modules/completion/external/src/_node
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
#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
|
85
.zprezto/modules/completion/external/src/_nvm
vendored
Normal file
85
.zprezto/modules/completion/external/src/_nvm
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
#compdef nvm
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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
|
75
.zprezto/modules/completion/external/src/_optirun
vendored
Normal file
75
.zprezto/modules/completion/external/src/_optirun
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
#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
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user