Compare commits

..

No commits in common. "master" and "0.3.0" have entirely different histories.

222 changed files with 8522 additions and 32174 deletions

View File

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

View File

@ -1,10 +0,0 @@
<!-- Thank you so much for your PR! -->
<!-- Please provide a general summary of your changes in the title above. -->
<!-- If submitting a new compdef, please check it is compliant with our contributing guidelines and tick the boxes: -->
- [ ] This compdef is not already available in zsh.
- [ ] This compdef is not already available in their original project.
- [ ] I am the original author, or I have authorization to submit this work.
- [ ] This is a finished work.
- [ ] It has a header containing authors, status and origin of the script.
- [ ] It has a license header or I accept that it will be licensed under the terms of the Zsh license.

6
.gitignore vendored
View File

@ -1,6 +0,0 @@
# zsh word code files
*.zwc
# IDE files
.vscode/
.idea/

View File

@ -1,39 +0,0 @@
# Contributing
## How to Contribute to zsh-completions
Contributions are welcome, just make sure you follow the guidelines:
* Completions are not accepted when already available in zsh.
* Completions are not accepted when already available in their original project.
* Please do not just copy/paste someone else's completion, ask before.
* Partially implemented completions are not accepted.
* Please add a header containing authors, status and origin of the script and license header if you do not wish to use the Zsh license (example [here](src/_tox)).
* Any reasonable open source license is acceptable but note that we recommend the use of the Zsh license and that you should use it if you hope for the function to migrate to zsh itself.
* Please try to follow the [Zsh completion style guide](https://github.com/zsh-users/zsh/blob/master/Etc/completion-style-guide).
* Please send one separate pull request per file.
* Send a pull request or ask for committer access.
## Contributing Completion Functions to Zsh
The zsh project itself welcomes completion function contributions via
[github pull requests](https://github.com/zsh-users/zsh/),
[gitlab merge requests](https://gitlab.com/zsh-org/zsh/) or via patch
files sent to its mailing list, `zsh-workers@zsh.org`.
Contributing to zsh has the advantage of reaching the most users.
## Including Completion Functions in Upstream Projects
Many upstream projects include zsh completions.
If well maintained, this has the advantage that users get a completion
function that matches the installed version of their software.
If you are the upstream maintainer this is a good choice. If the project
already includes completions for bash, fish, tcsh, etc then they are
likely open to including zsh's too. It can also be a good option for
completions handling commands that are system or distribution specific.
Ideally, arrange for the project's build system to install the
completion function in `$prefix/share/zsh/site-functions`.

25
LICENSE
View File

@ -1,25 +0,0 @@
The Z Shell is copyright (c) 1992-2017 Paul Falstad, Richard Coleman,
Zoltán Hidvégi, Andrew Main, Peter Stephenson, Sven Wischnowsky, and
others. All rights reserved. Individual authors, whether or not
specifically named, retain copyright in all changes; in what follows, they
are referred to as `the Zsh Development Group'. This is for convenience
only and this body has no legal status. The Z shell is distributed under
the following licence; any provisions made in individual files take
precedence.
Permission is hereby granted, without written agreement and without
licence or royalty fees, to use, copy, modify, and distribute this
software and to distribute modified versions of this software for any
purpose, provided that the above copyright notice and the following
two paragraphs appear in all copies of this software.
In no event shall the Zsh Development Group be liable to any party for
direct, indirect, special, incidental, or consequential damages arising out
of the use of this software and its documentation, even if the Zsh
Development Group have been advised of the possibility of such damage.
The Zsh Development Group specifically disclaim any warranties, including,
but not limited to, the implied warranties of merchantability and fitness
for a particular purpose. The software provided hereunder is on an "as is"
basis, and the Zsh Development Group have no obligation to provide
maintenance, support, updates, enhancements, or modifications.

View File

@ -1,95 +1,49 @@
zsh-completions ![GitHub release](https://img.shields.io/github/release/zsh-users/zsh-completions.svg) ![GitHub contributors](https://img.shields.io/github/contributors/zsh-users/zsh-completions.svg) [![IRC](https://img.shields.io/badge/IRC-%23zsh--completions-yellow.svg)](irc://irc.freenode.net/#zsh-completions) [![Gitter](https://badges.gitter.im/zsh-users/zsh-completions.svg)](https://gitter.im/zsh-users/zsh-completions?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
=============
zsh-completions
===============
**Additional completion definitions for [Zsh](https://www.zsh.org/).**
**Additional completion definitions for [Zsh](http://www.zsh.org).**
*This project aims at gathering/developing new completion scripts that are not available in Zsh yet. The scripts may be contributed to the Zsh project when stable enough.*
*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.*
---
## Usage
Status
------
See [issues](zsh-completions/issues) for details on each completion definition.
### Using packages
| System | Package |
| ------------- | ------------- |
| Debian / Ubuntu | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
| Fedora / CentOS / RHEL / Scientific Linux | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
| OpenSUSE / SLE | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
| Arch Linux / Manjaro / Antergos / Hyperbola | [zsh-completions](https://www.archlinux.org/packages/zsh-completions), [zsh-completions-git](https://aur.archlinux.org/packages/zsh-completions-git) |
| Gentoo / Funtoo | [app-shells/zsh-completions](https://packages.gentoo.org/packages/app-shells/zsh-completions) |
| NixOS | [zsh-completions](https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/zsh/zsh-completions/default.nix) |
| Void Linux | [zsh-completions](https://github.com/void-linux/void-packages/blob/master/srcpkgs/zsh-completions/template) |
| Slackware | [Slackbuilds](https://slackbuilds.org/repository/14.2/system/zsh-completions/) |
| macOS | [homebrew](https://github.com/Homebrew/homebrew-core/blob/master/Formula/z/zsh-completions.rb), [MacPorts](https://github.com/macports/macports-ports/blob/master/sysutils/zsh-completions/Portfile) |
| NetBSD | [pkgsrc](https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/zsh-completions/README.html) |
| FreeBSD | [shells/zsh-completions](https://www.freshports.org/shells/zsh-completions) |
Usage
-----
---
#### Using packages
### Using zsh frameworks
* Arch Linux: [AUR/zsh-completions](https://aur.archlinux.org/packages.php?ID=54111) / [AUR/zsh-completions-git](https://aur.archlinux.org/packages.php?ID=51001)
* Gentoo: [scrill overlay](http://gpo.zugaina.org/app-shells/zsh-completions)
#### [antigen](https://github.com/zsh-users/antigen)
Add `antigen bundle zsh-users/zsh-completions` to your `~/.zshrc`.
#### [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh)
To avoid issues with redundant `.zcompdump` cache generation (see [#603](https://github.com/zsh-users/zsh-completions/issues/603)), do **not** load `zsh-completions` as a standard plugin.
Instead, follow this optimized approach:
1. Clone the repository into your custom plugins directory:
```bash
git clone https://github.com/zsh-users/zsh-completions.git \
${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
```
2. Update your `~/.zshrc` configuration **before** sourcing oh-my-zsh:
```bash
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
autoload -U compinit && compinit
source "$ZSH/oh-my-zsh.sh"
```
This prevents `compinit` from being called twice and significantly improves shell startup time.
#### [zinit](https://github.com/zdharma-continuum/zinit)
Add `zinit light zsh-users/zsh-completions` to your `~/.zshrc`.
---
### Manual installation
#### Manual installation
* Clone the repository:
```bash
git clone https://github.com/zsh-users/zsh-completions.git
```
git clone git://github.com/zsh-users/zsh-completions.git
* Include the directory in your `$fpath`, for example by adding in `~/.zshrc`:
```bash
fpath=(path/to/zsh-completions/src $fpath)
```
fpath=(path/to/zsh-completions $fpath)
* You may have to force rebuild `zcompdump`:
```bash
rm -f ~/.zcompdump; compinit
```
rm -f ~/.zcompdump; compinit
---
Contributing
------------
### Contributing
Contributions are welcome, just make sure you follow the guidelines:
Contributions are welcome, see [CONTRIBUTING](https://github.com/zsh-users/zsh-completions/blob/master/CONTRIBUTING.md).
* Please add a header containing authors, license info, status and origin of the script (example [here](https://github.com/zsh-users/zsh-completions/blob/master/_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
Completions use the Zsh license, unless explicitly mentioned in the file header.
See [LICENSE](https://github.com/zsh-users/zsh-completions/blob/master/LICENSE) for more information.
License
-------
See each file for license details.

173
_ack Normal file
View File

@ -0,0 +1,173 @@
#compdef ack ack-grep
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for ack 1.94 (http://betterthangrep.com).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_ack() {
local curcontext="$curcontext" state line cmds update_policy ret=1
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _ack_types_caching_policy
unset _ack_raw_types
if ( [[ ${+_ack_raw_types} -eq 0 ]] || _cache_invalid "ack-grep" ) && ! _retrieve_cache "ack-grep"; then
_ack_raw_types=(${(S)${(f)${${"$(_call_program types $words[1] --help=types)"}#*--\[no\]}}#*no\]})
[[ $#_ack_raw_types -gt 0 ]] && _store_cache "ack-grep" _ack_raw_types
fi
_arguments -C \
'(- 1 *)--version[display version and copyright information]' \
'(- 1 *)--help[print a short help statement]' \
'(- 1 *)--man[print the manual page]' \
'(-a --all -u --unrestricted)'{-a,--all}'[operate on all files, regardless of type (but still skip directories like blib, CVS, etc.)]' \
'(-A --after-context -C --context)'{-A,--after-context}'[print N lines of trailing context after matching lines]:number' \
'(-B --before-context -C --context)'{-B,--before-context}'[print N lines of leading context before matching lines]:number' \
'(-C --context -A --after-context -B --before-context)'{-C,--context}'[print N lines (default 2) of context around matching lines]:number' \
'(-c --count)'{-c,--count}'[suppress normal output; instead print a count of matching lines for each input file]' \
'(--nocolor)--color[highlight the matching text]' \
'(--color --color-filename --color-match --color-lineno)--nocolor[supress the color]' \
'(--nocolor --color)--color-filename[sets the color to be used for filenames]:color:->colors' \
'(--nocolor --color)--color-match[sets the color to be used for matches]:color:->colors' \
'(--nocolor --color)--color-lineno[sets the color to be used for line numbers]:color:->colors' \
'--column[show the column number of the first match]' \
'(--noenv)--env[enable environment processing]' \
'(--env)--noenv[disable all environment processing, no .ackrc is read and all environment variables are ignored]' \
'--flush[flush output immediately]' \
'-f[only print the files that would be searched, without actually doing any searching]' \
'(--nofollow)--follow[follow symlinks]' \
'(--follow)--nofollow[don'\''t follow symlinks]' \
'-G[only paths matching the given regex are included in the search]:regex' \
'-g[print files where the relative path + filename matches the given regex]:regex' \
'(--nogroup)--group[group matches by file name]' \
'(--group)--nogroup[do not group matches by file name]' \
'(-H --with-filename -h --no-filename)'{-H,--with-filename}'[print the filename for each match]' \
'(-h --no-filename -H --with-filename)'{-h,--no-filename}'[suppress the prefixing of filenames on output when multiple files are searched]' \
'(-i --ignore-case)'{-i,--ignore-case}'[ignore case in the search strings]' \
'*--ignore-dir[ignore directory]:directory:_files -/' \
'*--noignore-dir[don'\''t ignore directory]:directory:_files -/' \
'--line[only print given line of each file]:number' \
'(-l --files-with-matches -L --files-without-matches)'{-l,--files-with-matches}'[only print the filenames of matching files, instead of the matching text]' \
'(-L --files-without-matches -l --files-with-matches)'{-L,--files-without-matches}'[only print the filenames of files that do NOT match]' \
'--match[specify the regular expression explicitly]:regex' \
'(-m --max-count)'{-m,--max-count}'[stop reading a file after N matches]:number' \
'(-r -R --recurse -n --no-recurse)'{-r,-R,--recurse}'[recurse into sub-directories]' \
'(-n --no-recurse -r -R --recurse)'{-n,--no-recurse}'[no descending into subdirectories]' \
'-o[show only the part of each line matching PATTERN (turns off text highlighting)]:pattern' \
'--output[output the evaluation of expr for each line (turns off text highlighting)]:expression' \
'--pager[direct ack'\''s output through program]:pager program:_command_names' \
'--passthru[prints all lines, whether or not they match the expression]' \
'--print0[the filenames are output separated with a null byte instead of the usual newline]' \
'(-Q --literal)'{-Q,--literal}'[quote all metacharacters in the pattern, it is treated as a literal]' \
'(--no-smart-case)--smart-case[ignore case in the search strings if pattern contains no uppercase characters]' \
'(--smart-case)--no-smart-case[disable --smart-case option]' \
'--sort-files[sorts the found files lexically]' \
'--show-types[outputs the filetypes that ack associates with each file]' \
'--thpppt[display the all-important Bill The Cat logo]' \
'*--type[specify the types of files to include or exclude from a search]:type:->types' \
'*--type-add[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \
'*--type-set[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \
'(-u --unrestricted -a --all)'{-u,--unrestricted}'[all files and directories (including blib/, core.*, ...) are searched, nothing is skipped]' \
'(-v --invert-match)'{-v,--invert-match}'[invert match: select non-matching lines]' \
'(-w --word-regexp)'{-w,--word-regexp}'[force the given pattern to match only whole words]' \
'-1[stops after reporting first match of any kind]' \
{'--','--no'}${_ack_raw_types/ ##/\[}']' \
'1: :->patterns' \
'*: :_files' \
&& ret=0
case $state in
patterns)
_message -e patterns 'pattern' && ret=0
;;
colors)
local colors; colors=(
'black' 'on_black'
'red' 'on_red'
'green' 'on_green'
'yellow' 'on_yellow'
'blue' 'on_blue'
'magenta' 'on_magenta'
'cyan' 'on_cyan'
'white' 'on_white'
'clear'
'reset'
'dark'
'bold'
'underline'
'underscore'
'blink'
'reverse'
'concealed'
)
_describe -t 'colors' 'color' colors && ret=0
;;
type-defs)
if compset -P '*='; then
local extensions; extensions=(*.*(:e))
_values -s ',' 'file extension' '.'$extensions && ret=0
else
_message -e type-name 'type name' && ret=0
fi
;;
types)
local types; types=({'','no'}${_ack_raw_types/ ##/:})
_describe -t 'types' 'type' types
;;
esac
return ret
}
_ack_types_caching_policy() {
# Rebuild if ackrc more recent than cache.
[[ -f $HOME/.ackrc && $$HOME/.ackrc -nt "$1" ]] && return 0
# Rebuild if cache is older than one week.
local -a oldp
oldp=( "$1"(Nmw+1) )
(( $#oldp )) && return 0
return 1
}
_ack "$@"

412
_adb Normal file
View File

@ -0,0 +1,412 @@
#compdef adb
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for adb (Android Debug Bridge) 1.0.26
# (http://developer.android.com/guide/developing/tools/adb.html).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext" adb_args
_adb() {
local ret=1
_arguments -C \
'(-e -s)-d[directs command to the only connected USB device, returns an error if more than one USB device is present]' \
'(-d -s)-e[directs command to the only running emulator, returns an error if more than one emulator is running]' \
'(-d -e)-s[directs command to the USB device or emulator with the given serial number]: :_adb_serial_numbers' \
'-p[simple product name or a relative/absolute path to a product out directory]: :_adb_products' \
'1: :_adb_cmds' \
'*::arg:->args' \
&& ret=0
adb_args="${(fkv)opt_args[(I)-d|-e|-s|-p]}"
case "$state" in
(args)
curcontext="${curcontext%:*:*}:adb-cmd-$words[1]:"
case $words[1] in
(help|version|devices|jdwp|bugreport|wait-for-device|start-server|kill-server|get-state|get-serialno|status-window|remount|reboot-bootloader|root|usb)
_message 'no more arguments' && ret=0
;;
(connect|disconnect)
_arguments \
'1: :_adb_host_colon_ports' \
&& ret=0
;;
(push)
_arguments \
'1:local directory:_files -/' \
'2: :_adb_remote_files -/' \
&& ret=0
;;
(pull)
_arguments \
'1: :_adb_remote_files -/' \
'2:local directory:_files -/' \
&& ret=0
;;
(sync)
_arguments \
'-l[list but do not copy]' \
'1: :_adb_sync_directories' \
&& ret=0
;;
(shell|emu)
_arguments -C \
'1: :_adb_remote_commands' \
'*::remote-command-arg:->remote-command-args' \
&& ret=0
case "$state" in
(remote-command-args)
curcontext="${curcontext%:*:*}:adb-remote-cmd-$words[1]:"
if (( $+functions[_adb_remote_command_$words[1]_args] )); then
_adb_remote_command_$words[1] && ret=0
# TODO Write handlers for following commands:
# * am (Activity Manager)
# * pm (Package Manager)
# TODO Reuse existing compdefs for standard commands (ls, id, ifconfig, kill, etc) ?
# How do we tell them to use _remote_ files/pids/users/etc ?
else
_adb_remote_command_default && ret=0
fi
;;
esac
;;
(logcat)
local -a rotation_opts
[[ -n ${(M)words:#"-f"} ]] && rotation_opts+=('-r[rotates the log file every kbytes of output. The default value is 16]:value (in kb)')
[[ -n ${(M)words:#"-r"} ]] && rotation_opts+=('-n[sets the maximum number of rotated logs. The default value is 4]:count')
_arguments \
'-b[loads an alternate log buffer for viewing, such as event or radio. The main buffer is used by default]: :_adb_logcat_buffers' \
'-c[clears (flushes) the entire log and exits]' \
'-d[dumps the log to the screen and exits]' \
'-f[writes log message output to file. The default is stdout]: :_files' \
'-g[prints the size of the specified log buffer and exits]' \
'-s[sets the default filter spec to silent]' \
'-v[sets the output format for log messages]: :_adb_logcat_output_formats' \
"${rotation_opts[@]}" \
'*: :_adb_logcat_filter_specs' \
&& ret=0
;;
(forward)
_arguments \
'1: :_adb_local_forward_specs' \
'2: :_adb_remote_forward_specs' \
&& ret=0
;;
(install)
_arguments \
'-l[forward-lock the app]' \
'-r[reinstall the app, keeping its data]' \
'-s[install on SD card instead of internal storage]' \
'1: :_files' \
&& ret=0
;;
(uninstall)
_arguments \
'-k[keep the data and cache directories]' \
'1: :_adb_packages' \
&& ret=0
;;
(reboot)
_arguments \
'1:program:((bootloader:reboot\ into\ the\ bootloader\ program recovery:reboot\ into\ the\ recovery\ program))' \
&& ret=0
;;
(tcpip)
_arguments \
'1::port' \
&& ret=0
;;
(ppp)
# TODO Complete tty (See http://developer.android.com/guide/developing/tools/adb.html#commandsummary)
# TODO Complete PPP parameters (See http://ppp.samba.org/pppd.html)
_arguments \
'1::tty' \
'*::parameters' \
&& ret=0
;;
esac
;;
esac
return ret
}
(( $+functions[_adb_cmds] )) ||
_adb_cmds() {
_alternative \
'general-commands:general command:_adb_general_cmds' \
'device-commands:device command:_adb_device_cmds' \
'scripting-commands:scripting command:_adb_scripting_cmds'
}
(( $+functions[_adb_general_cmds] )) ||
_adb_general_cmds() {
local commands; commands=(
'help:show help message'
'version:show version number'
'devices:list all connected devices'
'connect:connect to a device via TCP/IP'
'disconnect:disconnect from a TCP/IP device'
)
_describe -t general-commands 'general command' commands "$@"
}
(( $+functions[_adb_device_cmds] )) ||
_adb_device_cmds() {
local commands; commands=(
'push:copy file/dir to device'
'pull:copy file/dir from device'
'sync:copy host->device only if changed'
'shell:run remote shell interactively or command'
'emu:run emulator console command'
'logcat:view device log'
'forward:forward socket connections'
'jdwp:list PIDs of processes hosting a JDWP transport'
'install:push this padbage file to the device and install it'
'uninstall:remove this app padbage from the device'
'bugreport:return all information from the device'
)
_describe -t device-commands 'device command' commands "$@"
}
(( $+functions[_adb_scripting_cmds] )) ||
_adb_scripting_cmds() {
local commands; commands=(
'wait-for-device:block until device is online'
'start-server:ensure that there is a server running'
'kill-server:kill the server if it is running'
'get-state:prints\: offline | bootloader | device'
'get-serialno:prints\: <serial-number>'
'status-window:continuously print device status for a specified device'
'remount:remounts the /system partition on the device read-write'
'reboot:reboots the device, optionally into the bootloader or recovery program'
'reboot-bootloader:reboots the device into the bootloader'
'root:restarts the adbd daemon with root permissions'
'usb:restarts the adbd daemon listening on USB'
'tcpip:restarts the adbd daemon listening on TCP on the specified port'
'ppp:run PPP over USB'
)
_describe -t scripting-commands 'scripting command' commands "$@"
}
(( $+functions[_adb_products] )) ||
_adb_products() {
_alternative \
'product-names:product name:_adb_product_names' \
'directories:directory:_files -/'
}
(( $+functions[_adb_product_names] )) ||
_adb_product_names() {
local ret=1
if [[ -n "$ANDROID_PRODUCT_OUT" ]]; then
local product_names; product_names=("$ANDROID_PRODUCT_OUT:default value set in ANDROID_PRODUCT_OUT environment variable")
_describe -t product-names 'product name' product_names && ret=0
else
_message -e product-names 'product name' && ret=0
fi
return ret
}
(( $+functions[_adb_serial_numbers] )) ||
_adb_serial_numbers() {
local serial_numbers; serial_numbers=(${${(M)${(f)"$(_call_program devices $service devices)"}:#*device}%%[[:space:]]*}":connected device")
[[ -n "$ANDROID_SERIAL" ]] && serial_numbers+=("$ANDROID_SERIAL:default value set in ANDROID_SERIAL environment variable")
_describe -t serial-numbers 'serial number' serial_numbers "$@" && ret=0
}
(( $+functions[_adb_packages] )) ||
_adb_packages() {
local packages; packages=(${${(ps:\r\n:)"$(_call_program packages $service $adb_args shell 'ls /data/data 2>/dev/null')"}:#\**\*})
_multi_parts . packages
}
(( $+functions[_adb_host_colon_ports] )) ||
_adb_host_colon_ports() {
local ret=1
if compset -P '*:'; then
_message -e ports 'port' && ret=0
else
_wanted hosts expl 'host' _hosts -qS: && ret=0
fi
return ret
}
(( $+functions[_adb_remote_files] )) ||
_adb_remote_files() {
local dirsonly command="ls -d ${(S)words[CURRENT]/\/*//}*/ 2>/dev/null"
zparseopts -D -E '/=dirsonly'
(( ! $#dirsonly )) && command+="; ls -d ${words[CURRENT]}* 2>/dev/null"
local files; files=(${${(ps:\r\n:)"$(_call_program files $service $adb_args shell "'$command'" 2>/dev/null)"}:#\**\*})
_multi_parts "$@" / files
}
(( $+functions[_adb_remote_commands] )) ||
_adb_remote_commands() {
local commands; commands=(${${(ps:\r\n:)"$(_call_program commands $service $adb_args shell "'IFS=:;for path_dir in \$PATH; do ls \$path_dir 2>/dev/null; done'" 2>/dev/null)"}:#\**\*})
_describe -t remote-commands 'remote command' commands && ret=0
}
(( $+functions[_adb_local_forward_specs] )) ||
_adb_local_forward_specs() {
local ret=1
if compset -P '*:'; then
case ${IPREFIX%:} in
(tcp)
_message -e ports 'port' && ret=0
;;
(localabstract|localreserved)
_wanted sockets expl 'socket' _socket && ret=0
;;
(localfilesystem)
_wanted socket-files expl 'socket file' _files && ret=0
;;
(dev)
_wanted devices expl 'device' _files -g "/dev/**" && ret=0
;;
esac
else
local modes; modes=(
'tcp:TCP socket'
'localabstract:local abstract socket'
'localreserved:local reserved socket'
'localfilesystem:local filesystem socket'
'dev:device'
)
_describe -t forward-modes 'forward mode' modes -qS: && ret=0
fi
return ret
}
(( $+functions[_adb_remote_forward_specs] )) ||
_adb_remote_forward_specs() {
local ret=1
if compset -P '*:'; then
case ${IPREFIX%:} in
(tcp)
_message -e ports 'remote port' && ret=0
;;
(localabstract|localreserved|localfilesystem)
_message -e sockets 'remote socket' && ret=0
;;
(dev)
_message -e devices 'remote device' && ret=0
;;
(jdwp)
local pids; pids=(${${(f)"$(_call_program pids $service $adb_args jdwp 2>/dev/null)"}:#\**\*})
_describe -t remote-pids 'remote pid' pids && ret=0
;;
esac
else
local modes; modes=(
'tcp:TCP socket'
'localabstract:local abstract socket'
'localreserved:local reserved socket'
'localfilesystem:local filesystem socket'
'dev:device'
'jdwp:Java Debug Wire Protocol'
)
_describe -t forward-modes 'forward mode' modes -qS: && ret=0
fi
return ret
}
(( $+functions[_adb_sync_directories] )) ||
_adb_sync_directories() {
_alternative \
'partitions:partition:((system:the\ /system\ partition data:the\ /data\ partition))' \
'directories:directory:_adb_remote_files -/'
}
(( $+functions[_adb_logcat_filter_specs] )) ||
_adb_logcat_filter_specs() {
local ret=1
if compset -P '*:'; then
local priorities; priorities=(
'V:verbose (lowest priority)'
'D:debug'
'I:info'
'W:warning'
'E:error'
'F:fatal'
'S:silent (highest priority, on which nothing is ever printed)'
)
_describe -t log-priorities 'log priority' priorities "$@" && ret=0
else
local tags; tags=(${(u)${${${(f)"$(_call_program tags $service $adb_args logcat -d 2>/dev/null)"}%%[[:space:]]#\(*}##*\/}:#\**\*})
_describe -t log-tags 'log tag' tags -qS: "$@" && ret=0
fi
return ret
}
(( $+functions[_adb_logcat_output_formats] )) ||
_adb_logcat_output_formats() {
local formats; formats=(
'brief:display priority/tag and PID of originating process (the default format)'
'process:display PID only'
'tag:display the priority/tag only'
'thread:display process:thread and priority/tag only'
'raw:display the raw log message, with no other metadata fields'
'time:display the date, invocation time, priority/tag, and PID of the originating process'
'long:display all metadata fields and separate messages with a blank lines'
)
_describe -t log-formats 'log format' formats "$@" && ret=0
}
(( $+functions[_adb_logcat_buffers] )) ||
_adb_logcat_buffers() {
local buffers; buffers=(
'main:view the main log buffer (default)'
'radio:view the buffer that contains radio/telephony related messages'
'events:view the buffer containing events-related messages'
)
_describe -t log-buffers 'log buffer' buffers "$@" && ret=0
}
(( $+functions[_adb_remote_command_default] )) ||
_adb_remote_command_default() {
_wanted remote-files expl 'remote file' _adb_remote_files
}
_adb "$@"

View File

@ -1,5 +1,30 @@
#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
# -----------
#
@ -13,12 +38,15 @@
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext"
_android() {
typeset -A opt_args
local context state line curcontext="$curcontext"
local ret=1
_arguments -C -A "-*" \
@ -213,8 +241,6 @@ _android_cmds() {
'update:update a virtual device, project, SDK or adb'
'move:move a virtual device'
'delete:delete a virtual device'
'avd:displays the AVD Manager window'
'sdk:displays the SDK Manager window'
'display:display manager windows'
)
_describe -t commands 'command' commands "$@"
@ -298,11 +324,3 @@ _android_sdk_update_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

50
_attach Normal file
View File

@ -0,0 +1,50 @@
#compdef attach
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for attach (http://github.com/sorin-ionescu/attach).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Sorin Ionescu <sorin.ionescu@gmail.com>
#
# ------------------------------------------------------------------------------
local state mode_values existing_sessions ret=1
mode_values=(
"none:Disable redrawing completely"
"ctrl_l:Send a ^L character if the terminal is in char-at-a-time mode to the program"
"winch:Send a WINCH signal to the program"
)
existing_sessions=($(_call_program session attach))
_arguments -C -s -S \
'(--list -l)'{--list,-l}'[List sessions]' \
'(--sockets -L)'{--sockets,-L}'[List sockets]' \
'(--session -s)'{--session=,-s+}'[Set the session name]:session' \
'(--char -c)'{--char=,-c+}'[Set the detach character (default: ^\\)]:char' \
'(--redraw -r)'{--redraw=,-r+}'[Set the redraw method (none, ctrl_l, or winch)]:mode:->mode' \
'(--detached -d)'{--detached,-d}'[Start the session detched]' \
'(--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 this 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

163
_baselayout Normal file
View File

@ -0,0 +1,163 @@
#compdef rc-update rc-status rc rc-service
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Gentoo Baselayout v2 and OpenRC v0.8 (init system).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Vadim A. Misbakh-Soloviev <mva@mva.name>
# * Bapt <bapt@tuxfamily.org>
# * kaworu <kaworu@kaworu.ch>
# * David Durrleman <dualmoo@gmail.com>
# * oberyno <oberyno@gmail.com>
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
#<sys-apps/baselayout-1.12.11.1>
#
# Status:
# rc (fully done)
# rc-update (fully done)
# rc-status (fully done)
# rc-service (to be improved)
local gentoo_runlevels
gentoo_runlevels=(/etc/runlevels/*(:t))
# Stuff for rc
_rc () {
if (( CURRENT == 2 )); then
_values 'runlevels' $gentoo_runlevels
fi
}
_rc_list_service () {
local servicelist
servicelist=(${(f)"$(/sbin/rc-service -Cl 2>/dev/null)"})
_values 'services' $servicelist
}
# Stuff for rc-service
_rc-service () {
servicelist=${(f)"$(/sbin/rc-service -Cl 2>/dev/null)"}
if (( CURRENT == 2 ));then
_arguments -s \
'(-e --exists)'{-e,--exists}"[tests if the service exists or not]" \
'(-l --list)'{-l,--list}'[list all available services]' \
'(-r --resolve)'{-r,--resolve}'[resolve the service name to an init script]' \
'(-C --nocolor)'{-C,--nocolor}'[Disable color output]' \
'(-v --verbose)'{-v,--verbose}'[Run verbosely]' \
'(-q --quiet)'{-q,--quiet}'[Run quietly]'
_rc_list_service
else
case $words[2] in
-e|--exists|-r|--resolve)
(( CURRENT > 3 )) && return 0
_rc_list_service
;;
-*)
return 0
;;
*)
_values "action" stop start restart describe zap
;;
esac
fi
}
# Stuff for rc-status
_rc-status () {
_arguments -s \
'(-a --all)'{-a,--all}'[Show services at all run levels]' \
'(-l --list)'{-l,--list}'[Show list of run levels]' \
'(-nc --nocolor)'{-nc,--nocolor}'[Disable color output]' \
'(-s --servicelist)'{-s,--servicelist}'[Show all services]' \
'(-u --unused)'{-u,--unused}'[Show services not assigned to any run level]'
_values 'runlevels' $gentoo_runlevels
}
# Stuff for rc-update
_rc-update () {
local used_init
# FIXME: ${=${(f)"$(rc-update show 2>/dev/null)"}% |*} yield the same result (for me).
# we probably don't need any more the (M) matcher part.
used_init=(${=${(M)${(f)"$(/sbin/rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*})
if (( CURRENT == 2 )); then
_values 'rc-update actions' \
'add[Add script to a runlevel]' \
'del[Delete script from a runlevel]' \
'show[Show scripts lanched at a runlevel]' \
'-a[Add script to a runlevel]' \
'-d[Delete script from a runlevel]' \
'-s[Show scripts lanched at a runlevel]'
elif (( CURRENT == 3 )); then
case "$words[2]" in
add|-a)
_values 'scripts' /etc/init.d/*~*.sh(:t)
;;
del|-d)
_values 'scripts' $used_init
;;
show|-s)
_values 'runlevels' $gentoo_runlevels \
'-v[Show all init scripts]' \
'--verbose[Show all init scripts]'
;;
esac
elif (( CURRENT == 4 )); then
_values 'runlevels' $gentoo_runlevels
fi
}
case "$service" in
rc-update)
_rc-update "$@" && return 0
;;
rc-service)
_rc-service "$@" && return 0
;;
rc-status)
_rc-status "$@" && return 0
;;
rc)
_rc "$@" && return 0
;;
esac

View File

@ -1,8 +1,5 @@
#compdef choc
#compdef bpython bpython2
# ------------------------------------------------------------------------------
# Copyright (c) 2012 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
@ -28,33 +25,23 @@
# Description
# -----------
#
# Completion script for choc (https://chocolatapp.com/)
# Completion script for bpython (http://bpython-interpreter.org/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Nicholas Penree (https://github.com/drudge)
# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
#
# ------------------------------------------------------------------------------
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:
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_arguments -A "-*" \
'(-h --help)'{-h,--help}'[Show help message]' \
'(-i --interactive)'{-i,--interactive}'[Drop to bpython shell after running file instead of exiting]' \
'(-q --quiet)'{-q,--quiet}"[Don't flush the output to stdout]" \
'(-V --version)'{-V,--version}'[Print version and exit]' \
'--config[Use CONFIG instead of default config file]:Config file:_files' \
'*: :_files'

101
_brew Normal file
View File

@ -0,0 +1,101 @@
#compdef brew
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for brew (https://github.com/mxcl/homebrew).
#
# Source: https://github.com/mxcl/homebrew/blob/master/Library/Contributions/brew_zsh_completion.zsh
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * kulakowski (https://github.com/kulakowski)
# * Gabe Berke-Williams (https://github.com/gabebw)
# * James Conroy-Finn (https://github.com/jcf)
# * Daniel Schauenberg (https://github.com/mrtazz)
# * Adam Vandenberg (https://github.com/adamv)
# * Erik Kastner (https://github.com/kastner)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_brew_all_formulae() {
formulae=(`brew search`) # FIXME _call_program should be used here
}
_brew_installed_formulae() {
installed_formulae=(`brew list`) # FIXME _call_program should be used here
}
local -a _1st_arguments
_1st_arguments=(
'cat:display formula file for a formula'
'cleanup:uninstall unused and old versions of packages'
'create:create a new formula'
'deps:list dependencies and dependants of a formula'
'doctor:audits your installation for common issues'
'edit:edit a formula'
'home:visit the homepage of a formula or the brew project'
'info:information about a formula'
'install:install a formula'
'link:link a formula'
'list:list files in a formula or not-installed formulae'
'log:git commit log for a formula'
'missing:check all installed formulae for missing dependencies.'
'outdated:list formulae for which a newer version is available'
'prune:remove dead links'
'remove:remove a formula'
'search:search for a formula (/regex/ or string)'
'server:start a local web app that lets you browse formulae (requires Sinatra)'
'unlink:unlink a formula'
'update:freshen up links'
'upgrade:upgrade outdated formulae'
'uses:show formulae which depend on a formula'
)
local expl
local -a formulae installed_formulae
_arguments \
'(-v)-v[verbose]' \
'(--cellar)--cellar[brew cellar]' \
'(--config)--config[brew configuration]' \
'(--env)--env[brew environment]' \
'(--repository)--repository[brew repository]' \
'(--version)--version[version information]' \
'(--prefix)--prefix[where brew lives on this system]' \
'(--cache)--cache[brew cache]' \
'*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "brew subcommand" _1st_arguments
return
fi
case "$words[1]" in
search|-S)
_arguments \
'(--macports)--macports[search the macports repository]' \
'(--fink)--fink[search the fink repository]' ;;
list|ls)
_arguments \
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
'(--versions)--versions[list all installed versions of a formula]' \
'1: :->forms' && return 0
if [[ "$state" == forms ]]; then
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
fi ;;
install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae ;;
remove|rm|uninstall|unlink|cleanup|link|ln)
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
esac

85
_bundle Normal file
View File

@ -0,0 +1,85 @@
#compdef bundle
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Bundler (http://gembundler.com).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Bruno Michel (https://github.com/nono)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line _gems _opts ret=1
_arguments -C -A "-v" -A "--version" \
'(- 1 *)'{-v,--version}'[display version information]' \
'1: :->cmds' \
'*:: :->args' && ret=0
case $state in
cmds)
_values "bundle command" \
"install[Install the gems specified by the Gemfile or Gemfile.lock]" \
"update[Update dependencies to their latest versions]" \
"package[Package the .gem files required by your application]" \
"exec[Execute a script in the context of the current bundle]" \
"config[Specify and read configuration options for bundler]" \
"check[Determine whether the requirements for your application are installed]" \
"list[Show all of the gems in the current bundle]" \
"show[Show the source location of a particular gem in the bundle]" \
"console[Start an IRB session in the context of the current bundle]" \
"open[Open an installed gem in the editor]" \
"viz[Generate a visual representation of your dependencies]" \
"init[Generate a simple Gemfile, placed in the current directory]" \
"gem[Create a simple gem, suitable for development with bundler]" \
"help[Describe available tasks or one specific task]"
ret=0
;;
args)
case $line[1] in
help)
_values 'commands' 'install update package exec config check list show console open viz init gem help' && ret=0
;;
install)
_arguments \
'(--no-color)--no-color[disable colorization in output]' \
'(--local)--local[do not attempt to connect to rubygems.org]' \
'(--quiet)--quiet[only output warnings and errors]' \
'(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
'(--system)--system[install to the system location]' \
'(--deployment)--deployment[install using defaults tuned for deployment environments]' \
'(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
'(--path)--path=-[specify a different path than the system default]:path:_files' \
'(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
'(--without)--without=-[exclude gems that are part of the specified named group]:groups'
ret=0
;;
exec)
_normal && ret=0
;;
(open|show)
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
if [[ $_gems != "" ]]; then
_values 'gems' $_gems && ret=0
fi
;;
*)
_opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
_opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
if [[ $_opts != "" ]]; then
_values 'options' $_opts && ret=0
fi
;;
esac
;;
esac
return ret

51
_cap Normal file
View File

@ -0,0 +1,51 @@
#compdef cap
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Capistrano (http://capify.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Bruno Michel (https://github.com/nono)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line cmds ret=1
_arguments -C \
{-d,--debug}'[Prompts before each remote command execution]' \
{-e,--explain}'[Displays help (if available) for the task]:task' \
{-F,--default-config}'[Always use default config, even with -f]' \
{-f,--file}'[A recipe file to load. May be given more than once]:file:_files' \
{-H,--long-help}'[Explain these options and environment variables]' \
{-h,--help}'[Display this help message]' \
{-l,--logger}'[Choose logger method. STDERR used by default]:file:_files' \
{-n,--dry-run}'[Prints out commands without running them]' \
{-p,--password}'[Immediately prompt for the password]' \
{-q,--quiet}'[Make the output as quiet as possible]' \
{-r,--preserve-roles}'[Preserve task roles]' \
{-S,--set-before}'[Set a variable before the recipes are loaded]:variable' \
{-s,--set}'[Set a variable after the recipes are loaded]:variable' \
{-T,--tasks}'[List all tasks (matching optional PATTERN) in the loaded recipe files]:pattern' \
{-t,--tool}'[Abbreviates the output of -T for tool integration]' \
{-V,--version}'[Display the Capistrano version, and exit]' \
{-v,--verbose}'[Be more verbose. May be given more than once]' \
{-X,--skip-system-config}'[Do not load the system config file (capistrano.conf)]' \
{-x,--skip-user-config}'[Do not load the user config file (.caprc)]' \
'*: :->cmds' && ret=0
case $state in
cmds)
cmds=( ${(f)"$(_call_program commands cap -T 2> /dev/null | sed -e '/ # /!d; s/:/\\:/g; s/cap \([A-Za-z0-9\\:_-]*\) .*# /\1:/')"} )
_describe -t commands 'cap command' cmds && ret=0
;;
esac
return ret

77
_cpanm Normal file
View File

@ -0,0 +1,77 @@
#compdef cpanm
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for cpanm (http://search.cpan.org/dist/App-cpanminus/lib/App/cpanminus.pm).
#
# Source: https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ryushi (https://github.com/rshhh)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local arguments curcontext="$curcontext"
typeset -A opt_args
arguments=(
# Commands
# '(--install -i)'{--install,-i}'[Installs the modules]'
'(- :)--self-upgrade[Upgrades itself]'
'(- :)--info[Displays distribution info on CPAN]'
'(--installdeps)--installdeps[Only install dependencies]'
'(--look)--look[Download/unpack the distribution and then open the directory with your shell]'
'(- :)'{--help,-h}'[Displays help information]'
'(- :)'{--version,-V}'[Displays software version]'
# Options
{--force,-f}'[Force install]'
{--notest,-n}'[Do not run unit tests]'
{--sudo,-S}'[sudo to run install commands]'
'(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]'
'(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]'
{--local-lib,-l}'[Specify the install base to install modules]'
{--local-lib-contained,-L}'[Specify the install base to install all non-core modules]'
'--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls'
'--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]'
'--prompt[Prompt when configure/build/test fails]'
'--reinstall[Reinstall the distribution even if you already have the latest version installed]'
'--interactive[Turn on interactive configure]'
'--scandeps[Scan the depencencies of given modules and output the tree in a text format]'
'--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)'
'--save-dists[Specify the optional directory path to copy downloaded tarballs]'
# '--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]'
'--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]'
'(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]'
'(--man-pages)--no-man-pages[Do not generate man pages]'
# Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP,
# Wget, cURL and HTTP::Tiny (in that order) and uses the first one available.
# (So that the exclusions are not enabled here for the completion)
'(--lwp)--lwp[Use LWP module to download stuff]'
'(--wget)--wget[Use GNU Wget (if available) to download stuff]'
'(--curl)--curl[Use cURL (if available) to download stuff]'
# Other completions
'*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"'
# '*::args: _normal' # this looks for default files (any files)
)
_arguments -s $arguments \
&& return 0
return 1

View File

@ -1,6 +1,6 @@
#compdef gtk-launch gtk4-launch
#compdef debuild
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users
# 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
@ -28,57 +28,37 @@
# Description
# -----------
#
# Completion script for gtk-launch on gtk+-3.24.37, gtk4-launch-4.10.4
# (https://www.gtk.org/).
# Completion script for debuild 2.10.
#
# Status: incomplete.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * ncaq <ncaq@ncaq.net>
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_gtk-launch() {
local ret=1
if [[ $service == "gtk-launch" ]]; then
_arguments -S -A "-*" \
'(- *)'{-h,--help}'[Show help options]' \
'(- *)'{-v,--version}'[Show program version]' \
'(- *)'--help-all'[Show all help options]' \
'(- *)'--help-gtk'[Show GTK+ Options]' \
'(- *)'--display='[X display to use]:display:_x_display' \
'--class=[Program class as used by the window manager]:class' \
'--name=[Program name as used by the window manager]:name' \
'--gtk-module=[Load additional GTK+ modules]:module' \
'--g-fatal-warnings[Make all warnings fatal]' \
'1: :_gtk-launch-apps' \
'*:: :_files' && ret=0
else
# gtk4-launch
_arguments -S -A "-*" \
'(- *)'{-h,--help}'[Show help options]' \
'(- *)'{-v,--version}'[Show program version]' \
'1: :_gtk-launch-apps' \
'*:: :_files' && ret=0
fi
return ret
}
(( $+functions[_gtk-launch-apps] )) ||
_gtk-launch-apps() {
local -a apps=(/usr/share/applications/*.desktop(:r:t))
_values 'applications' $apps
}
_gtk-launch "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_debuild() {
# 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'
}
_debuild "$@"

73
_dhcpcd Normal file
View File

@ -0,0 +1,73 @@
#compdef dhcpcd
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for dhcpcd 2.3.2.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_arguments \
'1:network interface:_net_interfaces' \
- release \
'(-k --release)'{-k,--release}'[causes an existing dhcpcd process running on the interface to release it'\''s lease, deconfigure the interface and then exit]' \
- exit \
'(-x --exit)'{-x,--exit}'[causes an existing dhcpcd process running on the interface to exit]' \
- main \
'(-d --debug)'{-d,--debug}'[echo debug and informational messages to the console]' \
'(-h --hostname)'{-h,--hostname}'[specify the hostname sent, or an empty string to stop any hostname from being sent]:hostname:_hosts' \
'(-i --classid)'{-i,--classid}'[override the DHCP vendor classid field we send]:classid' \
'(-l --leasetime)'{-l,--leasetime}'[request a specific lease time in seconds]:lesae time \(seconds\)' \
'(-m --metric)'{-m,--metric}'[added routes will use the metric on systems where this is supported]:metric' \
'(-n --renew)'{-n,--renew}'[notifies an existing dhcpcd process running on the interface to renew it'\''s lease]' \
'(-p --persistent)'{-p,--persistent}'[don'\''t deconfigure the interface and configuration at exit]' \
'(-r --request)'{-r,--request}'[skip the broadcast request step and just request an address]:address' \
'(-s --inform)'{-s,--inform}'[behaves exactly like -r, but sends a DHCP inform instead of a request]:address' \
'(-t --timeout)'{-t,--timeout}'[timeout after seconds, instead of the default 20]:timeout \(seconds\)' \
'(-u --userclass)'{-u,--userclass}'[tags the DHCP message with the userclass class]:class' \
'*'{-H,--sethostname}'[forces dhcpcd to set the hostname as supplied by the DHCP server]' \
'({-I --clientid)'{-I,--clientid}'[send clientid as a client identifier string]:clientid' \
'*'{-S,--mscsr}'[request Microsoft specific Classless Static Routes (RFC 3442) code as well]' \
'(-A --noarp)'{-A,--noarp}'[don'\''t request or claim the address by ARP]' \
'(-G --nogateway)'{-G,--nogateway}'[don'\''t set any default routes]' \
'(-L --noipv4ll)'{-L,--noipv4ll}'[don'\''t use IPv4LL at all]' \
'(-M --nomtu)'{-M,--nomtu}'[don'\''t set the MTU of the interface]' \
'(-N --nontp)'{-N,--nontp}'[don'\''t touch /etc/ntpd.conf or restart the ntp service]' \
'(-R --nodns)'{-R,--nodns}'[don'\''t send DNS information to resolvconf or touch /etc/resolv.conf]' \
'(-T --test)'{-T,--test}'[on receipt of discover messages, simply print the contents of the DHCP message to the console]' \
'(-Y --nonis)'{-Y,--nonis}'[don'\''t touch /etc/yp.conf or restart the ypbind service]'

48
_ditz Normal file
View File

@ -0,0 +1,48 @@
#compdef ditz
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Ditz (http://ditz.rubyforge.org).
#
# Source: https://github.com/technolize/zsh-completion-funcs
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * technolize (https://github.com/technolize)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
ME=ditz
COMMANDS=--commands
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

139
_emulator Normal file
View 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>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext"
_emulator() {
# 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'
}
_emulator "$@"

202
_eselect Normal file
View File

@ -0,0 +1,202 @@
#compdef eselect
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Eselect (symlink manager for multiversioning
# and multibranding support for some libraries and binaries).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Vadim A. Misbakh-Soloviev <mva@mva.name>
# * Bapt <bapt@tuxfamily.org>
# * kaworu <kaworu@kaworu.ch>
# * David Durrleman <dualmoo@gmail.com>
# * oberyno <oberyno@gmail.com>
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
#<app-admin/eselect-1.0.11>
#
_eselect_env () {
if (( $words[(I)(update)] )); then
_values 'update options' \
'makelinks[force updating of links]' \
'noldconfig[Do not alter the ld.so cache or configuration]' && return 0
fi
_values 'env options' $stdopts[@] \
'update[Collect environment variables from all scripts]' && return 0
}
_eselect_binutils () {
local binutilslist
if (( $words[(I)(set)] )); then
binutilslist=(${${${(M)${(f)"$(eselect --no-color binutils list)"}## *}// \**/}//( \[*\] | \[*\] )/})
_values 'available binutils version' $binutilslist[@] && return 0
fi
_values 'binutils options' $stdopts[@] \
'list[List all installed version of binutils]' \
'show[Print the currently active binutils version]' \
'set[Activate one of the installed binutils]' && return 0
}
_eselect_kernel () {
local kernellist
if (( $words[(I)(set)] )); then
kernellist=(${${${(M)${(f)"$(eselect --no-color kernel list)"}## *}// \**/}//( \[*\] | \[*\] )/})
_values 'available kernel version' $kernellist[@] && return 0
fi
_values 'kenrel options' $stdopts[@] \
'list[List available kernel symlink targets]' \
'show[Show the current kernel symlink]' \
'set[Set a new kernel symlink target]' && return 0
}
_eselect_ctags () {
local ctagslist
if (( $words[(I)(set)] )); then
ctagslist=(${${${(M)${(f)"$(eselect --no-color ctags list)"}## *}// \**/}//( \[*\] | \[*\] )/})
_values 'available ctags version' $ctagslist[@] && return 0
fi
_values 'ctags options' $stdopts[@] \
'list[List available ctags symlink targets]' \
'show[Show the current target of the ctags symlink]' \
'update[Automatically update the ctags symlink]' \
'set[Set a new ctags symlink target]' && return 0
}
_eselect_profile () {
local profilelist
if (( $words[(I)(set)] )); then
profilelist=(${${${(M)${(f)"$(eselect --no-color profile list)"}## *}// \**/}//( \[*\] | \[*\] )/})
_values -w 'available profiles' $profilelist[@] \
'--force[Forcibly set the symlink]' && return 0
fi
_values 'profile options' $stdopts[@] \
'list[List available profile symlink targets]' \
'show[Show the current make.profile symlink]' \
'set[Set a new profile symlink target]' && return 0
}
_eselect_fontconfig () {
local fclistenabled fclistdisabled
if (( $words[(I)(enable)] )); then
fclistdisabled=(${${${${(M)${(f)"$(eselect --no-color fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
_values -w '.conf to enable' $fclistdisabled[@] && return 0
elif (( $words[(I)(disable)] )); then
fclistenabled=(${${${(M)${(M)${(f)"$(eselect --no-color fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
_values -w '.conf to disable' $fclistenabled[@] && return 0
fi
_values 'fontconfig options' $stdopts[@] \
'list[List available fontconfig .conf files]' \
'disable[Disable specified fontconfig .conf file(s)]' \
'enable[Enable specified fontconfig .conf file(s)]' && return 0
}
_eselect_opengl () {
local opengllist
if (( $words[(I)(set)] )); then
opengllist=(${${${(M)${(f)"$(eselect --no-color opengl list)"}## *}// \**/}//( \[*\] | \[*\] )/})
_values -w 'opengl implementations and options' $opengllist[@] \
'--use-old[If an implementationis already set, use that one instead]' \
'--prefix[Set the source prefix]:path:_files -/' \
'--dst-prefix[Set the destination prefix]:path:_files -/' \
'--impl-headers[Override global headers with ones provided by this profile]' && return 0
fi
_values 'opengl options' $stdopts[@] \
'list[List the available OpenGL implementations]' \
'set[Select the OpenGL implementation]' \
'show[Print the current OpenGL implementation]' && return 0
}
_eselect_vi () {
local vilist
if (( $words[(I)(set)] )); then
vilist=(${${${(M)${(f)"$(eselect --no-color vi list)"}## *}// \**/}//( \[*\] | \[*\] )/})
_values -w 'vi implementation' $vilist[@] && return 0
elif (( $words[(I)(update)] )); then
_values -w 'option' '--if-unset[Do not override existing implementation]' && return 0
fi
_values 'vi options' $stdopts[@] \
'list[List available vi implementations]' \
'set[Set a new vi implementation provider]' \
'show[Show the current vi implementation]' \
'update[Automatically update the vi provider]' && return 0
}
_eselect () {
local globopts sedcmd modnames modopts
local stdopts
stdopts=(
'help[Display help text]'
'usage[Display usage information]'
'version[Display version information]'
)
globopts=(
'--no-colour[Disable coloured output]'
'--no-color[Disable coloured output]'
)
modnames=(${${${(M)${(f)"$(eselect --no-color list-modules)"}## *}// */}// /})
if ((CURRENT == 2)); then
_arguments -s \
"$globopts[@]" \
"*:portage:_values 'eselect modules' \$modnames[@]" && return 0
elif ((CURRENT == 3)); then
if [[ $words[2] == --no-colour || $words[2] == --no-color ]]; then
_arguments -s \
"*:portage:_values 'eselect modules' \$modnames[@]" && return 0
elif (( $modnames[(I)$words[2]] )); then
if [[ "$words[2]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi) ]]; then
_eselect_$words[2] "$@"
else
modopts=(${${${(M)${(f)"$(eselect --no-color $words[2] usage)"}## *}// */}// /})
_arguments -s \
"*:portage:_values 'eselect $words[2] options' \$modopts[@]" && return 0
fi
fi
elif ((CURRENT >= 4)); then
if (( $words[(I)(--no-color|--no-colour)] )); then
if (( $modnames[(I)$words[3]] )); then
if [[ "$words[3]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi) ]]; then
_eselect_$words[3] "$@"
else
modopts=(${${${${(M)${(f)"$(eselect --no-color $words[3] usage)"}## *}// */}// /}// *})
_arguments -s \
"*:portage:_values 'eselect $words[3] options' \$modopts[@]" && return 0
fi
fi
else
if (( $modnames[(I)$words[2]] )); then
_eselect_$words[2] "$@"
fi
fi
fi
}
_eselect "$@"

View File

@ -1,34 +1,9 @@
#compdef fab
# ------------------------------------------------------------------------------
# Copyright (c) 2015 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Fabric (https://www.fabfile.org/)
# Completion script for Fabric (http://fabfile.org)
#
# Source: https://github.com/vhbit/fabric-zsh-autocomplete
#
@ -39,6 +14,9 @@
# * Valerii Hiora (https://github.com/vhbit)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local curcontext=$curcontext state line
@ -63,7 +41,7 @@ output_levels=(
_arguments -w -S -C \
'(-)'{-h,--help}'[show this help message and exit]: :->noargs' \
'(-)'{-V,--version}'[show program'\''s version number 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]' \
@ -75,14 +53,13 @@ _arguments -w -S -C \
'(-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/]' \
'(-a --no-agent)'{-a,--no-agent}'[don''t use the running SSH agent]' \
'(-k --no-keys)'{-k,--no-keys}'[don''t load private key files from ~/.ssh/]' \
'(-w --warn-only)'{-w,--warn-only}'[warn instead of abort, when commands fail]' \
'-i+[path to SSH private key file. May be repeated]: :_files' \
"(-f+ --fabfile=)"{-f+,--fabfile=}"[Python module file to import]: :_files -g *.py" \
'(-c+ --config=-)'{-c+,--config=-}'[specify location of config file to use]: :_files' \
'(-s+ --shell=-)'{-s+,--shell=-}'[specify a new shell, defaults to ''/bin/bash -l -c'']: :' \
'(--ssh-config-path=)--ssh-config-path=[ssh config path]: :_files' \
'(--hide=-)--hide=-[comma-separated list of output levels to hide]: :->levels' \
'(--show=-)--show=-[comma-separated list of output levels to show]: :->levels' \
'*::: :->subcmds' && return 0
@ -99,11 +76,3 @@ if [[ CURRENT -ge 1 ]]; then
return
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

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

View File

@ -1,6 +1,6 @@
#compdef optirun
#compdef gcc-config
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users
# 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
@ -28,43 +28,46 @@
# Description
# -----------
#
# Completion script for the optirun command from bumblebee
# (https://github.com/Bumblebee-Project/Bumblebee).
# Completion script for GCC config script (symlink manager for multiversioning).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Christophe-Marie Duquesne <chm.duquesne@gmail.com>
# * Vadim A. Misbakh-Soloviev <mva@mva.name>
# * Bapt <bapt@tuxfamily.org>
# * kaworu <kaworu@kaworu.ch>
# * David Durrleman <dualmoo@gmail.com>
# * oberyno <oberyno@gmail.com>
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
#<sys-devel/gcc-config-0.0>
local -a 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]:display:_x_display'
'(-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'
local arguments
arguments=(
'(- :)'{--use-old,-O}'[use the old profile if one was selected]'
'(- :)'{--use-portage-chost,-P}'[only set profile if its CHOST matches /etc/make.conf]:profiles:_gcc_profile'
'(- :)'{--get-current-profile,-c}'[print current used gcc profile]'
'(- :)'{--list-profiles,-l}'[print a list of available profiles]'
'(- :)'{--print-environ,-E}'[print environment of the given/current profile]:profiles:_gcc_profile'
'(- :)'{--get-bin-path,-B}'[print binary path of given/current profile]:profiles:_gcc_profile'
'(- :)'{--get-lib-path,-L}'[print library path of given/current profile]:profiles:_gcc_profile'
'(- :)'{--get-stdcxx-incdir,-X}'[print g++ include path of given/current profile]:profiles:_gcc_profile'
'(- :)'{--help,-h}'[show help]'
'(- :)'{--version,-v}'[show version info]'
'(- :):profiles:_gcc_profile'
)
_arguments $arguments
_gcc_profile () {
local profile
profile=(${(f)"$(_call_program gcc-installed RC_NOCOLOR=yes gcc-config --list-profiles)"})
profile=${${profile/\[([^]]*)\]/}/\*}
_tags profile && { compadd "$@" -k profile || compadd "$@" ${(kv)=profile} }
}
# 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
_arguments $arguments

68
_geany Normal file
View File

@ -0,0 +1,68 @@
#compdef geany
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Geany (http://www.geany.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_arguments \
'(- 1 *)'{-h,--help}'[Show help options]' \
'(- 1 *)--help-all[Show all help options]' \
'(- 1 *)--help-gtk[Show GTK+ Options]' \
'(- 1 *)'{-V,--version}'[Show version and exit]' \
'(--column)--column[Set initial column number for the first opened file (useful in conjunction with --line)]:column number' \
'(-c --config)'{-c,--config}'[Use an alternate configuration directory]:configuration file:_files' \
'(--ft-names)--ft-names[Print internal filetype names]' \
'(-g --generate-tags)'{-g,--generate-tags}'[Generate global tags file (see documentation)]' \
'(-P --no-preprocessing)'{-P,--no-preprocessing}'[Don'\''t preprocess C/C++ files when generating tags]' \
'(-i --new-instance)'{-i,--new-instance}'[Don'\''t open files in a running instance, force opening a new instance]' \
'(--socket-file)--socket-file[Use this socket filename for communication with a running Geany instance]:socket file:_files' \
'(--list-documents)--list-documents[Return a list of open documents in a running Geany instance]' \
'(-l --line)'{-l,--line}'[Set initial line number for the first opened file]:line number' \
'(-m --no-msgwin)'{-m,--no-msgwin}'[Don'\''t show message window at startup]' \
'(-n --no-ctags)'{-n,--no-ctags}'[Don'\''t load auto completion data (see documentation)]' \
'(-p --no-plugins)'{-p,--no-plugins}'[Don'\''t load plugins]' \
'(--print-prefix)--print-prefix[Print Geany'\''s installation prefix]' \
'(-s --no-session)'{-s,--no-session}'[Don'\''t load the previous session'\''s files]' \
'(-t --no-terminal)'{-t,--no-terminal}'[Don'\''t load terminal support]' \
'(--vte-lib)--vte-lib[Filename of libvte.so]:libvte.so filename:_files -g "*.so"' \
'(-v --verbose)'{-v,--verbose}'[Be verbose]' \
'(--display)--display[X display to use]:X display:_x_display' \
'*: :_files'

454
_gem Normal file
View File

@ -0,0 +1,454 @@
#compdef gem gem1.9
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for gem (http://rubygems.org).
#
# Source: https://gist.github.com/164465
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Alex Vollmer (https://github.com/alexvollmer)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
gem_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
)
_gem() {
if (( CURRENT > 2 )); then
(( CURRENT-- ))
shift words
_call_function 1 _gem_${words[1]}
else
_values "gem command" \
"build[Build a gem from a gemspec]" \
"cert[Manage RubyGems certificates and signing settings]" \
"check[Check installed gems]" \
"cleanup[Clean up old versions of installed gems in the local repository]" \
"contents[Display the contents of the installed gems]" \
"dependency[Show the dependencies of an installed gem]" \
"environment[Display information about the RubyGems environment]" \
"fetch[Download a gem and place it in the current directory]" \
"generate_index[Generates the index files for a gem server directory]" \
"help[Provide help on the 'gem' command]" \
"install[Install a gem into the local repository]" \
"list[Display gems whose name starts with STRING]" \
"lock[Generate a lockdown list of gems]" \
"mirror[Mirror a gem repository]" \
"outdated[Display all gems that need updates]" \
"pristine[Restores installed gems to pristine condition from files located in the gem cache]" \
"query[Query gem information in local or remote repositories]" \
"rdoc[Generates RDoc for pre-installed gems]" \
"search[Display all gems whose name contains STRING]" \
"server[Documentation and gem repository HTTP server]" \
"sources[Manage the sources and cache file RubyGems uses to search for gems]" \
"specification[Display gem specification (in yaml)]" \
"stale[List gems along with access times]" \
"uninstall[Uninstall gems from the local repository]" \
"unpack[Unpack an installed gem to the current directory]" \
"update[Update the named gems (or all installed gems) in the local repository]" \
"which[Find the location of a library file you can require]"
fi
}
__all_gems() {
_gem_names=($(${service} list | awk '{print $1}'))
compadd "$@" -k _gem_names
}
__all_gems_all() {
_gem_names=($(gem list | awk '{print $1}') "--all")
compadd "$@" -k _gem_names
}
__gem_help_arguments() {
_args=("commands"
"examples"
"build"
"cert"
"check"
"cleanup"
"contents"
"dependency"
"environment"
"fetch"
"generate_index"
"help"
"install"
"list"
"lock"
"mirror"
"outdated"
"pristine"
"query"
"rdoc"
"search"
"server"
"sources"
"specification"
"stale"
"uninstall"
"unpack"
"update"
"which")
compadd "$@" -k _args
}
__gem_trust_policies() {
_args=("NoSecurity"
"LowSecurity"
"MediumSecurity"
"HighSecurity")
compadd "$@" -k _args
}
_gem_build() {
_arguments \
*:file:_files -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_outdated() {
_arguments \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
"--platform[Specify the platform of gem to outdated]" \
$gem_general_flags && ret=0
}
_gem_pristine() {
_arguments \
":gem name:__all_gems_all" \
"--all[Restore all installed gems to pristine condition]" \
"(-v --version)"{-v,--version}"[Specify version of gem to restore to pristine condition]" \
$gem_general_flags && ret=0
}
_gem_query() {
_arguments \
"(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
"(-v --version)"{-v,--version}"[Specify version of gem to query]" \
"(-n --name-matches)"{-n,--name-matches}"[Name of gem(s) to query on matches the provided REGEXP]" \
"(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
"--no-versions[Display only gem names]" \
"(-a --all)"{-a,--all}"[Display all gem versions]" \
"--prerelease[Display prerelease versions]" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
$gem_general_flags && ret=0
}
_gem_rdoc() {
_arguments \
":gem name:__all_gems_all" \
"--all[Generate RDoc/RI documentation for all installed gems]" \
"--no-rdoc[Include RDoc generated documents]" \
"--no-ri[Include RI generated documents]" \
"(-v --version)"{-v,--version}"[Specify version of gem to rdoc]" \
$gem_general_flags && ret=0
}
_gem_search() {
_arguments \
":gem name::" \
"(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
"(-v --version)"{-v,--version}"[Specify version of gem to search]" \
"(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
"--no-versions[Display only gem names]" \
"(-a --all)"{-a,--all}"[Display all gem versions]" \
"--prerelease[Display prerelease versions]" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
$gem_general_flags && ret=0
}
_gem_server() {
_arguments \
"(-p --port=PORT)"{-p,--port=-}"[port to listen on]" \
"(-d --dir=GEMDIR)"{-d,--dir=-}"[directory from which to serve gems]":directory:_directories \
"--no-daemon[run as a daemon]" \
$gem_general_flags && ret=0
}
_gem_sources() {
_arguments \
"(-a --add)"{-a,--add}"[Add source]" \
"(-l --list)"{-l,--list}"[List sources]" \
"(-r --remove)"{-r,--remove}"[Remove source]" \
"(-c --clear-all)"{-c,--clear-all}"[Remove all sources (clear the cache)]" \
"(-u --update)"{-u,--update}"[Update source cache]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
$gem_general_flags && ret=0
}
_gem_specification() {
_arguments \
":gemname:__all_gems" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
"(-v --version)"{-v,--version}"[Specify version of gem to examine]" \
"--platform[Specify the platform of gem to specification]" \
"--all[Output specifications for all versions of the gem]" \
"--ruby[Output ruby format]" \
"--yaml[Output RUBY format]" \
"--marshal[Output Marshal format]" \
$gem_general_flags && ret=0
}
_gem_stale() {
_arguments \
$gem_general_flags && ret=0
}
_gem_uninstall() {
_arguments \
"*:gemname:__all_gems" \
"(-a --no-all)"{-a,--no-all}"[Uninstall all matching versions]" \
"(-I --no-ignore-dependencies)"{-I,--no-ignore-dependencies}"[Ignore dependency requirements while uninstalling]" \
"(-x --no-executables)"{-x,--no-executables}"[Uninstall applicable executables without confirmation]" \
"(-i --install-dir)"{-i,--install-dir}"[Directory to uninstall gem from]":directory:_directories \
"(-n --bindir)"{-n,--bindir}"[Directory to remove binaries from]":directory:_directories \
"--no-user-install[Uninstall from user's home directory in addition to GEM_HOME.]" \
"(-v --version)"{-v,--version}"[Specify version of gem to uninstall]" \
"--platform[Specify the platform of gem to uninstall]" \
$gem_general_flags && ret=0
}
_gem_unpack() {
_arguments \
":gemname:__all_gems" \
"--target=-[target directory for unpacking]":directory:_directories \
"(-v --version)"{-v,--version}"[Specify version of gem to unpack]" \
$gem_general_flags && ret=0
}
_gem_update() {
_arguments \
"*:gemname:__all_gems" \
"(-i --install-dir)"{-i,--install-dir}"[Gem repository directory to get installed gems]":directory:_directories \
"(-n --bindir)"{-n,--bindir}"[Directory where binary files are located]":directory:_directories \
"(-d --no-rdoc)"{-d,--no-rdoc}"[Generate RDoc documentation for the gem on install]" \
"--no-ri[Generate RI documentation for the gem on install]" \
"(-E --no-env-shebang)"{-E,--no-env-shebang}"[Rewrite the shebang line on installed scripts to use /usr/bin/env]" \
"(-f --no-force)"{-f,--no-force}"[Force gem to install, bypassing dependency checks]" \
"(-t --no-test)"{-t,--no-test}"[Run unit tests prior to installation]" \
"(-w --no-wrappers)"{-w,--no-wrappers}"[Use bin wrappers for executables Not available on dosish platforms]" \
"(-P --trust-policy)"{-P,--trust-policy}"[Specify gem trust policy]:trust policy:__gem_trust_policies" \
"--ignore-dependencies[Do not install any required dependent gems]" \
"(-y --include-dependencies)"{-y,--include-dependencies}"[Unconditionally install the required dependent gems]" \
"--no-format-executable[Make installed executable names match ruby. If ruby is ruby18, foo_exec will be foo_exec18]" \
"--no-user-install[Install in user's home directory instead of GEM_HOME. Defaults to using home only if GEM_HOME is not writable.]" \
"--development[Install any additional development dependencies]" \
"--prerelease[Install prerelease versions of a gem if available. Defaults to skipping prereleases.]" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
"--system[Update the RubyGems system software]" \
"--platform[Specify the platform of gem to update]" \
$gem_general_flags && ret=0
}
_gem_which() {
_arguments \
*:file:_files -f \
"(-a --no-all)"{-a,--no-all}"[show all matching files]" \
"(-g --no-gems-first)"{-g,--no-gems-first}"[search gems before non-gems]" \
$gem_general_flags && ret=0
}

150
_genlop Normal file
View File

@ -0,0 +1,150 @@
#compdef genlop
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for GenLop (Gentoo Installation log parser).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Vadim A. Misbakh-Soloviev <mva@mva.name>
# * Bapt <bapt@tuxfamily.org>
# * kaworu <kaworu@kaworu.ch>
# * David Durrleman <dualmoo@gmail.com>
# * oberyno <oberyno@gmail.com>
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
#<app-portage/genlop-0.30.8>
_genlop () {
local prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]" days months arg single state lstate
days=(monday tuesday wednesday thursday friday saturday sunday)
months=(january february march april may june july august september october november december)
arg=( --current -c --time -t --gmt -g --info -i --file -f --rsync -r --unmerge -u --date --search -s --list -l )
single=( --current -c --pretend -p --help -h --version -v )
[[ ${prev2} == (1st|2nd|3rd|4th|5th) ]] &&
compadd in\ $months && return 0
[[ ${prev1} == ([2-9]|[1-9][0-9]*) && ${prev2} != \
(january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
_values '' 'days ago' 'months ago' 'years ago' 'weeks ago' && return 0
[[ ${prev1} == (1) && ${prev2} != \
(january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
_values '' 'day ago' 'month ago' 'year ago' 'week ago' && return 0
case "$prev1" in
last)
_values '' month week
compadd $days && return 0
;;
1st|2nd|3rd|4th|5th)
compadd $days && return 0
;;
january|february|march|april|may|june|july|august|september|october|november|december)
compadd {1..31} && return 0
;;
--date)
_message 'enter number for more options or use mm/dd/yyyy format'
_values '' \
last yesterday 1st 2nd 3rd 4th 5th
_alternative \
'*:*:_days' '*:*:_months' && return 0
;;
--file|-f)
_arguments '*:logfile:_files' && return 0
;;
*)
_arguments \
"($single $arg *)"{--current,-c}"[display the current merge in action]" \
"($single)*--date[specify date of event]:date:->date" \
"($single)*-f[specify the logfile to use]:logfile:_files" \
"($single --gmt -g)"{--gmt,-g}"[display time in GMT/UTC format (default is local time)]" \
"($single $arg *)"{--help,-h}"[display help information]" \
"($single --info -i --list -l)"{--info,-i}"[print brief summary about installed ebuild]" \
"($single --search -s --info -i --list -l *)"{--list,-l}"[list merge history]" \
"(--nocolor -n)"{--nocolor,-n}"[disable colored output]" \
"($single $arg *)"{--pretend,-p}"[estimate build time of a piped emerge -p]" \
"($single --search -s --info -i --time -t --unmerge -u --rsync -r *)"{--rsync,-r}"[display rsync history]" \
"($single --rsync -r --search -s --list -l *)"{--search,-s}"[select ebuilds matching the provided regular expression]:pattern:" \
"($single --time -t)"{--time,-t}"[display merge time]" \
"($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
"($single $arg *)"{--version,-v}"[display version information]" \
"($single)*:package:_gentoo_packages available"
;;
esac
while [[ -n "$state" ]]; do
lstate=$state
state=''
case "$lstate" in
date) _message 'enter number for more options or use mm/dd/yyyy format'
_values '' \
last yesterday 1st 2nd 3rd 4th 5th
_alternative \
':*:_days' ':*:_months' && return 0
;;
esac
done
}
_days() {
local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday"
local day=$(date +%u)
if [[ ${day} == 1 ]] then compadd $m
elif [[ ${day} == 2 ]] then compadd $m $t
elif [[ ${day} == 3 ]] then compadd $m $t $w
elif [[ ${day} == 4 ]] then compadd $m $t $w $T
elif [[ ${day} == 5 ]] then compadd $m $t $w $T $f
elif [[ ${day} == 6 ]] then compadd $m $t $w $T $f $s
elif [[ ${day} == 7 ]] then compadd $m $t $w $T $f $s $S
fi
}
_months() {
local j="january" f="february" m="march" a="april" M="may" ju="june" J="july" A="august" s="september" o="october" n="november" d="december"
local month=$(date +%m)
if [[ ${month} == 01 ]] then compadd $j
elif [[ ${month} == 02 ]] then compadd $j $f
elif [[ ${month} == 03 ]] then compadd $j $f $m
elif [[ ${month} == 04 ]] then compadd $j $f $m $a
elif [[ ${month} == 05 ]] then compadd $j $f $m $a $M
elif [[ ${month} == 06 ]] then compadd $j $f $m $a $M $ju
elif [[ ${month} == 07 ]] then compadd $j $f $m $a $M $ju $J
elif [[ ${month} == 08 ]] then compadd $j $f $m $a $M $ju $J $A
elif [[ ${month} == 09 ]] then compadd $j $f $m $a $M $ju $J $A $s
elif [[ ${month} == 10 ]] then compadd $j $f $m $a $M $ju $J $A $s $o
elif [[ ${month} == 11 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n
elif [[ ${month} == 12 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n $d
fi
}

224
_gentoo_packages Normal file
View File

@ -0,0 +1,224 @@
#autoload
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# functions for gentoo packages
# inspired by _deb_packages
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Vadim A. Misbakh-Soloviev <mva@mva.name>
# * Bapt <bapt@tuxfamily.org>
# * kaworu <kaworu@kaworu.ch>
# * David Durrleman <dualmoo@gmail.com>
# * oberyno <oberyno@gmail.com>
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
#Usage: _gentoo_packages installed|available|installed_versions|available_versions|binary|category|useflag|overlays|sets|licenses
# List installed overlays
_gentoo_packages_overlays () {
for f in /etc/make.conf /etc/make.globals; do
[[ -z "$PORTDIR_OVERLAY" && -r "$f" ]] &&
local PORTDIR_OVERLAY="`. "$f" 2>/dev/null; echo ${PORTDIR_OVERLAY}`"
done
compadd $=PORTDIR_OVERLAY
}
#List the sets
_gentoo_packages_sets() {
local sets
[[ -f /usr/share/portage/config/sets.conf ]] && sets=(${${${(M)${(f)"$(</usr/share/portage/config/sets.conf)"}##\[*}/\[/@}/\]})
[[ -f /etc/portage/sets.conf ]] && sets=($sets ${${${(M)${(f)"$(</etc/portage/sets.conf)"}##\[*}/\[/@}/\]})
compadd $sets
}
#List licenses
_gentoo_packages_licenses () {
local licenses var PORTDIR
var=PORTDIR
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.globals ]] &&
local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
licenses=($PORTDIR/licenses/*(:t))
compadd $licenses
}
# Completion function to show useflags.
_gentoo_packages_useflag(){
local flags var PORTDIR
var=PORTDIR
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.globals ]] &&
local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
flags=( ${${(M)${(f)"$(<$PORTDIR/profiles/use.desc)"}:#* - *}%% - *}
${${${(M)${(f)"$(<$PORTDIR/profiles/use.local.desc)"}#* - *}%% - *}#*:} )
compadd $flags
}
_gentoo_packages_active_useflag(){
local flags var USE
var=USE
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
flags=(${${${=USE}%-*}%\\*})
compadd $flags
}
_gentoo_packages_category(){
local var trees category
for var in PORTDIR PORTDIR_OVERLAY ; do
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.globals ]] &&
local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
done
trees=($PORTDIR $=PORTDIR_OVERLAY)
category=( $trees/*-*(/:t) )
_wanted cat_packages expl 'category' compadd "$@" $category
}
_gentoo_packages_installed(){
local installed_dir installed_portage installed_list expl
installed_dir="/var/db/pkg"
installed_portage=($installed_dir/*-*/*)
installed_pkgname=( ${${installed_portage:t}%%-[0-9]*} )
_wanted packages expl 'category/package' compadd "$@" ${installed_pkgname}
installed_list=( ${${installed_portage#$installed_dir/}%%-[0-9]*} )
_wanted cat_packages expl 'category/package' _multi_parts "$@" / installed_list
}
_gentoo_packages_installed_versions(){
local installed_list installed_portage expl
installed_portage=(/var/db/pkg/*-*/*)
_wanted packages expl 'package' compadd "$@" ${installed_portage:t}
installed_list=( ${installed_portage##*/pkg/} )
_wanted cat_packages expl 'category/package' _multi_parts "$@" / installed_list
}
_gentoo_packages_available_pkgnames_only(){
local var trees packages
for var in PORTDIR PORTDIR_OVERLAY ; do
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.globals ]] &&
local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
done
trees=( $PORTDIR $=PORTDIR_OVERLAY)
packages=( $trees/*-*/*(:t) )
_wanted packages expl 'package' compadd - "${(@)packages}"
}
_gentoo_packages_available(){
local var trees category packages pkg expl
for var in PORTDIR PORTDIR_OVERLAY ; do
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.globals ]] &&
local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
done
trees=( $PORTDIR $=PORTDIR_OVERLAY)
category=( $trees/*-*(/:t) )
packages=( $trees/*-*/*(:t) )
_wanted packages expl 'package' compadd - "${(@)packages}"
# Complete cat/pkg. _multi_parts is much to slow for such a large task,
# _sep_parts removes the dash from gnome-<tab>, and _path_files wants to
# complete cat/pkg/files (if "files" is ignored with -F, miscfiles, etc...
# don't get completed).
if [[ $PREFIX != */* ]] ; then
_wanted cat_packages expl 'category/package' compadd -S '/' $category
else
compset -P '*/'
pkg=( $trees/$IPREFIX/*(:t) )
_wanted cat_packages expl 'category/package' compadd $pkg
fi
}
_gentoo_packages_available_versions(){
local var overlay_ebuilds portage_ebuilds expl trees category
for var in PORTDIR PORTDIR_OVERLAY ; do
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.globals ]] &&
local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
done
trees=($PORTDIR $=PORTDIR_OVERLAY)
category=( $trees/*-*(/:t) )
typeset -U category
if [[ $#PREFIX -ge 1 && -z $words[(r)(--inject|-i)] ]] ; then
overlay_ebuilds=($=PORTDIR_OVERLAY/*-*/${PREFIX%%-[0-9]#*}*/*.ebuild(:t:r) )
portage_ebuilds=($PORTDIR/metadata/cache/*-*/${PREFIX%%-[0-9]#*}*(:t))
_wanted packages expl 'package' compadd $portage_ebuilds $overlay_ebuilds
fi
pkg=( $trees/${PREFIX%%/*}/*/*.ebuild(:t:r) )
_wanted cat_packages expl 'category/package' _sep_parts category / pkg
}
#Function to show tbz2 files available
_gentoo_packages_binary() {
[[ -z $PKGDIR && -r /etc/make.conf ]] &&
local PKGDIR="`. /etc/make.conf 2>/dev/null; echo $PKGDIR`"
[[ -z $PKGDIR && -r /etc/make.globals ]] &&
local PKGDIR="`. /etc/make.globals 2>/dev/null; echo $PKGDIR`"
# this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
# binary mirror will be available we should rewrite it accordingly.
_path_files -g \*.tbz2 -W "$PKGDIR/All"
}
_gentoo_packages () {
local command="$argv[$#]"
[[ "$command" == (sets|licenses|installed(_versions|)|available(_versions|)|binary|category|(active_|)useflag|available_pkgnames_only|overlays) ]] || {
_message "unknown command: $command"
return 1
}
_gentoo_packages_$command
}
_gentoo_packages "$@"

405
_gentoolkit Normal file
View File

@ -0,0 +1,405 @@
#compdef equery euse eclean eclean-dist eclean-pkg epkginfo genpkgindex glsa-check revdep-rebuild
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Gentoolkit (collection of Gentoo administrative scripts).
# (Means portage helper python-scrips and some usefull staff)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Vadim A. Misbakh-Soloviev <mva@mva.name>
# * Bapt <bapt@tuxfamily.org>
# * kaworu <kaworu@kaworu.ch>
# * David Durrleman <dualmoo@gmail.com>
# * oberyno <oberyno@gmail.com>
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
#<app-portage/gentoolkit-0.2.4-rc3>
#
# Status:
# euse (fully done)
# equery (fully done)
# eclean* (fully done)
# epkginfo (fully done)
# genpkgindex (fully done)
# glsa-check (fully done)
# revdep-rebuild (fully done)
# eread (nothing todo)
# XXX: shouldn't this go to _gentoo_package?
_packages () {
if compset -P '(\\|)(>=|<=|<|>|=)' ; then
_gentoo_packages ${*/(#m)(installed|available)/${MATCH}_versions}
else
_gentoo_packages $*
fi
}
_euse () {
local state tmp start_args suboptions_args
start_args=(
{'(--help)-h','(-h)--help'}'[show help]'
{'(--version)-v','(-v)--version'}'[show version]'
{'(--info)-i','(-i)--info'}'[show descriptions for the given useflags]'
{'(--active)-a','(-a)--active'}'[show currently active useflags and their origin]'
{'(--enable)-E','(-E)--enable'}'[enable the given useflags]'
{'(--disable)-D','(-D)--disable'}'[disable the given useflags]'
{'(--prune)-P','(-P)--prune'}'[show version]'
)
suboptions_args=(
{'(--global)-g','(-g)--global'}'[show only global use flags]'
{'(--local)-l','(-l)--local'}'[show only local use flags]'
)
if (( CURRENT == 2 ));then
_arguments -s $start_args
elif (( CURRENT == 3 ));then
case "$words[2]" in
-i|--info|-a|--active)
_arguments -s $suboptions_args \
'*:useflags:_gentoo_packages useflag' && ret=0
;;
-E|--enable)
_arguments \
'*:useflags:_gentoo_packages useflag' && ret=0
;;
-D|--disable)
_arguments \
'*:active useflags:_gentoo_packages active_useflag' && ret=0
esac
else
_arguments \
'*:useflag:_gentoo_packages useflag' && ret=0
fi
}
_equery () {
# Based off of X/_xauth.
local state context line expl ret=1
local tmp cmd start_args common_args
start_args=(
{'(--nocolor)-C','(-C)--nocolor'}'[turns off colors]'
{'(--quiet)-q','(-q)--quiet'}'[minimal output]'
{'(--help)-h','(-h)--help'}'[show help]'
{'(--version)-V','(-V)--version'}'[show version]'
)
common_args=(
'(-i --installed -I --exclude-installed)'{-i,--installed}'[search installed packages]'
'(-I --exclude-installed -i --installed)'{-I,--exclude-installed}'[do not search installed packages]'
'(-p --portage)'{-p,--portage-tree}'[also search in portage tree]'
'(-o --overlay-tree)'{-o,--overlay-tree}'[also search in overlay tree]'
)
_arguments -s $start_args \
'*::command:->command' && ret=0
while [[ -n "$state" ]]; do
tmp="$state"
state=
case "$tmp" in
command)
if (( CURRENT == 1 )); then
state=subcommands
else
cmd="$words[1]"
curcontext="${curcontext%:*:*}:equery-${cmd}:"
case "$cmd" in
belongs|b)
_arguments \
'(-c --category)'{-c,--category}'[only search in specified category]:category:_gentoo_packages category' \
'(-e --earlyout)'{-e,--earlyout}'[stop when first match found]' \
'(-f --full-regex)'{-f,--full-regex}'[supplied query is a full regex]:pattern:' \
'*:file:_files' && ret=0
;;
check|k)
_arguments \
':portage:_packages installed' && ret=0
;;
depends|d)
_arguments \
'(-a --all-packages)'{-a,--all-packages}'[search in all available packages (slow)]:all packages:->packages' \
'(-d --direct -D --indirect)'{-d,--direct}'[search direct dependencies only (default)]' \
'(-d --direct -D --indirect)'{-D,--indirect}'[search indirect dependencies (VERY slow)]' \
'*:package:_packages installed' && ret=0
;;
depgraph|g)
_arguments \
'(-U --no-useflags)'{-U,--no-useflags}'[do not show USE flags]' \
'(-l --linear)'{-l,--linear}'[do not use fancy formatting]' \
':package:_packages installed' && ret=0
;;
files|f)
_arguments \
'--timestamp[append timestamp]' \
'--md5sum[append md5sum]' \
'--type[prepend file type]' \
'--filter=[filter output]:filter(s):_values -s , '' dir obj sym dev fifo path conf cmd doc man info' \
':installed pkgname:_packages installed' && ret=0
;;
hasuse|h)
_arguments \
$common_args \
':useflag:_gentoo_packages useflag' && ret=0
;;
list|l)
_arguments \
$common_args \
': :_guard "^--*" pattern' && ret=0
;;
size|s)
_arguments \
'(-b --bytes)'{-b,--bytes}'[report size in bytes]' \
':package:_packages installed' && ret=0
;;
which|w)
_arguments \
':portage:_packages available' && ret=0
;;
uses|u)
_arguments \
{--all,-a}'[include non-installed packages]' \
":portage:_packages installed" && ret=0
;;
*)
_message 'command not found'
;;
esac
fi
;;
subcommands)
tmp=(
{belongs,b}'[list all packages owning file(s)]'
{check,k}'[check MD5sums and timestamps of package]'
{depends,d}'[list all packages depending on specified package]'
{depgraph,g}'[display a dependency tree for package]'
{files,f}'[list files owned by package]'
{hasuse,h}'[list all packages with specified useflag]'
{list,l}'[list all packages matching pattern]'
{size,s}'[print size of files contained in package]'
{uses,u}'[display USE flags for package]'
{which,w}'[print full path to ebuild for package]'
)
_values 'equery command' $tmp && ret=0
;;
esac
done
}
_eclean_wrapper () {
local global_opts pkg_opts dist_opts
global_opts=(
'(-C --nocolor)'{-C,--nocolor}'[turns off colors]'
'(-d,--destructive)'{-d,--destructive}'[only keep the minimum for a reinstallation]'
'(-e,--exclude-file)'{-e,--exclude-file}'[path to the exclusion file]:filename:_files'
'(-i,--interactive)'{-i,--interactive}'[ask confirmation before deletions]'
'(-n,--package-names)'{-n,--package-names}'[protect all versions (when --destructive)]'
'(-p,--pretend)'{-p,--pretend}'[only display what would be cleaned]'
'(-q,--quiet)'{-q,--quiet}'[minimal output]'
'(-t,--time-limit)'{-t,--time-limit}'[dont delete files modified since <time>]:time:_eclean_time'
'(: -)'{-h,--help}'[show help]'
'(: -)'{-V,--version}'[show version]'
)
dist_opts=(
'(-s,--size-limit)'{-s,--size-limit}'[do not delete disfiles bigger than <size>]:size:_eclean_size'
'(-f,--fetch-restricted)'{-f,--fetch-restricted}'[protect fetch-restricted files]'
)
# XXX: If you add options here make sure that it'll work.
# since there isn't any option *right* now, $pkg_opts
# is never used.
pkg_opts=()
# check which kind of eclean command we run.
case "$words[1]" in
eclean-pkg)
_arguments -s $global_opts $pkg_opts &&
return 0
;;
eclean-dist)
_arguments -s $global_opts $dist_opts &&
return 0
;;
eclean)
# eclean. complete only specifics options if an action has been given,
# global_opts and packages|distfiles otherwhise.
if (( $words[(I)(packages)] )); then
# Currently no options so return 0
#_values "packages options" $pkg_opts &&
return 0
elif (( $words[(I)(distfiles)] )); then
_values "distfiles options" $dist_opts &&
return 0
else
_arguments -s $global_opts
# complete packages|distfiles only if CURRENT-1 don't need an arg
if [[ ! $words[CURRENT-1] =~ -(e|-exclude-file|t|-time-limit|s|-size-limit|h|-help|v|-version) ]]; then
_values 'eclean command' \
'packages[clean outdated binary packages]' \
'distfiles[clean outdated packages sources files]' &&
return 0
fi
fi
;;
esac
}
_eclean_time () {
# adapted from _chmod
compset -P '*'
suf=( -S '' )
_alternative -O suf \
'number:number:(0 1 2 3 4 5 6 7 8 9)' \
'time_unit:time_unit:((y\:year m\:month w\:week d\:day h\:hour))' &&
return 0
}
_eclean_size () {
# adapted from _chmod
compset -P '*'
suf=( -S '' )
_alternative -O suf \
'number:number:(0 1 2 3 4 5 6 7 8 9)' \
'time_unit:time_unit:((G\:gigabytes M\:megabytes K\:kilobytes B\:bytes))' &&
return 0
}
_epkginfo () {
if (( CURRENT == 2 )); then
_arguments -s '*:package:_gentoo_packages available'
fi
}
_genpkgindex () {
_arguments -s \
'(: -)'{-h,--help}'[Display help and exit]' \
'(-h --help -q --quiet -v --verbose)'{-q,--quiet}'[Be quiet]' \
'(-h --help -q --quiet -v --verbose)'{-v,--verbose}'[Be verbose]' \
'(-h --help -c --compress)'{-c,--compress}'[Compresses the generated metadata with bzip2]' \
'(-h --help -P --pkgdir)'{-P,--pkgdir}'[Set the base location of the binary packages (default $PKGDIR)]:file:_files'
}
_glsa-check () {
local actions
actions=(-l --list -d --dump --print -t --test -p --pretend -f --fix -i --inject -h --help -V --version -m --mail)
_arguments -s \
"($actions)"{-l,--list}'[list all unapplied GLSA]:glsa_id:_glsa_id' \
"($actions)"{-d,--dump,--print}'[show all information about the given GLSA]:glsa_id:_glsa_id' \
"($actions)"{-t,--test}'[test if this system is affected by the given GLSA]:glsa_id:_glsa_id' \
"($actions)"{-p,--pretend}'[show the necessary commands to apply this GLSA]:glsa_id:_glsa_id' \
"($actions)"{-f,--fix}'[try to auto-apply this GLSA (experimental)]:glsa_id:_glsa_id' \
"($actions)"{-i,--inject}'[inject the given GLSA into the checkfile]:glsa_id:_glsa_id' \
'(-n --nocolor)'{-n,--nocolor}'[disable colors (option)]' \
'(: -)'{-h,--help}'[Show help message]' \
'(: -)'{-V,--version}'[some information about this tool]' \
'(-v --verbose)'{-v,--verbose}'[print more messages (option)]' \
'(-c --cve)'{-c,--cve}'[show CAN ids in listing mode (option)]' \
"($actions)"{-m,--mail}'[send a mail with the given GLSAs to the administrator]:glsa_id:_glsa_id'
}
# glsa-list can contain an arbitrary number of GLSA ids,
# filenames containing GLSAs or the special identifiers
# 'all', 'new' and 'affected'
_glsa_id () {
# XXX: we'll avoid displaying GLSA ids, because the ratio use/noise
# will be low. May be we should display only the X previous GLSA,
# or GLSA ids of the X last month.
#
# start to look at /usr/lib/gentoolkit/pym/glsa.py if GLSA_DIR is still
# PORTDIR + "metadata/glsa/"
# and then get the list (it's only xml files in GLSA_DIR, easy!)
compadd 'all' 'new' 'affected'
_files
}
_revdep-rebuild () {
if (( $words[(I)(--)] )); then
# here it's no more revdep-rebuild options, but emerge options that are called
_arguments -s '*:portage:_portage --emerge $@' && return 0
fi
_arguments -s \
'(-C --nocolor)'{-C,--nocolor}'[Turn off colored output]' \
'(-d --debug)'{-d,--debug}'[Print way too much information (uses bash set -xv)]' \
'(-e --exact)'{-e,--exact}'[Emerge based on exact package version]' \
'(: -)'{-h,--help}'[Print help]' \
'(-i --ignore)'{-i,--ignore}'[Ignore temporary files from previous runs]' \
'(-k --keep-temp)'{-k,--keep-temp}'[Do not delete temporary files on exit]' \
'(-L --library)'{-L,--library}'[<NAME> Emerge existing packages that use the library with NAME]:file:_files' \
'(-l --no-ld-path)'{-l,--no-ld-path}'[Do not set LD_LIBRARY_PATH]' \
'(-o --no-order)'{-o,--no-order}'[Do not check the build order (Saves time, but may cause breakage)]' \
'(-p --pretend)'{-p,--pretend}'[Do a trial run without actually emerging anything (also passed to emerge command)]' \
'(-P --no-progress)'{-P,--no-progress}'[Turn off the progress meter]' \
'(-q --quiet)'{-q,--quiet}'[Be less verbose (also passed to emerge command)]' \
'(-v --verbose)'{-v,--verbose}'[Be more verbose (also passed to emerge command)]' \
'(-u --no-util)'{-u,--no-util}'[<UTIL> Do not use features provided by UTIL]:file:_files'
# XXX: does someone really use -u|--no-util option?
# we can check packages installed (like portage-utils etc) to see
# which "UTIL" is avaiable.
}
case "$service" in
euse)
_euse "$@" && return 0
;;
equery)
_equery "$@" && return 0
;;
eclean*)
_eclean_wrapper "$@" && return 0
;;
epkginfo)
_epkginfo "$@" && return 0
;;
genpkgindex)
_genpkgindex "$@" && return 0
;;
glsa-check)
_glsa-check "$@" && return 0
;;
revdep-rebuild)
_revdep-rebuild "$@" && return 0
;;
esac

View File

@ -1,30 +1,9 @@
#compdef git-flow
#description Git Flow branching model
# ------------------------------------------------------------------------------
# Copyright (c) 2010-2015 Justin Hileman
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
# OR OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for git-flow (https://github.com/nvie/gitflow).
# Completion script for git-flow (http://github.com/nvie/gitflow).
#
# Source: https://github.com/bobthecow/git-flow-completion
#
@ -36,9 +15,11 @@
# * 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)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_git-flow ()
@ -70,8 +51,7 @@ _git-flow ()
(init)
_arguments \
-f'[Force setting of gitflow branches, even if already configured]' \
-d'[Use default branch naming conventions and prefixes]'
-f'[Force setting of gitflow branches, even if already configured]'
;;
(version)
@ -88,11 +68,6 @@ _git-flow ()
(feature)
__git-flow-feature
;;
(support)
__git-flow-support
;;
esac
;;
esac
@ -115,8 +90,6 @@ __git-flow-release ()
'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 \
@ -138,24 +111,10 @@ __git-flow-release ()
-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'[Don'\''t 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]'
@ -182,7 +141,6 @@ __git-flow-hotfix ()
'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 \
@ -209,11 +167,6 @@ __git-flow-hotfix ()
':hotfix:__git_flow_hotfix_list'
;;
(publish)
_arguments \
':hotfix:__git_flow_hotfix_list'
;;
*)
_arguments \
-v'[Verbose (more) output]'
@ -240,12 +193,12 @@ __git-flow-feature ()
'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.'
'publish: public'
'track: track'
'diff: diff'
'rebase: rebase'
'checkout: checkout'
'pull: pull'
)
_describe -t commands 'git flow feature' subcommands
_arguments \
@ -265,9 +218,7 @@ __git-flow-feature ()
(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]'\
-r'[Rebase instead of merge]'\
':feature:__git_flow_feature_list'
;;
@ -312,47 +263,6 @@ __git-flow-feature ()
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
@ -403,18 +313,6 @@ __git_flow_hotfix_list ()
_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
@ -434,11 +332,3 @@ __git_command_successful () {
}
_git-flow "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,6 +1,6 @@
#compdef archlinux-java
#compdef git-pulls
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# 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
@ -28,58 +28,76 @@
# Description
# -----------
#
# Completion script for archlinux-java a tool for selecting default Java runtime (https://wiki.archlinux.org/index.php/java).
# Completion script for git-pulls 0.3.1 (https://git-pulls.com/schacon/git-pulls).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
# * Julien Nicoulaud (https://github.com/nicoulaj)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_archlinux-java_command_arguments() {
case $words[1] in
(set)
local java_versions=("${(@f)$(archlinux-java status | tail -n +2 | tr -s ' ' | cut -d ' ' -f2)}")
_describe -t output 'Downloads to delete' java_versions
;;
esac
}
typeset -A opt_args
local context state line curcontext="$curcontext"
_archlinux-java() {
local -a commands
commands=(
"status:List installed Java environments and enabled one"
"get:Return the short name of the Java environment set as default"
"set:Force <JAVA_ENV> as default"
"unset:Unset current default Java environment"
"fix:Fix an invalid/broken default Java environment configuration"
"help:Show help"
)
_git-pulls() {
local ret=1
_arguments -C \
'(- 1 *)--help[show usage]' \
'1:cmd:->cmds' \
'*:: :->args' \
'*::arg:->args' \
&& ret=0
case "$state" in
(cmds)
_describe -t commands 'commands' commands
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
;;
(*)
_archlinux-java_command_arguments
(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
}
_archlinux-java
(( $+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 "$@"
}
# 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
_git-pulls "$@"

View File

@ -1,6 +1,6 @@
#compdef git-wtf
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users
# 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
@ -36,17 +36,14 @@
# -------
#
# * Mario Fernandez (https://github.com/sirech)
# * Shohei YOSHIDA (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
__git_wtf_branches() {
local -a branches
branches=(${(f)"$(git for-each-ref --format='%(refname:short)' refs/heads/)"})
_describe 'branch' branches
}
_arguments -w -C -s \
_git-wtf () {
_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]' \
@ -54,12 +51,7 @@ _arguments -w -C -s \
'(--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_wtf_branches'
'*: :__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
_git-wtf "$@"

267
_github Normal file
View File

@ -0,0 +1,267 @@
#compdef github gh
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Github gem 0.6.2 (https://github.com/defunkt/github-gem).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud (https://github.com/nicoulaj)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext"
_github() {
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 "$@"

130
_gradle Normal file
View File

@ -0,0 +1,130 @@
#compdef gradle gradlew
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Gradle 1.0-milestone-5 (http://www.gradle.org).
#
# Status: incomplete (see TODO/FIXME tags)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
typeset -A opt_args
local context state line
_gradle() {
local curcontext="$curcontext"
_arguments \
'(- 1 *)'{-?,-h,--help}'[show help message]' \
'(-a --no-rebuild)'{-a,--no-rebuild}'[do not rebuild project dependencies]' \
'(-b --build-file)'{-b,--build-file}'[specify the build file]:build file:_gradle_scripts' \
'(-C --cache)'{-C,--cache}'[specify how compiled build scripts should be cached]:cache strategy:((rebuild\:rebuild\ the\ cache on\:use\ the\ cache\ \(default\)))' \
'(-c --settings-file)'{-c,--settings-file}'[speciy the settings file]:settings file:_gradle_scripts' \
'*'{-D-,--system-prop}'[set system property of the JVM]:property:_gradle_properties' \
'(-d --debug -q --quiet -i --info)'{-d,--debug}'[log in debug mode (includes normal stacktrace)]' \
'(--foreground --no-daemon --stop)--daemon[use the Gradle daemon to run the build, starts the daemon if not running]' \
'(-e --embedded)'{-e,--embedded}'[specify an embedded build script]:embedded build script' \
'(--daemon --no-daemon --stop)--foreground[start the Gradle daemon in the foreground]' \
'(-g --gradle-user-home)'{-g,--gradle-user-home}'[specify the gradle user home directory]: :_files -/' \
'--gui[launch a GUI application]' \
'(-I --init-script)'{-I,--init-script}'[specify an initialization script]:init script:_gradle_scripts' \
'(-i --info -q --quiet -d --debug)'{-i,--info}'[set log level to info]' \
'(-m --dry-run)'{-m,--dry-run}'[run the builds with all task actions disabled]' \
'(-n --dependencies)'{-n,--dependencies}'[show list of all project dependencies]' \
'--no-color[do not use color in the console output]' \
'(--daemon --foreground --stop)--no-daemon[do not use the Gradle daemon to run the build]' \
'--no-opt[ignore any task optimization]' \
'*'{-P-,--project-prop}'[set project property for the build script]:property:_gradle_properties' \
'(-p --project-dir)'{-p,--project-dir}'[specify the start directory for Gradle]: :_files -/' \
'--profile[profile build execution time and generate a report in the <build_dir>/reports/profile directory]' \
'(-q --quiet -d --debug -i --info)'{-q,--quiet}'[log errors only]' \
'(-r --properties)'{-r,--properties}'[show list of all available project properties]' \
'(-S --full-stacktrace)'{-S,--full-stacktrace}'[print out the full (very verbose) stacktrace for any exceptions]' \
'(-s --stacktrace)'{-s,--stacktrace}'[print out the stacktrace also for user exceptions]' \
'(--daemon --foreground)--stop[stop the Gradle daemon if it is running]' \
'(-t --tasks)'{-t,--tasks}'[show list of available tasks]' \
'(-u --no-search-upward)'{-u,--no-search-upward}'[don'\''t search in parent folders for a settings.gradle file]' \
'(-v --version)'{-v,--version}'[print version info]' \
'(-x --exclude-task)*'{-x,--exclude-task}'[specify a task to be excluded from execution]:task:_gradle_tasks' \
'*: :_gradle_tasks'
}
(( $+functions[_gradle_tasks] )) ||
_gradle_tasks() {
local alternatives task_group task_group_name task_group_tasks
local project="${PREFIX%:*}"
alternatives=("project:project:_gradle_projects -qS:")
for task_group in ${(M)${(ps:\n\n:)"$($service --daemon --quiet --no-color ${project}:tasks 2>/dev/null)"}:#*[[:space:]]\-[[:space:]]*}; do
task_group_name="${${${task_group%%---*}%[[:space:]]tasks[[:space:]]*}:l}"
task_group_tasks=(${(q)${(f)${task_group##*---}}/[[:space:]]\-[[:space:]]/:})
alternatives+=("${task_group_name//[[:space:]]/-}-task:${task_group_name} task:((${task_group_tasks[@]}))")
done
_alternative "${alternatives[@]}"
}
(( $+functions[_gradle_projects] )) ||
_gradle_projects() {
local project="${PREFIX%:*}"
local projects; projects=(${${${(M)${(f)"$($service --daemon --quiet --no-color ${project}:projects 2>/dev/null)"}:#*--- Project\ \':*}#*\'}%\'*})
_multi_parts $@ : projects
}
(( $+functions[_gradle_scripts] )) ||
_gradle_scripts() {
_files -g '*.gradle*'
}
(( $+functions[_gradle_properties] )) ||
_gradle_properties() {
local ret=1
if compset -P '*='; then
_message -e property-values 'property value' && ret=0
else
_wanted property-names expl 'property name' _gradle_property_names -qS= && ret=0
fi
return ret
}
(( $+functions[_gradle_property_names] )) ||
_gradle_property_names() {
local property_names; property_names=(${${(M)${(f)"$($service --daemon --quiet --no-color :properties 2>/dev/null)"}:#*:*}%%:*})
_describe -t property_names 'property name' property_names "$@"
}
_gradle "$@"

169
_heroku Normal file
View File

@ -0,0 +1,169 @@
#compdef heroku
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for the Heroku client gem (https://github.com/heroku/heroku)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ali B. (http://awhitebox.com)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local -a _1st_arguments
_1st_arguments=(
"account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
"addons":"list installed addons"
"addons\:list":"list all available addons"
"addons\:add":"install an addon"
"addons\:upgrade":"upgrade an existing addon"
"addons\:downgrade":"downgrade an existing addon"
"addons\:remove":"uninstall an addon"
"addons\:open":"open an addon's dashboard in your browser"
"apps":"list your apps"
"apps\:info":"show detailed app information"
"apps\:create":"create a new app"
"apps\:rename":"rename the app"
"apps\:open":"open the app in a web browser"
"apps\:destroy":"permanently destroy an app"
"auth\:login":"log in with your heroku credentials"
"auth\:logout":"clear local authentication credentials"
"config":"display the config vars for an app"
"config\:add":"add one or more config vars"
"config\:remove":"remove a config var"
"db\:push":"push local data up to your app"
"db\:pull":"pull heroku data down into your local database"
"domains":"list custom domains for an app"
"domains\:add":"add a custom domain to an app"
"domains\:remove":"remove a custom domain from an app"
"domains\:clear":"remove all custom domains from an app"
"help":"list available commands or display help for a specific command"
"keys":"display keys for the current user"
"keys\:add":"add a key for the current user"
"keys\:remove":"remove a key from the current user"
"keys\:clear":"remove all authentication keys from the current user"
"logs":"display recent log output"
"logs\:cron":"DEPRECATED: display cron logs from legacy logging"
"logs\:drains":"manage syslog drains"
"maintenance\:on":"put the app into maintenance mode"
"maintenance\:off":"take the app out of maintenance mode"
"pg\:info":"display database information"
"pg\:ingress":"allow direct connections to the database from this IP for one minute"
"pg\:promote":"sets DATABASE as your DATABASE_URL"
"pg\:psql":"open a psql shell to the database"
"pg\:reset":"delete all data in DATABASE"
"pg\:unfollow":"stop a replica from following and make it a read/write database"
"pg\:wait":"monitor database creation, exit when complete"
"pgbackups":"list captured backups"
"pgbackups\:url":"get a temporary URL for a backup"
"pgbackups\:capture":"capture a backup from a database id"
"pgbackups\:restore":"restore a backup to a database"
"pgbackups\:destroy":"destroys a backup"
"plugins":"list installed plugins"
"plugins\:install":"install a plugin"
"plugins\:uninstall":"uninstall a plugin"
"ps\:dynos":"scale to QTY web processes"
"ps\:workers":"scale to QTY background processes"
"ps":"list processes for an app"
"ps\:restart":"restart an app process"
"ps\:scale":"scale processes by the given amount"
"releases":"list releases"
"releases\:info":"view detailed information for a release"
"rollback":"roll back to an older release"
"run":"run an attached process"
"run\:rake":"remotely execute a rake command"
"run\:console":"open a remote console session"
"sharing":"list collaborators on an app"
"sharing\:add":"add a collaborator to an app"
"sharing\:remove":"remove a collaborator from an app"
"sharing\:transfer":"transfer an app to a new owner"
"ssl":"list certificates for an app"
"ssl\:add":"add an ssl certificate to an app"
"ssl\:remove":"remove an ssl certificate from an app"
"ssl\:clear":"remove all ssl certificates from an app"
"stack":"show the list of available stacks"
"stack\:migrate":"prepare migration of this app to a new stack"
"version":"show heroku client version"
)
_arguments '*:: :->command'
if (( CURRENT == 1 )); then
_describe -t commands "heroku command" _1st_arguments
return
fi
local -a _command_args
case "$words[1]" in
apps:info)
_command_args=(
'(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
)
;;
apps:create)
_command_args=(
'(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
'(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \
'(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \
)
;;
config)
_command_args=(
'(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
)
;;
db:push)
_command_args=(
'(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
'(-d|--debug)'{-d,--debug}'[enable debugging output]' \
'(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \
'(-f|--filter)'{-f,--filter}'[only push certain tables]' \
'(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
'(-t|--tables)'{-t,--tables}'[only push the specified tables]' \
)
;;
db:pull)
_command_args=(
'(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
'(-d|--debug)'{-d,--debug}'[enable debugging output]' \
'(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \
'(-f|--filter)'{-f,--filter}'[only pull certain tables]' \
'(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
'(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \
)
;;
keys)
_command_args=(
'(-l|--long)'{-l,--long}'[display extended information for each key]' \
)
;;
logs)
_command_args=(
'(-n|--num)'{-n,--num}'[the number of lines to display]' \
'(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \
'(-s|--source)'{-s,--source}'[only display logs from the given source]' \
'(-t|--tail)'{-t,--tail}'[continually stream logs]' \
)
;;
pgbackups:capture)
_command_args=(
'(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
)
;;
stack)
_command_args=(
'(-a|--all)'{-a,--all}'[include deprecated stacks]' \
)
;;
esac
_arguments \
$_command_args \
'(--app)--app[the app name]' \
&& return 0

View File

@ -1,9 +1,34 @@
#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 (https://jmeter.apache.org/).
# Completion script for JMeter (http://jakarta.apache.org/jmeter).
#
# Status: incomplete
#
@ -14,10 +39,12 @@
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_arguments \
'(- 1 *)--?[print command line options and exit]' \
'(- 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"' \
@ -25,34 +52,18 @@ _arguments \
{-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"' \
{-i,--jmeterlogconf}'[jmeter logging configuration file]: :_files -g "*.xml"' \
{-j,--jmeterlogfile}'[jmeter run file]: :_files -g "*.log"' \
{-n,--nongui}'[run JMeter in nongui mode]' \
{-s,--server}'[run the JMeter server]' \
{-E,--proxyScheme}'[set a proxy scheme to use for the proxy server]:scheme' \
{-H,--proxyHost}'[set a proxy server for JMeter to use]: :_hosts' \
{-P,--proxyPort}'[set proxy server port for JMeter to use]:number' \
{-N,--nonProxyHosts}'[set non proxy host list]:host' \
{-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"' \
{-f,--forceDeleteResultFile}'[force delete existing results files and web report folder]' \
{-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)]' \
{-g,--removeonly}'[generate report dashboard only, from a test results file]: :_files' \
{-e,--reportatendofloadtests}'[generate report dashboard after load test]' \
{-o,--reportoutputfolder}'[output folder for report dashboard]: :_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
{-X,--remoteexit}'[exit the remote servers at end of test (non-GUI)]'

View File

@ -1,6 +1,6 @@
#compdef afew
#compdef jmeter-plugins
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# 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
@ -28,38 +28,35 @@
# Description
# -----------
#
# Completion script for afew(version 3.0.1) an initial tagging script for notmuch mail.
# (https://github.com/teythoon/afew)
# Completion script for jmeter-plugins command line tool 0.4.2
# (http://code.google.com/p/jmeter-plugins).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_arguments \
'(- 1 *)'{-h,--help}'[display usage information]' \
'(- 1 *)'{-V,--version}"[show program's version number and exit]" \
"(-t --tag -m --move-mails)"{-w,--watch}"[continuously monitor the mailbox for new messages matching the given query]" \
"(-m --move-mails -w --watch)"{-t,--tag}"[run the tag filters]" \
"(-w --watch -m --move-mails)"{-m,--move-mails}"[move mail files between maildir folders]" \
"(-n --all)"{-a,--all}"[operate on all email]" \
"(-a --new)"{-n,--new}"[operate on all new email]" \
{-C,--notmuch-config=}"[specify path to notmuch configuration file]:files:_files" \
{-e,--enable-filters=}"[specify filter classes to use]:filter" \
{-d,--dry-run}"[don't change the DB]" \
{-R,--reference-set-size=}"[specify size of the reference set]:size [1000]" \
{-T,--reference-set-timeframe-days=}"[don't use emails older than specified age]:age (days) [30]" \
{-N,--notmuch-args=}"[arguments for nutmuch new(in move mode)]:notmuch arg" \
{-v,--verbose}"[be more verbose]" \
'*: :_guard "^-*" query'
# 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
'(- 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'

View File

@ -1,9 +1,34 @@
#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 (https://jonas.ow2.org/).
# Completion script for JOnAS 5.2 (http://jonas.ow2.org).
#
# ------------------------------------------------------------------------------
# Authors
@ -12,6 +37,9 @@
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
typeset -A opt_args
@ -70,7 +98,7 @@ case "$state" in
'-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\ independent\ implementation\ of\ RMI))' \
'-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]' \
@ -90,11 +118,3 @@ case "$state" in
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

193
_knife Normal file
View File

@ -0,0 +1,193 @@
#compdef knife
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Chef's knife (http://www.opscode.com/chef).
#
# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/knife
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Frank Louwers (https://github.com/franklouwers)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
# 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 )
# 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
cloudproviders=(bluebox ec2 rackspace slicehost terremark)
_arguments \
'1: :->knifecmd'\
'2: :->knifesubcmd'\
'3: :->knifesubcmd2' \
'4: :->knifesubcmd3' \
'5: :->knifesubcmd4' \
'6: :->knifesubcmd5'
case $state in
knifecmd)
compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
;;
knifesubcmd)
case $words[2] in
(bluebox|ec2|rackspace|slicehost|terremark)
compadd "$@" server images
;;
client)
compadd -Q "$@" "bulk delete" list create show delete edit reregister
;;
configure)
compadd "$@" client
;;
cookbook)
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
;;
node)
compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
;;
recipe)
compadd "$@" list
;;
role)
compadd -Q "$@" "bulk delete" create delete edit "from file" list show
;;
windows)
compadd "$@" bootstrap
;;
*)
_arguments '2:Subsubcommands:($(_knife_options1))'
esac
;;
knifesubcmd2)
case $words[3] in
server)
compadd "$@" list create delete
;;
images)
compadd "$@" list
;;
site)
compadd "$@" vendor show share search download list unshare
;;
(show|delete|edit)
_arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))'
;;
(upload|test)
_arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)'
;;
list)
compadd -a "$@" knife_general_flags
;;
bag)
compadd -Q "$@" show edit list "from file" create delete
;;
*)
_arguments '3:Subsubcommands:($(_knife_options2))'
esac
;;
knifesubcmd3)
case $words[3] in
show)
case $words[2] in
cookbook)
versioncomp=1
_arguments '4:Cookbookversions:($(_cookbook_versions) latest)'
;;
(node|client|role)
compadd "$@" --attribute
esac
esac
case $words[4] in
(show|edit)
_arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))'
;;
file)
_arguments '*:file or directory:_files -g "*.(rb|json)"'
;;
list)
compadd -a "$@" knife_general_flags
;;
*)
_arguments '*:Subsubcommands:($(_knife_options3))'
esac
;;
knifesubcmd4)
if (( versioncomp > 0 )); then
compadd "$@" attributes definitions files libraries providers recipes resources templates
else
_arguments '*:Subsubcommands:($(_knife_options2))'
fi
;;
knifesubcmd5)
_arguments '*:Subsubcommands:($(_knife_options3))'
esac
}
# Helper functions to provide the argument completion for several depths of commands
_knife_options1() {
( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
}
_knife_options2() {
( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
}
_knife_options3() {
( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
}
# The chef_x_remote functions use knife to get a list of objects of type x on the server
_chef_roles_remote() {
(knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_clients_remote() {
(knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_nodes_remote() {
(knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_cookbooks_remote() {
(knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_sitecookbooks_remote() {
(knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_data_bags_remote() {
(knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
_chef_cookbooks_local() {
(for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
}
# This function extracts the available cookbook versions on the chef server
_cookbook_versions() {
(knife cookbook show $words[4] | grep -v $words[4] | grep -v -E '\]|\[|\{|\}' | sed 's/ //g' | sed 's/"//g')
}
_knife "$@"

View File

@ -1,5 +1,30 @@
#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
# -----------
#
@ -14,6 +39,9 @@
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
(( $+functions[_language_codes_iso_639_1] )) ||
@ -240,11 +268,3 @@ _language_codes() {
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

98
_layman Normal file
View File

@ -0,0 +1,98 @@
#compdef layman
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for LayMan (Gentoo overLAYs (repositories) MANager).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Vadim A. Misbakh-Soloviev <mva@mva.name>
# * Bapt <bapt@tuxfamily.org>
# * kaworu <kaworu@kaworu.ch>
# * David Durrleman <dualmoo@gmail.com>
# * oberyno <oberyno@gmail.com>
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
#<app-portage/layman-1.1.1>
#
local arguments actions_args actions global_opts add_actions
_layman_remote_overlays() {
local layman_list_overlays
layman_list_overlays=(${(S)${${(f)"$(layman -k -N -L 2>/dev/null)"}//\[*}#\* })
compadd "$@" ${(kv)=layman_list_overlays} "ALL"
}
_layman_local_overlays() {
local layman_list_overlays
layman_list_overlays=(${(S)${${(f)"$(layman -N -l)"}//\[*}#\* })
compadd "$@" ${(kv)=layman_list_overlays} "ALL"
}
actions=(
--delete -d
--sync -s
--info -i
--sync-all -S
--list -L
--list-local -l
--fetch -f
)
global_opts=(
'(--config -c)'{-c,--config}'[Select an alternative configuration file]:configuration file:_files'
'(--overlays -o)'{-o,--overlays}'[Specifies the location of additional overlay lists]:overlay url:_urls'
'(--nofetch -n)'{-n,--nofetch}'[Prevents from automatically fetching the remote lists of overlays]'
'(--nocheck -k)'{-k,--nocheck}'[Prevents from checking the remote lists of overlays for complete overlay definitions]'
'(--quiet -q)'{-q,--quiet}'[Makes layman completely quiet]'
'(--verbose -v)'{-v,--verbose}'[Verbose output]'
'(--quietness -Q)'{-Q,--quietness}'[Makes layman less verbose]:level:({0..4})'
'(--nocolor -N)'{-N,--nocolor}'[Remove color codes from the output]'
)
add_actions=(
-p --priority
--add -a
)
actions_args=(
"($actions --add -a)"{--add,-a}'[Add the given overlay to your installed overlays]:overlay:_layman_remote_overlays'
"($actions --priority -p)"{--priority,-p}'[It will modify the priority of the added overlay]:priority:({0..100})'
"($actions $add_actions)"{--delete,-d}'[Delete the given overlay from your installed overlays]:overlay:_layman_local_overlays'
"($actions $add_actions)"{--sync,-s}'[Update the specified overlay]:overlat:_layman_local_overlays'
"($actions $add_actions)"{--info,-i}'[Display all available information about the specified overlay]:overlay:_layman_remote_overlays'
"($actions $add_actions)"{--sync-all,-S}'[Update all overlays]'
"($actions $add_actions)"{--list,-L}'[List the contents of the remote list]'
"($actions $add_actions)"{--list-local,-l}'[List the locally installed overlays]'
"($actions $add_actions)"{--fetch,-f}'[Fetches the remote list of overlays]'
)
_arguments $global_opts[@] $actions_args[@]

44
_lein Normal file
View File

@ -0,0 +1,44 @@
#compdef lein
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Leiningen (https://github.com/technomancy/leiningen)
#
# Source: https://github.com/technolize/zsh-completion-funcs
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * technolize (https://github.com/technolize)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local ret=1 state
_arguments ':subcommand:->subcommand' && ret=0
case $state in
subcommand)
subcommands=(
"clean:remove compiled files and dependencies from project"
"compile:ahead-of-time compile the project"
"deps:download and install all dependencies"
"help:display a list of tasks or help for a given task"
"install:install the project and its dependencies in your local repository"
"jar:create a jar file containing the compiled .class files"
"new:create a new project skeleton"
"pom:write a pom.xml file to disk for maven interop"
"test:run the project's tests"
"uberjar:Create a jar including the contents of each of deps"
"upgrade:upgrade leiningen to the latest stable release"
"version:print leiningen's version"
)
_describe -t subcommands 'leiningen subcommands' subcommands && ret=0
esac
return ret

309
_lunar Normal file
View File

@ -0,0 +1,309 @@
#compdef lunar lin lrm lvu
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Lunar (http://www.lunar-linux.org)
#
# Source: https://github.com/Valodim/lunar-zsh-completion
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Valodim (https://github.com/Valodim)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
# completion for lunar itself (different name, see below)
_lunar_comp() {
local suf ret=1 curcontext="$curcontext"
local -a vals state line expl
# regular arguments, this will probably just hand down to the * command below
_arguments -C \
'(- :)-d[Enables debug messages]' \
'(- :)-h[Display help text]' \
'(- :)-v[Increases the level of message output]' \
'*::command:->command' && return 0
# complete the first word, ie. subcommand
if (( CURRENT == 1 )); then
local -a lunar_commands
# all lunar subcommands
lunar_commands=(
'prune:Removes old sources and install/compile logs'
'renew:Checks ver. against moonbase & recompiles if necessary'
'update:Fetches latest moonbase and then does a "renew"'
'rebuild:Recompiles all installed modules'
'optimize:Shortcut to the optimization menu'
'fix:Check and fix all modules and internal state of lunar'
'nofix:Check but do not fix modules and internal state'
'fixdepends:Check and fix the dependency database of lunar'
'set:Check internal variable(s) and assign their values'
'unset:Unsets an internal variable'
'resurrect:Force modulename(s) to be unpacked from /var/cache'
'install:Install a checklist of modules'
'remove:Remove a checklist of modules'
'hold:Place a hold on a checklist of modules'
'unhold:Remove a hold on a checklist of modules'
'exile:Remove a module a/o prevent it from being resurrected'
'unexile:Allows a module to be compiled|resurrected again')
# just show the commands with description
_describe -t commands 'lunar command' lunar_commands && ret=0
return ret
else
# at this point, we have to decide what to complete for specific subcommands
# make a list of subcommands with no further arguments for later
local -a lunar_no_args
lunar_no_args=( prune renew update rebuild optimize fix nofix fixdepends )
# update the current context
curcontext="${curcontext%:*:*}:lunar-$words[1]:"
# if there is a specific function of the form _lunar-subcommand
if (( $+functions[_lunar-$words[1]] )); then
# call that for completion
_call_function ret _lunar-$words[1]
elif [[ -n "${lunar_no_args[(r)${words[1]}]}" ]]; then
# all commands from the array above take no further arguments
_message "lunar ${words[1]} requires no arguments"
else
# by default, complete modules
_lunar_modules
fi
return ret
fi
}
# specific completion for lunar set
_lunar-set() {
# second argument: all lunar variables
if (( CURRENT == 2 )); then
local vars
vars=( ${(f)"$(cat /var/lib/lunar/unset.sh | cut -d' ' -f2)"} )
_describe -t modules 'lunar variable' vars && return 0
# third argument: some value
elif (( CURRENT == 3 )); then
_message "value"
# no further argument
else
_message "no further arguments"
fi
}
_lunar-unset() {
local vars
vars=( ${(f)"$(cat /var/lib/lunar/unset.sh | cut -d' ' -f2)"} )
_describe -t modules 'lunar variable' vars && return 0
}
_lunar-unhold() {
local vals
vals=( ${(f)"$(lvu held | sort | uniq)"} )
_describe -t modules 'held modules' vals && return 0
}
_lunar-unexile() {
local vals
vals=( ${(f)"$(lvu exiled | sort | uniq)"} )
_describe -t modules 'exiled modules' vals && return 0
}
_lrm() {
_arguments \
'(-d --debug)'{-d,--debug}'[Enables debug messages]' \
'(-D --downgrade)'{-D,--downgrade}'[downgrades a module]:module:_lunar_modules:version' \
'(-h --help)'{-h,--help}'[Displays this help text]' \
'(-k --keepconfig)'{-k,--keepconfig}'[remove module(s) but keep dependencies and config]' \
'(-n --nosustain)'{-n,--nosustain}'[removes module(s) even if they are sustained]' \
'(-u --upgrade)'{-u,--upgrade}'[remove the module but do not run scripts etc.]' \
'(-v --verbose)'{-v,--verbose}'[Increases the level of message output]' \
'(-p --purge)'{-p,--purge}'[Delete all modules that depend on the module(s) being removed as well]' \
'*:module:_lunar_installed_modules' && return 0
}
_lin() {
_arguments \
'(-c --compile)'{-c,--compile}'[Ignore /var/cache/lunar and compiles]' \
'(-d --debug)'{-d,--debug}'[Enables debug messages]' \
'--deps[Configure modules and determine dependencies]' \
'(-f --from)'{-f,--from}'[Specify an alternate for /var/spool/lunar]:directory:_files -/' \
'(-h --help)'{-h,--help}'[Displays help text]' \
'--opts[Add custom configure options to the module]:configure option string' \
'(-p --probe)'{-p,--probe}'[Only lin if not already installed]' \
'(-r --reconfigure)'{-r,--reconfigure}'[Select new dependencies for modules]' \
'(-R --resurrect)'{-R,--resurrect}'[Force to be unpacked from /var/cache/lunar]' \
'(-s --silent)'{-s,--silent}'[Decreases the level of message output]' \
'(-v --verbose)'{-v,--verbose}'[Increases the level of message output]' \
'(-w --want)'{-w,--want}'[Try to install a different version]:wanted version' \
'*:module:_lunar_modules' && return 0
}
# completion for lvu, very similar to the lunar one above (therefore uncommented)
_lvu() {
local suf ret=1 curcontext="$curcontext"
local -a vals state line expl
_arguments -C \
'(- :)-d[Enables debug messages]' \
'(- :)-h[Display help text]' \
'(- :)-v[Increases the level of message output]' \
'*::command:->command' && return 0
if (( CURRENT == 1 )); then
local -a lvu_commands
lvu_commands=(
'what:display a module''s description'
'short:display a module''s short description'
'where:display a module''s section'
'cd:change directory to module and execs a new shell'
'alien:discover untracked files'
'from:discover what installed a given file'
'leafs:display installed modules that have no explicit dependencies on them'
'orphans:display installed modules that are missing dependencies'
'conflicts:display conflicting files'
'held:display held modules'
'exiled:display exiled modules'
'expired:display a list of modules which need an update'
'info:display terse summary information about module'
'search:searches all modules long descriptions for phrase.'
'service:displays modules that provide that service'
'website:display a module''s website'
'install:display an install log'
'size:find and show installed size of a module or ALL (slow)'
'installed:display installed modules/version of module'
'compile:display a compile log'
'compiler:display the compiler version used'
'links:display a list of modules that this module links to'
'sources:display source files for a module'
'urls:display all URLs for a module'
'maintainer:display maintainer for a module'
'version:display version of module in moonbase'
'new:attempt to create a new module from scratch'
'edit:copy a module to zlocal for editing'
'diff:view changes on edited module'
'submit:attempt to submit a module to the lunar ML'
'unedit:delete zlocal copy of a module'
'sum:display checksums'
'md5sum:display md5sums'
'export:make snapshot of box''s configuration.'
'import:restores an exported snapshot.'
'section:display moonbase sections'
'moonbase:display text listing of the moonbase'
'html:display html listing of the moonbase'
'updatelog:display summary log of previous lunar update'
'activity:display main log file'
'newer:display available modules newer than Aug 01, 2003'
'older:display modules installed before Jan 01, 2003'
'voyeur:peak into module compilation'
'pam:display installed modules that are Linux-PAM aware'
'depends:displays installed modules that explicitly or recursively depend on this module.'
'tree:displays a tree of the module''s dependencies'
'stree:same as ''tree'' but highly abbreviated'
'eert:same as ''tree'' but reverse and installed deps only'
'leert:full reverse dependency tree')
_describe -t commands 'lvu command' lvu_commands && ret=0
return ret
elif (( CURRENT == 2 )); then
local -a lvu_no_args
lvu_no_args=( alien leafs orphans conflicts held exiled expired export moonbase html updatelog pam )
curcontext="${curcontext%:*:*}:lvu-$words[1]:"
if (( $+functions[_lvu-$words[1]] )); then
_call_function ret _lvu-$words[1]
elif [[ -n "${lvu_no_args[(r)${words[1]}]}" ]]; then
_message "lvu ${words[1]} requires no arguments"
else
_lunar_modules
fi
return ret
else
_message "No further arguments"
fi
}
_lvu-service() {
_alternative \
'service:service name:_lvu-service-service' \
'port:port number:_guard "[0-9]#" "port number"'
}
_lvu-service-service() {
local vals
vals=( ${(f)"$(cat /etc/services | grep -E -o '^(\w+)' | sort | uniq)"} )
_describe -t modules 'service' vals && return 0
}
_lvu-diff() {
local vals
vals=( /var/lib/lunar/moonbase/zlocal/*(/:t) )
_describe -t modules 'moonbase module from zlocal' vals && return 0
}
_lvu-unedit() {
local vals
vals=( /var/lib/lunar/moonbase/zlocal/*(/:t) )
_describe -t modules 'moonbase module from zlocal' vals && return 0
}
_lvu-newer() {
_message "date string"
}
_lvu-older() {
_message "date string"
}
_lvu-import() {
_files
}
_lvu-from() {
_files
}
_lvu-new() {
_message "module name"
}
_lvu-search() {
_message "search string"
}
# specific completion for moonbase modules
_lunar_modules() {
local vals
vals=( /var/lib/lunar/moonbase/*/*(/:t) )
_describe -t modules 'moonbase module' vals && return 0
}
# specific completion for moonbase modules
_lunar_installed_modules() {
local vals
vals=( ${(f)"$(lvu installed | cut -d':' -f1)"} )
_describe -t modules 'moonbase installed module' vals && return 0
}
# hub function called for completion
_lunar() {
# decide which completion to use
case "$service" in
lin) _lin "$@";;
lrm) _lrm "$@";;
lvu) _lvu "$@";;
lunar) _lunar_comp "$@";;
*) _message "unknown command $service";;
esac
}
_lunar "$@"

49
_lunchy Normal file
View 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

240
_manage.py Normal file
View File

@ -0,0 +1,240 @@
#compdef manage.py
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Django's manage.py (https://www.djangoproject.com).
#
# Source: https://github.com/technolize/zsh-completion-funcs
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * technolize (https://github.com/technolize)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
typeset -ga 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.]'
)
_managepy-adminindex(){
_arguments -s : \
$nul_args \
'*::directory:_directories' && ret=0
}
_managepy-createcachetable(){
_arguments -s : \
$nul_args && ret=0
}
_managepy-dbshell(){
_arguments -s : \
$nul_args && ret=0
}
_managepy-diffsettings(){
_arguments -s : \
$nul_args && ret=0
}
_managepy-dumpdata(){
_arguments -s : \
'--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
'--indent=-[specifies the indent level to use when pretty-printing output.]:' \
$nul_args \
'*::appname:_applist' && ret=0
}
_managepy-flush(){
_arguments -s : \
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
$nul_args && ret=0
}
_managepy-help(){
_arguments -s : \
'*:command:_managepy_cmds' \
$nul_args && ret=0
}
_managepy_cmds(){
local line
local -a cmd
_call_program help-command ./manage.py help \
|& sed -n '/^ /s/[(), ]/ /gp' \
| while read -A line; do cmd=($line $cmd) done
_describe -t managepy-command 'manage.py command' cmd
}
_managepy-inspectdb(){
_arguments -s : \
$nul_args && ret=0
}
_managepy-loaddata(){
_arguments -s : \
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
'*::file:_files' \
$nul_args && ret=0
}
_managepy-reset(){
_arguments -s : \
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
'*::appname:_applist' \
$nul_args && ret=0
}
_managepy-runfcgi(){
local state
local fcgi_opts
fcgi_opts=(
'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
'host[hostname to listen on..]:'
'port[port to listen on.]:'
'socket[UNIX socket to listen on.]::file:_files'
'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
'maxspare[max number of spare processes / threads.]:'
'minspare[min number of spare processes / threads.]:'
'maxchildren[hard limit number of processes / threads.]:'
'daemonize[whether to detach from terminal.]:boolean:(False True)'
'pidfile[write the spawned process-id to this file.]:file:_files'
'workdir[change to this directory when daemonizing.]:directory:_files'
'outlog[write stdout to this file.]:file:_files'
'errlog[write stderr to this file.]:file:_files'
)
_arguments -s : \
$nul_args \
'*: :_values "FCGI Setting" $fcgi_opts' && ret=0
}
_managepy-runserver(){
_arguments -s : \
'--noreload[tells Django to NOT use the auto-reloader.]' \
'--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \
$nul_args && ret=0
}
_managepy-shell(){
_arguments -s : \
'--plain[tells Django to use plain Python, not IPython.]' \
$nul_args && ret=0
}
_managepy-sql(){}
_managepy-sqlall(){}
_managepy-sqlclear(){}
_managepy-sqlcustom(){}
_managepy-sqlflush(){}
_managepy-sqlindexes(){}
_managepy-sqlinitialdata(){}
_managepy-sqlreset(){}
_managepy-sqlsequencereset(){}
_managepy-startapp(){}
_managepy-syncdb() {
_arguments -s : \
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
$nul_args && ret=0
}
_managepy-test() {
_arguments -s : \
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
'*::appname:_applist' \
$nul_args && ret=0
}
_managepy-testserver() {
_arguments -s : \
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
'--addrport=-[port number or ipaddr:port to run the server on.]' \
'*::fixture:_files' \
$nul_args && ret=0
}
_managepy-validate() {
_arguments -s : \
$nul_args && ret=0
}
_managepy-commands() {
local -a commands
commands=(
'adminindex:prints the admin-index template snippet for the given app name(s).'
'createcachetable:creates the table needed to use the SQL cache backend.'
'dbshell:runs the command-line client for the current DATABASE_ENGINE.'
"diffsettings:displays differences between the current settings.py and Django's default settings."
'dumpdata:Output the contents of the database as a fixture of the given format.'
'flush:Executes ``sqlflush`` on the current database.'
'help:manage.py help.'
'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
'loaddata:Installs the named fixture(s) in the database.'
'reset:Executes ``sqlreset`` for the given app(s) in the current database.'
'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
'runserver:Starts a lightweight Web server for development.'
'shell:Runs a Python interactive interpreter.'
'sql:Prints the CREATE TABLE SQL statements for the given app name(s).'
'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).'
'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).'
'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).'
'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.'
'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).'
"sqlinitialdata:RENAMED: see 'sqlcustom'"
'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).'
'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).'
"startapp:Creates a Django app directory structure for the given app name in this project's directory."
"syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.'
'testserver:Runs a development server with data from the given fixture(s).'
'validate:Validates all installed models.'
)
_describe -t commands 'manage.py command' commands && ret=0
}
_applist() {
local line
local -a apps
_call_program help-command "python -c \"import os.path as op, re, settings, sys;\\
bn=op.basename(op.abspath(op.curdir));[sys\\
.stdout.write(str(re.sub(r'^%s\.(.*?)$' %
bn, r'\1', i)) + '\n') for i in settings.\\
INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \
| while read -A line; do apps=($line $apps) done
_values 'Application' $apps && ret=0
}
_managepy() {
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
}
_managepy "$@"

View File

@ -1,9 +1,34 @@
#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 3.x and 4.x (https://maven.apache.org/).
# Completion script for Maven (http://maven.apache.org).
#
# Status: See FIXME and TODO tags.
#
@ -43,58 +68,28 @@
# zstyle ':completion:*:*:mvn:*:warnings' format $'\e[1m -- No matches found --\e[22m'
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
typeset -A opt_args
local context state line
_mvn() {
typeset -A opt_args
local context state line
local curcontext="$curcontext" maven_version excl_opts opts
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=(
"(- : *)"{-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 -b --builder)"{-b,--builder}'[The id of the build strategy to use]'
"($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 -llr --legacy-local-repository)"{-llr,--legacy-local-repository}'[Use Maven 2 Legacy Local Repository behaviour]'
"($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 -gt --global-toolchains)"{-gt,--global-toolchains}'[alternate path for the global toolchains file]:global toolchains file:_mvn_toolchains_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]'
"($excl_opts -ntp --no-transfer-progress)"{-ntp,--no-transfer-progress}'[Do not display transfer progress when downloading or uploading ]'
"*"{-D-,--define}'[define a system property]:property:_mvn_properties'
)
_pick_variant -r maven_version maven4='Maven 4' maven3='Maven 3' maven2='Maven 2' unknown --version
if [[ $maven_version == 'maven4' || $maven_version == 'maven3' ]]; then
opts+=(
"($excl_opts --color)"'--color[defines the color mode of the output. Supported are auto, always, never]: :(never always auto)'
"($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+=(
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]'
@ -102,26 +97,39 @@ _mvn() {
)
fi
if [[ $maven_version == 'maven4' ]]; then
opts+=(
"($excl_opts -canf --cache-artifact-not-found)"{-canf,--cache-artifact-not-found}'[defines caching behaviour for not found artifacts]: :(false true)'
"($excl_opts -fos --fail-on-severity)"{-fos,--fail-on-severity}'[configure which severity of logging should cause the build to fail]: :(WARN ERROR)'
"($excl_opts -itr --ignore-transitive-repositories)"{-itr,--ignore-transitive-repositories}'[if set, Maven will ignore remote repositories introduced by transitive dependencies]'
"($excl_opts --non-interactive)"'--non-interactive[run in non-interactive mode. Alias for --batch-mode]'
"($excl_opts -r --resume)"{-r,--resume}'[resume reactor from the last failed project, using the resume.properties file in the build directory]'
)
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]'
)
opts+=(
_arguments -C \
"(- : *)"{-h,--help}'[display help information]' \
"(- : *)"{-v,--version}'[display version information]' \
"(- : *)"{-emp,--encrypt-master-password}'[encrypt master security password]:master password:_mvn_passwords' \
"(- : *)"{-ep,--encrypt-password}'[encrypt server password]:password:_mvn_passwords' \
"($excl_opts -B --batch-mode)"{-B,--batch-mode}'[run in non-interactive (batch) mode]' \
"($excl_opts -V --show-version)"{-V,--show-version}'[display version information without stopping build]' \
"($excl_opts -q --quiet -X --debug)"{-q,--quiet}'[quiet output, only show errors]' \
"($excl_opts -X --debug -q --quiet)"{-X,--debug}'[produce execution debug output]' \
"($excl_opts -N --non-recursive)"{-N,--non-recursive}'[do not recurse into sub-projects]' \
"($excl_opts -C --strict-checksums -c --lax-checksums)"{-C,--strict-checksums}'[fail the build if checksums don'\''t match]' \
"($excl_opts -c --lax-checksums -C --strict-checksums)"{-c,--lax-checksums}'[warn if checksums don'\''t match]' \
"($excl_opts -e --errors)"{-e,--errors}'[produce execution error messages]' \
"($excl_opts -f --file)"{-f,--file}'[force the use of an alternate POM file]:POM file:_mvn_pom_files' \
"($excl_opts -s --settings)"{-s,--settings}'[alternate path for the user settings file]:settings file:_mvn_settings_files' \
"($excl_opts -gs --global-settings)"{-gs,--global-settings}'[alternate path for the global settings file]:global settings file:_mvn_settings_files' \
"($excl_opts -fae --fail-at-end -ff --fail-fast -fn --fail-never)"{-fae,--fail-at-end}'[only fail the build afterwards, allow all non-impacted builds to continue]' \
"($excl_opts -ff --fail-fast -fae --fail-at-end -fn --fail-never)"{-ff,--fail-fast}'[stop at first failure in reactorized builds]' \
"($excl_opts -fn --fail-never -fae --fail-at-end -ff --fail-fast)"{-fn,--fail-never}'[nerver fail the build, regardless of project result]' \
"($excl_opts)*"{-P,--activate-profiles}'[comma-delimited list of profiles to activate]:profile:_mvn_profiles -s ,' \
"($excl_opts -pl --projects)"{-pl,--projects}'[build specified reactor projects instead of all projects]:project list:_mvn_projects -s ,' \
"($excl_opts -rf --resume-from)"{-rf,--resume-from}'[resume reactor from specified project]:project:_mvn_projects' \
"($excl_opts -o --offline -U --update-snapshots -cpu --check-plugin-updates -up --update-plugins)"{-o,--offline}'[work offline]' \
"($excl_opts -U --update-snapshots -nsu --no-snapshot-updates -o --offline)"{-U,--update-snapshots}'[force a check for updated releases and snapshots on remote repositories]' \
"($excl_opts -nsu --no-snapshot-updates -U --update-snapshots -o --offline)"{-nsu,--no-snapshot-updates}'[Supress SNAPSHOT updates]' \
"*"{-D-,--define}'[define a system property]:property:_mvn_properties' \
"${opts[@]}" \
"($excl_opts)*: :_mvn_args"
)
_arguments -C "$opts[@]"
}
(( $+functions[_mvn_args] )) ||
@ -425,7 +433,6 @@ _mvn_common_property_names() {
'skipTests:skip tests execution'
'maven.test.skip:skip tests compilation and execution'
'gpg.passphrase:gpg passphrase'
'tycho.mode:enable maven mode for Tycho projects to disable p2 resolution'
)
_describe -t 'common-property-names' 'common property name' properties $@
}
@ -469,7 +476,6 @@ _mvn_property_values() {
((#i)*(createChecksum|generatePom|maven.test.skip)*) _wanted booleans expl 'boolean' _mvn_booleans && ret=0;;
((#i)*user*) _wanted users expl 'user' _users && ret=0;; # TODO Use _alternative and add repository usernames from settings + projects
((#i)*plugin*) _wanted plugin expl 'plugin' _mvn_plugins && ret=0;;
((#i)*tycho.mode*) _wanted tychomodes expl 'tychomode' _mvn_tycho_modes && ret=0;;
(*) _default && ret=0;;
esac
return ret
@ -543,14 +549,6 @@ _mvn_booleans() {
}
(( $+functions[_mvn_tycho_modes] )) ||
_mvn_tycho_modes() {
local tychomodes; tychomodes=(
'maven:maven mode, Tycho will not do any p2 dependency resolution'
)
_describe -t tychomodes 'boolean' tychomodes
}
# ------------------------------------------------------------------------------
# Helper functions
# ------------------------------------------------------------------------------
@ -623,11 +621,3 @@ _mvn_profiles_caching_policy() {
}
_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

84
_pear Normal file
View File

@ -0,0 +1,84 @@
#compdef pear
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Pear (http://pear.php.net).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * aki77 (https://github.com/aki77)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_pear () {
local curcontext="$curcontext" state line expl ret=1
_arguments \
'1: :->subcmds' \
'*:: :->args' && ret=0
case $state in
subcmds)
_pear_commands
;;
args)
local cmd args
cmd=$words[1]
args=()
case $cmd in
channel-alias|channel-delete|channel-info|channel-update)
args+=(
':channel:_pear_discovered_channels'
)
;;
uninstall|upgrade|run-scripts)
args+=(
':package:_pear_installed_packages'
)
;;
esac
_arguments "$args[@]" && ret=0
return
;;
esac
return ret
}
_pear_commands () {
local commands
commands=(
${${(f)${"$(_call_program commands $service 2>&1)"#*Commands:}%Usage:*}/[[:blank:]]*[[:blank:]][[:blank:]]/:}
)
_describe -t commands 'Pear commands' commands
}
_pear_installed_packages () {
local packages
packages=(
${${(f)"$(pear list)"#*STATE}%%[[:blank:]]*}
)
_wanted package expl 'package' compadd -a packages
}
_pear_discovered_channels () {
local channels
channels=(
${${${(f)"$(_call_program commands pear list-channels)"#*SUMMARY}%__uri*}%%[[:blank:]]*}
)
_wanted channel expl 'channel' compadd -a channels
}
_pear "$@"

View File

@ -1,6 +1,6 @@
#compdef dad
#compdef periscope
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# 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
@ -28,48 +28,29 @@
# Description
# -----------
#
# Completion script for dad a command line manager of aria2 daemon. (https://github.com/baskerville/diana).
# Completion script for Periscope (http://code.google.com/p/periscope).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_dad() {
typeset -A opt_args
local context state line
local curcontext="$curcontext"
local -a commands=(
"start:Start aria2c daemon"
"stop:Stop aria2c daemon"
)
_arguments -C \
'(- 1 *)'-h"[Show help and exit]" \
"-d[Set download dir]:download_dir:->val" \
"-s[Set secret token]:secret_token:->val" \
"-u[Set aria2c username]:username:->val" \
"-p[Set aria2c password]:password:->val" \
'1:cmd:->cmds' \
'*: : :->args'
case "$state" in
(cmds)
_describe -t commands 'commands' commands
;;
esac
}
_dad
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_arguments \
'(- : *)'{-h,--help}'[show help message and exit]' \
'(- : *)--version[show version number and exit]' \
'*'{-l,--language}'[wanted language]: :_language_codes ISO-639-1' \
'(-f --force)'{-f,--force}'[replace existing subtitle file]' \
'(-q --query)'{-q,--query}'[query to send to the subtitles website]:queries' \
'--list-plugins[list all plugins supported by periscope]' \
'--list-active-plugins[list all plugins used to search subtitles]' \
'--cache-folder[cache/config directory to use]: :_files -/' \
'--quiet[run in quiet mode (only show warn and error messages)]' \
'--debug[set the logging level to debug]' \
'*: :_files'

243
_pgsql_utils Normal file
View File

@ -0,0 +1,243 @@
#compdef psql pg_dump createdb dropdb vacuumdb
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for PostgreSQL utils (http://postgresql.org).
#
# Source: http://www.zsh.org/mla/users/2004/msg01006.html
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Dominic Mitchell <dom+zsh@happygiraffe.net>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_pgsql_get_identity () {
_pgsql_user=${(v)opt_args[(i)-U|--username]}
_pgsql_port=${(v)opt_args[(i)-p|--port]}
_pgsql_host=${(v)opt_args[(i)-h|--host]}
_pgsql_params=(
${_pgsql_user:+"--username=$_pgsql_user"}
${_pgsql_port:+"--port=$_pgsql_port"}
${_pgsql_host:+"--host=$_pgsql_host"}
)
}
# Postgres Allows specifying the path to the directory containing the
# socket as well as a hostname.
_pgsql_host_or_dir() {
_alternative \
'hosts:host:_hosts' \
'directories:directory:_directories'
}
_pgsql_users () {
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
_pgsql_get_identity
# We use _pgsql_port and _pgsql_host directly here instead of
# _pgsql_params so as to not pick up a partially completed
# username.
_pgsql_params=(
${_pgsql_port:+"--port=$_pgsql_port"}
${_pgsql_host:+"--host=$_pgsql_host"}
)
compadd "$@" - ${${(f)~~"$( psql $_pgsql_params[@] -At -c '\du' template1 2>/dev/null )"}[@]%%|*}
}
_pgsql_tables () {
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
_pgsql_get_identity
# Need to pull out the database name from the existing arguments.
# This is going to vary between commands. Thankfully, it's only
# used by pg_dump, which always has the dbname in arg1. If it's
# not present it defaults to ${PGDATABASE:-$LOGNAME}, which
# matches (I think) the PostgreSQL behaviour.
local db
db=${line[1]:-${PGDATABASE:-$LOGNAME}}
# XXX In postgres 7.3 and above, the schema name is in the first
# column. I'm not sure how best to work around that... It really
# needs to be prepended with a "." to the table name.
# Many thanks to Oliver Kiddle for pointing out how to get the 2nd
# column out of this...
compadd "$@" - \
${${${(f)~~"$( psql $_pgsql_params[@] -At -c '\dt' $db 2>/dev/null )"}#*|}%%|*}
}
_pgsql_databases () {
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
_pgsql_get_identity
# Should I grep out template0?
compadd "$@" - ${${(f)~~"$( psql $_pgsql_params[@] -At -l 2>/dev/null )"}[@]%%|*}
}
##
## The actual completion code for the commands
##
_psql () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-V,--version}'[display client version]' \
{-a,--echo-all}'[print commands read]' \
{-A,--no-align}'[unaligned output mode]' \
{-c+,--command=}':execute SQL command:' \
{-d+,--dbname=}':database to connect to:_pgsql_databases' \
{-e,--echo-queries}'[display queries submitted]' \
{-E,--echo-hidden}'[display hidden queries]' \
{-f+,--file=}':SQL file to read:_files' \
{-F+,--field-separator=}':field separator char:' \
{-H,--html}'[HTML output]' \
{-l,--list}'[list databases]' \
{-o+,--output=}':query output:_files' \
{-P+,--pset=}':set psql variable:' \
{-q,--quiet}'[non verbose mode]' \
{-R+,--record-separator=}':record separator char:' \
{-s,--single-step}'[prompt before each query]' \
{-S,--single-line}'[newline sends query]' \
{-t,--tuples-only}'[dont display header/footer]' \
{-T+,--table-attr=}':HTML table options:' \
-u'[prompt for username/password]' \
{-v+,--set=,--variable=}':set SQL variable:' \
{-x,--expanded}'[one column per line]' \
{-X,--no-psqlrc}'[dont read ~/.psqlrc]' \
':PostgreSQL database:_pgsql_databases' \
':PostgreSQL user:_pgsql_users'
}
_pg_dump () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-a,--data-only}'[dump only data]' \
{-b,--blobs}'[dump blobs as well]' \
{-c,--clean}'[include clean cmds in dump]' \
{-C,--create}'[include createdb cmds in dump]' \
{-d,--inserts}'[use INSERT not COPY]' \
{-D,--{attribute,column}-inserts}'[use INSERT (cols) not COPY]' \
{-f+,--file=}':output file:_files' \
{-F+,--format=}':output format:_values "format" "p[plain text]" "t[tar]" "c[custom]"' \
{-i,--ignore-version}'[ignore version mismatch]' \
{-n+,--schema=}':schema to dump:' \
{-o,--oids}'[dump objects identifiers for every table]' \
{-O,--no-owner}'[dont recreate as same owner]' \
{-R,--no-reconnect}'[dont output connect]' \
{-s,--schema-only}'[no data, only schema]' \
{-S+,--superuser=}':superuser name:_pgsql_users' \
{-t+,--table=}':table to dump:_pgsql_tables' \
{-v,--verbose}'[verbose mode]' \
{-V,--version}'[display client version]' \
{-x,--no-{acl,privileges}}'[dont dump ACLs]' \
-X+':option:_values "option" use-set-session-authorization disable-triggers' \
{-Z+,--compress=}':compression level:_values "level" 9 8 7 6 5 4 3 2 1 0' \
':PostgreSQL database:_pgsql_databases'
}
_createdb () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-e,--echo}'[display SQL queries]' \
{-q,--quiet}'[non verbose mode]' \
{-D+,--location=}':database location:_directories' \
{-T+,--template=}':database template:_pgsql_databases' \
{-E+,--encoding=}':database encoding:_values "encoding" $_pgsql_encodings[@]' \
':PostgreSQL database:' \
':comment:'
}
_dropdb () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-e,--echo}'[display SQL queries]' \
{-q,--quiet}'[non verbose mode]' \
{-i,--interactive}'[confirm before drop]' \
':PostgreSQL database:_pgsql_databases'
}
_vacuumdb () {
local curcontext="$curcontext" state line expl
typeset -A opt_args
_arguments -C -s \
"$_pgsql_common_opts[@]" \
{-a,--all}'[vacuum all databases]' \
{-d+,--dbname=}':database to connect to:_pgsql_databases' \
{-t+,--table=}':table to dump:_pgsql_tables' \
{-f,--full}'[do full vacuuming]' \
{-z,--analyze}'[update optimizer hints]' \
{-e,--echo}'[show the commands being sent to the server]' \
{-q,--quiet}'[do not write any messages]' \
{-v,--verbose}'[write a lot of output]' \
'--help[show this help, then exit]' \
'--version[output version information, then exit]' \
'1:PostgreSQL database:_pgsql_databases'
}
_pgsql_utils () {
local _pgsql_common_opts _pgsql_encodings
_pgsql_common_opts=(
{-\?,--help}'[display help]'
{-h+,--host=}':database host:_pgsql_host_or_dir'
# Postgres doesn't like service names here, which is why we
# don't use _ports.
{-p+,--port=}':database port number:'
{-U+,--username=}':connect as user:_pgsql_users'
{-W,--password}'[prompt for password]'
)
# Taken from
# <http://www.postgresql.org/docs/7.4/static/multibyte.html#CHARSET-TABLE>.
# It'd be real nice if postgres could tell us these...
_pgsql_encodings=(
SQL_ASCII
EUC_{JP,CN,KR,TW}
JOHAB
UNICODE
MULE_INTERNAL
LATIN{1,2,3,4,5,6,7,8,9,10}
ISO_8859_{5,6,7,8}
KOI8
WIN
ALT
WIN1256
TCVN
WIN874
)
case "$service" in
psql) _psql "$@" ;;
pg_dump) _pg_dump "$@" ;;
createdb) _createdb "$@" ;;
dropdb) _dropdb "$@" ;;
vacuumdb) _vacuumdb "$@" ;;
esac
}
_pgsql_utils "$@"

119
_pip Normal file
View File

@ -0,0 +1,119 @@
#compdef pip
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for pip (http://pypi.python.org/pypi/pip).
#
# Source: https://github.com/technolize/zsh-completion-funcs
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * technolize (https://github.com/technolize)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local ret=1 state
declare -ga common_ops
common_ops=(
"--version[display version number]"
{-h,--help}"[show help]"
{-E,--environment=}"[virtualenv environment to run pip]:environment:_directories"
{-s,--enable-site-packages}"[include site-packages in virtualenv]"
{-v,--verbose}"[give more output]"
{-q,--quiet}"[give less output]"
"--log=[log file where a complete record will be kept]"
"--proxy=[specify a proxy in the form user:passwd@proxy.server:port]:proxy"
"--timeout=[set the socket timeout (default 15 seconds)]:second"
)
_directories () {
_wanted directories expl directory _path_files -/ "$@" -
}
typeset -A opt_args
_arguments \
':subcommand:->subcommand' \
$common_ops \
'*::options:->options' && ret=0
case $state in
subcommand)
subcommands=(
"bundle:create pybundle"
"freeze:put all currently installed packages"
"help:show available commands"
"install:install packages"
"search:search pypi"
"uninstall:uninstall packages"
"unzip:unzip undividual packages"
"zip:zip dividual packages"
)
_describe -t subcommands 'pip subcommand' subcommands && ret=0
;;
options)
declare -a args
args=(
$common_ops
)
declare -a requirement
requirement=(
{-r,--requirement=}"[install all the packages listed in the given requirements file]:filename"
)
declare -a findlink
findlink=(
{-f,--find-links=}"[URL to look for packages at]:url"
)
case $words[1] in
bundle | install)
args+=(
{-e,--editable=}"[install a package directly from a checkout]:VCS+REPOS_URL[@REV]#egg=PACKAGE"
$requirement
$findlink
{-i,--index-url=,--pypi-url=}"[base URL of Python Package Index]:URL"
"--extra-index-url=[extra URLs of package indexes to use]:URL"
{-b,--build=,--build-dir=}"[unpack packages into DIR]:directory:_directories"
{--src=,--source=}"[check out --editable packages into DIR]:directory:_directories"
{-U,--upgrade}"[upgrade all packages to the newest available version]"
{-I,--ignore-installed}"[ignore the installed packages]"
"--noinstall[download and unpack all packages, but don't actually install them]"
"--install-option=[extra arguments to be supplied to the setup.py install command]"
)
;;
freeze)
args+=(
$requirement
$findlink
)
;;
unzip | zip)
args+=(
"--unzip[unzip a package]"
"--no-pyc[do not include .pyc files in zip files]"
{-l,--list}"[list the packages available, and their zip status]"
"--sort-files[with --list, sort packages according to how many files they contain]"
"--path=[restrict operation to the given paths]:paths"
{-n,--simulate}"[do not actually perform the zip/unzip operation]"
)
;;
esac
_arguments $args && ret=0
;;
esac
return ret

View File

@ -25,7 +25,7 @@
# Description
# -----------
#
# Completion script for pkcon (https://www.freedesktop.org/software/PackageKit/).
# Completion script for pkcon (http://www.packagekit.org).
#
# ------------------------------------------------------------------------------
# Authors
@ -34,10 +34,14 @@
# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local -a command_options
command_options=(
_pkcon() {
local -a options
options=(
'--version[Show the program version and exit]'
'--filter[Set the filter, e.g. installed]'
"--root[Set the install root, e.g. '/' or '/mnt/ltsp']"
@ -48,10 +52,10 @@ command_options=(
'(-c --cache-age)'{-c,--cache-age}"[The maximum metadata cache age. Use -1 for 'never'.]"
'(-h --help)'{-h,--help}'[Show help options.]'
'(-v --verbose)'{-v,--verbose}'[Show debugging information for all files]'
)
)
local -a actions
actions=(
local -a actions
actions=(
'accept-eula'
'get-roles'
'get-distro-upgrades'
@ -82,13 +86,13 @@ actions=(
'repo-set-data'
'what-provides'
'upgrade-system'
)
)
local context state line expl cmd
local -A opt_args
local context state line expl cmd
local -A opt_args
integer i=2
while (( i < $#words )); do
integer i=2
while (( i < $#words )); do
case "$words[$i]" in
-*)
# skip option
@ -103,35 +107,30 @@ while (( i < $#words )); do
(( CURRENT-- ))
fi
(( i++ ))
done
done
if [[ -z "$cmd" ]]
then
_arguments -s -w : $command_options \
if [[ -z "$cmd" ]]
then
_arguments -s -w : $options \
":action:($actions)"
return
fi
fi
case "$cmd" in
case "$cmd" in
search)
_arguments : $command_options \
_arguments : $options \
':type:(name details group file)' \
':data: :'
;;
refresh)
_arguments -s -w : $command_options \
_arguments -s -w : $options \
'--force'
;;
*)
_arguments -s -w : $command_options
_arguments -s -w : $options
;;
esac
return 1
esac
return 1
}
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et
_pkcon "$@"

View File

@ -1,9 +1,34 @@
#compdef play
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Play! framework 1.2.2 (https://www.playframework.com/).
# Completion script for Play! framework 1.2.2 (http://www.playframework.org).
#
# ------------------------------------------------------------------------------
# Authors
@ -13,12 +38,15 @@
# * Mario Fernandez (https://github.com/sirech)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local context curcontext="$curcontext" state line
typeset -A opt_args
_play() {
local context curcontext="$curcontext" state line
typeset -A opt_args
local ret=1
_arguments -C \
@ -36,9 +64,9 @@ _play() {
(dependencies|deps)
_arguments \
'1:: :_play_apps' \
'(--debug)--debug[Debug mode (even more information logged than in verbose mode)]' \
'(--jpda)--jpda[Listen for JPDA connection. The process will be suspended until a client is plugged to the JPDA port.]' \
'(--sync)--sync[Keep lib/ and modules/ directory synced. Delete unknown dependencies.]' \
'(--debug)--debug[Debug mode (even more informations logged than in verbose mode)]' \
'(--jpda)--jpda[Listen for JPDA connection. The process will suspended until a client is plugged to the JPDA port.]' \
'(--sync)--sync[Keep lib/ and modules/ directory synced. Delete unknow dependencies.]' \
'(--verbose)--verbose[Verbose Mode]' \
&& ret=0
;;
@ -180,11 +208,3 @@ _play_colon_dirs_list() {
}
_play "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

102
_port Normal file
View File

@ -0,0 +1,102 @@
#compdef port
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for MacPorts (http://www.macports.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Matt Cable <wozz@wookie.net>
# * Sorin Ionescu <sorin.ionescu@gmail.com>
#
# ------------------------------------------------------------------------------
local subcmds
# Cache the list of ports.
if (( ! $+_port_list )); then
_port_list=($(port echo all; echo "all current active inactive installed uninstalled outdated"))
fi
subcmds=(
'activate'
'archive'
'build'
'cat'
'clean'
'configure'
'contents'
'deactivate'
'dependents'
'deps'
'destroot'
'dir'
'distcheck'
'distclean'
'dmg'
'echo'
'edit'
'extract'
'fetch'
'file'
'help'
'info'
'install'
'installed'
'list'
'livecheck'
'location'
'mpkg'
'outdated'
'patch'
'pkg'
'provides'
'rpmpackage'
'search'
'selfupdate'
'sync'
'test'
'unarchive'
'uninstall'
'upgrade'
'variants'
'version'
)
_arguments -C \
'-v[verbose mode (generate verbose messages)]' \
'-d[debug mode (generate debugging messages)]' \
'-q[quiet mode (suppress messages)]' \
'-D[specify portdir]' \
'-k[keep mode (do not autoclean after install)]' \
'-n[dont follow dependencies in upgrade (only for upgrading)]' \
'-a[upgrade all installed ports (only for upgrading)]' \
'-u[uninstall non-active ports when upgrading and uninstalling]' \
'-f[force mode (ignore state file)]' \
'-s[source-only mode]' \
'-b[binary-only mode]' \
'-o[honor state files older than Portfile]' \
'*::command:->command' \
&& return 0
case "$state" in
(command)
if (( CURRENT == 1 )); then
state='subcommands'
else
state='portname'
fi
;;
esac
case "$state" in
(subcommands)
_describe -t commands 'port commands' subcmds
;;
(portname)
_describe -t commands 'available ports' _port_list
;;
esac

352
_portage Normal file
View File

@ -0,0 +1,352 @@
#compdef emerge ebuild quickpkg emaint env-update portageq repoman tbz2tool
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Portage (Gentoo source packages manager) utils.
# TODO: Entropy (binary portage-compatible packages manager) support.
# (equo, entropy-server, administrative scripts)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Vadim A. Misbakh-Soloviev <mva@mva.name>
# * Bapt <bapt@tuxfamily.org>
# * kaworu <kaworu@kaworu.ch>
# * David Durrleman <dualmoo@gmail.com>
# * oberyno <oberyno@gmail.com>
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
#<sys-apps/portage-2.1.4.4>
# TODO: <sys-apps/portage-2.2_aplha*> (sets, some other candies)
#
# Status:
# emerge (fully done)
# ebuild (fully done)
# emaint (fully done)
# env-update (fully done)
# portageq (fully done)
# repoman (fully done)
# tbz2tool (fully done)
# xpak (nothing todo)
# Stuff for ebuild
_ebuild () {
if (( CURRENT == 2 ));then
_files -g \*.ebuild
elif (( CURRENT > 2 ));then
_values "ebuild command" \
'clean[Cleans the temporary build directory]' \
'help[Show help]' \
'setup[Run all package specific setup actions and exotic system checks]' \
'fetch[Fetch all necessary files]' \
'digest[Creates a digest file for the package]' \
'unpack[Extracts the sources to a subdirectory in the build directory]' \
'compile[Compiles the extracted sources by running the src_compile()]' \
'preinst[Run specific actions that need to be done before installation]' \
'install[Installs the package to the temporary install directory]' \
'postinst[Run specific actions that need to be done after installation]' \
'qmerge[Installs the package to the filesystem]' \
'merge[perform the following actions: fetch, unpack, compile, install and qmerge]' \
'unmerge[Remove the installed files of the packages]' \
'prerm[Run specific actions that need to be executed before unmerge]' \
'postrm[Run specific actions that need to be executed after unmerge]' \
'config[Run specific actions needed to be executed after the emerge process has completed]' \
'package[This command is a lot like the merge command, but creates a .tbz2 package instead of installing]' \
'manifest[Updates the manifest file for the package]' \
'rpm[Builds a RedHat RPM package]'
fi
}
# Stuff for quickpkg
_quickpkg () {
if compset -P '(\\|)(>=|<=|<|>|=)'; then
_arguments -s \
'*:installed package:_gentoo_packages installed_versions'
elif compset -P '(\\|)[/]'; then
_path_files -W / -/
else
_arguments \
'*:installed package:_gentoo_packages installed'
fi
}
# Stuff for emerge
_emerge () {
local nopkg_opts all noask_opts bopts install_args common_args profiles
noask_opts=(-p -a --pretend --ask --regen --info --search -s --searchdesc \
-S --version -V --help -h --metadata)
nopkg_opts=(--resume --skipfirst -c --clean -h --help --depclean --info \
--metadata -P --prune --regen -s --search -S --searchdesc --sync -C \
--unmerge -V --version -i --inject)
bopts=($nopkg_opts -b --buildpkg -B --buildpkgonly -G --getbinpkgonly -g \
--getbinpkg -k --usepkg -K --usepkgonly --fetch-all-uri -f -F --fetchonly)
all=($bopts -l --changelog --columns --deep -D --emptytree -e --newuse \
--noconfmem --nodeps -O --noreplace -n --oneshot -1 -o --onlydeps --tree -t \
-u --update -U --upgradeonly)
common_args=(
"($noask_opts --sync)"{-p,--pretend}'[Simply display what would be done]'
"($noask_opts)"{-a,--ask}'[Ask what would be done]'
'(-d --debug --help -h --version -V)'{-d,--debug}'[Tells emerge to run the emerge command in debug mode]'
'(--quiet -q --verbose -v)'{-q,--quiet}'[General outcome is a reduced or condensed output]'
'(--verbose -v --quiet -q)'{-v,--verbose}'[Tell emerge to run in verbose mode]'
'--nospinner[Disables the spinner for the session]'
)
install_args=(
"($bopts)"{-b,--buildpkg}'[Tells emerge to build binary packages]'
"($bopts)"{-B,--buildpkgonly}'[Tells emerge to only build binary packages]'
"($nopkg_opts --emptytree -e -l --changelog --usepkgonly -K)"{-l,--changelog}'[This will show the ChangeLog]'
"($nopkg_opts -t --tree)--columns[Displays versions in aligned format]"
"($nopkg_opts -D --deep)"{-D,--deep}'[Consider the entire dependency tree of packages]'
"($nopkg_opts -e -l --changelog --emptytree)"{-e,--emptytree}'[Only consider glibc as installed packages]'
"($all --nospinner --pretend -p)"{-i,--inject}'[Portage thinks that this package is installed]'
"($nopkg_opts $bopts)"{-f,--fetchonly}'[Just perform fetches for all packages]'
"($nopkg_opts $bopts)"{-F,--fetch-all-uri}'[Fetch all possible files for all packages]'
"($bopts)"{-g,--getbinpkg}'[Tells emerge to download binary package]'
"($bopts)"{-G,--getbinpkgonly}'[As --getbinpkg, but does not use local info]'
"($nopkg_opts)--noconfmem[Causes portage to disregard merge records]"
"($nopkg_opts -O --nodeps)"{-O,--nodeps}'[Merges specified packages without merging dependencies]'
"($nopkg_opts -n --noreplace)"{-n,--noreplace}'[Skip packages already installed]'
"($nopkg_opts)"{-1,--oneshot}'[Do not add package to the world profile]'
"($nopkg_opts --onlydeps -o)"{-o,--onlydeps}'[Only merge (or pretend to merge) the dependencies]'
"($nopkg_opts --columns -t --tree)"{-t,--tree}'[Show dependency tree]'
"($nopkg_opts --update -u)"{-u,--update}'[Updates packages to the most recent version available]'
"($nopkg_opts --upgradeonly -U)"{-U,--upgradeonly}'[Do not update packages to a lower version]'
"($bopts)"{-k,--usepkg}'[Tells emerge to use binary packages if available]'
"($bopts --changelog -l)"{-K,--usepkgonly}'[Tells emerge to use binary packages only]'
"($all)"{-c,--clean}'[Cleans the system by removing packages]'
'(: -)'{-h,--help}'[Displays help]:subject:(sync config system)'
"(: $all)--depclean[Clean all packages that have no reason for being installed]"
"(: $all $noask_opts --nospinner --quiet -q)--info[This is a list of information to include in bug reports]"
'(: -)--metadata[Generate metadata]'
"($nopkg_opts --usepkgonly -K)--newuse[Include installed packages which have changed USE flags]"
"($all)"{-P,--prune}'[Removes all but the latest versions of matching packages]'
"(: $all $noask_opts --verbose -v)--regen[Causes portage to check and update the dependency cache]"
"(: $all $noask_opts --verbose -v)"{-s,--search}'[Searches for matches]'
"(: $all $noask_opts --verbose -v)"{-S,--searchdesc}'[Matches the seachdesc string against the description field]'
"(: $all --pretend -p)--sync[Initiates a portage tree update]"
"($all)"{-C,--unmerge}'[Removes all matching packages]'
'(: -)'{-V,--version}'[Display version info]'
"(: $all[3,-1])--resume[Resumes the last merge operation]"
"(: $all[3,-1])--skipfirst[Removes the first package in the resume list]"
)
profiles=(
'world[All packages in the world profile]'
'system[All packages in the system profile]'
)
# Dispatch
if (( $words[(I)(--(unmerge|clean|prune)|-[[:alpha:]]#(C|c|P)[[:alpha:]]#)] )) ; then
if compset -P '(\\|)(>=|<=|<|>|=)'; then
_arguments -s \
'*:installed package:_gentoo_packages installed_versions' && return 0
else
_arguments -s \
"$common_args[@]" "$install_args[@]" \
"*:installed package:_gentoo_packages installed" && return 0
fi
elif (( $words[(I)(world|system)] )) ; then
_arguments -s \
"$common_args[@]" "$install_args[@]" \
"($nopkg_opts[1,-2] --inject -i --oneshot -1):" && return 0
elif (( $words[(I)(--usepkgonly|-[[:alnum:]]#K[[:alnum:]]#)] )) ; then
_arguments -s \
"$common_args[@]" "$install_args[@]" \
'*:binary package:_gentoo_packages binary' && return 0
elif [[ $words[-3] == (--help|-h) ]] ; then
_message "No more arguments" && return 0
else
if compset -P '(\\|)(>=|<=|<|>|=)'; then
_arguments \
"*:portage:_gentoo_packages available_versions" && return 0
elif (( $words[(I)(--inject|-i)] )) ; then
_arguments -s \
"$common_args[@]" "$install_args[@]" \
"*:portage:_gentoo_packages available_versions" && return 0
else
_arguments -s \
"$common_args[@]" "$install_args[@]" \
"($nopkg_opts)::portage: _values 'profile' \$profiles[@] " \
"($nopkg_opts)::portage:_gentoo_packages sets " \
"($nopkg_opts)*:portage:_gentoo_packages available" && return 0
fi
fi
}
_emaint () {
_arguments -s \
'(: -)'{-h,--help}'[show help message and exit]' \
'(: -)'--version"[show program's version number and exit]" \
'(-c --check -f --fix)'{-c,--check}"[Check for any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))" \
'(-c --check -f --fix)'{-f,--fix}"[Fix any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))"
}
_env-update () {
_arguments -s '(: -)--no-ldconfig[Do not run ldconfig]'
}
_portageq () {
local action
action="$words[2]"
if (( CURRENT == 2 )); then
_values 'command' \
'--help[Show help]' \
'config_protect_mask[Returns the CONFIG_PROTECT_MASK paths]' \
'config_protect[Returns the CONFIG_PROTECT paths]' \
'portdir[Returns PORTDIR paths]' \
'contents[List the files that are installed for a given package]' \
'vdb_path[Returns the path used for the var(installed) package database]' \
'gentoo_mirrors[Returns the mirrors set to use in the portage configuration]' \
'exithandler[MISSING DOCUMENTATION!]' \
'all_best_visible[Returns all best_visible packages (without .ebuild)]' \
'match[Returns a \n separated list of category/package-version]' \
'metadata[Returns metadata values for the specified package]' \
'best_visible[Returns category/package-version (without .ebuild)]' \
'mass_best_visible[Returns category/package-version (without .ebuild)]' \
"has_version[Return code 0 if it's available, 1 otherwise]" \
'envvar[Returns a specific environment variable as exists prior to ebuild.sh]' \
'pkgdir[Returns the PKGDIR path]' \
'best_version[Returns category/package-version (without .ebuild)]' \
'mass_best_version[Returns category/package-version (without .ebuild)]' \
'portdir_overlay[Returns the PORTDIR_OVERLAY path]' \
'distdir[Returns the DISTDIR path]' \
'owners[print the packages that own the files and which files belong to each package]'
elif (( CURRENT == 3 )); then
if [[ "$action" =~ (contents|(all_|mass_|)best_visible|match|metadata|(has|best)_version|owners|mass_best_version) ]]; then
_arguments -s '*:root:_files'
fi
elif (( CURRENT > 3 )); then
if [[ "$action" =~ ((mass_|)best_(visible|version)|has_version) ]]; then
_arguments -s '*:package:_gentoo_packages available'
elif [[ "$action" == owners ]]; then
_arguments -s '*:root:_files'
fi
fi
}
_repoman () {
local previous
previous="$words[CURRENT-1]"
_arguments -s \
'(--force)'--force'[Force commit to proceed, regardless of QA issues]' \
'(-q --quiet -v --verbose)'{-q,--quiet}'[Be less verbose about extraneous info]' \
'(-p --pretend -m --commitmsg -M --commitmsgfile)'{-p,--pretend}'[Dont commit or fix anything; just show what would be done]' \
'(-i --include-masked)'{-i,--include-masked}'[Include masked packages in scans at category or tree level]' \
'(-x --xmlparse)'{-x,--xmlparse}'[Forces the metadata.xml parse check to be carried out]' \
'(-q --quiet -v --verbose)'{-v,--verbose}'[Displays every package name while checking]' \
'(-I --ignore-arches)'{-I,--ignore-arches}'[Ignore arch-specific failures (where arch != host)]' \
'(-m --commitmsg -M --commitmsgfile)'{-m,--commitmsg}'[Adds a commit message via the command line]:message:' \
'(-m --commitmsg -M --commitmsgfile)'{-M,--commitmsgfile}'[Adds a commit message from the specified file]:commit_file:_files' \
'(: -)'{-V,--version}'[Show version info]' \
'(: -)'{-h,--help}'[Show this screen]'
# if we don't have an option that cancel action, or if we don't already have an action.
if ! [[ "$previous" =~ (-h|-V|-m|-M|--version|--help|--commitmsg|--commitmsgfile) ]] &&
! (( $words[(I)(full|last|help|scan|fix|lfull|manifest|commit)] )); then
_values 'action' \
'full[Scan directory tree for QA issues (full listing)]' \
'last[Remember report from last run]' \
'help[Show this screen]' \
'scan[Scan directory tree for QA issues (short listing)]' \
'fix[Fix simple QA issues (stray digests, missing digests)]' \
'lfull[Remember report from last run (full listing)]' \
'manifest[Generate a Manifest (fetches files if necessary)]' \
'commit[Scan directory tree for QA issues; if OK, commit via cvs]'
fi
}
_tbz2tool () {
if (( CURRENT == 2 )); then
_values 'action' 'join' 'split'
elif (( CURRENT > 2 )) && (( CURRENT < 6 )); then
_arguments -s '*:file:_files'
fi
}
zparseopts -D -E -A Args -- -emerge
if (( ${+Args[--emerge]} ));then
_emerge "$@" && return 0
fi
case "$service" in
emerge)
_emerge "$@" && return 0
;;
ebuild)
_ebuild "$@" && return 0
;;
quickpkg)
_quickpkg "$@" && return 0
;;
emaint)
_emaint "$@" && return 0
;;
env-update)
_env-update "$@" && return 0
;;
portageq)
_portageq "$@" && return 0
;;
repoman)
_repoman "$@" && return 0
;;
tbz2tool)
_tbz2tool "$@" && return 0
;;
esac

189
_portage_utils Normal file
View File

@ -0,0 +1,189 @@
#compdef qatom qcheck qdepends qfile qgrep qcache qlist qlop qsearch qsize quse qtbz2 qpkg qxpak
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Portage Utils (small and faster portage helper tools,
# writen in C, partially — Gentoolkit analog).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Vadim A. Misbakh-Soloviev <mva@mva.name>
# * Bapt <bapt@tuxfamily.org>
# * kaworu <kaworu@kaworu.ch>
# * David Durrleman <dualmoo@gmail.com>
# * oberyno <oberyno@gmail.com>
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
#<app-portage/portage-utils-0.19>
#
local common_args PORTDIR
var=PORTDIR
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.globals ]] &&
local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
common_args=(
{'(--verbose)-v','(-v)--verbose'}'[Make a lot of noise]' \
{'(--quiet)-q','(-q)--quiet'}'[Tighter output; suppress warnings]' \
{'(--nocolor)-C','(-C)--nocolor'}'[Do not output color]' \
{'(--help)-h','(-h)--help'}'[Print this help and exit]' \
{'(--version)-V','(-V)--version'}'[Print version and exit]' \
)
case $service in
qcheck)
_arguments -s $common_args \
{'(--all)-a','(-a)--all'}'[List all packages]' \
{'(--update)-u','(-u)--update'}'[Update chksum and mtimes for packages]' \
'*:packages:_gentoo_packages installed'
;;
qdepends)
_arguments -s $common_args \
{'(--depend)-d','(-d)--depend'}'[Show DEPEND info (default)]' \
{'(--rdepend)-r','(-r)--rdepend'}'[Show RDEPEND info]' \
{'(--pdepend)-p','(-p)--pdepend'}'[Show PDEPEND info]' \
{'(--key)-k','(-k)--key'}'[User defined vdb key]' \
{'(--query)-Q','(-Q)--query'}'[Query reverse deps]' \
{'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
{'(--all)-a','(-a)--all'}'[Show all DEPEND info]' \
'*:packages:_gentoo_packages installed'
;;
qfile)
_arguments -s $common_args \
{'(--exact)-e','(-e)--exact'}'[Exact match]' \
'*:filename:_files'
;;
qgrep)
_arguments -s $common_args \
{'(--invert-match)-I','(-I)--invert-match'}'[Select non-matching lines]' \
{'(--ignore-case)-i','(-i)--ignore-case'}'[Ignore case distinctions]' \
{'(--with-filename)-H','(-H)--with-filename'}'[Print the filename for each match]' \
{'(--count)-c','(-c)--count'}'[Only print a count of matching lines per FILE]' \
{'(--regexp)-e','(-e)--regexp'}'[Use PATTERN as a regular expression]' \
'*:pattern::'
;;
qcache)
local arches allarches arch
show_archs(){
arches=(${(f)"$(<$PORTDIR/profiles/arch.list)"})
allarches=($archs)
for arch in $arches;do
allarches=($allarches $arch)
done
_describe -t available-arches "arch" allarches
}
_arguments -s $common_args \
'*:arch:show_archs'
;;
qlist)
_arguments -s $common_args \
{'(--installed)-I','(-I)--installed'}'[Just show installed packages]' \
{'(--slots)-S','(-S)--slots'}'[Display installed packages with slots]' \
{'(--umap)-U','(-U)--umap'}'[Display installed packages with flags used]' \
{'(--dups)-D','(-D)--dups'}'[Only show package dups]' \
{'(--exact)-e','(-e)--exact'}'[Exact match (only CAT/PN or PN without PV)]' \
{'(--all)-a','(-a)--all'}'[Show every installed package]' \
{'(--dir)-d','(-d)--dir'}'[Only show directories]' \
{'(--obj)-o','(-o)--obj'}'[Only show objects]' \
{'(--sym)-s','(-s)--sy'}'[Only show symlinks]' \
'*:packages:_gentoo_packages installed'
;;
qlop)
_arguments -s $common_args \
{'(--guage)-g','(-g)--guage'}'[Guage number of times a package has been merged]' \
{'(--time)-t','(-t)--time'}'[Calculate merge time for a specific package]' \
{'(--human)-H','(-H)--human'}'[Print seconds in human readable format (needs -t)]' \
{'(--list)-l','(-l)--list'}'[Show merge history]' \
{'(--unlist)-u','(-u)--unlist'}'[Show unmerge history]' \
{'(--sync)-s','(-s)--sync'}'[Show sync history]' \
{'(--current)-c','(-c)--current'}'[Show current emerging packages]' \
{'(--logfile)-f','(-f)--logfile'}'[Read emerge logfile instead of /var/log/emerge.log]:log:_files' \
'*:packages:_gentoo_packages available'
;;
qsearch)
_arguments -s $common_args \
{'(--all)-a','(-a)--all'}'[List the descriptions of every package in the cache]' \
{'(--cache)-c','(-c)--cache'}'[Use the portage cache]' \
{'(--search)-s','(-s)--search'}'[Regex search package basenames]' \
{'(--desc)-S','(-S)--desc'}'[Regex search package descriptions]' \
{'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
{'(--homepage)-H','(-H)--homepage'}'[Show homepage info]' \
'*:pattern::'
;;
qsize)
_arguments -s $common_args \
{'(--filesystem)-f','(-f)--filesystem'}'[Show size used on disk]' \
{'(--all)-a','(-a)--all'}'[Size all installed packages]' \
{'(--sum)-s','(-s)--sum'}'[Include a summary]' \
{'(--sum-only)-S','(-S)--sum-only'}'[Show just the summary]' \
{'(--megabyte)-m','(-m)--megabyte'}'[Display size in megabytes]' \
{'(--kilobyte)-k','(-k)--kilobyte'}'[Display size in kilobytes]' \
{'(--byte)-b','(-b)--byte'}'[Display size in bytes]' \
'*:packages:_gentoo_packages installed'
;;
quse)
_arguments -s $common_args \
{'(--exact)-e','(-e)--exact'}'[Show exact non regexp matching using strcmp]' \
{'(--all)-a','(-a)--all'}'[Show annoying things in IUSE]' \
{'(--keywords)-K','(-K)--keywords'}'[Use the KEYWORDS vs IUSE]' \
{'(--license)-L','(-L)--license'}'[Use the LICENSE vs IUSE]' \
{'(--describe)-D','(-D)--describe'}'[Describe the USE flag]' \
{'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
'*:use flag:_gentoo_packages useflag'
;;
qtbz2)
_arguments -s $common_args \
{'(--join -s --split -t --tarbz2 -x --xpak)-j','(-t --tarbz2 -j -s --split -x --xpak)--join'}'[Join tar.bz2 + xpak into a tbz2]:*:tar.bz2 file and xpak file:_files -g \*.\(tar.bz2\|xpak\)' \
{'(--join -j --split -t --tarbz2 -x --xpak)-s','(-t --tarbz2 -j --join -s -x --xpak)--split'}'[Split a tbz2 into a tar.bz2 + xpak]:tbz2 file:_files -g \*.tbz2' \
{'(--join -j -s --split --tarbz2 -x --xpak)-t','(--join -j -s --split -t -x --xpak)--tarbz2'}'[Just split the tar.bz2]:tbz2 file:_files -g \*.tbz2' \
{'(--join -j -s --split -t --tarbz2 --xpak)-x','(--join -j -s --split -t --tarbz2 -x)--xpak'}'[Just split the xpak]:tbz2 file:_files -g \*.tbz2' \
{'(--stdout)-O','(-O)--stdout'}'[Write files to stdout]'
;;
qpkg)
_arguments -s $common_args \
{'(--pretend)-p','(-p)--pretend'}'[pretend only]' \
{'(--pkgdir)-P','(-P)--pkgdir'}'[alternate package directory]:alternate pkgdir:_files -/' \
'*:Installed packages:_gentoo_packages installed_versions'
;;
qxpak)
_arguments -s $common_args \
{'(--list --extract -x --create -c)-l','(-l --extract -x --create -c)--list'}'[List the contents of an archive]:xpak archive:_files -g \*.xpak' \
{'(--list -l --extract --create -c)-x','(--list -l -x --create -c)--extract'}'[Extract the contents of an archive]:xpak archive:_files -g \*.xpak' \
{'(--list -l --extract -x --create)-c','(--list -l --extract -x -c)--create'}'[Create an archive of a directory/files]:*:archive name and files to archive:_files' \
{'(--dir)-d','(-d)--dir'}'[Change to specified directory]:directory:_files -/' \
{'(--stdout)-O','(-O)--stdout'}'[Write files to stdout]'
;;
esac

View File

@ -1,32 +1,11 @@
#compdef redis-cli rec
# ------------------------------------------------------------------------------
# Copyright (c) 2009-2015 Robby Russell and contributors (see
# https://github.com/ohmyzsh/ohmyzsh/graphs/contributors)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Redis (https://redis.io/).
# Completion script for Redis (http://redis.io).
#
# Source: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/redis-cli
# Source: https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/redis-cli
#
# ------------------------------------------------------------------------------
# Authors
@ -35,12 +14,17 @@
# * Alexandru Totolici (https://github.com/totolici)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local -a redis_commands=(
local -a _1st_arguments
_1st_arguments=(
'append:append a value to a key'
'auth:authenticate to the server'
'bgrewriteeaof:asynchronously rewrite the append-only file'
'bgsave:asynchronously save the dataset to disk'
'bgsave:asynchornously save the dataset to disk'
'blpop:remove and get the first element in a list, or block until one is available'
'brpop:remove and get the last element in a list, or block until one is available'
'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available'
@ -51,7 +35,7 @@ local -a redis_commands=(
# 'debug object:get debugging information about a key'
# 'debug setgfault:make the server crash'
'decr:decrement the integer value of a key by one'
'decrby:decrement the integer value of a key by the given number'
'decrby:decrement the integet value of a key by the given number'
'del:delete a key'
'discard:discard all commands issued after MULTI'
'echo:echo the given string'
@ -95,8 +79,8 @@ local -a redis_commands=(
'mget:get the values of all the given keys'
'monitor:listen for all requests received by the server in real time'
'move:move a key to another database'
'mset:set multiple keys to multiple values'
'msetnx:set multiple keys to multiple values, only if none of the keys exist'
'mset:set multiple keys to muliple values'
'msetnx:set multiple keys tom ultiple values, only if none of the keys exist'
'multi:mark the start of a transaction block'
'object:inspect the internals of Redis objects'
'persist:remove the expiration from a key'
@ -154,23 +138,21 @@ local -a redis_commands=(
'zrem:remove a member from a sorted set'
'zremrangebyrank:remove all members in a sorted set within the given indexes'
'zremrangebyscore:remove all members in a sorted set within the given scores'
'zrevrange:return a range of members in a sorted set, by index, with scores ordered from high to low'
'zrevrange:return a range of membrs in a sorted set, by index, with scores ordered from high to low'
'zrevrangebyscore:return a range of members in a sorted set, by score, with scores ordered from high to low'
'zrevrank:determine the index of a member in a sorted set, with scores ordered from high to low'
'zscore:get the score associated with the given member in a sorted set'
'zunionstore:add multiple sorted sets and store the resulting sorted set in a new key'
'zunionstore:add multiple sorted sets and store te resulting sorted set in a new key'
)
local expl
_arguments \
'(-v --version)'{-v,--version}'[show version]' \
'(-h --help)'{-h,--help}'[show help]' \
'1::command:{ _describe -t commands "redis-cli subcommand" redis_commands }' \
&& return 0
'*:: :->subcmds' && return 0
# 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
if (( CURRENT == 1 )); then
_describe -t commands "redis-cli subcommand" _1st_arguments
return
fi

118
_rvm Normal file
View File

@ -0,0 +1,118 @@
#compdef rvm
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for rvm (https://rvm.beginrescueend.com/).
#
# Source: https://github.com/wayneeseguin/rvm/blob/master/scripts/zsh/Completion/_rvm
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Bruno Michel (https://github.com/nono)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line cmds ret=1
_arguments -C \
'(- 1 *)'{-v,--version}'[display version information]' \
'(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \
'(--prefix)--prefix[path for all rvm files (~/.rvm/), with trailing slash!]:path:_files' \
'(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \
'(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \
'(--archives)--archives[directory for downladed files (~/.rvm/archives/)]:path:_files' \
'-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \
'-e[Execute code from the command line]:code' \
'(-G)-G[root gem path to use]:path:_files' \
'(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \
'(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \
'(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \
'(-C|--configure)'{-C,--configure}'=[custom configure options]' \
'(--nice)--nice[process niceness (for slow computers, default 0)]:number' \
'(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \
'(--head)--head[with update, updates rvm to git head version]' \
'(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \
'(--default)--default[with ruby select, sets a default ruby for new shells]' \
'(--debug)--debug[Toggle debug mode on for very verbose output]' \
'(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \
'(--force)--force[Force install, removes old install & source before install]' \
'(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \
'(--latest)--latest[with gemset --dump skips version strings for latest gem]' \
'(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \
'(--docs)--docs[with install, attempt to generate ri after installation]' \
'(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \
'1: :->cmds' \
'*: :->args' && ret=0
case $state in
cmds)
cmds=( ${(f)"$(_call_program commands rvm help 2> /dev/null | sed -e '/^== Action/,/^== Implementation/!d; / - /!d; s/^[ *]*\([^ ]*\) *\- *\(.*\)/\1:\2/')"} )
cmds+=( $(rvm list strings) )
_describe -t commands 'rvm command' cmds && ret=0
;;
args)
case $line[1] in
(use|uninstall|remove|list)
if (( CURRENT == 3 )); then
# See if weve made it to the @; eg, 1.9.2@
if ! \grep -q '@' <<< "${line[CURRENT-1]}" ; then
_values -S , 'rubies' \
$(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') \
default system $(rvm alias list | cut -d' ' -f1) && ret=0
else
# Construct a full version string for each of the gemsets.
# Eg, 1.9.2@min 1.9.2@rail3 …
_values -S , 'gemsets' \
$(rvm ${line[CURRENT-1]%%@*} gemset list | awk '/^[ -_[:alnum:]]+$/ {print "'${line[CURRENT-1]%%@*}'@"$1}')
fi
fi
;;
(install|fetch)
_values -S , 'rubies' $(rvm list known_strings) && ret=0
;;
gemset)
if (( CURRENT == 3 )); then
_values 'gemset_commands' $(rvm gemset | sed -e '/create/!d; s/^.*[{]\(.*\)[}].*$/\1/; s/,/ /g')
else
#_values -S , 'gemsets' $(rvm gemset list | \grep -v gemset 2>/dev/null)
_values -S , 'gemsets' $(rvm gemset list | \grep -Ev '(gemset|info)' 2>/dev/null | awk '/^[ -_[:alnum:]]+$/ {print '$1'}')
fi
ret=0
;;
package)
if (( CURRENT == 3 )); then
_values 'package_commands' $(rvm package | sed -e '/Usage/!d; s/^.*[{]\(.*\)[}] [{].*$/\1/; s/,/ /g')
else
_values 'packages' $(rvm package | sed -e '/Usage/!d; s/^.*[}] [{]\(.*\)[}].*$/\1/; s/,/ /g')
fi
ret=0
;;
*)
(( ret )) && _message 'no more arguments'
;;
esac
;;
esac
return ret

View File

@ -1,6 +1,6 @@
#compdef exportfs
#compdef sbt
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users
# 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
@ -28,24 +28,22 @@
# Description
# -----------
#
# Completion script for nfs's exportfs - maintain table of exported NFS file systems.
# Completion script for sbt 0.10+ (https://github.com/harrah/xsbt).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Timofey Titovets <nefelim4ag@gmail.com>
# * Tony Sloane <inkytonik@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]'
function _tasks () {
compadd clean compile console console-project console-quick doc package \
package-doc package-src publish publish-local run run-main test test-only \
test:compile test:package test:package-doc test:package-src update
}
_exportfs "$@"
_arguments "*:task:_tasks"
return 0

208
_scala Normal file
View File

@ -0,0 +1,208 @@
#compdef scala scalac
# ------------------------------------------------------------------------------
# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for scala and scalac (http://www.scala-lang.org/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Tony Sloane <inkytonik@gmail.com>
#
# ------------------------------------------------------------------------------
typeset -A opt_args
local context state line
function phases () {
compadd "parser" "namer" "packageobjects" "typer" "superaccessors" \
"pickler" "refchecks" "selectiveanf" "liftcode" "selectivecps" "uncurry" \
"tailcalls" "specialize" "explicitouter" "erasure" "lazyvals" "lambdalift" \
"constructors" "flatten" "mixin" "cleanup" "icode" "inliner" "closelim" \
"dce" "jvm" "terminal"
}
shared_opts=(
"-bootclasspath+[Override location of bootstrap class files]:bootstrap class directory:_files -/"
"-classpath+[Specify where to find user class files]:directory:_files -/"
"-D-[Pass -Dproperty=value directly to the runtime system]"
"-d+[Destination for generated classfiles]: directory or jar file:_files"
"-dependencyfile+[Set dependency tracking file]:dependency tracking file:_files"
"-deprecation[Emit warning and location for usages of deprecated APIs]"
"-encoding+[Specify character encoding used by source files]:encoding:"
"-explaintypes[Explain type errors in more detail]"
"-extdirs+[Override location of installed extensions]:extensions directory:_files -/"
"-g\:-[Set level of generated debugging info (default\: vars)]:debugging info level:(none source line vars notailcalls)"
"-help[Print a synopsis of standard options]"
"-J-[pass argument directly to Java runtime system]:JVM argument:"
"-javabootclasspath+[Override java boot classpath]:Java boot class path directory]:_files -/"
"-javaextdirs+[Override java extdirs classpath]:Java extdirs directory:_files -/"
"-no-specialization[Ignore @specialize annotations]"
"-nobootcp[Do not use the boot classpath for the scala jars]"
"-nowarn[Generate no warnings]"
"-optimise[Generate faster bytecode by applying optimisations to the program]"
"-P\:-[Pass an option to a plugin (written <plugin>:<opt>)]"
"-print[Print program with Scala-specific features removed]"
"-sourcepath+[Specify location(s) of source files]:source file directory:_files -/"
"-target\:-[Target platform for object files (default\: jvm-1.5)]:platform name:(jvm-1.5 msil)"
"-toolcp+[Add to the runner classpath]:directory:_files -/"
"-unchecked[Enable detailed unchecked (erasure) warnings]"
"-uniqid[Uniquely tag all identifiers in debugging output]"
"-usejavacp[Utilize the java.class.path in classpath resolution]"
"-verbose[Output messages about what the compiler is doing]"
"-version[Print product version and exit]"
"-X[Print a synopsis of advanced options]"
"-Y[Print a synopsis of private options]"
)
X_opts=(
"-Xcheck-null[Warn upon selection of nullable reference]"
"-Xcheckinit[Wrap field accessors to throw an exception on uninitialized access]"
"-Xdisable-assertions[Generate no assertions or assumptions]"
"-Xelide-below+[Calls to @elidable methods are omitted if method priority is lower than integer argument]"
"-Xexperimental[Enable experimental extensions]"
"-Xfatal-warnings[Fail the compilation if there are any warnings]"
"-Xfuture[Turn on future language features]"
"-Xgenerate-phase-graph+[Generate the phase graphs (outputs .dot files) to fileX.dot]:output file:_files"
"-Xlint[Enable recommended additional warnings]"
"-Xlog-implicits[Show more detail on why some implicits are not applicable]"
"-Xmax-classfile-name+[Maximum filename length for generated classes]"
"-Xmigration[Warn about constructs whose behavior may have changed]"
"-Xno-forwarders[Do not generate static forwarders in mirror classes]"
"-Xno-uescape[Disable handling of \u unicode escapes]"
"-Xnojline[Do not use JLine for editing]"
"-Xprint\:-[Print out program after <phase>]:phase name:phases"
"-Xprint-icode[Log internal icode to *.icode files]"
"-Xprint-pos[Print tree positions, as offsets]"
"-Xprint-types[Print tree types (debugging option)]"
"-Xprompt[Display a prompt after each error (debugging option)]"
"-Xresident[Compiler stays resident: read source filenames from standard input]"
"-Xscript+[Treat the source file as a script and wrap it in a main method]:main object name"
"-Xshow-class+[Show internal representation of class]:class name"
"-Xshow-object+[Show internal representation of object]:object name"
"-Xshow-phases[Print a synopsis of compiler phases]"
"-Xsource-reader+[Specify a class name for a custom method of reading source files]:class name"
"-Xverify[Verify generic signatures in generated bytecode]"
"-Xassem-extdirs+[List of directories containing assemblies (requires -target:msil) (default\: lib)]:assembly directory:_files -/"
"-Xassem-name+[Name of the output assembly (requires -target:msil)]:assembly name:_files"
"-Xassem-path+[List of assemblies referenced by the program (requires -target:msil)]:assembly path:_files"
"-Xsourcedir+[Mirror source folder structure in output directory (requires -target:msil)]:source directory:_files -/".
"-Xplugin\:-[Load one or more plugins from file]:plugin file:_files"
"-Xpluginsdir+[Path to search compiler plugins]:plugin directory:_files -/"
"-Xplugin-list[Print a synopsis of loaded plugins]"
"-Xplugin-disable\:-[Disable the given plugin(s)]"
"-Xplugin-require\:-[Abort unless the given plugin(s) are available]"
)
Y_opts=(
"-Y[Print a synopsis of private options]"
"-Ybuild-manager-debug[Generate debug information for the Refined Build Manager compiler]"
"-Ybuilder-debug\:-[Compile using the specified build manager (default\: none)]:build manager:(none refined simple)"
"-Yclosure-elim[Perform closure elimination]"
"-Ycompact-trees[Use compact tree printer when displaying trees]"
"-Ydead-code[Perform dead code elimination]"
"-Ydependent-method-types[Allow dependent method types]"
"-Ygen-javap+[Generate a parallel output directory of .javap files]:output directory:_files -/"
"-Yinfer-argument-types[Infer types for arguments of overriden methods]"
"-Yinline[Perform inlining when possible]"
"-Ylinearizer\:-[Linearizer to use (default\: rpo)]:linearizer:(normal dfs rpo dump)"
"-Ylog-classpath[Output information about what classpath is being applied]"
"-Yno-completion[Disable tab-completion in the REPL]"
"-Yno-generic-signatures[Suppress generation of generic signatures for Java]"
"-Yno-imports[Compile without any implicit imports]"
"-Yno-self-type-checks[Suppress check for self-type conformance among inherited members]"
"-Yno-squeeze[Disable creation of compact code in matching]"
"-Ynotnull[Enable (experimental and incomplete) scala.NotNull]"
"-Ypmat-naive[Desugar matches as naively as possible]"
"-Ypresentation-delay+[Wait number of ms after typing before starting typechecking]"
"-Ypresentation-log+[Log presentation compiler events into file]:log file:_files"
"-Ypresentation-replay+[Replay presentation compiler events from file]:log file:_files"
"-Yprofile-class+[Specify name of profiler class]:profiler class name"
"-Yprofile-memory[Heap snapshot after compiler run (requires jgpagent on JVM -agentpath)]"
"-Yrangepos[Use range positions for syntax trees]"
"-Yrecursion+[Set recursion depth used when locking symbols]"
"-Yrepl-sync[Do not use asynchronous code for REPL startup]"
"-Ypresentation-verbose[Print information about presentation compiler tasks]"
"-Yresolve-term-conflict\:-[Resolve term conflicts (default\: error)]:resolution strategy:(package object error)"
"-Yrich-exceptions[Fancier exceptions. Set source search path with -Dscala.control.sourcepath]"
"-Yself-in-annots[Include a \"self\" identifier inside of annotations]"
"-Yshow\:-[Show after <phase> (requires -Xshow-class or -Xshow-object)]:phase name:phases"
"-Yshow-syms[Print the AST symbol hierarchy after each phase]"
"-Yshow-trees[Print detailed ASTs (requires -Xprint:phase)]"
"-Ystatistics[Print compiler statistics]"
"-Ystruct-dispatch\:-[Structural method dispatch policy (default\: poly-cache)]:policy name:(no-cache mono-cache poly-cache invoke-dynamic)"
"-Ybrowse\:-[Browse the abstract syntax tree after <phase>]:phase name:phases"
"-Ycheck\:-[Check the tree at the end of <phase>]:phase name:phases"
"-Ylog\:-[Log operations during <phase>]:phase name:phases"
"-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:phases"
"-Yskip\:-[Skip <phase>]:phase name:phases"
"-Ystop-after\:-[Stop after given phase <phase>]:phase name:phases"
"-Ystop-before\:-[Stop before given phase <phase>]:phase name:phases"
"-Ywarn-all[Enable all -Y warnings]"
"-Ywarn-dead-code[Warn when dead code is identified]"
"-Ywarn-inaccessible[Warn about inaccessible types in method signatures]"
"-Ywarn-nullary-override[Warn when non-nullary overrides nullary, e.g. def foo() over def foo]"
"-Ywarn-nullary-unit[Warn when nullary methods return Unit]"
"-Ywarn-numeric-widen[Warn when numerics are widened]"
"-Ywarn-value-discard[Warn when non-Unit expression results are unused]"
"-Ycompletion-debug[Trace all tab completion activity]"
"-Ydebug[Increase the quantity of debugging output]"
"-Ydoc-debug[Trace all scaladoc activity]"
"-Yide-debug[Generate, validate and output trees using the interactive compiler]"
"-Yinfer-debug[Trace type inference and implicit search]"
"-Ypmat-debug[Trace all pattern matcher activity]"
"-Ypresentation-debug[Enable debugging output for the presentation compiler]"
"-Yrepl-debug[Trace all REPL activity]"
"-Ytyper-debug[Trace all type assignments]"
)
scala_opts=(
"-e+[execute <string> as if entered in the repl]:string" \
"-howtorun+[what to run (default\: guess)]:execution mode:(script object jar guess)" \
"-i+[preload <file> before starting the repl]:file to preload:_files" \
"-nc[no compilation daemon\: do not use the fsc offline compiler]" \
"-save[save the compiled script in a jar for future use]"
)
case $words[$CURRENT] in
-X*) _arguments $X_opts;;
-Y*) _arguments $Y_opts;;
*) case $service in
scala) _arguments $scala_opts $shared_opts "*::filename:_files";;
scalac) _arguments $shared_opts "*::filename:_files";;
esac
esac
return 0

View File

@ -1,29 +1,9 @@
#compdef setup.py
# ------------------------------------------------------------------------------
# Copyright (C) 2015 by Hideo Hattori <hhatto.jp@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for setup.py (https://docs.python.org/distutils/).
# Completion script for setup.py (http://docs.python.org/distutils/).
#
# ------------------------------------------------------------------------------
# Authors
@ -32,11 +12,14 @@
# * Hideo Hattori (https://github.com/hhatto)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_setup.py() {
typeset -A opt_args
local context state line
typeset -A opt_args
local context state line
_setuppy() {
_arguments -s -S \
"--verbose[run verbosely (default)]" \
"-v[run verbosely (default)]" \
@ -147,7 +130,7 @@ _setuppy_build() {
"-f[forcibly build everything (ignore file timestamps)]" \
"--executable=[specify final destination interpreter path (build.py)]" \
"-e[specify final destination interpreter path (build.py)]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_build_py] )) ||
@ -162,7 +145,7 @@ _setuppy_build_py() {
"-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
"--force[forcibly build everything (ignore file timestamps)]" \
"-f[forcibly build everything (ignore file timestamps)]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_build_ext] )) ||
@ -200,7 +183,7 @@ _setuppy_build_ext() {
"--swig-opts=[list of SWIG command line options]" \
"--swig=[path to the SWIG executable]" \
"--user[add user include, library and rpath]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_build_clib] )) ||
@ -216,7 +199,7 @@ _setuppy_build_clib() {
"-f[forcibly build everything (ignore file timestamps)]" \
"--compiler=[specify the compiler type]" \
"-c[specify the compiler type]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_build_scripts] )) ||
@ -228,7 +211,7 @@ _setuppy_build_scripts() {
"-f[forcibly build everything (ignore file timestamps]" \
"--executable=[specify final destination interpreter path]" \
"-e[specify final destination interpreter path]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_clean] )) ||
@ -243,7 +226,7 @@ _setuppy_clean() {
"--bdist-base=[temporary directory for built distributions]" \
"--all[remove all build output, not just temporary by-products]" \
"-a[remove all build output, not just temporary by-products]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_install] )) ||
@ -252,7 +235,7 @@ _setuppy_install() {
"--prefix=[installation prefix]" \
"--exec-prefix=[(Unix only) prefix for platform-specific files]" \
"--home=[(Unix only) home directory to install under]" \
"--user[install in user site-package]" \
"--user[install in user site-package '/home/hattori/.local/lib/python2.7/site-packages']" \
"--install-base=[base installation directory (instead of --prefix or --home)]" \
"--install-platbase=[base installation directory for platform-specific files (instead of --exec-prefix or --home)]" \
"--root=[install everything relative to this alternate root directory]" \
@ -271,9 +254,10 @@ _setuppy_install() {
"-f[force installation (overwrite any existing files)]" \
"--skip-build[skip rebuilding everything (for testing/debugging)]" \
"--record=[filename in which to record list of installed files]" \
"--install-layout=[installation layout to choose (known values: deb, unix)]" \
"--old-and-unmanageable[Try not to use this!]" \
"--single-version-externally-managed[used by system package builders to create 'flat' eggs]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_install_lib] )) ||
@ -291,7 +275,7 @@ _setuppy_install_lib() {
"--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
"-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
"--skip-build[skip the build steps]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_install_headers] )) ||
@ -301,7 +285,7 @@ _setuppy_install_headers() {
"-d[directory to install header files to]" \
"--force[force installation (overwrite existing files)]" \
"-f[force installation (overwrite existing files)]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_install_scripts] )) ||
@ -314,7 +298,7 @@ _setuppy_install_scripts() {
"--force[force installation (overwrite existing files)]" \
"-f[force installation (overwrite existing files)]" \
"--skip-build[skip the build steps]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_install_data] )) ||
@ -325,7 +309,7 @@ _setuppy_install_data() {
"--root=[install everything relative to this alternate root directory]" \
"--force[force installation (overwrite existing files)]" \
"-f[force installation (overwrite existing files)]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_sdist] )) ||
@ -336,18 +320,18 @@ _setuppy_sdist() {
"-k[keep the distribution tree around after creating archive file(s)]" \
"--dist-dir=[directory to put the source distribution archive(s) in \[default: dist\]]" \
"-d[directory to put the source distribution archive(s) in \[default: dist\]]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_register] )) ||
_setuppy_register() {
_arguments -s \
"--repository=[url of repository \[default: https://pypi.python.org/pypi\]]" \
"-r[url of repository \[default: https://pypi.python.org/pypi\]]" \
"--repository=[url of repository \[default: http://pypi.python.org/pypi\]]" \
"-r[url of repository \[default: http://pypi.python.org/pypi\]]" \
"--show-response[display full response text from server]" \
"--list-classifiers[list the valid Trove classifiers]" \
"--strict[Will stop the registering if the meta-data are not fully compliant]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_bdist] )) ||
@ -365,7 +349,7 @@ _setuppy_bdist() {
"-u[Owner name used when creating a tar file \[default: current user\]]" \
"--group=[Group name used when creating a tar file \[default: current group\]]" \
"-g[Group name used when creating a tar file \[default: current group\]]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_bdist_dumb] )) ||
@ -387,7 +371,7 @@ _setuppy_bdist_dumb() {
"-u[Owner name used when creating a tar file \[default: current user\]]" \
"--group=[Group name used when creating a tar file \[default: current group\]]" \
"-g[Group name used when creating a tar file \[default: current group\]]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_bdist_rpm] )) ||
@ -437,7 +421,7 @@ _setuppy_bdist_rpm() {
"--force-arch=[Force an architecture onto the RPM build process]" \
"--quiet[Run the INSTALL phase of RPM building in quiet mode]" \
"-q[Run the INSTALL phase of RPM building in quiet mode]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_bdist_wininst] )) ||
@ -460,23 +444,23 @@ _setuppy_bdist_wininst() {
"--title=[title to display on the installer background instead of default]" \
"-t[title to display on the installer background instead of default]" \
"--skip-build[skip rebuilding everything (for testing/debugging)]" \
"--install-script=[basename of installation script to be run after installation or before uninstallation]" \
"--install-script=[basename of installation script to be run afterinstallation or before deinstallation]" \
"--pre-install-script=[Fully qualified filename of a script to be run before any files are installed. This script need not be in the distribution]" \
"--user-access-control=[specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UAC]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_upload] )) ||
_setuppy_upload() {
_arguments -s \
"--repository=[url of repository \[default: https://pypi.python.org/pypi\]]" \
"-r[url of repository \[default: https://pypi.python.org/pypi\]]" \
"--repository=[url of repository \[default: http://pypi.python.org/pypi\]]" \
"-r[url of repository \[default: http://pypi.python.org/pypi\]]" \
"--show-response[display full response text from server]" \
"--sign[sign files to upload using gpg]" \
"-s[sign files to upload using gpg]" \
"--identity=[GPG identity used to sign files]" \
"-i[GPG identity used to sign files]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_check] )) ||
@ -488,7 +472,7 @@ _setuppy_check() {
"-r[Checks if long string meta-data syntax are reStructuredText-compliant]" \
"--strict[Will exit with an error if a check fails]" \
"-s[Will exit with an error if a check fails]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_alias] )) ||
@ -502,7 +486,7 @@ _setuppy_alias() {
"-u[save options to the current user's pydistutils.cfg file]" \
"--filename=[configuration file to use (default=setup.cfg)]" \
"-f[configuration file to use (default=setup.cfg)]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_bdist_egg] )) ||
@ -518,7 +502,7 @@ _setuppy_bdist_egg() {
"--dist-dir=[directory to put final built distributions in]" \
"-d[directory to put final built distributions in]" \
"--skip-build[skip rebuilding everything (for testing/debugging)]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_develop] )) ||
@ -543,6 +527,9 @@ _setuppy_develop() {
"-i[base URL of Python Package Index]" \
"--find-links=[additional URL(s) to search for packages]" \
"-f[additional URL(s) to search for packages]" \
"--delete-conflicting[no longer needed; don't use this]" \
"-D[no longer needed; don't use this]" \
"--ignore-conflicts-at-my-risk[no longer needed; don't use this]" \
"--build-directory=[download/extract/build in DIR; keep the results]" \
"-b[download/extract/build in DIR; keep the results]" \
"--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
@ -561,12 +548,15 @@ _setuppy_develop() {
"--local-snapshots-ok[allow building eggs from local checkouts]" \
"-l[allow building eggs from local checkouts]" \
"--version[print version information and exit]" \
"--install-layout=[installation layout to choose (known values: deb)]" \
"--force-installation-into-system-dir[force installation into /usr]" \
"-0[force installation into /usr]" \
"--no-find-links[Don't load find-links defined in packages being installed]" \
"--user[install in user site-package]" \
"--user[install in user site-package '/home/hattori/.local/lib/python2.7/site-packages']" \
"--uninstall[Uninstall this source package]" \
"-u[Uninstall this source package]" \
"--egg-path=[Set the path to be used in the .egg-link file]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_easy_install] )) ||
@ -591,6 +581,9 @@ _setuppy_easy_install() {
"-i[base URL of Python Package Index]" \
"--find-links=[additional URL(s) to search for packages]" \
"-f[additional URL(s) to search for packages]" \
"--delete-conflicting[no longer needed; don't use this]" \
"-D[no longer needed; don't use this]" \
"--ignore-conflicts-at-my-risk[no longer needed; don't use this]" \
"--build-directory=[download/extract/build in DIR; keep the results]" \
"-b[download/extract/build in DIR; keep the results]" \
"--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \
@ -609,9 +602,12 @@ _setuppy_easy_install() {
"--local-snapshots-ok[allow building eggs from local checkouts]" \
"-l[allow building eggs from local checkouts]" \
"--version[print version information and exit]" \
"--install-layout=[installation layout to choose (known values: deb)]" \
"--force-installation-into-system-dir[force installation into /usr]" \
"-0[force installation into /usr]" \
"--no-find-links[Don't load find-links defined in packages being installed]" \
"--user[install in user site-package]" \
"*::setup.py commands:_setup.py"
"--user[install in user site-package '/home/hattori/.local/lib/python2.7/site-packages']" \
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_egg_info] )) ||
@ -629,7 +625,7 @@ _setuppy_egg_info() {
"-R[Don't add subversion revision ID \[default\]]" \
"--no-date[Don't include date stamp \[default\]]" \
"-D[Don't include date stamp \[default\]]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_rotate] )) ||
@ -641,7 +637,7 @@ _setuppy_rotate() {
"-d[directory where the distributions are]" \
"--keep=[number of matching distributions to keep]" \
"-k[number of matching distributions to keep]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_saveopts] )) ||
@ -653,7 +649,7 @@ _setuppy_saveopts() {
"-u[save options to the current user's pydistutils.cfg file]" \
"--filename=[configuration file to use (default=setup.cfg)]" \
"-f[configuration file to use (default=setup.cfg)]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_setopt] )) ||
@ -673,7 +669,7 @@ _setuppy_setopt() {
"-u[save options to the current user's pydistutils.cfg file]" \
"--filename=[configuration file to use (default=setup.cfg)]" \
"-f[configuration file to use (default=setup.cfg)]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_test] )) ||
@ -683,7 +679,7 @@ _setuppy_test() {
"-m[Run 'test_suite' in specified module]" \
"--test-suite=[Test suite to run (e.g. 'some_module.test_suite')]" \
"-s[Test suite to run (e.g. 'some_module.test_suite')]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_install_egg_info] )) ||
@ -691,25 +687,17 @@ _setuppy_install_egg_info() {
_arguments -s \
"--install-dir=[directory to install to]" \
"-d[directory to install to]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
(( $+functions[_setuppy_upload_docs] )) ||
_setuppy_upload_docs() {
_arguments -s \
"--repository=[url of repository \[default: https://pypi.python.org/pypi\]]" \
"-r[url of repository \[default: https://pypi.python.org/pypi\]]" \
"--repository=[url of repository \[default: http://pypi.python.org/pypi\]]" \
"-r[url of repository \[default: http://pypi.python.org/pypi\]]" \
"--show-response[display full response text from server]" \
"--upload-dir=[directory to upload]" \
"*::setup.py commands:_setup.py"
"*::setup.py commands:_setuppy"
}
_setup.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
_setuppy "$@"

79
_showoff Normal file
View File

@ -0,0 +1,79 @@
#compdef showoff
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Showoff (https://github.com/schacon/showoff).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Bruno Michel (https://github.com/nono)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line cmds ret=1
_arguments -C \
'1: :->cmds' \
'*: :->args' && ret=0
case $state in
cmds)
cmds=(
'add:Add a new slide at the end in a given dir'
'new:Add a new slide at the end in a given dir'
'create:Create new showoff presentation'
'init:Create new showoff presentation'
'help:Shows list of commands or help for one command'
'heroku:Setup your presentation to serve on Heroku'
'serve:Serves the showoff presentation in the current directory'
'static:Generate static version of presentation'
)
_describe -t commands 'showoff command' cmds && ret=0
;;
args)
case $line[1] in
(add|new)
_arguments \
'(-d --dir)'{-d,--dir}'=[Slide dir (where to put a new slide file)]:directory:_files' \
'(-n --name)'{-n,--name}'=[Slide name (name of the new slide file)]:basename' \
{-s,--source}'=[Include code from the given file as the slide body]:file:_files' \
'(-t --style --type)'{-t,--style,--type}'=[Slide Type/Style (default: title)]:style' \
'(-u --no-number)'{-u,--no-number}'[Dont number the slide, use the given name verbatim]' \
'1:title' && ret=0
;;
(create|init)
_arguments \
'(-d --slidedir)'{-d,--slidedir}'=[Sample slide directory name (default: one)]:arg' \
'(-n --nosamples)'{-n,--nosamples}'=[Dont create sample slides]' \
'1:dir_name' && ret=0
;;
help)
_values 'commands' add new create init help heroku serve static && ret=0
;;
heroku)
_message 'please entrer an heroku_name' && ret=0
;;
serve)
_arguments \
'(-h --host)'{-h,--host}'=[Host or ip to run on (default: localhost)]:host' \
'(-p --port)'{-p,--port}'=[Port on which to run (default: 9090)]:port' \
'1:title' && ret=0
;;
static)
_message 'please entrer a name' && ret=0
;;
*)
(( ret )) && _message 'no more arguments'
;;
esac
;;
esac
return ret

110
_smartmontools Normal file
View File

@ -0,0 +1,110 @@
#compdef smartctl smartd
# ------------------------------------------------------------------------------
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for smartmontools (http://smartmontools.sourceforge.net).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_smartctl() {
local context state line expl
local -A opt_args
_arguments -A "-*" \
'(-h --help --usage)'{-h,--help,--usage}'[Show help message]' \
'(-V --version --copyright --license)'{-v,--version,--copyright,--license}'[Print license, copyright, and version information and exit]' \
'(-i --info)'{-i,--info}'[Show identity information for device]' \
'(-a --all)'{-a,--all}"[Show all SMART information for device]" \
'(-x --xall)'{-xa,--xall}"[Show all information for device]" \
'--scan[Scan for devices]' \
'--scan-open[Scan for devices and try to open each device]' \
\
'(-q --quietmode)'{-q,--quietmode}'[Set smartctl quiet mode]:TYPE:(errorsonly silent noserial)' \
'(-d --device)'{-d,--device}'[Specify device type]:TYPE:(ata scsi sat usbcypress usbjmicron usbsunplus marvell areca 3ware hpt megaraid cciss auto test)' \
'(-T --tolerance)'{-T,--tolerance}'[Set tolerance]:TOLERANCE:(normal conservative permissive verypermissive)' \
'(-b --badsum)'{-q,--badsum}'[Set action on bad checksum]:TYPE:(warn exit ignore)' \
'(-r --report)'{-r,--report}'[Report transactions]:TYPE:' \
'(-n --nocheck)'{-n,--nocheck}'[No check if MODE]:MODE:(never sleep standby idle)' \
\
'(-s --smart)'{-s,--smart}'[Enable/disable SMART on device]:VALUE:(on off)' \
'(-o --offlineauto)'{-s,--smart}'[Enable/disable automatic offline testing on device]:VALUE:(on off)' \
'(-S --saveauto)'{-S,--saveauto}'[Enable/disable attribute autosave on device]:VALUE:(on off)' \
\
'(-H --health)'{-h,--health}'[Show device SMART health status]' \
'(-c --capabilities)'{-c,--capabilities}'[Show device SMART capabilities]' \
'(-A --attributes)'{-A,--attributes}'[Show device SMART vendor-specific attributes and values]' \
'(-f --format)'{-f,--format}'[Set output format for attributes]:FORMAT:(old brief)' \
'(-l --log)'{-l,--log}'[Show device log]:TYPE:(error selftest selective directory background sasphy sataphy scttemp scterc gplog smartlog xerror xselftest)' \
'(-v --vendorattribute)'{-v,--vendorattribute}'[Set display option for vendor attribute]:N,OPTION:' \
'(-F --firmwarebug)'{-F,--firmwarebug}'[Use firmware bug workaround]:TYPE:(none samsung samsung2 samsung3 swapid)' \
'(-P --presets)'{-P,--presets}'[Drive-specific presets]:TYPE:(use ignore show showall)' \
'(-B --drivedb)'{-B,--drivedb}'[Read and replace drive database from file]:FILE:_files' \
\
'(-t --test)'{-t,--test}'[Run test]:TEST:(offline short long conveyance vendor select pending afterselect,on afterselect,off scttempint)' \
'(-C --captive)'{-C,--captive}'[Do test in captive mode]' \
'(-X --abort)'{-X,--abort}'[Abort any non-captive test on device]' \
\
'1:Device:_files'
}
_smartd() {
local context state line expl
local -A opt_args
_arguments -A "-*" \
'(-h --help --usage)'{-h,--help,--usage}'[Show help message]' \
'(-V --version --copyright --license)'{-v,--version,--copyright,--license}'[Print license, copyright, and version information and exit]' \
\
'(-A --attributelog)'{-A,--attributelog}'[Log ATA attribute information to {PREFIX}MODEL-SERIAL.ata.csv]:PREFIX:' \
'(-B --drivedb)'{-B,--drivedb}'[Read and replace drive database from file]:FILE:_files' \
'(-c --configfile)'{-c,--configfile}'[Read configuration file or stdin]:FILE:_files' \
'(-d --debug)'{-d,--debug}'[Start smartd in debug mode]' \
'(-D --showdirectives)'{-D,--showdirectives}'[Print the configuration file directives and exit]' \
'(-i --interval)'{-i,--interval}'[Set interval between disk checks to N seconds, where N >= 10]:Seconds >= 10:' \
'(-l --logfacility)'{-l,--logfacility}'[Use syslogfacility local0 - local7 or daemon]:FACILITY:(local0 local1 local2 local3 local4 local5 local6 local7)' \
'(-n --no-fork)'{-n,--no-fork}'[Do not fork into background]' \
'(-p --pidfile)'{-p,--pidfile}'[Write PID file]:FILE:_files' \
'(-q --quit)'{-q,--quit}'[Quit on...]:WHEN:(nodev errors nodevstartup never onecheck showtests)' \
'(-r --report)'{-r,--report}'[Report transactions for...]:TYPE:(ioctl ataioctl scsiioctl)' \
'(-s --savestates)'{-s,--savestates}'[Save disk states to {PREFIX}MODEL-SERIAL.TYPE.state]:TYPE:'
}
_smartmontools() {
local ret=1
_call_function ret _$service
return ret
}
_smartmontools "$@"

63
_srm Normal file
View File

@ -0,0 +1,63 @@
#compdef srm
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for srm.
#
# It is based on the rm completion script from Zsh.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Sorin Ionescu <sorin.ionescu@gmail.com>
#
# ------------------------------------------------------------------------------
declare -a opts args
args=(
'(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]'
'(-r --interactive)'{-i,--interactive}'[prompt before any removal]'
'(-r -R --recursive)'{-r,-R,--recursive}'[remove the contents of directories recursively]'
'(-s --simple)'{-s,--simple}'[only overwrite with a single pass of random data]'
'(-v --verbose)'{-v,--verbose}'[explain what is being done]'
'(- *)--help[display help message and exit]'
'(- *)--version[output version information and exit]'
'*::files:->file'
)
if _pick_variant gnu=gnu unix --help; then
args+=(
'(-x --one-file-system)'{-x,--one-file-system}'[stay within filesystems of files given as arguments]'
'(-P --openbsd)'{-P,--openbsd}'[overwrite the file 3 times (0xff, 0x00, 0xff)]'
'(-D --dod)'{-D,--dod}'[overwrite the file with 7 US DoD compliant passes (0xF6, 0x00, 0xFF, random, 0x00, 0xFF, random)]'
'(-E --doe)'{-E,--doe}'[overwrite the file with 3 US DoE compliant passes (random, random, DoE)]'
)
else
args+=(
'(-m --medium)'{-m,--medium}'[overwrite the file with 7 US DoD compliant passes (0xF6, 0x00, 0xFF, random, 0x00, 0xFF, random)]'
'(-z --zero)'{-z,--zero}'[after overwriting, zero blocks used by file]'
'(-n --nounlink)'{-n,--nounlink}'[overwrite file, but do not rename or unlink it]'
)
fi
local curcontext=$curcontext state line ret=1
declare -A opt_args
_arguments -s -S -C $opts \
$args && ret=0
case $state in
(file)
declare -a ignored
ignored=()
((CURRENT > 1)) &&
ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
((CURRENT < $#line)) &&
ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
_files -F ignored && ret=0
;;
esac
return $ret

View File

@ -1,6 +1,6 @@
#compdef mcookie
#compdef ssh-copy-id
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# 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
@ -28,24 +28,23 @@
# Description
# -----------
#
# Completion script for mcookie, util-linux 2.40.2 (https://github.com/util-linux/util-linux/)
# - generate random 128-bit hexadecimal numbers
# Completion script for ssh-copy-id.
#
# Author:
# * Aditi Sharma (https://github.com/Aditi76117)
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_arguments \
{-f,--file}'[Use file as as cookie seed]:file:_files' \
{-m,--max-size}'[Set maximum length of output]:number' \
{-v,--verbose}'[Print entropy source and random seed info]' \
'(- *)'{-h,--help}'[Display help message and exit]' \
'(- *)'{-V,--version}'[Display version information and exit]'
# 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
# FIXME This completes "user@host" and not "[user@]host" ("user@" is optionnal),
# should be merged in _ssh.
_arguments -A "-*" \
'-i+[use identity file]:SSH identity file:_files' \
'1: :_user_at_host'

View File

@ -1,6 +1,6 @@
#compdef mina
#compdef subliminal
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# 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
@ -28,41 +28,31 @@
# Description
# -----------
#
# Completion script for Mina (http://nadarei.co/mina/).
# Completion script for Subliminal (https://github.com/Diaoul/subliminal).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Kazuya Takeshima (https://github.com/mitukiii)
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
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
_arguments \
'(- : *)'{-h,--help}'[show help message and exit]' \
'(- : *)--version[show version number and exit]' \
'*'{-l,--language}'[wanted language]: :_language_codes ISO-639-1' \
'*'{-p,--plugin}'[plugin to use]:plugin name:((OpenSubtitles BierDopje TheSubDB SubsWiki Subtitulos))' \
'(-m --multi)'{-m,--multi}'[download multiple subtitle languages]' \
'(-f --force)'{-f,--force}'[replace existing subtitle file]' \
'(-w --workers)'{-w,--workers}'[number of threads to use]:number' \
'(-c --compatibility)'{-c,--compatibility}'[try not to use unicode]' \
'(-q --quiet -v --verbose)'{-q,--quiet}'[disable output]' \
'(-v --verbose -q --quiet)'{-v,--verbose}'[verbose output]' \
'(--no-cache-dir)--cache-dir[cache directory to use]: :_files -/' \
'(--cache-dir)--no-cache-dir[do not use cache directory]' \
'*: :_files'

451
_symfony Normal file
View File

@ -0,0 +1,451 @@
#compdef symfony
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Symfony (http://www.symfony-project.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * aki77 (https://github.com/aki77)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_symfony () {
local curcontext="$curcontext" state line expl ret=1 cache_version
cache_version=$(_get_sf_cache_var version)
(( ${(P)+cache_version} == 0 )) && {
eval $cache_version=${${${(z)$($service -V)}[3]}%.*}
}
if [ ${(P)cache_version} = "1.0" ] ; then
_symfony10
return
fi
_arguments -C \
'(-T --tasks)'{-T,--tasks}'[list of the symfony tasks]' \
'(-V --version)'{-V,--version}'[version]' \
'1: :->tasks' \
'*:: :->args' && ret=0
case $state in
tasks)
_sf_tasks
;;
args)
local task args
task=$words[1]
args=(
${${${${${(M)${${${(z)${${"$($service help $task)"#*Usage:}#[[:cntrl:]]}%%[[:cntrl:]]*}//\[/}//\]/}:#--*}%%\"*}/=/"=-"}/(#b)--(app|application)=-/--$match[1]=-:application:_sf_apps}//(#b)--(env|environment)=-/--$match[1]=-:environment:_sf_environments}
)
case $task in
help)
args+=(
':task:_sf_tasks'
)
;;
app:routes)
args+=(
':application:_sf_apps'
':"route name":'
)
;;
configure:author)
_message 'project author'
;;
configure:database)
_message 'database dsn'
;;
generate:app)
_message 'new application name'
;;
generate:module)
args+=(
':application:_sf_apps'
':"new module name":'
)
;;
generate:project)
_message 'new project name'
;;
generate:task)
_message 'new task name'
;;
i18n:extract)
args+=(
':application:_sf_apps'
':"target culture":'
)
;;
i18n:find)
args+=(
':application:_sf_apps'
)
;;
log:rotate)
args+=(
':application:_sf_apps'
':environment:_sf_environments'
)
;;
plugin:add-channel)
_message 'channel name'
;;
plugin:install)
_message 'plugin name'
;;
plugin:publish-assets)
args+=(
':plugin:_sf_plugins'
)
;;
plugin:uninstall)
_message 'plugin name'
;;
plugin:upgrade)
_message 'plugin name'
;;
project:deploy)
_message 'server name'
;;
project:disable|project:enable)
args+=(
':environment:_sf_environments'
'*:application:_sf_apps'
)
;;
project:optimize)
args+=(
':application:_sf_apps'
':environment:_sf_environments'
)
;;
propel:data-dump|doctrine:data-dump)
_message 'target filename'
;;
propel:data-load|doctrine:data-load)
args+=(
'*:file:_files'
)
;;
propel:generate-admin)
args+=(
':application:_sf_apps'
':model:_sf_models'
)
;;
propel:generate-module|propel:init-admin)
args+=(
':application:_sf_apps'
':module:_sf_modules_candidate'
':model:_sf_models'
)
;;
propel:generate-module-for-route|doctrine:generate-module-for-route)
args+=(
':application:_sf_apps'
':"route name":'
)
;;
doctrine:create-model-tables|doctrine:delete-model-files)
args+=(
'*:model:_sf_doctrine_models'
)
;;
doctrine:generate-admin)
args+=(
':application:_sf_apps'
'*:model:_sf_doctrine_models'
)
;;
doctrine:generate-module)
args+=(
':application:_sf_apps'
':module:_sf_doctrine_modules_candidate'
':model:_sf_doctrine_models'
)
;;
test:coverage)
args+=(
'*:file:_files'
)
;;
test:functional)
args+=(
':application:_sf_apps'
'*:test:_sf_functionaltests'
)
;;
test:unit)
args+=(
'*:test:_sf_unittests'
)
;;
esac
_arguments "$args[@]" && ret=0
return
;;
esac
return ret
}
_symfony10 () {
local curcontext="$curcontext" state line expl ret=1
_arguments -C \
'(-T --tasks)'{-T,--tasks}'[list of the symfony tasks]' \
'(-V --version)'{-V,--version}'[version]' \
'1: :->tasks' \
'*:: :->args' && ret=0
case $state in
tasks)
_sf10_tasks
;;
args)
local task args
task=$words[1]
args=()
case $task in
init-project)
_message 'new project name'
;;
init-app)
_message 'application name'
;;
init-module)
args+=(
':application:_sf_apps'
)
;;
init-batch)
args+=(
':skeleton name:compadd default rotate'
':"script name":'
':application:_sf_apps'
)
;;
init-controller)
args+=(
':application:_sf_apps'
':environment:_sf_environments'
':"script name":'
':"debug?":compadd true false'
)
;;
log-rotate)
args+=(
':application:_sf_apps'
':environment:_sf_environments'
)
;;
propel-load-data|propel-build-all-load)
args+=(
':application:_sf_apps'
':environment:_sf_environments'
':fixtures:_sf_fixtures'
)
;;
clear-cache|cc)
args+=(
':application:_sf_apps'
':what:compadd template config'
)
;;
sync)
args+=(
':environment:_sf_environments'
':"real run?":compadd go'
)
;;
propel-init-crud|propel*-init-admin|propel-generate-crud)
args+=(
':application:_sf_apps'
':module:_sf_modules_candidate'
':model:_sf_models'
)
;;
doctrine-init-admin|doctrine-generate-crud)
args+=(
':application:_sf_apps'
':module:_sf_doctrine_modules_candidate'
':model:_sf_doctrine_models'
)
;;
test-unit)
args+=(
':test:_sf_unittests'
)
;;
test-functional)
args+=(
':application:_sf_apps'
':test:_sf_functionaltests'
)
;;
esac
_arguments "$args[@]" && ret=0
return
;;
esac
return ret
}
_sf_tasks () {
local tmp ns line cache_task
cache_task=$(_get_sf_cache_var task)
(( ${(P)+cache_task} == 0 )) && {
tmp=(
${${${(f)${"$($service -T)"##*Available tasks:}}##[[:blank:]][[:blank:]]}%%[[:blank:]]*}
)
eval "$cache_task=()"
ns=''
for line in $tmp; do
if [ $line[1] = ":" ] ; then
eval "$cache_task+=( ${ns}${line#:} )"
else
ns="${line}:"
fi
done
}
_wanted symfony-task expl 'Symfony task' compadd -a $cache_task
}
_sf10_tasks () {
local sf_tasks
sf_tasks=(
${${${(f)${"$($service -T)"#available pake tasks:}%%task aliases:*}#[[:blank:]][[:blank:]]}/[[:blank:]]*>[[:blank:]]/:}
)
_describe -t symfony-tasks 'Symfony task' sf_tasks
}
_sf_apps () {
_wanted application expl 'application' compadd \
${$(echo apps/*):t}
}
_sf_environments () {
local app
app=$([ -f apps/"$words[2]"/config/settings.yml ] && echo $words[2] || echo frontend)
if [ -r apps/$app/config/settings.yml ] ; then
_wanted environment expl 'environment' compadd \
${${${(M)${(@f)"$(<apps/$app/config/settings.yml)"}:#[[:alpha:]]*}%%:*}:#all}
fi
}
_sf_plugins () {
_wanted application expl 'plugin' compadd \
${$(echo plugins/*):t}
}
_sf_models () {
_wanted application expl 'model' compadd \
$(_get_sfmodels)
}
_sf_doctrine_models () {
_wanted model expl 'model' compadd \
$(_get_sf_doctrine_models)
}
_sf_modules_candidate () {
_wanted module expl 'module' compadd \
${$(_get_sfmodels):l}
}
_sf_doctrine_modules_candidate () {
_wanted module expl 'module' compadd \
${$(_get_sf_doctrine_models):l}
}
_sf_unittests () {
_wanted test expl 'test' compadd \
${${${$(echo test/unit/**/*Test.php):r}#test/unit/}%Test}
}
_sf_functionaltests () {
_wanted test expl 'test' compadd \
${${$(echo test/functional/$words[2]/*ActionsTest.php):t:r}%Test}
}
_sf_fixtures () {
_files -W $(pwd)/data
}
_get_sfmodels () {
echo ${${$(echo lib/model/*Peer.php):t:r}%Peer}
}
_get_sf_doctrine_models () {
echo ${${$(echo lib/model/doctrine/*Table.class.php):t:r:r}%Table}
}
_get_sf_cache_var () {
echo ${$(echo "_sf_cache_${(j:_:)@}$(pwd)")//[^[:alnum:]]/_}
}
_symfony "$@"

291
_task Normal file
View File

@ -0,0 +1,291 @@
#compdef task
# ------------------------------------------------------------------------------
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the
#
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor,
# Boston, MA
# 02110-1301
# USA
#
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Taskwarrior (http://taskwarrior.org).
#
# Source: The Taskwarrior project.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * P.C. Shyamshankar (http://lucentbeing.com)
# * Johannes Schlatow <johannes@schlatow.name>
#
# ------------------------------------------------------------------------------
typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
_task_projects=($(task _projects))
_task_tags=($(task _tags))
_task_ids=($(task _ids))
_task_config=($(task _config))
_task_modifiers=(
'before' \
'after' \
'none' \
'any' \
'is' \
'isnt' \
'has' \
'hasnt' \
'startswith' \
'endswith' \
'word' \
'noword'
)
_task_cmds=($(task _commands))
_task_zshcmds=( ${(f)"$(task _zshcommands)"} )
_task_idCmds=(
'append' \
'prepend' \
'annotate' \
'denotate' \
'edit' \
'duplicate' \
'info' \
'start' \
'stop' \
'done'
)
_task_idCmdsDesc=(
'append:Appends more description to an existing task.' \
'prepend:Prepends more description to an existing task.' \
'annotate:Adds an annotation to an existing task.' \
'denotate:Deletes an annotation of an existing task.' \
'edit:Launches an editor to let you modify a task directly.' \
'duplicate:Duplicates the specified task, and allows modifications.' \
'info:Shows all data, metadata for specified task.' \
'start:Marks specified task as started.' \
'stop:Removes the start time from a task.' \
'done:Marks the specified task as completed.'
)
_task() {
_arguments -s -S \
"*::task command:_task_commands"
return 0
}
local -a reply args word
word=$'[^\0]#\0'
# priorities
local -a task_priorities
_regex_words values 'task priorities' \
'H:High' \
'M:Middle' \
'L:Low'
task_priorities=("$reply[@]")
# projects
local -a task_projects
task_projects=(
/"$word"/
":values:task projects:compadd -a _task_projects"
)
local -a _task_dates
_regex_words values 'task dates' \
'tod*ay:Today' \
'yes*terday:Yesterday' \
'tom*orrow:Tomorrow' \
'sow:Start of week' \
'soww:Start of work week' \
'socw:Start of calendar week' \
'som:Start of month' \
'soy:Start of year' \
'eow:End of week' \
'eoww:End of work week' \
'eocw:End of calendar week' \
'eom:End of month' \
'eoy:End of year' \
'mon:Monday' \
'tue:Tuesday'\
'wed:Wednesday' \
'thu:Thursday' \
'fri:Friday' \
'sat:Saturday' \
'sun:Sunday'
_task_dates=("$reply[@]")
local -a _task_reldates
_regex_words values 'task reldates' \
'hrs:n hours' \
'day:n days' \
'1st:first' \
'2nd:second' \
'3rd:third' \
'th:4th, 5th, etc.' \
'wks:weeks'
_task_reldates=("$reply[@]")
task_dates=(
\( "$_task_dates[@]" \|
\( /$'[0-9][0-9]#'/- \( "$_task_reldates[@]" \) \)
\)
)
_regex_words values 'task frequencies' \
'daily:Every day' \
'day:Every day' \
'weekdays:Every day skipping weekend days' \
'weekly:Every week' \
'biweekly:Every two weeks' \
'fortnight:Every two weeks' \
'quarterly:Every three months' \
'semiannual:Every six months' \
'annual:Every year' \
'yearly:Every year' \
'biannual:Every two years' \
'biyearly:Every two years'
_task_freqs=("$reply[@]")
local -a _task_frequencies
_regex_words values 'task frequencies' \
'd:days' \
'w:weeks' \
'q:quarters' \
'y:years'
_task_frequencies=("$reply[@]")
task_freqs=(
\( "$_task_freqs[@]" \|
\( /$'[0-9][0-9]#'/- \( "$_task_frequencies[@]" \) \)
\)
)
# attributes
local -a task_attributes
_regex_words -t ':' default 'task attributes' \
'pro*ject:Project name:$task_projects' \
'du*e:Due date:$task_dates' \
'wa*it:Date until task becomes pending:$task_dates' \
're*cur:Recurrence frequency:$task_freqs' \
'pri*ority:priority:$task_priorities' \
'un*til:Recurrence end date:$task_dates' \
'fg:Foreground color' \
'bg:Background color' \
'li*mit:Desired number of rows in report'
task_attributes=("$reply[@]")
args=(
\( "$task_attributes[@]" \|
\( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":default:modifiers:compadd -S ':' -a _task_modifiers" \) \) \|
\( /'(rc).'/- \( /$'[^:]#:'/ ":arguments:config:compadd -S ':' -a _task_config" \) \) \|
\( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \|
\( /"$word"/ \)
\) \#
)
_regex_arguments _task_attributes "${args[@]}"
## task commands
# default completion
(( $+functions[_task_default] )) ||
_task_default() {
_task_attributes "$@"
}
# commands expecting an ID
(( $+functions[_task_id] )) ||
_task_id() {
if (( CURRENT < 3 )); then
# update IDs
_task_zshids=( ${(f)"$(task _zshids)"} )
_describe -t values 'task IDs' _task_zshids
else
_task_attributes "$@"
fi
}
# merge completion
(( $+functions[_task_merge] )) ||
_task_merge() {
# TODO match URIs in .taskrc
_files
}
# push completion
(( $+functions[_task_push] )) ||
_task_push() {
# TODO match URIs in .taskrc
_files
}
# pull completion
(( $+functions[_task_pull] )) ||
_task_pull() {
# TODO match URIs in .taskrc
_files
}
# modify (task [0-9]* ...) completion
(( $+functions[_task_modify] )) ||
_task_modify() {
_describe -t commands 'task command' _task_idCmdsDesc
_task_attributes "$@"
}
## first level completion => task sub-command completion
(( $+functions[_task_commands] )) ||
_task_commands() {
local cmd ret=1
if (( CURRENT == 1 )); then
# update IDs
_task_zshids=( ${(f)"$(task _zshids)"} )
_describe -t commands 'task command' _task_zshcmds
_describe -t values 'task IDs' _task_zshids
# TODO match more than one ID
elif [[ $words[1] =~ ^[0-9]*$ ]] then
_call_function ret _task_modify
return ret
else
# local curcontext="${curcontext}"
# cmd="${_task_cmds[(r)$words[1]:*]%%:*}"
cmd="${_task_cmds[(r)$words[1]]}"
idCmd="${(M)_task_idCmds[@]:#$words[1]}"
if (( $#cmd )); then
# curcontext="${curcontext%:*:*}:task-${cmd}"
if (( $#idCmd )); then
_call_function ret _task_id
else
_call_function ret _task_${cmd} ||
_call_function ret _task_default ||
_message "No command remaining."
fi
else
_message "Unknown subcommand ${cmd}"
fi
return ret
fi
}

View File

@ -1,6 +1,6 @@
#compdef teamocil
# ------------------------------------------------------------------------------
# Copyright (c) 2014 Github zsh-users - https://github.com/zsh-users
# 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
@ -28,29 +28,23 @@
# Description
# -----------
#
# Completion script for Teamocil 1.4.2 (https://github.com/remiprev/teamocil).
# Completion script for Teamocil (https://github.com/remiprev/teamocil)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Petr Zelenin <petr.zelenin@gmail.com>
# * Grigory V. <floatboth@me.com>
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_arguments \
'--here[set up the first window in the current window]' \
'--edit[edit the YAML layout file instead of using it]' \
'--layout [use a specific layout file, instead of \`~/.teamocil/<layout>.yml\`]' \
'--list[list all available layouts in \`~/.teamocil/\`]' \
'--show[show the content of the layout file instead of executing it]' \
'--debug[show the commands Teamocil will execute instead of actually executing them]' \
'*:teamocil layouts:_files -W ~/.teamocil -g "*.yml(:r)"'
# 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
'--here[open the session from the current window]' \
'--layout[specify a custom file path to a YAML layout file]:teamocil layout file:_files -g "*.yml"' \
'--edit[open the layout file (whether or not --layout is used) with $EDITOR]' \
'1:teamocil layout:_files -W ~/.teamocil -g "*.yml(:r)"'

23
_thor Normal file
View File

@ -0,0 +1,23 @@
#compdef thor
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for thor (https://github.com/wycats/thor).
#
# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/thor
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Andrew Hodges (https://github.com/betawaffle)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
# FIXME This should be rewritten using up-to-date ZSH completion API.
compadd `thor list | grep thor | cut -d " " -f 2`

127
_vagrant Normal file
View File

@ -0,0 +1,127 @@
#compdef vagrant
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Vagrant (http://vagrantup.com).
#
# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/vagrant
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Nikita Fedyashev (https://github.com/nfedyashev)
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local -a _1st_arguments
_1st_arguments=(
'box:Box commands'
'destroy:Destroys the vagrant environment'
'halt:Halts the currently running vagrant environment'
'help:[TASK] Describe available tasks or one specific task'
'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
'package:Packages a vagrant environment for distribution'
'provision:Run the provisioner'
'reload:Reload the vagrant environment'
'resume:Resumes a suspend vagrant environment'
'ssh:SSH into the currently running environment'
'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.'
'status:Shows the status of the current Vagrant environment.'
'suspend:Suspends the currently running vagrant environment'
'up:Creates the vagrant environment'
'version:Prints the Vagrant version information'
)
local -a _box_arguments
_box_arguments=(
'add:NAME URI Add a box to the system'
'help:COMMAND Describe subcommands or one specific subcommand'
'list:Lists all installed boxes'
'remove:NAME Remove a box from the system'
'repackage:NAME Repackage an installed box into a `.box` file.'
)
__task_list ()
{
local expl
declare -a tasks
tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version)
_wanted tasks expl 'help' compadd $tasks
}
__box_list ()
{
_wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g')
}
__vm_list ()
{
_wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *:\([a-zA-Z0-9]\+\)' 2>/dev/null | cut -d: -f2)
}
__vagrant-box ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _box_arguments
return
;;
(options)
case $line[1] in
(repackage|remove)
_arguments ':feature:__box_list'
;;
esac
;;
esac
}
local expl
local -a boxes installed_boxes
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _1st_arguments
return
;;
(options)
case $line[1] in
(help)
_arguments ':feature:__task_list'
;;
(box)
__vagrant-box
;;
(up|provision|package|destroy|reload|ssh|halt|resume|status)
_arguments ':feature:__vm_list'
esac
;;
esac

312
_virtualbox Normal file
View File

@ -0,0 +1,312 @@
#compdef VBoxManage=vboxmanage VBoxHeadless=vboxheadless
# ------------------------------------------------------------------------------
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for VirtualBox (http://www.virtualbox.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
_vboxmachines() {
VBoxManage list vms | egrep -o '^"[^"]+"' 2>/dev/null | sed -e 's|"||g' | while read machine; do
_wanted 'machine' expl 'machine' compadd $machine
done
}
# Roughly guess command options
_vboxcommandoptions() {
cmd="$1"
cmdoutput=$(VBoxManage "$cmd" 2>/dev/null | tail -n +2 | grep -v 'Syntax error:' | grep -v '<uuid>|<name>' | sed 's|<[^>]\+>||g' | sed 's|VBoxManage [^ ]\+ | |')
optcount=0
option=""
optlines=()
echo "$cmdoutput" | egrep -o ' [\[A-Za-z0-9\-\<].*' | while read line; do
option="${option}${line}"
if [[ $line[-1] != '|' ]]; then
optcount=$(($optcount+1))
optlines[$optcount]="$option"
option=""
fi
done
# optionals ([abc])
for line in $optlines; do
echo "$line" | egrep -o '\[[^]]+\]' | while read option; do
option=$(echo $option | sed 's|[]\[]||g' | cut -d ' ' -f 1)
_options=(${(s:|:)option})
for option in $_options; do
_wanted "${cmd}_option" expl "${cmd} option" compadd -- $option
done
done
done
# mandatory
for line in $optlines; do
echo "$line" | sed 's|\[[^]]\+\]|\n|g' | while read option; do
if [[ "$option" != "" ]]; then
_option=$(echo $option | cut -d ' ' -f 1)
_options=(${(s:|:)option})
for option in $_options; do
_wanted "${cmd}_option" expl "${cmd} option" compadd -- $option
done
fi
done
done
}
# List possible mediums
_vboxmediums() {
_wanted "mediums" expl "mediums" compadd -- "none"
_wanted "mediums" expl "mediums" compadd -- "emptydrive"
_wanted "mediums" expl "mediums" compadd -- "iscsi"
_files -g '*.{iso,vmdk,vdi}'
for CD in /dev/cd/*; do
readlink -f $CD
done | uniq | while read CD; do
_wanted "host drives" expl "host drives" compadd -- "host:$CD"
done
}
# List available os types
_vboxostypes() {
VBoxManage list ostypes | grep '^ID' | awk '{print $2}' | while read OSTYPE; do
_wanted 'ostype' expl 'os type' compadd -- $OSTYPE
done
}
# Guess options for this commands
_vboxopts_controlvm() { _vboxcommandoptions controlvm }
_vboxopts_modifyvm() { _vboxcommandoptions modifyvm }
_vboxopts_export() { _vboxcommandoptions export }
_vboxmanage() {
local -a _1st_arguments
_1st_arguments=(
"list:gives information about VirtualBox's current settings"
'showvminfo:shows information about a particular virtual machine'
'registervm:import a virtual machine definition in an XML file into VirtualBox'
'unregistervm:unregisters a virtual machine'
'createvm:creates a new XML virtual machine definition file'
'modifyvm:changes the properties of a registered virtual machine which is not running'
'import:imports a virtual appliance in OVF format by copying the virtual disk images and creating virtual machines in VirtualBox'
'export:exports one or more virtual machines from VirtualBox into a virtual appliance in OVF format'
'startvm:starts a virtual machine that is currently in the "Powered off" or "Saved" states'
'controlvm:change the state of a virtual machine that is currently running'
'discardstate:discards the saved state of a virtual machine which is not currently running'
'adoptstate:adopt a saved state file (.sav)'
'snapshot:control snapshots'
'closemedium:removes a hard disk, DVD or floppy image from a VirtualBox media registry'
'storageattach:attaches/modifies/removes a storage medium connected to a storage controller'
'storagectl:attaches/modifies/removes a storage controller'
'bandwidthctl:creates/deletes/modifies bandwidth groups'
'showhdinfo:shows information about a virtual hard disk image'
'createhd:creates a new virtual hard disk image'
'modifyhd:change the characteristics of a disk image after it has been created'
'clonehd:duplicates a registered virtual hard disk image to a new image file with a new unique identifier'
'convertfromraw:converts a raw disk image to a VirtualBox Disk Image (VDI) file'
'getextradata:retrieve string data to a virtual machine or to a VirtualBox configuration'
'setextradata:attach string data to a virtual machine or to a VirtualBox configuration'
'setproperty:change global settings which affect the entire VirtualBox installation'
'usbfilter:used for working with USB filters in virtual machines, or global filters'
'sharedfolder:share folders on the host computer with guest operating systems'
'guestproperty:get or set properties of a running virtual machine'
'guestcontrol:control certain things inside a guest from the host'
'debugvm:for experts who want to tinker with the exact details of virtual machine execution'
'metrics:monitor the usage of system resources'
'hostonlyif:change the IP configuration of a host-only network interface'
'dhcpserver:control the DHCP server that is built into VirtualBox'
'extpack:add or remove VirtualBox extension packs'
)
local context state line expl
local -A opt_args
_arguments '*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "VBoxManage commands" _1st_arguments -V1
return
fi
case "$words[1]" in
list)
_arguments \
'--long' \
':list option:(vms runningvms ostypes hostdvds hostfloppies bridgedifs hostonlyifs dhcpservers hostinfo hostcpuids hddbackends hdds dvds floppies usbhost usbfilters systemproperties extpacks)'
;;
showvminfo)
_arguments \
:machine:_vboxmachines \
'--details' \
'--machinereadable' \
'--log: :'
;;
unregistervm)
_arguments \
:machine:_vboxmachines \
'--delete'
;;
createvm)
_arguments \
'--name: :' \
'--ostype:os type:_vboxostypes' \
'--register' \
'--basefolder:folder:_files -/' \
'--settingsfile:file:_files' \
'--uuid: :'
;;
modifyvm)
_arguments \
:machine:_vboxmachines \
:modifyvm_option:_vboxopts_modifyvm
;;
import)
_arguments \
':ovf file:_files -g \*.{ovf,ova}' \
'--dry-run'
;;
export)
_arguments \
:machine:_vboxmachines \
:export_option:_vboxopts_export
;;
startvm)
_arguments \
:machine:_vboxmachines \
'--type:running mode:(gui sdl headless)'
;;
controlvm)
_arguments \
:machine:_vboxmachines \
:controlvm_option:_vboxopts_controlvm
;;
adoptstate)
_arguments \
:machine:_vboxmachines \
':sav file:_files -g \*.sav'
;;
closemedium)
_arguments \
':type:(disk dvd floppy)' \
':file:_files' \
'--delete'
;;
discardstate|bandwidthctl|getextradata|setextradata|debugvm)
_arguments \
:machine:_vboxmachines
;;
storagectl)
_arguments \
:machine:_vboxmachines \
'--name: :' \
'--add:type:(ide scsi floppy sas)' \
'--controller:type:(LSILogic|LSILogicSAS|BusLogic|IntelAHCI|PIIX3|PIIX4|ICH6|I82078)' \
--sataideemulation{1..4}":port:({1..30})" \
"--sataportcount:num:({1..30})" \
'--hostiocache:bool:(on off)' \
'--bootable:bool:(on off)' \
'--remove' #"
;;
storageattach)
_arguments \
:machine:_vboxmachines\
'--storagectl:storage ctl:("IDE Controller" "SATA Controller")' \
'--port: :' \
'--device: :' \
'--type:drive type:(dvddrive hdd fdd)' \
'--medium:mediums:_vboxmediums' \
'--mtype:behaviour:(normal writethrough immutable shareable)' \
'--comment: :' \
'--passthrough:enabled?:(on off)' \
'--bandwidthgroup: :' \
'--forceunmount' '--server: :' \
'--target: :' \
'--lun: :' \
'--encodedlun: :' \
'--username: :' \
'--password: :' \
'--intnet: :'
;;
createhd)
_arguments \
'--filename:filename:_files -g \*.{vdi,vmdk,vhd}' \
'--size:megabytes:' \
'--sizebyte:bytes:' \
'--format:type:(VDI VMDK VHD)' \
'--variant:type:(Standard Fixed Split2G Stream ESX)'
;;
sharedfolder)
_arguments \
':action:(add remove)' \
:machine:_vboxmachines \
'--name: :' \
'--hostpath:path:_files -/' \
'--transient' \
'--readonly' \
'--automount'
;;
esac
return 1
}
_vboxheadless() {
local context state line expl
local -A opt_args
_arguments \
'(-s -startvm --startvm)'{-s,-startvm,--startvm}'[Start given VM]:machine:_vboxmachines' \
'(-n --vnc)'{-n,--vnc}'[Enable the built in VNC server]' \
'(-m --vncport)'{-m,--vncport}'[TCP port number to use for the VNC server]:port:' \
'(-o --vncpass)'{-o,--vncpass}'[Set the VNC server password]:pw:' \
'(-v -vrde --vrde)'{-v,-vrde,--vrde}"[Enable (default) or disable the VRDE server or don't change the setting]::(on off config)" \
'(-e -vrdeproperty --vrdeproperty)'{-e,-vrdeproperty,--vrdeproperty}'[Set a VRDE property]: :' \
'(-c -capture --capture)'{-c,-capture,--capture}'[Record the VM screen output to a file]' \
'(-w --width)'{-w,--width}'[Frame width when recording]:width:' \
'(-h --height)'{-h,--height}'[Frame height when recording]:height:' \
'(-r --bitrate)'{-r,--bitrate}'[Recording bit rate when recording]:bitrate:' \
'(-f --filename)'{-f,--filename}'[File name when recording. The codec used will be chosen based on the file extension]:filename:_files'
}
_virtualbox() {
local ret=1
_call_function ret _$service
return ret
}
_virtualbox "$@"

202
_vpnc Normal file
View File

@ -0,0 +1,202 @@
#compdef vpnc vpnc-connect vpnc-disconnect
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for vpnc.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
(( $+functions[_vpnc-connect] )) ||
_vpnc-connect() {
_arguments \
'(- : *)--version[display version information]' \
'(- : *)--'{,long-}'help[display help information]' \
'--gateway[IP/name of your IPSec gateway]: :_hosts' \
'--id[your group name]: :_groups' \
'--username[your username]: :_users' \
'--domain[domain name for authentication]: :_domains' \
'--xauth-inter[enable interactive extended authentication]' \
'--vendor[vendor of your IPSec gateway]: :_vpnc_gateway_vendors' \
'--natt-mode[NAT-Traversal method]: :_vpnc_nat_traversal_methods' \
'--script[command executed using system() to configure the interface, routing and so on]:command path:_files' \
'--dh[name of the IKE DH Group]: :_vpnc_ike_diffie_hellman_groups' \
'--pfs[Diffie-Hellman group to use for PFS]: :_vpnc_pfs_diffie_hellman_groups' \
'--enable-1des[enable weak single DES encryption]' \
'--enable-no-encryption[enable using no encryption for data traffic (key exchanged must be encrypted)]' \
'--application-version[application version to report]:application version' \
'--ifname[visible name of the TUN/TAP interface]:name' \
'--ifmode[mode of TUN/TAP interface]: :_vpnc_tun_tap_modes' \
'--debug[show verbose debug messages]: :_vpnc_debug_levels' \
'--no-detach[Don'\''t detach from the console after login]' \
'--pid-file[store the pid of background process in the file]:pid file:_files' \
'--local-addr[local IP to use for ISAKMP/ESP/...]: :_hosts' \
'--local-port[local ISAKMP port number to use]: :_vpnc_isakmp_port_numbers' \
'--udp-port[local UDP port number to use]: :_vpnc_udp_port_numbers' \
'--dpd-idle[send DPD packet after not receiving anything for X seconds]: :_vpnc_dpd_idle_times' \
'--non-inter[Don'\''t ask anything, exit on missing options]' \
'--auth-mode[authentication mode]: :_vpnc_authentication_modes' \
'--ca-file[filename and path to the CA-PEM-File]:CA-PEM file:_files' \
'--ca-dir[path of the trusted CA-Directory]:CA directory:_files -/' \
'--target-network[target network in dotted decimal or CIDR notation]:target network/netmask' \
'--print-config[print your configuration; output can be used as vpnc.conf]' \
'*: :_vpnc_confs'
}
(( $+functions[_vpnc-disconnect] )) ||
_vpnc-disconnect() {
_message 'no more arguments'
}
(( $+functions[_vpnc_confs] )) ||
_vpnc_confs() {
# FIXME /etc/vpnc/ is only accessible to root, how do we deal with this ?
local confs; confs=(/etc/vpnc/*.conf(:t:s/\.conf/))
_describe -t confs 'VPNC conf' confs "$@"
}
(( $+functions[_vpnc_gateway_vendors] )) ||
_vpnc_gateway_vendors() {
local vendors; vendors=(
'cisco'
'netscreen'
)
_describe -t vendors 'vendor' vendors "$@"
}
(( $+functions[_vpnc_nat_traversal_methods] )) ||
_vpnc_nat_traversal_methods() {
local methods; methods=(
'natt:NAT-T as defined in RFC3947 (default)'
'none:disable use of any NAT-T method'
'force-natt:always use NAT-T encapsulation even without presence of a NAT device'
'cisco-udp:Cisco proprietary UDP encapsulation, commonly over Port 10000'
)
_describe -t methods 'NAT traversal method' methods "$@"
}
(( $+functions[_vpnc_ike_diffie_hellman_groups] )) ||
_vpnc_ike_diffie_hellman_groups() {
local groups; groups=(
'dh1'
'dh2'
'dh5'
)
_describe -t groups 'IKE Diffie Hellman group' groups "$@"
}
(( $+functions[_vpnc_pfs_diffie_hellman_groups] )) ||
_vpnc_pfs_diffie_hellman_groups() {
local groups; groups=(
'nopfs'
'dh1'
'dh2'
'dh5'
'server'
)
_describe -t groups 'PFS Diffie Hellman group' groups "$@"
}
(( $+functions[_vpnc_tun_tap_modes] )) ||
_vpnc_tun_tap_modes() {
local modes; modes=(
'tun:virtual point to point interface (default)'
'tap:virtual ethernet interface'
)
_describe -t modes 'TUN/TAP interface mode' modes "$@"
}
(( $+functions[_vpnc_debug_levels] )) ||
_vpnc_debug_levels() {
local levels; levels=(
'0:do not print debug information'
'1:print minimal debug information'
'2:show statemachine and packet/payload type information'
'3:dump everything exluding authentication data'
'99:dump everything INCLUDING AUTHENTICATION data (e.g. PASSWORDS)'
)
_describe -t levels 'debug level' levels "$@"
}
(( $+functions[_vpnc_isakmp_port_numbers] )) ||
_vpnc_isakmp_port_numbers() {
local ports; ports=(
'0:use random port'
'1:minimum port number'
'500:default port number'
'65535:maximum port number'
)
_describe -t ports 'ISAKMP port number' ports "$@"
}
(( $+functions[_vpnc_udp_port_numbers] )) ||
_vpnc_udp_port_numbers() {
local ports; ports=(
'0:use random port'
'1:minimum port number'
'10000:default port number'
'65535:maximum port number'
)
_describe -t ports 'UDP port number' ports "$@"
}
(( $+functions[_vpnc_dpd_idle_times] )) ||
_vpnc_dpd_idle_times() {
local times; times=(
'0:completely disable DPD'
'10:minimum value'
'300:default value'
'86400:maximum value'
)
_describe -t times 'DPD idle wait time (seconds)' times "$@"
}
(( $+functions[_vpnc_authentication_modes] )) ||
_vpnc_authentication_modes() {
local modes; modes=(
'psk:pre-shared key (default)'
'cert:server + client certificate'
'hybrid:server certificate + xauth'
)
_describe -t modes 'authentication mode' modes "$@"
}
case $service in
vpnc|vpnc-connect) _call_function ret _vpnc-connect && return ret ;;
vpnc-disconnect) _call_function ret _vpnc-disconnect && return ret ;;
esac

338
_yaourt Normal file
View File

@ -0,0 +1,338 @@
#compdef yaourt yaourt.static=yaourt
# Completion file for yaourt, based on pacman's
# copy this file to /usr/share/zsh/site-functions/_pacman
typeset -A opt_args
# options for passing to _arguments: main pacman commands
_yaourt_opts_commands=(
'-Q[Query the package database]'
'-R[Remove a package from the system]'
'-S[Synchronize packages]'
'-U[Upgrade a package]'
'-V[Display version and exit]'
'-h[Display usage]'
'-B[backup pacman database]'
'-G[Get PKGBUILD]'
'-C[Clean backup files]'
'--stats[Package Statistics]'
)
# options for passing to _arguments: options common to all commands
_yaourt_opts_common=(
'-b[Alternate database location]:database_location:_files -/'
'-h[Display syntax for the given operation]'
'-r[Set alternate installation root]:installation root:_files -/'
'-v[Be more verbose]'
'--cachedir[Alternate package cache location]:cache_location:_files -/'
'--config[An alternate configuration file]:config file:_files'
'--logfile[An alternate log file]:config file:_files'
'--noconfirm[Do not ask for confirmation]'
'--noprogressbar[Do not show a progress bar when downloading files]'
'--noscriptlet[Do not execute the install scriptlet if one exists]'
'--print[Only print the targets instead of performing the operation]'
)
# options for passing to _arguments: options for --upgrade commands
_yaourt_opts_pkgfile=(
'-d[Skip dependency checks]'
'-f[Overwrite conflicting files]'
'*:package file:_files -g "*.pkg.tar.*(.)"'
)
# options for passing to _arguments: subactions for --query command
_yaourt_opts_query_actions=(
'-g[View all members of a package group]:*:package groups:->query_group'
'-o[Query the package that owns a file]:file:_files'
'-p[Package file to query]:*:package file:->query_file'
'-s[Search package names and descriptions]:*:search text:->query_search'
)
# options for passing to _arguments: options for --query and subcommands
_yaourt_opts_query_modifiers=(
'-c[List package changelog]'
'-d[List packages installed as dependencies]'
'-e[List packages explicitly installed]'
'-i[View package information]'
'-ii[View package information including backup files]'
'-k[Check package files]'
'-l[List package contents]'
'-m[List installed packages not found in sync db(s)]'
'-t[List packages not required by any package]'
'-u[List packages that can be upgraded]'
'--aur[Install packages from aur, even if they are in community, or, with the -u option, update packages installed from aur]'
'--devel[Used with -u updates all cvs/svn/git/hg/bzr packages]'
)
# options for passing to _arguments: options for --remove command
_yaourt_opts_remove=(
'-c[Remove all dependent packages]'
'-d[Skip dependency checks]'
'-k[Only remove database entry, do not remove files]'
'-n[Remove protected configuration files]'
'-s[Remove dependencies not required by other packages]'
'*:installed package:_yaourt_completions_installed_packages'
)
# options for passing to _arguments: options for --sync command
_yaourt_opts_sync_actions=(
'*-c[Remove old packages from cache]:*:clean:->sync_clean'
'*-cc[Remove all packages from cache]:*:clean:->sync_clean'
'-g[View all members of a package group]:*:package groups:->sync_group'
'-s[Search package names and descriptions]:*:search text:->sync_search'
)
# options for passing to _arguments: options for --sync command
_yaourt_opts_sync_modifiers=(
'-d[Skip dependency checks]'
'-f[Overwrite conflicting files]'
'-i[View package information]'
'-l[List all packages in a repository]'
'-p[Print download URIs for each package to be installed]'
'-u[Upgrade all out-of-date packages]'
'-w[Download packages only]'
'-y[Download fresh package databases]'
'*--ignore[Ignore a package upgrade]:package:
_yaourt_completions_all_packages'
'*--ignoregroup[Ignore a group upgrade]:package group:
_yaourt_completions_all_groups'
'--asdeps[Install packages as non-explicitly installed]'
'--asexplicit[Install packages as explicitly installed]'
)
# handles --help subcommand
_yaourt_action_help() {
_arguments -s : \
"$_yaourt_opts_commands[@]"
}
# handles cases where no subcommand has yet been given
_yaourt_action_none() {
_arguments -s : \
"$_yaourt_opts_commands[@]"
}
# handles --query subcommand
_yaourt_action_query() {
local context state line
typeset -A opt_args
# _arguments -s : \
# "$_yaourt_opts_common[@]" \
# "$_yaourt_opts_query_actions[@]" \
# "$_yaourt_opts_query_modifiers[@]"
case $state in
query_file)
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_query_modifiers[@]" \
'*:package file:_files -g "*.pkg.tar.*"'
;;
query_group)
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_query_modifiers[@]" \
'*:groups:_yaourt_completions_installed_groups'
;;
query_owner)
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_query_modifiers[@]" \
'*:file:_files'
;;
query_search)
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_query_modifiers[@]" \
'*:search text: '
;;
*)
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_query_actions[@]" \
"$_yaourt_opts_query_modifiers[@]" \
'*:package:_yaourt_completions_installed_packages'
;;
esac
}
# handles --remove subcommand
_yaourt_action_remove() {
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_remove[@]"
}
# handles --sync subcommand
_yaourt_action_sync() {
local context state line
typeset -A opt_args
# _arguments -s : \
# "$_yaourt_opts_common[@]" \
# "$_yaourt_opts_sync_actions[@]" #\
# #"$_yaourt_opts_sync_modifiers[@]"
case $state in
sync_clean)
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_sync_modifiers[@]" \
'*-c[Remove old packages from cache]' \
;;
sync_group)
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_sync_modifiers[@]" \
'*:package group:_yaourt_completions_all_groups'
;;
sync_search)
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_sync_modifiers[@]" \
'*:search text: '
;;
*)
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_sync_modifiers[@]" \
'*:package:_yaourt_completions_all_packages'
;;
esac
}
# handles --upgrade subcommand
_yaourt_action_upgrade() {
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_pkgfile[@]"
}
# handles --version subcommand
_yaourt_action_version() {
# no further arguments
return 0
}
# provides completions for package groups
_yaourt_completions_all_groups() {
local -a cmd groups
_yaourt_get_command
groups=( $(_call_program groups $cmd[@] -Sg) )
typeset -U groups
compadd "$@" -a groups
}
# provides completions for packages available from repositories
# these can be specified as either 'package' or 'repository/package'
_yaourt_completions_all_packages() {
local -a cmd packages repositories packages_long
_yaourt_get_command
if compset -P1 '*/*'; then
packages=( $(_call_program packages $cmd[@] -Sql ${words[CURRENT]%/*}) )
typeset -U packages
_wanted repo_packages expl "repository/package" compadd ${(@)packages}
else
packages=( $(_call_program packages $cmd[@] -Sql) )
typeset -U packages
_wanted packages expl "packages" compadd - "${(@)packages}"
repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
typeset -U repositories
_wanted repo_packages expl "repository/package" compadd -S "/" $repositories
fi
}
# provides completions for package groups
_yaourt_completions_installed_groups() {
local -a cmd groups
_yaourt_get_command
groups=(${(o)${(f)"$(_call_program groups $cmd[@] -Qg)"}% *})
typeset -U groups
compadd "$@" -a groups
}
# provides completions for installed packages
_yaourt_completions_installed_packages() {
local -a cmd packages packages_long
packages_long=(/var/lib/pacman/local/*(/))
packages=( ${${packages_long#/var/lib/pacman/local/}%-*-*} )
compadd "$@" -a packages
}
# provides completions for repository names
_yaourt_completions_repositories() {
local -a cmd repositories
repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
# Uniq the array
typeset -U repositories
compadd "$@" -a repositories
}
# builds command for invoking pacman in a _call_program command - extracts
# relevant options already specified (config file, etc)
# $cmd must be declared by calling function
_yaourt_get_command() {
# this is mostly nicked from _perforce
cmd=( "pacman" )
integer i
for (( i = 2; i < CURRENT - 1; i++ )); do
if [[ ${words[i]} = "--config" || ${words[i]} = "--root" ]]; then
cmd+=( ${words[i,i+1]} )
fi
done
}
# main dispatcher
_pacman() {
case $words[2] in
-Q*g*) # ipkg groups
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_query_modifiers[@]" \
'*:groups:_yaourt_completions_installed_groups'
;;
-Q*o*) # file
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_query_modifiers[@]" \
'*:package file:_files'
;;
-Q*p*) # file *.pkg.tar.*
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_query_modifiers[@]" \
'*:package file:_files -g "*.pkg.tar.*"'
;;
-Q*) _yaourt_action_query ;;
-R*) _yaourt_action_remove ;;
-S*c*) # no completion
return 0
;;
-S*l*) # repos
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_sync_modifiers[@]" \
'*:package repo:_yaourt_completions_repositories' \
;;
-S*g*) # pkg groups
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_sync_modifiers[@]" \
'*:package group:_yaourt_completions_all_groups'
;;
-S*) _yaourt_action_sync ;;
-U*) _yaourt_action_upgrade ;;
-V*) _yaourt_action_version ;;
-h*) _yaourt_action_help ;;
- ) _yaourt_action_none ;;
* ) return 1 ;;
esac
}
# run the main dispatcher
_pacman "$@"

36
_zargs Normal file
View File

@ -0,0 +1,36 @@
#compdef zargs
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for zargs.
#
# Source: http://smasher.org/tmp/_zargs.gz
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Atom Smasher <atom@smasher.org>
# * Sorin Ionescu <sorin.ionescu@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments -s -S \
'(--eof -e)'{--eof=,-e+}'[Change the end-of-input-args string from "--" to eof-str]:string' \
'(--exit -x)'{--exit,-x}'[Exit if the size (see --max-chars) is exceeded]' \
'(--interactive -p)'{--interactive,-p}'[Prompt before executing each command line]' \
'--help[Print this summary and exit]' \
'(--max-args -n)'{--max-args=,-n+}'[Use at most max-args arguments per command line]:integer' \
'(--max-chars -s)'{--max-chars=,-s+}'[Use at most max-chars characters per command line]:integer' \
'(--max-lines -l)'{--max-lines=,-l+}'[Use at most max-lines of the input-args per command line]:integer' \
'(--max-procs -P)'{--max-procs=,-P+}'[Run up to max-procs command lines in the background at once]:integer' \
'(--no-run-if-empty, -r)'{--no-run-if-empty,-r}'[Do nothing if there are no input arguments before the eof-str]' \
'(--null -0)'{--null,-0}'[Split each input-arg at null bytes, for xargs compatibility]' \
'(--replace -i)'{--replace=,-i+}'[Substitute replace-str in the initial-args by each initial-arg]:string' \
'(--verbose -t)'{--verbose,-t}'[Print each command line to stderr before executing it]' \
'--version[Print the version number and exit]' \
'(-):command: _command_names -e' \
'*::args: _normal'

View File

@ -1,36 +0,0 @@
#compdef age
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for age 1.1.1 (https://github.com/FiloSottile/age).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Hydrargyrum (https://github.com/hydrargyrum)
#
# ------------------------------------------------------------------------------
_arguments \
-A '-*' \
'(- *)'{-h,--help}'[show help message and exit]' \
'(-e --encrypt -d --decrypt)'{-e,--encrypt}'[Encrypt INPUT to OUTPUT]' \
'(-e --encrypt -d --decrypt -a --armor -p --passphrase -r --recipient -R --recipients-file)'{-d,--decrypt}'[Decrypt INPUT to OUTPUT]' \
\*{-i,--identity=}'[Encrypt/Decrypt using the identities at PATH]:IDENTITY:_files' \
'(-o --output)'{-o,--output=}'[Write encrypted/decrypted file to OUTPUT]:OUTPUT:_files' \
'(-j --plugin)'{-j,--plugin=}'[Encrypt/Decrypt using the data-less PLUGIN]:PLUGIN:' \
'(-d --decrypt)'\*{-r,--recipient=}'[Encrypt to the explicitly specified RECIPIENT]:RECIPIENT:' \
'(-d --decrypt)'\*{-R,--recipients-file=}'[Encrypt to the RECIPIENTS listed in the file at PATH]:RECIPIENTS_FILE:_files' \
'(-a --armor -d --decrypt)'{-a,--armor}'[Encrypt to an ASCII-only "armored" encoding]' \
'(-p --passphrase -d --decrypt)'{-p,--passphrase}'[Encrypt with a passphrase]' \
:INPUT:_files
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,63 +0,0 @@
#compdef artisan
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for artisan (http://laravel.com/docs/artisan).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * loranger (https://github.com/loranger)
# * Yohan Tambè (https://github.com/Cronos87)
#
# ------------------------------------------------------------------------------
_artisan_get_command_list () {
IFS=" "
php artisan --no-ansi | \
sed "1,/Available commands/d" | \
awk '/ [a-z]+/ { print $1 }' | \
sed -E 's/^[ ]+//g' | \
sed -E 's/[:]+/\\:/g' | \
sed -E 's/[ ]{2,}/\:/g'
}
_artisan () {
if [ -f artisan ]; then
local -a commands
IFS=$'\n'
commands=(`_artisan_get_command_list`)
_describe 'commands' commands
fi
}
compdef _artisan php artisan
compdef _artisan artisan

View File

@ -1,71 +0,0 @@
#compdef atach
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for atach (https://github.com/sorin-ionescu/atach).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Sorin Ionescu <sorin.ionescu@gmail.com>
#
# ------------------------------------------------------------------------------
local state mode_values existing_sessions ret=1
mode_values=(
"none:disable redrawing"
"ctrl_l:use ctrl + l to redraw"
"winch:use sigwinch to redraw"
)
existing_sessions=($(_call_program session atach))
_arguments -C -s -S \
'(--list -l)'{--list,-l}'[list sessions]' \
'(--sockets -L)'{--sockets,-L}'[list sockets]' \
'(--session -s)'{--session=,-s+}'[set the session name]:session' \
'(--char -c)'{--char=,-c+}'[set the detach character (default: ^\\)]:char' \
'(--redraw -r)'{--redraw=,-r+}'[set the redraw method (none, ctrl_l, or winch)]:mode:->mode' \
'(--detached -d)'{--detached,-d}'[start the session detached]' \
'(--no-detach -D)'{--no-detach,-D}'[disable detaching]' \
'(--no-suspend -Z)'{--no-suspend,-Z}'[disable suspending]' \
'(--version -v)'{--version,-v}'[display version and copyright]' \
'(--help -h)'{--help,-h}'[display help]' \
'(-)::args:->session-or-command' && ret=0
case "$state" in
(mode)
_describe -t mode 'redraw mode' mode_values && ret=0
;;
(session-or-command)
_describe -t 'session' 'sessions' existing_sessions && ret=0
_path_commands && ret=0
;;
esac
return $ret

View File

@ -1,197 +0,0 @@
#compdef avdmanager
# ------------------------------------------------------------------------------
# Copyright (c) 2023 Github zsh-users - https://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for avdmanager(https://developer.android.com/studio/command-line/avdmanager)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
_avdmanager() {
typeset -A opt_args
local context state line
local curcontext="$curcontext"
local ret=1
_arguments -C -A "-*" \
'(- *)'{-h,--help}'[Print help message]' \
'(-s --silent)'{-s,--silent}'[Silent mode, shows error only]' \
'(-v --verbose)'{-v,--verbose}'[Verbose mode, shows errors, warnings and all messages]' \
'--clear-cache[Clear the SDK Manager repository manifest cache]' \
'1: :_avdmanager_subcommands' \
'*::arg:->args' \
&& ret=0
case "$state" in
(args)
if (( $+functions[_avdmanager_${words[1]}] )); then
_avdmanager_${words[1]} && ret=0
else
ret=0
fi
;;
esac
return ret
}
(( $+functions[_avdmanager_list] )) ||
_avdmanager_list() {
local ret=1
_arguments -C \
'1: :(avd target device)' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
case $words[1] in
(avd|target|device)
_arguments \
'(-0 --null)'{-0,--null}'[Terminate lines with \0 instead of \n]' \
'(-c --compact)'{-c,--compact}'[Compact output]' \
&& ret=0
;;
esac
;;
esac
return $ret
}
(( $+functions[_avdmanager_create] )) ||
_avdmanager_create() {
local ret=1
_arguments -C \
'1: :(avd)' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
case $words[1] in
(avd)
_arguments \
'(-c --sdcard)'{-c,--sdcard}'[Path to a shared SD card image]: :_files' \
'(-g --tag)'{-g,--tag}'[The sys-img tag to use for the AVD]:tag' \
'(-p --path)'{-p,--path}'[Directory where the new AVD will be created]' \
'(-k --package)'{-k,--package}'[Package path of the system image for this AVD]:package' \
'(-n --name)'{-n,--name}'[Name of the new AVD]:name' \
'--skin[The optional name of a skin to use with this device]' \
'(-f --force)'{-f,--force}'[Forces creation]' \
'(-b --abi)'{-b,--abi}'[The ABI to use for the AVD]:abi' \
'(-d --device)'{-d,--device}'[The optional device definition to use]' \
&& ret=0
;;
esac
;;
esac
return $ret
}
(( $+functions[_avdmanager_move] )) ||
_avdmanager_move() {
local ret=1
_arguments -C \
'1: :(avd)' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
case $words[1] in
(avd)
_arguments \
'(-p --path)'{-p,--path}"[Path to the AVD's new directory]: :_files -/" \
'(-n --name)'{-n,--name}'[Name of the AVD to delete]: :_avdmanager_avds' \
'(-r --rename)'{-r,--rename}'[New name of the AVD]' \
&& ret=0
;;
esac
;;
esac
return $ret
}
(( $+functions[_avdmanager_delete] )) ||
_avdmanager_delete() {
local ret=1
_arguments -C \
'1: :(avd)' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
case $words[1] in
(avd)
_arguments \
'(-n --name)'{-n,--name}'[Name of the AVD to delete]: :_avdmanager_avds' \
&& ret=0
;;
esac
;;
esac
return $ret
}
(( $+functions[_avdmanager_subcommands] )) ||
_avdmanager_subcommands() {
local -a commands=(
"list:Lists existing targets or virtual devices"
"create:Creates a new Android Virtual Device"
"move:Moves or renames an Android Virtual Device"
"delete:Deletes an Android Virtual Device"
)
_describe -t commands 'subcommand' commands
}
(( $+functions[_avdmanager_avds] )) ||
_avdmanager_avds() {
local -a avds=(${(@f)"$(avdmanager list avd -c)"})
_values 'android virtual devices' $avds
}
_avdmanager "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,235 +0,0 @@
#compdef bitcoin-cli
# ------------------------------------------------------------------------------
# Copyright (c) 2017 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for bitcoin-cli v29.0.0 (https://bitcoin.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ian Ker-Seymer (https://github.com/ianks)
# * notmike (https://github.com/notmike-5)
# ------------------------------------------------------------------------------
_bitcoin-cli() {
local context state line curcontext="$curcontext"
_arguments -C \
-?'[This help message]' \
-addrinfo'[Get the number of addresses known to the node, per network and total]' \
-chain='[Use the chain <chain> (default: main). Allowed values: main, test, signet, regtest]:chain:(main test signet regtest)' \
-color='[Color setting for CLI output (default: auto)]:when:(always auto never)' \
-conf='[Specify configuration file. Relative paths will be prefixed by datadir location. (default: bitcoin.conf)]:PATH:_files' \
-datadir='[Specify data directory]:PATH:_directories' \
-getinfo'[Get general information from the remote server]' \
-testnet'[Use the test chain]' \
-regtest'[Enter regression test mode]' \
-named'[Pass named instead of positional arguments (default: false)]' \
-netinfo=-'[Get network peer connection information from the remote server.]::level_or_help:(0 1 2 3 4 help)' \
-stdin'[Read extra arguments from standard input, one per line until EOF/Ctrl-D]' \
-rpcport='[Connect to JSON-RPC on <port> (default: 8332, testnet: 18332, regtest: 18443)]: :_guard "[[\:digit\:]]#" "PORT"' \
-rpcwait'[Wait for RPC server to start]' \
-rpcwaittimeout='[Timeout in seconds to wait for the RPC server to start, or 0 for no timeout. (default: 0)]:timeout' \
-rpcuser='[Username for JSON-RPC connections]:RPCUSER:()' \
-rpcpassword='[Password for JSON-RPC connections]:RPCPASSWORD:()' \
-rpccookiefile='[Location of the auth cookie(default: data dir)]:dir:_files' \
-rpcwallet='[Send RPC for non-default wallet on RPC server]:server' \
-rpcconnect='[Send commands to node running on <ip> (default: 127.0.0.1)]:RPCCONNECT:_hosts' \
-rpcclienttimeout='[Timeout during HTTP requests, or 0 for no timeout. (default: 900)]: :_guard "[[\:digit\:]]#" "RPCCLIENTTIMEOUT"' \
-version'[Print version and exit]' \
':subcommand:->subcommand' && ret=0
case $state in
subcommand)
subcommands=(
'dumptxoutset'
'getbestblockhash'
'getblock'
'getblockchaininfo'
'getblockcount'
'getblockfilter'
'getblockfrompeer'
'getblockhash'
'getblockheader'
'getblockstats'
'getchainstates'
'getchaintips'
'getchaintxstats'
'getdeploymentinfo'
'getdifficulty'
'getmempoolancestors'
'getmempooldescendants'
'getmempoolentry'
'getmempoolinfo'
'getrawmempool'
'gettxout'
'gettxoutproof'
'gettxoutsetinfo'
'gettxspendingprevout'
'importmempool'
'loadtxoutset'
'preciousblock'
'pruneblockchain'
'savemempool'
'scanblocks'
'scantxoutset'
'verifychain'
'verifytxoutproof'
'getmemoryinfo'
'getrpcinfo'
'help'
'logging'
'stop'
'uptime'
'getblocktemplate'
'getmininginfo'
'getnetworkhashps'
'getprioritisedtransactions'
'prioritisetransaction'
'submitblock'
'submitheader'
'addnode'
'clearbanned'
'disconnectnode'
'getaddednodeinfo'
'getaddrmaninfo'
'getconnectioncount'
'getnettotals'
'getnetworkinfo'
'getnodeaddresses'
'getpeerinfo'
'listbanned'
'ping'
'setban'
'setnetworkactive'
'analyzepsbt'
'combinepsbt'
'combinerawtransaction'
'converttopsbt'
'createpsbt'
'createrawtransaction'
'decodepsbt'
'decoderawtransaction'
'decodescript'
'descriptorprocesspsbt'
'finalizepsbt'
'fundrawtransaction'
'getrawtransaction'
'joinpsbts'
'sendrawtransaction'
'signrawtransactionwithkey'
'submitpackage'
'testmempoolaccept'
'utxoupdatepsbt'
'enumeratesigners'
'createmultisig'
'deriveaddresses'
'estimatesmartfee'
'getdescriptorinfo'
'getindexinfo'
'signmessagewithprivkey'
'validateaddress'
'verifymessage'
'abandontransaction'
'abortrescan'
'backupwallet'
'bumpfee'
'createwallet'
'createwalletdescriptor'
'encryptwallet'
'getaddressesbylabel'
'getaddressinfo'
'getbalance'
'getbalances'
'gethdkeys'
'getnewaddress'
'getrawchangeaddress'
'getreceivedbyaddress'
'getreceivedbylabel'
'gettransaction'
'getunconfirmedbalance'
'getwalletinfo'
'importdescriptors'
'importprunedfunds'
'keypoolrefill'
'listaddressgroupings'
'listdescriptors'
'listlabels'
'listlockunspent'
'listreceivedbyaddress'
'listreceivedbylabel'
'listsinceblock'
'listtransactions'
'listunspent'
'listwalletdir'
'listwallets'
'loadwallet'
'lockunspent'
'migratewallet'
'psbtbumpfee'
'removeprunedfunds'
'rescanblockchain'
'restorewallet'
'send'
'sendall'
'sendmany'
'sendtoaddress'
'setlabel'
'settxfee'
'setwalletflag'
'signmessage'
'signrawtransactionwithwallet'
'simulaterawtransaction'
'unloadwallet'
'upgradewallet'
'walletcreatefundedpsbt'
'walletdisplayaddress'
'walletlock'
'walletpassphrase'
'walletpassphrasechange'
'walletprocesspsbt'
'getzmqnotifications'
)
_describe -t subcommands 'bitcoin-cli subcommands' subcommands && ret=0
esac
return ret
}
_bitcoin-cli "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,68 +0,0 @@
#compdef blkid
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Description
# -----------
#
# Completion for blkid, util-linux 2.40.2 (https://github.com/util-linux/util-linux/)
# - locate/print block device attributes
# https://man7.org/linux/man-pages/man8/blkid.8.html
# ------------------------------------------------------------------------------
# Authors
# -------
# * Aditi Sharma (https://github.com/Aditi76117)
# ------------------------------------------------------------------------------
_arguments \
'(-c --cache-file)'{-c+,--cache-file}'[Read from cachefile instead of reading from the default cache file]:cache file:_files' \
'(-d --no-encoding)'{-d,--no-encoding}"[Don't encode non-printing characters]" \
'(-D --no-part-details)'{-D,--no-part-details}"[Don't print information from partition table in low-level probing mode]" \
'(-g --garbage-collect)'{-g,--garbage-collect}'[Perform a garbage collection on the blkid cache]' \
'(-H --hint)'{-H,--hint}'[Set probing hint]:setting' \
'(-i --info)'{-i,--info}'[Display information about I/O limits]' \
'(-k --list-filesystems)'{-k,--list-filesystems}'[List all known filesystems and RAIDS and exits]' \
'(-l --list-one)'{-l,--list-one}'[Look up only one device that matches with the --match-token option]' \
'(-L --label)'{-L+,--label}'[Look up the device that uses this filesystem label]:label' \
'(-n --match-types)'{-n+,--match-types}'[Restrict the probing functions to the specified comma-separated list of superblock types]:list' \
'(-o --output)'{-o+,--output}'[Use the specified output format]:format:(full value list device udev export)' \
'(-O --offset)'{-O+,--offset}'[Probe at the given offset]:offset' \
'(-p --probe)'{-p,--probe}'[Switch to low-level superblock probing mode]' \
'(-s --match-tag)'{-m+,--match-tag}'[Show only the tags that match tag]:tag' \
'(-S --size)'{-S,--size}'[Override the size of device/file]' \
'(-t --match-token)'{-t+,--match-token}'[Search for block devices with tokens named NAME that have the VALUE]:name' \
'(-u --usages)'{-u,--usages}'[Restrict the probing functions to the specified comma-separated list of usage types]:list' \
'(-U --uuid)'{-U,--uuid}'[Look up the device that uses this filesystem uuid]:uuid' \
'(- *)'{-h,--help}'[Display help text and exit]' \
'(- *)'{-V,--version}'[Print version and exit]' \
'*:device:_files -g /dev'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,163 +0,0 @@
#compdef bower
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Bower (https://bower.io).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Joe Lencioni (https://github.com/lencioni)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line _opts ret=1
_arguments -C \
'(- 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]" && ret=0
_arguments \
'(--force)--force[make various commands more forceful]' \
'(--json)--json[output consumable JSON]' \
'(--log-level)--log-level[what level of logs to report]' \
"(--offline)--offline[don't hit the network]" \
'(--quiet)--quiet[only output important information]' \
"(--silent)--silent[don't output anything, besides errors]" \
'(--verbose)--verbose[make output more verbose]' \
'(--allow-root)--allow-root[allow 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[don't 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 the project's bower.json dependencies]" \
"(--save-dev)--save-dev[save installed packages into the project's bower.json devDependencies]" && ret=0
;;
update)
_arguments \
'(--force-latest)--force-latest[force latest version on conflict]' \
'(--help)--help[show help message]' \
"(--production)--production[don't 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 'option' $_opts && ret=0
fi
;;
esac
;;
esac
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,360 +0,0 @@
#compdef bundle
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Bundler 2.7.0 (https://bundler.io/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Bruno Michel (https://github.com/nono)
# * Shohei Yoshida (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
_bundle_commands() {
local -a commands=(
"install:Install the gems specified by the Gemfile or Gemfile.lock"
"update:Update dependencies to their latest versions"
"cache: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"
"help:Describe available tasks or one specific task"
"add:Add the named gem to the Gemfile and run bundle install"
"binstubs:Generate binstubs for executables in a gem"
"check:Determine whether the requirements for your application are installed"
"show:Show the source location of a particular gem in the bundle"
"outdated:Show all of the outdated gems in the current bundle"
"console:Start an IRB session in the context of the current bundle"
"open:Open an installed gem in the editor"
"list:Show all of the gems in the current bundle"
"lock:Generate a lockfile for your dependencies"
"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"
"platform:Displays platform compatibility information"
"clean:Clean up unused gems in your Bundler directory"
"doctor:Display warnings about common problems"
"remove:Removes gems from the Gemfile"
)
_describe -t commands 'command' commands "$@"
}
_bundle_gems() {
local -a gems=($(bundle show | awk '/^ / { print $2 }'))
if [[ $? == 0 ]]; then
_values 'gems' $gems
fi
}
_bundle_groups() {
if [[ -e Gemfile ]]; then
local -a groups=(${(@f)"$(awk '/^ *group *:/{sub(/^ *group *:/, ""); print $1}' Gemfile)"})
_values 'groups' $groups
fi
}
_bundle_config_subcommands() {
local subcommands;
subcommands=(
"list:print a list of all bundler configuration"
"get:print the value of that configuration setting"
"set:set <name> <value> defaults to setting configuration"
"unset:delete the configuration"
)
_describe -t subcommands 'subcommand' subcommands "$@"
}
_arguments -C -A "-v" -A "--version" \
'(- 1 *)'{-v,--version}'[display version information]' \
'(-r --retry)'{-r,--retry}'[specify the number of times you with to attempt network commands]:number:' \
'(-v --verbose)'{-V,--verbose}'[print out additional logging information]' \
'--no-color[print all output without color]' \
'1: :_bundle_commands' \
'*:: :->args' && ret=0
case $state in
args)
case $words[1] in
help)
local -a commands=('install' 'update' 'cache' 'exec' 'config' 'help' 'add' 'binstubs'
'check' 'show' 'outdated' 'console' 'open' 'list' 'lock' 'lock' 'viz' 'init'
'gem' 'platform' 'clean' 'doctor' 'remove')
_arguments -C \
'1: :($commands)' \
&& ret=0
;;
install)
local -a policies=('HighSecurity' 'MediumSecurity' 'LowSecurity' 'AlmostNoSecurity' 'NoSecurity')
_arguments \
'--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files -/' \
'--clean[remove any gems not present in the current Gemfile]' \
'--deployment[install using defaults tuned for deployment environments]' \
'--redownload[force download every gem, even if the required versions are already available locally]' \
'--frozen[do not allow the Gemfile.lock to be updated after this install]' \
'--full-index[download and cache the index file of all gems]' \
'--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile:_files' \
'(-j --jobs)'{-j,--jobs}'[the maximum number of parallel download and install jobs]:number' \
'--local[do not attempt to connect to rubygems.org]' \
'--no-cache[do not update the cache in vendor/cache with newly installed gems]' \
'--no-prune[do not remove stale gem from cache after installation]' \
'--path=-[specify a different path than the system default]:path:_files' \
'--quiet[only output warnings and errors]' \
'--shebang=-[specify ruby executable to execute scripts]:ruby:_files' \
'--standalone=-[create standalone bundles]:groups:_bundle_groups' \
'--system[install to the system location]' \
"--trust-policy=-[apply the Rubygems security policy]:arg:($policies)" \
'--with=-[include gems that are part of the specified named group]:groups:_bundle_groups' \
'--without=-[exclude gems that are part of the specified named group]:groups:_bundle_groups' \
&& ret=0
;;
update)
_arguments \
'--all[update all gems specified in Gemfile]' \
\*{--group,-g}=-'[only update the gems in the specified group]' \
'--source=-[the name of a source used in the Gemfile]:url' \
'--local[do not attempt to fetch gems remotely and use the gem cached instead]' \
'--ruby[update the locked version of Ruby to the current version of Ruby]' \
'--bundler[update the locked version of bundler to invoked bundler version]' \
'--full-index[fall back to using the single-file index of all gems]' \
'(-j --jobs)'{-j,--jobs}'[specify the number of jobs to run in parallel]:number' \
'--retry=-[retry failed network or git requests for number times]:number' \
'--quiet[only output warnings and errors]' \
'--redownload[force download every gem, even if the required versions are already available locally]' \
'--patch[prefer updating only to next patch version]' \
'--minor[prefer updating only to next minor version]' \
'--major[prefer updating only to next major version (default)]' \
'--strict[do not allow any gem to be updated past latest --patch | --minor | --major]' \
'--conservative[use bundle install conservative update behavior]' \
'*:: :_bundle_gems' \
&& ret=0
;;
cache)
_arguments \
'--all[include all sources]' \
'--all-platforms[include gems for all platforms present in the lockfile, not only the current one]' \
'--cache-path=-[specify a different cache path than the default(vendor/cache)]: :_files -/' \
'--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile:_files' \
"--no-install[don't install the gems, only update the cache]" \
"--no-prune[don't remove stale gems from the cache]" \
'--path=-[specify a different path than the system default($BUNDLE_PATH or $GEM_HOME)]: :_files' \
'--quite[only output warnings and errors]' \
'--frozen[do not allow the Gemfile.lock to be updated after this bundle cache operation]' \
'--no-color[disable colorization in output]' \
'(-r --retry)'{-r,--retry}=-'[specify the number of times you with to attempt network commands]:nums' \
'(-V --verbose)'{-v,--verbose}'[enable verbose output mode]' \
&& ret=0
;;
exec)
_arguments \
'--keep-file-descriptors[exec will revert to the 1.9 behavior of passing all file descriptors to the new process]' \
'*:: :_normal' \
&& ret=0
;;
config)
_arguments -C \
'1: :_bundle_config_subcommands' \
'--local[use local configuration]' \
'--global[use global configuration]' \
&& ret=0
;;
add)
_arguments \
'(-v --version)'{-v,--version}=-'[specify version requirements for the added gem]:version' \
'(-g --group)'{-g,--group}=-'[specify the group for the added gem]:group:_bundle_groups' \
'(-s --source)'{-s,--source}=-'[specify the source for the added gem]: :_files' \
'(-r --require)'{-r,--require}=-'[adds require path to gem]: :_files' \
'--path=-[specify the file path for the added gem]: :_files -/' \
'--git=-[specify the git source for the added gem]:git' \
'--github=-[specify the github source for the added gem]:github' \
'--branch=-[specify the git branch for the added gem]:branch' \
'--ref=-[specify the git ref for the added gem]' \
"--glob=[specify the location of a dependency's .gemspec, expanded within Ruby]:glob" \
'--quiet[do not print progress information to the starndard output]' \
'--skip-install[adds the gem to the Gemfile but does not install it]' \
'--optimistic[adds optimistic declaration of version]' \
'--strict[adds strict declaration of version]' \
'1::gem:' \
&& ret=0
;;
binstubs)
_arguments \
'--force[overwrite existing binstubs if they exist]' \
'--path=-[the location to install the specified binstubs to]: :_files -/' \
'--standalone[makes binstubs that can work without depending on Rubygems or Bundler at runtime]' \
'--shebang=-[specify a different shebang executable name than the default(default: ruby)]: :_files' \
'--all[create binstubs for all gems in the bundle]' \
'1::gem:' \
&& ret=0
;;
check)
_arguments \
'--dry-run[locks the Gemfile before running the command]' \
'--gemfile=-[use the specified gemfile instead of the Gemfile]: :_files' \
'--path=-[specify a different path than the system default($BUNDLE_PATH or $GEM_HOME)]: :_files -/' \
&& ret=0
;;
show)
_arguments \
'--paths[list the paths of all gems that are required by your Gemfile]' \
'1:: :_bundle_gems' \
&& ret=0
;;
outdated)
_arguments \
'--local[do not attempt to fetch gems remotely and use the gem cache instead]' \
'--pre[check for newer pre-release gems]' \
'--source[check against a specific source]' \
'--strict[only list newer versions allowed by your Gemfile requirements]' \
{--parseable,--porcelain}'[use minimal formatting for more parsable output]' \
'--group=-[list gems from a specific group]:group:_bundle_groups' \
'--groups[list gems organized by groups]' \
'--major[prefer updating to next major version(default)]' \
'--minor[prefer updating only to next minor version]' \
'--patch[prefer updating only to next patch version]' \
'--filter-major[only list major new versions]' \
'--filter-minor[only list minor new versions]' \
'--filter-patch[only list patch new versions]' \
'--only-explicit[only list gems specified in your Gemfile, not their dependencies]' \
'*:: :_bundle_gems' \
&& ret=0
;;
console)
_arguments \
'--no-color[disable colorization in output]' \
'(-r --retry)'{-r,--retry}=-'[specify the number of times you with to attempt network commands]:num' \
'(-v --verbose)'{-v,--verbose}=-'[enable verbose output mode]' \
'1:: :_bundle_groups' \
&& ret=0
;;
open)
_arguments \
'1:: :_bundle_gems' \
&& ret=0
;;
list)
_arguments \
'--name-only[print only the name of each gem]' \
'--paths[print the path to each gem in the bundle]' \
'--without-group=-[a space-separated list of groups of gems to skip during printing]: :_bundle_groups' \
'--only-group=-[a space-separated list of groups of gems to print]: :_bundle_groups' \
&& ret=0
;;
lock)
_arguments \
'--update=-[ignores the existing lockfile]' \
'--local[do not attempt to connect to rubygems.org]' \
'--print[prints the lockfile to STDOUT instead of writing to the file system]' \
'--lockfile=-[the path where the lick file should be written to]: :_files' \
'--full-index[fall back to using the single file index of all gems]' \
'--add-platform=-[add a new platform to the lockfile, re-resolving for the addition of that platform]' \
'--remove-platform=-[remove a platform from the lockfile]' \
'--normalize-platforms[normalize lockfile platforms]' \
'--patch[if updating, prefer updating only to next patch version]' \
'--minor[if updating, prefer updating only to next minor version]' \
'--major[if updating, prefer updating to next major version(default)]' \
'--strict[if updating, do not allow any gem to be updated past latest --patch | --minor | --major]' \
'--conservative[if updating, use bundle install conservative update behavior]' \
&& ret=0
;;
viz)
_arguments \
'(-f --file)'{-f,--file}=-'[the name to use for the generated file]: :_files' \
'(-F --format)'{-F,--format}=-'[output format option]: :(png jpg svg dot)' \
'(-R --requirements)'{-r,--requirements}'[set to show the version of each required dependency]' \
'(-v --version)'{-v,--version}'[set to show each version]' \
'(-W --without)'{-W,--without}'[exclude gems that are part of the specified named group]' \
&& ret=0
;;
init)
_arguments \
'--gemspec=-[use the specified .gemspec to create the Gemfile]: :_files' \
'--gemfile=[use the specified name for the gamfile instead of Gemfile]:name' \
&& ret=0
;;
gem)
_arguments \
'(--exe -b --bin --no-exe)'{--exe,-b,--bin}'[specify that bundler should create a binary executable in the generated rubygem project]' \
'(--exe -b --bin --no-exe)--no-exe[do not create a binary]' \
'(--no-coc)--coc[add a CODE_OF_CONDUCT.md to the root of the generated project]' \
'(--coc)--no-coc[do not create a CODE_OF_CONDUCT.md]' \
'(--no-ext --ext)--ext=[add boilerplate for C or Rust extension code to the generated project]: :(c rust)' \
'(--ext --no-ext)--no-ext[do not add extension code]' \
'(--no-mit --mit)--mit[add an MIT license to a LICENSE.txt file in the root of the generated project]' \
'(--mit --no-mit)--no-mit[do not create a LICENSE.txt]' \
'(-t --test --no-test)'{-t,--test}=-'[specify the test framework]: :(minitest rspec test-unit)' \
'(-t --test --no-test)--no-test[do not use a test framework]' \
'(--ci --no-ci)--ci=-[specify the continuous integration service]: :(github travis gitlab circle)' \
'(--ci --no-ci)--no-ci[do not use a continuous integration service]' \
'(--linter --no-linter)--linter=-[specify the linter and code formatter]: :(rubocop standard)' \
'(--linter --no-linter)--no-linter[do not add a linter]' \
'(-e --edit)'{-e,--edit}=-'[open the resulting GEM_NAME.gemspec in EDITOR]' \
'1::gem_name:' \
&& ret=0
;;
platform)
_arguments \
'--ruby[it will display the ruby directive information]' \
&& ret=0
;;
clean)
_arguments \
'--dry-run[print the changes, but do not clean the unused gems]' \
'--force[forces cleaning up unused gems even if Bundler is configured to use globally installed gems]' \
&& ret=0
;;
doctor)
_arguments \
'--quiet[only output warnings and errors]' \
'--gemfile=-[the location of the Gemfile which Bundler should use]: :_files' \
&& ret=0
;;
remove)
_arguments \
'--install[runs bundle install after the given gem have been removed from the Gemfile]' \
'*:: :_bundle_gems' \
&& ret=0
;;
esac
;;
esac
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,93 +0,0 @@
#compdef cap
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Capistrano 3.17.1 (https://capistranorb.com/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Bruno Michel (https://github.com/nono)
# * Shohei Yoshida (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line cmds ret=1
_arguments -C \
'--backtrace=[Enable full backtrace]: :(stderr stdout)' \
'--comments[Show commented tasks only]' \
'--job-stats[Display job statistics]:level' \
'--suppress-backtrace[Suppress backtrace lines matching regexp PATTERN]:pattern' \
'(-A --all)'{-A,--all}'[Show all tasks, even uncommented ones]' \
'(-B --build-all)'{-B,--build-all}'[Build all prerequisites, including those which are up-to-date]' \
'(-C --directory)'{-C,--directory}'[Change to DIRECTORY before doing anything]: :_files -/' \
'(-D --describe)'{-D,--describe}'[Describe the tasks, then exit]:pattern' \
'(-E --execute-continue)'{-E,--execute-continue}'[Execute Ruby code and exit]:code' \
'(-f --rakefile)'{-f,--rakefile}'[Use FILENAME as the rakefile to search for]: :_files' \
'(-G --no-system --nosystem)'{-G,--no-system,--nosystem}'[Use standard project Rakefile search paths, ignore system wide rakefiles]' \
'(-g --system)'{-g,--system}'[Using system wide rakefiles]' \
'(-I --libdir)'\*{-I,--libdir}'[Include LIBDIR in the search path for required modules]: :_files -/' \
'(-j --jobs)'{-j,--jobs}'[Specifies the maximum number of tasks to execute in parallel]:num' \
'(-m --multitask)'{-m,--multitask}'[Treat all tasks as multitasks]' \
'(-N --no-search --nosearch)'{-N,--no-search,--nosearch}'[Do not search parent directories for the Rakefile]' \
'(-P --prereqs)'{-P,--prereqs}'[Display the tasks and dependencies, then exit]' \
'--execute-print[Execute some Ruby code, print the result, then exit]:code' \
'--require[Require MODULE before executing rakefile]:module' \
'(-R --rakelibdir --rakelib)'{-R,--rakelibdir,--rakelib}'[Auto-import any .rake files in RAKELIBDIR]: :_files -/' \
'(-t --trace)'{-t,--trace}'[Turn on invoke/execute tracing, enable full backtrace]: :(stderr stdout)' \
'(-T --tasks)'{-T,--tasks}'[Display the tasks with descriptions]::pattern' \
'(-W --where)'{-W,--where}'[Describe the tasks then exit]::pattern' \
'(-X --no-deprecation-warnings)'{-X,--no-deprecation-warnings}'[Disable the deprecation warnings]' \
'(- *)'{-V,--version}'[Display the program version]' \
'(-n --dry-run)'{-n,--dry-run}'[Do a dry run without executing actions]' \
'(-r --roles)'{-r,--roles}'[Run SSH commands only on hosts matching these roles]:roles' \
'(-z --hosts)'{-z,--hosts}'[Run SSH commands only on matching hosts]:hosts' \
'(-p --print-config-variables)'{-p,--print-config-variables}'[Display the defined config variables before starting the deployment tasks]' \
'(- *)'{-h,-H,--help}'[Display help message]' \
'*: :->cmds' && ret=0
case $state in
cmds)
cmds=( ${(f)"$(_call_program commands cap -T 2>/dev/null | sed -e '/ # /!d; s/:/\\:/g; s/cap \([A-Za-z0-9\\:_-]*\) .*# /\1:/')"} )
_describe -t commands 'cap command' cmds && ret=0
;;
esac
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,89 +0,0 @@
#compdef cask
# ------------------------------------------------------------------------------
# Copyright (c) 2014 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for cask (https://cask.readthedocs.io)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * ptrv <mail@petervasil.net>
# * Johan Andersson <johan.rejeep@gmail.com>
# * Sebastien Duthil <duthils@free.fr>
#
# ------------------------------------------------------------------------------
function _cask() {
local ret=1 state
_arguments \
':subcommand:->subcommand' \
'*:: :->subcmds' && ret=0
case $state in
subcommand)
subcommands=(
"build:build all Elisp files in the files directive"
"clean-elc:remove all byte compiled Elisp files in the files directive"
"exec:execute command with correct 'exec-path' and 'load-path'"
"exec-path:print 'exec-path' for all packages and dependencies"
"files:print list of files specified in the files directive"
"help:display usage information or documentation for specified command"
"info:show info about the current package"
"init:initialize the current directory with a Cask-file"
"install:install all packages specified in the Cask-file"
"link:manage links"
"list:list dependencies"
"load-path:print 'load-path' for all packages and dependencies"
"outdated:print list of outdated packages"
"package:build package and put in specified directory (default: dist)"
"package-directory:print current package installation directory"
"path:print 'exec-path' for all packages and dependencies"
"pkg-file:write a 'define-package' file"
"update:update package version"
"upgrade-cask:upgrade Cask itself and its dependencies"
"upgrade:upgrade Cask itself and its dependencies"
"version:print program version"
)
_describe -t subcommands 'cask subcommands' subcommands && ret=0
esac
case "$words[1]" in
init)
_arguments \
'(--dev)--dev[Run in dev mode]' && ret=0 ;;
exec)
_generic
;;
esac
return ret
}
_cask "$@"

View File

@ -1,339 +0,0 @@
#compdef ccache -P -value-,CCACHE_*,-default-
# zsh completion script for ccache 4.10.2
# Copyright 2018 CERN for the benefit of the LHCb Collaboration.
# 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 copyright holder 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 THE COPYRIGHT HOLDER OR CONTRIBUTORS 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.
#
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
# allow users to define their better compilers
# inspired by _cmake_compilers
# users could override with
#
# _ccache_compilers() {
# local -a _ccache_compilers
# _ccache_compilers=(gcc g++ clang clang++)
# _wanted compilers expl "compiler" compadd -- $_ccache_compilers
# }
(( $+functions[_ccache_compilers] )) ||
_ccache_compilers() {
_command_names -e
}
_ccache_booleans() {
_message 'There are no "false" values, unset variable to disable'
local description=${1:-boolean}
local -a booleans=('true' 'yes')
_describe -t booeans "$description" booleans
}
(( $+functions[_ccache_sloppiness] )) ||
_ccache_sloppiness() {
_values -s ',' \
'clang_index_store[ignore the clang compiler option -index-store-path and its argument]' \
'file_stat_matches[rely on mtimes and ctimes]' \
'file_stat_matches_ctime[ignore ctime when file_stat_matches is enabled]' \
'gcno_cwd[not hash the current working directory]' \
'incbin[pretend the .incbin directive]' \
'include_file_ctime[ignore headers ctime too new]' \
'include_file_mtime[ignore headers mtime too new]' \
'ivfsoverlay[ignore the clang option -ivfsoverlay and its argument]' \
'locale[include locale environment variables in the hash]' \
'module[enable cache even if -fmodules is used]' \
'pch_defines[be sloppy about #defines in pch]' \
'random_seed[ignore the -frandom-seed option and its argument]' \
'system_headers[only check non-system headers in direct mode]' \
'time_macros[ignore __DATE__ and __TIME__]'
}
(( $+functions[_ccache_compilerchecks] )) ||
_ccache_compilerchecks() {
local -a compiler_check_values=(
'content:the actual compiler binary'
'mtime:mtime and size of the compiler'
'none:ignore compiler for hashing'
'string\::any hard coded string (pre-computed version)'
'%compiler%\ -v:any compiler invocation output'
)
_describe -t compilerchecks "compiler information included in the hash" compiler_check_values
}
(( $+functions[_ccache_compiler_type] )) ||
_ccache_compiler_type() {
local -a compiler_types=(
'auto:guess compiler name'
'clang:clang-based compiler'
'clang-cl:clang-cl'
'gcc:gcc-based compiler'
'icl:Intel compiler on Windows'
'msvc:Microsoft Visual C++'
'nvcc:NVCC CUDA compiler'
'other:any compiler other than the known types'
)
_describe -t compiler_types "compiler types" compiler_types
}
if [[ "$service" = -value-* ]]; then
case $service in
*CCACHE_*DIR*)
# CCACHE_BASEDIR: relative to which top level paths are hashed
# CCACHE_DIR: where the cache and config are kept
# CCACHE_TEMPDIR: where temporary files are kept
# all: a single path
_path_files -/
;;
*CCACHE_CC*)
_ccache_compilers
;;
*CCACHE_COMPILERCHECK*)
_ccache_compilerchecks
;;
*CCACHE_*COMPRESS*)
_ccache_booleans "write compressed cache"
;;
*CCACHE_EXTENSION*)
_alternative ':set extension for intermediate files: '
;;
*CCACHE_*DIRECT*)
_ccache_booleans "use direct mode"
;;
*CCACHE_*DISABLE*)
_ccache_booleans "disable cache usage"
;;
*CCACHE_EXTRAFILES*)
local sep=:
compset -P "*${sep}"
compset -S "${sep}*" || suf="$sep"
_files "" -r "${sep}"' /\t\t\-' "$@"
;;
*CCACHE_*HARDLINK*)
_ccache_booleans "create hard links rather than copies"
;;
*CCACHE_*HASHDIR*)
_ccache_booleans "include the cwd in the hash"
;;
*CCACHE_IGNOREHEADERS*)
_dir_list
;;
*CCACHE_*COMMENTS*)
_ccache_booleans "consider comments in hashing"
;;
*CCACHE_LIMIT_MULTIPLE*)
_alternative ":clean up down to level (e.g. 0.8): "
;;
*CCACHE_LOGFILE*)
_path_files -g "*(/) *.log"
;;
*CCACHE_MAXFILES*)
_alternative ":maximum number of files in the cache (0= no limit): "
;;
*CCACHE_MAXSIZE*)
_alternative ':maximum cache size (0= no limit) with suffix k,M,G,T or Ki,Mi,Gi,Ti: '
;;
*CCACHE_PATH*)
_alternative ':PATH for compiler lookup (instead of $PATH):_dir_list'
;;
*CCACHE_PREFIX*)
_alternative ':prefixes for compiler invocation: '
;;
*CCACHE_PREFIX_CPP*)
_alternative ':prefixes for preprocessor invocation: '
;;
*CCACHE_*READONLY*)
_ccache_booleans "treat cache as read-only"
;;
*CCACHE_*READONLY_DIRECT*)
_ccache_booleans "retrieve from read-only cache in direct mode"
;;
*CCACHE_*RECACHE*)
_ccache_booleans "use cache in write-only mode"
;;
*CCACHE_*CPP2*)
_ccache_booleans "pass original rather than preprocessed source code to compiler"
;;
*CCACHE_SLOPPINESS*)
_ccache_sloppiness
;;
*CCACHE_*STATS*)
_ccache_booleans "update statistics counters"
;;
*CCACHE_UMASK*)
_alternative ":umask value (octal): "
;;
*CCACHE_*UNIFY*)
_ccache_booleans "normalize sources prior to processing"
;;
esac
return
fi
__ccache_config_keys() {
local -a keys=(
'absolute_paths_in_stderr:rewrite relative paths in error output to absolute paths'
'base_dir:specify relative to which top level paths are hashed'
'cache_dir:specify where the cache is kept'
'compiler:specify compiler'
'compiler_check:compiler information included in the hash'
'compiler_type:force a compiler type'
'compression:write compressed cache'
'compression_level:cache compression level'
'cpp_extension:set extensions for intermediate files'
'debug:enable debug mode'
'debug_dir:specify directory to write debug files'
'debug_level:specify the amount of debug information'
'depend_mode:enable depend mode'
'direct_mode:use direct mode'
'disable:disable cache usage'
'extra_files_to_hash:additional files to consider in hashing'
'file_clone:use file cloning to store and fetch cached compiler results'
'hard_link:create hard links rather than copies'
'hash_dir:include the cwd in the hash'
'ignore_headers_in_manifest:set paths to headers to ignore in hashing'
'ignore_options:list of options that ccache will ignore'
'inode_cache:cache source file hashes based on device, inode and timestamps'
'keep_comments_cpp:consider comments in hashing'
'log_file:specify a log file'
'max_files:maximum number of files in the cache'
'max_size:maximum size of the cache'
'msvc_dep_prefix:specify the prefix of included files output for MSVC compiler'
'namespace:namespace will be added to the hashed data for each compilation'
'path:PATH for compiler lookup (instead of $PATH)'
'pch_external_checksum:use .sum file for hash'
'prefix_command:prefixes for compiler invocation'
'prefix_command_cpp:prefixes for preprocessor invocation'
'read_only:treat cache as read-only'
'read_only_direct:retrieve from read-only cache in direct mode'
'recache:use cache in write-only mode'
'remote_only:use remote storage'
'remote_storage:specify one or several storage backends'
'reshare:write results to remote storage even for local storage cache hits'
'run_second_cpp:pass original rather than preprocessed source code to compiler'
'sloppiness:hash files sloppy'
'stats:update statistics counters'
'stats_log:write statistics counter updates to the specified file'
'temporary_dir:specify where temporary files are kept'
'umask:set umask for ccache and child processes (e.g. for sharing cache)'
)
_describe -t configkeys "configuration keys" keys -S '='
}
if compset -P '--set-config=*='; then
case $IPREFIX in
( *=absolute_paths_in_stderr= | *=compression= | *=debug= | *=depend_mode= | *=direct_mode= | *=disable= | *=file_clone= | *=hard_link= | *=hash_dir= | *=inode_cache= | *=keep_comments_cpp= | *=read_only= | *=read_only_direct= | *=recache= | *=run_second_cpp= | *=stats= | *=unify= )
local -a booleans=('true' 'false')
_describe -t booleans 'boolean' booleans
;;
(*=base_dir= | *=cache_dir= | *=debug_dir= | *=temporary_dir=)
_path_files -/
;;
(*=compiler=)
_ccache_compilers
;;
(*=compiler_check=)
_ccache_compilerchecks
;;
(*=compiler_type=)
_ccache_compiler_type
;;
(*=extra_files_to_hash=)
local sep=:
compset -P "*${sep}"
compset -S "${sep}*" || suf="$sep"
_files "" -r "${sep}"' /\t\t\-' "$@"
;;
( *=ignore_headers_in_manifest= | *=path= )
_dir_list
;;
(*=log_file= | *=stats_log= )
_path_files -g "*(/) *.log"
;;
(*=sloppiness=)
_ccache_sloppiness
;;
*=umask=)
_alternative ":umask value (octal): "
;;
esac
elif [[ $words[2] == -* ]]; then
# if the first argument starts with -, we are in configure-ccache mode
_arguments \
'*'{-o,--set-config=}"[set configuration key]:keys:__ccache_config_keys" \
'(: -)'{-h,--help}'[show help message]' \
'(: -)'{-V,--version}'[print version and copyright information]' \
'(-c --cleanup)'{-c,--cleanup}'[delete old files and recalculate size counters]' \
'(-C --clear)'{-C,--clear}'[clear the cache completely (except configuration)]' \
'--config-path[operate on configuration file PATH instead of the default]: :_files' \
'(-d --dir)'{-d,--dir}'[operate on cache directory PATH instead of the default]: :_files -/' \
'--evict-namespace[remove file created in namespace NAMESPACE]:namespace' \
'--evict-older-than[remove files older than AGE]:age' \
'(-F --max-files=)'{-F,--max-files=}'[set maximum number of files in cache]:number of files in cache: ' \
'(-M --max-size=)'{-M,--max-size=}'[set maximum size of cache]:cache size: ' \
'(-X --recompress)'{-X,--recompress}'[recompress the cache to level LEVEL]:level' \
'--recompress-threads[use up to THREADS threads when recompressing the cache]:threads' \
'(-x --show-compression)'{-x,--show-compression}'[show compression statistics]' \
'(-p --show-config)'{-p,--show-config}'[show current configuration options]' \
'--show-log-stats[print statistics counters from the stats log in human-readable format]' \
'(-s --show-stats)'{-s,--show-stats}'[show statistics summary]' \
'(-v --verbose)'{-v,--verbose}'[increase verbosity]' \
'(-z --zero-stats)'{-z,--zero-stats}'[zero statistics counters]' \
'--trim-dir[remove old files from directory _PATH_]: :_files -/' \
'--trim-max-size[specify the maximum size for --trim-dir]:size' \
'--trim-method[specify the method for --trim-dir]: :(atime mtime)' \
'--trim-recompress[recompress to level LEVEL]:level' \
'--trim-recompress-threads[use up to THREADS threads when recompressing]:threads' \
'--checksum-file[print the checksum of the file at PATH]: :_files' \
'--extract-result[extract file data stored in result file at PATH to the current working directory]' \
'--format[specify format for --print-log-stats and --print-stats]:format:(tab json)' \
'(-k --get-config)'{-k,--get-config}'[print the value of configuration key]:key' \
'--hash-file[print the hash of the file at PATH]: :_files' \
'--inspect[print result/manifest file at PATH in human-readable format]' \
'--print-log-stats[print statistics counter IDs and corresponding values from the stats log]' \
'--print-stats[print statistics counter IDs and corresponding values in machine-parsable format]' \
'--print-version[print version only]'
elif [[ $CURRENT -eq 2 ]]; then
_ccache_compilers
else
# the command line already looks like 'ccache <compiler> ...'
# forward to the completion function of the compiler
(( CURRENT-- ))
shift words
_normal
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

994
src/_cf
View File

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

View File

@ -1,65 +0,0 @@
#compdef chatblade
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for chatblade 0.7.0 (https://github.com/npiv/chatblade)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Johannes Bittner (https://github.com/johannes87)
#
# ------------------------------------------------------------------------------
_chatblade() {
local -a args
local context state state_descr line
typeset -A opt_args
args+=(
'(- *)'{-h,--help}'[show this help message and exit]'
'(- *)--version[display the chatblade version]'
'--openai-api-key[the OpenAI API key can also be set as env variable OPENAI_API_KEY]:key'
'--openai-base-url[a custom URL to use the openAI against a local or custom model]:key'
'--temperature[temperature (openai setting)]:temperature'
'(-c --chat-gpt)'{-c,--chat-gpt}'[chat GPT model 3.5/4 shorthand or full qualified model name, can also be set via env variable OPENAI_API_MODEL]:chat GPT model:(3.5 4 4o mini o1 o1mini)'
'(-i --interactive)'{-i,--interactive}'[start an interactive chat session. This will implicitly continue the conversation]'
'(-s --stream)'{-s,--stream}'[Stream the incoming text to the terminal]'
'(-t --tokens)'{-t,--tokens}'[display what *would* be sent, how many tokens, and estimated costs]'
'(-p --prompt-file)'{-p,--prompt-file}'[prompt name - will load the prompt with that name at ~/.config/chatblade/name or a path to a file]:prompt file:_files'
'(-e --extract)'{-e,--extract}'[extract content from response if possible (either json or code block)]'
'(-r --raw)'{-r,--raw}'[print session as pure text, dont pretty print or format]'
'(-n --no-format)'{-n,--no-format}'[do not add pretty print formatting to output]'
'(-o --only)'{-o,--only}'[Only display the response, omit query]'
'--theme[Set the theme for syntax highlighting see https://pygments.org/styles/, can also be set with CHATBLADE_THEME]:theme:_values "theme" default emacs friendly manni monokai'
'(-l --last)'{-l,--last}'[alias for -S last, the default session if none is specified]'
'(-S --session)'{-S,--session}'[initiate or continue named session]:session:->sessions'
'--session-list[list sessions]'
'--session-path[show path to session file]'
'--session-dump[dump session to stdout]'
'--session-delete[delete session]'
'--session-rename[rename session]:new session:->sessions'
)
_arguments -s $args
case $state in
(sessions)
local -a sessions
sessions=("${(@f)$(chatblade --session-list)}")
_describe 'session' sessions
;;
esac
}
_chatblade
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,53 +0,0 @@
#compdef chmem
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for chmem, util-linux 2.40.2 (https://github.com/util-linux/util-linux/)
# - configure memory
#
# Author:
# *Aditi Sharma (https://github.com/Aditi76117)
# ------------------------------------------------------------------------------
_arguments -s \
'(-b --blocks)'{-b,--blocks}'[Use a BLOCKRANGE parameter instead of RANGE or SIZE]' \
'(-d --disable)'{-d,--disable}'[Set the specified RANGE, SIZE, or BLOCKRANGE of memory offline]' \
'(-e --enable)'{-e,--enable}'[Set the specified RANGE, SIZE, or BLOCKRANGE of memory online]' \
'(-z --zone)'{-z,--zone}'[Select the memory ZONE where to set the specified RANGE, SIZE, or BLOCKRANGE of memory online or offline]' \
'(-v --verbose)'{-v,--verbose}'[Verbose mode]' \
'(- *)'{-h,--help}'[Display help text and exit]' \
'(- *)'{-V,--version}'[Print version and exit]'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,211 +0,0 @@
#compdef chromium
# Copyright 2018 CERN for the benefit of the LHCb Collaboration
# 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 CERN 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 THE COPYRIGHT
# OWNER OR CONTRIBUTORS 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.
#
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
_arguments \
"--user-data-dir=[Specify the directory that user data is kept in]:directory:_path_files -/" \
"--app=[Runs URL in app mode]:url:_urls" \
"--incognito[Open in incognito mode]" \
"--new-window[open in new window]" \
"(--no-proxy-server --proxy-auto-detect --proxy-pac-url --password-store)--proxy-server=[specify proxy server]:[<proxy-scheme>\://]<proxy-host>[\:<proxy-port>]:_chromium_proxyurls" \
"--no-proxy-server[Disables the proxy server]" \
"--proxy-auto-detect[Autodetect proxy configuration]" \
"--proxy-pac-url=[Specify proxy autoconfiguration URL]:proxy autoconfiguration url:_urls" \
"--password-store=[Set the password store to use]:password store: _wanted arguments expl 'wallet store' compadd -- basic gnome kwallet" \
"--version[print version]" \
"*:: :{ _alternative _urls _files }"
# excerpt from the chromium help message:
#
# Specify the HTTP/SOCKS4/SOCKS5 proxy server to use for requests. This overrides any environment variables or settings picked via the options dialog. An individual proxy server is specified
# using the format:
#
#
#
# Where <proxy-scheme> is the protocol of the proxy server, and is one of:
#
# "http", "socks", "socks4", "socks5".
#
# If the <proxy-scheme> is omitted, it defaults to "http". Also note that "socks" is equivalent to "socks5".
#
# Examples:
#
# --proxy-server="foopy:99"
# Use the HTTP proxy "foopy:99" to load all URLs.
#
# --proxy-server="socks://foobar:1080"
# Use the SOCKS v5 proxy "foobar:1080" to load all URLs.
#
# --proxy-server="socks4://foobar:1080"
# Use the SOCKS v4 proxy "foobar:1080" to load all URLs.
#
# --proxy-server="socks5://foobar:66"
# Use the SOCKS v5 proxy "foobar:66" to load all URLs.
#
# It is also possible to specify a separate proxy server for different URL types, by prefixing the proxy server specifier with a URL specifier:
#
# Example:
#
# --proxy-server="https=proxy1:80;http=socks4://baz:1080"
# Load https://* URLs using the HTTP proxy "proxy1:80". And load http://*
# URLs using the SOCKS v4 proxy "baz:1080".
#
_chromium_proxyurls () {
#TODO: semicolon separated urls not yet implemented
# mostly copied from _urls
local ipre scheme host user uhosts ret=1 expl match glob suf
local localhttp
zstyle -a ":completion:${curcontext}:urls" local localhttp
local localhttp_servername="$localhttp[1]"
local localhttp_documentroot="$localhttp[2]"
local localhttp_userdir="$localhttp[3]"
zstyle -a ":completion:${curcontext}:urls" urls urls
if [[ $#urls -gt 1 || ( $#urls -eq 1 && ! -d $urls[1] ) ]]
then
[[ $#urls -eq 1 && -f $urls[1] ]] && urls=($(< $urls[1]))
_wanted urls expl 'URL' compadd "$@" -a urls && return 0
urls=()
fi
urls="$urls[1]"
glob=(-g '*(^/)')
zparseopts -D -K -E 'g:=glob'
ipre="$IPREFIX"
if ! compset -P '(#b)([-+.a-z0-9]#):'
then
_tags -C argument prefixes
while _tags
do
while _next_label prefixes expl 'URL prefix' -S '' "$@"
do
compset -S '[^:/]*' && compstate[to_end]=''
compadd "$expl[@]" http:// socks:// socks4:// socks5:// && ret=0
done
(( ret )) || return 0
done
return 1
fi
scheme="$match[1]"
case "$scheme" in
(http(|s)|socks(|4|5)) if ! compset -P //
then
_wanted -C "$scheme" prefixes expl 'end of prefix' compadd -S '' "$@" //
return
fi ;;
(file) [[ -prefix //(127.0.0.1|localhost)/ ]] && compset -P '//(127.0.0.1|localhost)'
[[ -prefix /// ]] && compset -P //
if ! compset -P //
then
_tags -C file files
while _tags
do
while _next_label files expl 'local file'
do
if [[ -prefix / ]]
then
_path_files "$expl[@]" -S '' "${glob[@]}" && ret=0
_path_files "$expl[@]" -S/ -r '/' -/ && ret=0
elif [[ -z "$PREFIX" ]]
then
compadd -S '/' -r '/' "$expl[@]" "$@" - "${PWD%/}" && ret=0
fi
done
(( ret )) || return 0
done
return 1
fi ;;
esac
if ! compset -P '(#b)([^:/]#)([:/])'
then
uhosts=($urls/$scheme/$PREFIX*$SUFFIX(/:t))
_tags hosts
while _tags
do
while _next_label hosts expl host
do
compset -S '[:/]*' || suf="/"
(( $#uhosts )) || _hosts -S "$suf" -r '/:' "$expl[@]" && ret=0
[[ "$scheme" = http ]] && uhosts=($uhosts $localhttp_servername)
compadd -S "$suf" -r '/:' "$expl[@]" -a uhosts && ret=0
done
(( ret )) || return 0
done
return 1
fi
host="$match[1]"
[[ $match[2] = ':' ]] && ! compset -P '<->/' && _message -e ports 'port number' && return 0
_tags remote-files files || return 1
if [[ "$localhttp_servername" = "$host" ]]
then
if compset -P \~
then
if ! compset -P '(#b)([^/]#)/'
then
_users -S/ "$@"
return
fi
user="$match[1]"
while _tags
do
while _next_label files expl 'local file'
do
_path_files "$expl[@]" "$@" -W ~$user/$localhttp_userdir "${glob[@]}" && ret=0
_path_files -S/ -r '/' "$expl[@]" -W ~$user/$localhttp_userdir-/ && ret=0
done
(( ret )) || return 0
done
else
while _tags
do
while _next_label files expl 'local file'
do
_path_files "$expl[@]" "$@" -W $localhttp_documentroot "${glob[@]}" && ret=0
_path_files -S/ -r '/' "$expl[@]" -W $localhttp_documentroot -/ && ret=0
done
(( ret )) || return 0
done
fi
else
while _tags
do
(( $#urls )) && while _next_label files expl 'local file'
do
_path_files "$expl[@]" "$@" -W $urls/$scheme/$host "${glob[@]}" && ret=0
_path_files -S/ -r '/' "$expl[@]" -W $urls/$scheme/$host -/ && ret=0
done
[[ $scheme = (scp|sftp) ]] && _requested remote-files && _remote_files -h $host -- ssh && ret=0
(( ret )) || return 0
done
fi
return $ret
}

View File

@ -1,66 +0,0 @@
#compdef clang-check
# ------------------------------------------------------------------------------
# Copyright (c) 2022 Github zsh-users - https://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for clang-check v20.1.2 (https://clang.llvm.org/docs/ClangCheck.html)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments \
'(- *)--help[Display available options]' \
'(- *)--help-hidden[Display available more options]' \
'(- *)--help-list[Display list of available options]' \
'(- *)--help-list-hidden[Display list of more available options]' \
'(- *)--version[Display the version of this program]' \
'--analyze[Run static analysis engine]' \
'--analyzer-output-path=[Write output to file]: :_files' \
'--ast-dump[Build ASTs and then debug dump them]' \
'--ast-dump-filter=[Use with -ast-dump or -ast-print to dump/print only AST declaration nodes having a certain substring]:string' \
'--ast-list[Build ASTs and print the list of declaration node qualified names]' \
'--ast-print[Build ASTs and then pretty-print them]' \
'*--extra-arg=[Additional argument to append to the compiler command line]:arg' \
'*--extra-arg-before=[Additional argument to prepend to the compiler command line]:arg' \
'--fix-what-you-can[Apply fix-it advice even in the presence of unfixable errors]' \
'--fixit[Apply fix-it advice to the input source]' \
'-p[Build directory where compile_commands.json is]: :_files -/' \
'--print-all-options[Print all option values after command line parsing]' \
'--print-options[Print non-default options after command line parsing]' \
'--syntax-tree-dump[dump the syntax tree]' \
'--tokens-dump[dump the preprocessed tokens]' \
'*: :_files'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,77 +0,0 @@
#compdef clang-format
# ------------------------------------------------------------------------------
# Copyright (c) 2022 Github zsh-users - https://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for clang-format v20.1.2 (https://clang.llvm.org/docs/ClangFormat.html)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
local -a styles=(LLVM GNU Google Chromium Microsoft)
_arguments \
'(- *)--help[Display available options]' \
'(- *)--help-hidden[Display available more options]' \
'(- *)--help-list[Display list of available options]' \
'(- *)--help-list-hidden[Display list of more available options]' \
'--Wclang-format-violations[Warnings about individual formatting changes needed]' \
'--Werror=[If set, changes formatting warnings to errors]' \
'*--Wno-error=[If set, do not error out on the specified warning type]:warn' \
'--assume-filename=[Set filename used to determine the language and to find .clang-format file]: :_files' \
'--cursor=[The position of the cursor when invoking clang-format from an editor integration]:pos' \
'(-n --dry-run)'{-n,--dry-run}'[If set, do not actually make the formatting changes]' \
'--dump-config[Dump configuration options to stdout and exit]' \
'--fail-on-incomplete-format[If set, fail with exit code 1 on incomplete format]' \
'--fallback-style=[The name of the predefined style used as a fallback]: :'"($styles)" \
'--ferror-limit=[Set the maximum number of clang-format errors to emit before stopping]:limit' \
'*--files=[Provide a list of files to run clang-format]: :_files' \
'--fno-color-diagnostics[If set, not to print diagnostics in color]' \
'-i[Inplace edit files, if specified]' \
'--length=[Format a range of this length(in bytes)]:bytes' \
'--lines=[format a range of lines]:format' \
'--list-ignored[List ignored files]' \
'--offset=[Format a range starting at this byte offset]' \
'--output-replacements-xml[Output replacements as XML]' \
'--print-all-options[Print all option values after command line parsing]' \
'--print-options[Print non default options after command line parsing]' \
'--qualifier-alignment=[If set, overrides the qualifier alignment style determined by the QualifierAlignment style flag]' \
'--sort-includes[If set, overrides the include sorting behavior determined by the SortIncludes style flag]' \
'--style=[Set coding style]: :'"($styles)" \
'--verbose[If set, show the list of processed files]' \
'(- *)--version[Display the version of this program]' \
'*: :_files'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,83 +0,0 @@
#compdef clang-tidy
# ------------------------------------------------------------------------------
# Copyright (c) 2022 Github zsh-users - https://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for clang-tidy v15.0.2 (https://clang.llvm.org/extra/clang-tidy/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
local -a styles=(LLVM GNU Google Chromium Microsoft)
_arguments \
'(- *)--help[Display available options]' \
'(- *)--help-hidden[Display available more options]' \
'(- *)--help-list[Display list of available options]' \
'(- *)--help-list-hidden[Display list of more available options]' \
'--allow-no-checks[Allow empty enabled checks]' \
'--checks=[Comma-separated list of globs with optional "-" prefix]:checks' \
'--config=[Specifies a configuration in YAML/JSON format]:conf' \
'--config-file=[Specify the path of .clang-tidy or custom config-file]: :_files' \
'--dump-config[Dumps configuration in the YAML format to stdout]' \
'--enable-check-profile[Enable per-check timing profiles, and print a report to stderr]' \
'--enable-module-headers-parsing[Enable preprocessor-level module header parsing for C++20 and above]' \
'--exclude-header-filter=[Regular expression of headers to exclude diagnostics from]:filter' \
'--explain-config[For each enabled check explains, where it is enabled]' \
'--export-fixes=[YAML file to store suggested fixes in]: :_files' \
'*--extra-arg[Additional argument to append to the compiler command line]:arg' \
'*--extra-arg-before[Additional argument to prepend to the compiler command line]:arg' \
'--fix[Apply suggested fixes]' \
'--fix-errors[Apply suggested fixes even if compilation errors were found]' \
'--fix-notes[If a warning has no fix, but a single fix can be found through an associated diagnostic node, apply the fix]' \
'--format-style=[Style for formatting code around applied fixes]: :(none file llvm google webkit mozilla)' \
'--header-filter=[Regular expression matching the names of the headers to output diagnostics from]:regexp' \
'--line-filter=[List of files with line ranges to filter the warnings]' \
'(- *)--list-checks[List all enabled checks and exit]' \
'--load=[Load the specified plugin]: :_files' \
'-p[Build directory where compile_commands.json is]: :_files -/' \
'--print-all-options[Print all option values after command line parsing]' \
'--print-options[Print non default options after command line parsing]' \
'--quiet[Run clang-tidy in quiet mode]' \
'--store-check-profile=[These per-TU profiles are instead stored as JSON]:prefix' \
'--system-headers[Display the errors from system headers]' \
'--use-color[Use colors in diagnostics]' \
'(- *)--version[Display the version of this program]' \
'--verify-config[Check the config files to ensure each check and option is recognized]' \
'--vfsoverlay=[Overlay the virtual filesystem described by file over the real file system]: :_files' \
'--warnings-as-errors=[Upgrades warning to errors]:check' \
'*: :_files'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,601 +0,0 @@
#compdef cmake -value-,CMAKE_GENERATOR,-default-
# ------------------------------------------------------------------------------
# Copyright (c) 2017 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# -------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for CMake 3.31.0 (https://cmake.org).
#
# -------------------------------------------------------------------------
# Authors
# -------
#
# * Scott M. Kroll <skroll@gmail.com> (initial version)
# * Paul Seyfert <pseyfert.mathphys@gmail.com> (handling of --build and updates)
# * Norbert Lange <nolange79@gmail.com> (presets, command mode, updates)
#
# -------------------------------------------------------------------------
# Notes
# -----
#
# * By default only C and C++ languages are supported for compiler flag
# variables. To define your own list of languages:
#
# cmake_langs=('C' 'C'
# 'CXX' 'C++')
# zstyle ':completion:*:cmake:*' languages $cmake_langs
#
# -------------------------------------------------------------------------
local context state line curcontext="$curcontext" cmake_args
local -a cmake_build_options=(
'-S[Explicitly specify a source directory]:source directory:_path_files -/'
'-B[Explicitly specify a build directory]:build directory:_path_files -/'
'-C[Pre-load a script to populate the cache]:initial cache:_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'
'-A[Specify platform name if supported by generator]:platform name'
'--toolchain[Specify toolchain file]: :_files'
'--install-prefix[Specify install directory]: :_path_files -/'
# Warnings
'(-Wdev)-Wno-dev[Suppress/Enable developer warnings]'
'(-Wno-dev)-Wdev[Suppress/Enable developer warnings]'
'(-Wdeprecated)-Wno-deprecated[Suppress/Enable deprecation warnings]'
'(-Wno-deprecated)-Wdeprecated[Suppress/Enable deprecation warnings]'
'(-Werror=dev)-Wno-error=dev[Make developer warnings (not) errors]'
'(-Wno-error=dev)-Werror=dev[Make developer warnings (not) errors]'
'(-Wno-error=deprecated)-Werror=deprecated[Make deprecated macro and function warnings (not) errors]'
'(-Werror=deprecated)-Wno-error=deprecated[Make deprecated macro and function warnings (not) errors]'
'--preset=[Specify a configure preset]:preset:_cmake_presets'
'--list-presets[List available presets]'
'--workflow[Run a workflow preset]'
'-E[CMake command mode]:command:_cmake_command_help'
'-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]"'
'--fresh[Configure a fresh build tree, removing any existing cache file]'
'--build[Build a CMake-generated project binary tree]:project directory:_path_files -/'
'--install[Install a CMake-generated project binary tree]:project directory:_path_files -/'
'--open[Open generated project in the associated application]:project directory:_path_files -/'
'-N[View mode only]'
'-P[Process script mode]:script:_files'
'--find-package[Legacy pkg-config like mode. Do not use]'
'--graphviz=[Generate graphviz of dependencies, see CMakeGraphVizOptions.cmake for more]:graphviz output:_files'
'--system-information[Dump information about this system]::system information output:_files'
'--print-config-dir[Print CMake config directory for user-wide FileAPI queries]'
'--log-level=[Set the verbosity of messages from CMake files]:log level:(ERROR WARNING NOTICE STATUS VERBOSE DEBUG TRACE)'
'--log-context[Prepend log messages with context, if given]'
'--debug-trycompile[Do not delete the try_compile build tree. Only useful on one try_compile at a time]'
'--debug-output[Put cmake in a debug mode]'
'--debug-find[Put cmake find in a debug mode]'
'--debug-find-pkg=[Limit cmake debug-find to the comma-separated list of packages]:packages'
'--debug-find-var=[Limit cmake debug-find to the comma-separated list of result variables]:variables'
'(--trace-expand)--trace[Put cmake in trace mode]'
'(--trace)--trace-expand[Put cmake in trace mode with variable expansion]'
'--trace-format=[Set the output format of the trace]:trace format:(human json-v1)'
'*--trace-source[Trace only this CMake file/module. Multiple options allowed]:filename:_files'
'--trace-redirect[Redirect trace output to a file instead of stderr]:trace output:_files'
'--warn-uninitialized[Warn about uninitialized values]'
'--no-warn-unused-cli[Do not warn about command line options]'
'--warn-unused-vars[Warn about unused variables]'
'--check-system-vars[Find problems with variable usage in system files]'
'--compile-no-warning-as-error[Ignore COMPILE_WARNING_AS_ERROR property and CMAKE_COMPILE_WARNING_AS_ERROR variable]'
'--profiling-format[Output data for profiling CMake scripts]:profiling format:(google-trace)'
'--profiling-output[Select an output path for the profiling data]:filename:_files'
':cmake project:_path_files -/'
)
# ------------------------
# _cmake_generator_options
#
# arguments are $1: build working directory (top level Makefile or build.ninja file)
# $2: position of "--" in the command line
# ------------------------
(( $+functions[_cmake_generator_options] )) ||
_cmake_generator_options() {
# pass only the part of the command line starting at "--" to the completion
shift (( $2 - 1 )) words
(( CURRENT = $CURRENT + 1 - $2 ))
if [ -f $1/Makefile ]
then
$_comps[make]
elif [ -f $1/build.ninja ]
then
$_comps[ninja]
fi
}
# --------------
# _cmake_presets
# --------------
(( $+functions[_cmake_presets] )) ||
_cmake_presets() {
local invoke; invoke=(${(Q)words})
invoke[$CURRENT]=()
# TODO: remove all arguments -* except -S
local list_presets; list_presets=(${(f)"$(${invoke} --list-presets 2>/dev/null |
sed -n -e 's,^[[:space:]]*"\([^"]*\)"[[:space:]]*-[[:space:]]*\(.*\),\1:\2,p' \
-e 's,^[[:space:]]*"\([^"]*\)"[[:space:]]*$,\1,p')"})
_describe 'presets' list_presets
}
# --------------
# _cmake_targets
# --------------
(( $+functions[_cmake_targets] )) ||
_cmake_targets() {
local -a targets
if [ -f $1/Makefile ]
then
# `make help` doesn't work for Makefiles in general, but for CMake generated Makefiles it does.
i=1
for target in $(make -f $1/Makefile help | \grep -e "\.\.\." | sed "s/\.\.\. //" | sed "s/ (the default.*//") ; do
targets[$i]=$target
(( i = $i + 1 ))
done
elif [ -f $1/build.ninja ]
then
# `ninja help` doesn't seem to be the list of targets we're interested in
i=1
for target in $(ninja -C $1 -t targets all 2&>/dev/null | awk -F: '{print $1}') ; do
targets[$i]="$target"
(( i++ ))
done
fi
_describe 'build targets' targets
}
_cmake_suggest_builddirs() {
_alternative ':current directory:(.)' 'directory::_directories' && return 0
}
_cmake_suggest_installdirs() {
_alternative ':current directory:(.)' 'directory::_directories' && return 0
}
_cmake_on_build() {
local build_extras;build_extras=(
'--[Native build tool options]'
'--target[specify build target]'
'--clean-first[build target clean first]'
'--config[For multi-configuration tools]'
'--parallel[maximum number of build processes]'
'--use-stderr')
local -a undescribed_build_extras
i=1
for be in $build_extras ; do
undescribed_build_extras[$i]=$(echo $be | sed "s/\[.*//")
(( i++ ))
done
inbuild=false
dashdashposition=-1
for ((i = (($CURRENT - 1)); i > 1 ; i--)); do
if [[ $words[$i] == --build ]] ; then
inbuild=true
buildat=$i
(( difference = $CURRENT - $i ))
elif [[ $words[$i] == -- ]] ; then
dashdashposition=$i
fi
done
# check if build mode has been left
outofbuild=false
for ((i = (($CURRENT - 1)); i > (($buildat + 1)); i--)); do
# don't check the word after --build (should be a directory)
if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]] ; then continue ; fi
if [[ $words[(($i - 1))] == --target ]] ; then continue ; fi
if [[ $words[(($i - 1))] == --config ]] ; then continue ; fi
if [[ $words[(($i - 1))] == --parallel ]] ; then continue ; fi
outofbuild=true
done
if (( $dashdashposition > 0 )) ; then
_cmake_generator_options $words[(($buildat + 1))] $dashdashposition && return 0
fi
if [[ "$inbuild" == false || "$difference" -eq 1 ]] ; then
# either there is no --build or completing the directory after --build
_arguments -C -s \
- build_opts \
"$cmake_build_options[@]" \
- build_cmds \
"$cmake_suggest_build[@]" && return 0
elif [[ $words[(($CURRENT - 1))] == --target ]] ; then
# after --build <dir> --target, suggest targets
_cmake_targets $words[(($buildat + 1))] && return 0
elif [[ $words[(($CURRENT - 1))] == --config ]] ; then
# after --build <dir> --config, no idea
return 0
elif [[ $words[(($CURRENT - 1))] == --parallel ]] ; then
# after --build <dir> --parallel
return 0
elif [ "$outofbuild" = true ] ; then
# after --build <dir> --<not a --build option>, suggest other cmake_build_options (like -Wno-dev)
_arguments "$cmake_build_options[@]" && return 0
else
# after --build <dir>, suggest other cmake_build_options (like -Wno-dev) or --build options (like --clean-first)
_arguments "$build_extras[@]" "$cmake_build_options[@]" && return 0
fi
}
_cmake_on_install() {
local build_extras;build_extras=(
'--[Native build tool options]'
'--prefix[Override the installation prefix, CMAKE_INSTALL_PREFIX]'
'--config[For multi-configuration generators(e.g. Visual Studio)]'
'--component[Component-based install]'
'--strip[Strip before installing.]'
)
local -a undescribed_build_extras
i=1
for be in $build_extras ; do
undescribed_build_extras[$i]=$(echo $be | sed "s/\[.*//")
(( i++ ))
done
inbuild=false
dashdashposition=-1
for ((i = (($CURRENT - 1)); i > 1 ; i--)); do
if [[ $words[$i] == --install ]] ; then
inbuild=true
buildat=$i
(( difference = $CURRENT - $i ))
elif [[ $words[$i] == -- ]] ; then
dashdashposition=$i
fi
done
outofbuild=false
for ((i = (($CURRENT - 1)); i > (($buildat + 1)); i--)); do
# don't check the word after --install (should be a directory)
if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]] ; then continue ; fi
if [[ $words[(($i - 1))] == --prefix ]] ; then continue ; fi
if [[ $words[(($i - 1))] == --config ]] ; then continue ; fi
if [[ $words[(($i - 1))] == --component ]] ; then continue ; fi
outofbuild=true
done
if (( $dashdashposition > 0 )) ; then
_cmake_generator_options $words[(($buildat + 1))] $dashdashposition && return 0
fi
if [[ "$inbuild" == false || "$difference" -eq 1 ]] ; then
# either there is no --install or completing the directory after --install
_arguments -C -s \
- build_opts \
"$cmake_build_options[@]" \
- build_cmds \
"$cmake_suggest_install[@]" && return 0
elif [[ $words[(($CURRENT - 1))] == --prefix ]] ; then
# after --install <dir> --prefix, no idea
return 0
elif [[ $words[(($CURRENT - 1))] == --config ]] ; then
# after --install <dir> --config, no idea
return 0
elif [[ $words[(($CURRENT - 1))] == --component ]] ; then
# after --build <dir> --component, no idea
return 0
elif [ "$outofbuild" = true ] ; then
# after --build <dir> --<not a --build option>, suggest other cmake_build_options (like -Wno-dev)
_arguments "$cmake_build_options[@]" && return 0
else
# after --build <dir>, suggest other cmake_build_options (like -Wno-dev) or --build options (like --clean-first)
_arguments "$build_extras[@]" "$cmake_build_options[@]" && return 0
fi
}
local -a cmake_help_actions=(
'(- 1)'{--help,-help,-usage,-h,-H}'[Print usage information and exit]'
'(- 1)'{--version,-version}'[Print version number and exit]'
'(- 1)--help-full[Print all help manuals and exit]'
'(- 1)--help-manual[Print one help manual and exit]:module-name: _cmake_list_names --help-manual-list "manual name"'
'(- 1)--help-manual-list[List help manuals available and exit]'
'(- 1)--help-command[Print help for one command and exit]:command-name: _cmake_list_names --help-command-list "command name"'
'(- 1)--help-command-list[List commands with help available and exit]'
'(- 1)--help-commands[Print cmake-commands manual and exit]'
'(- 1)--help-module[Print help for one module and exit]:module-name: _cmake_list_names --help-module-list "module name"'
'(- 1)--help-module-list[List modules with help available and exit]'
'(- 1)--help-modules[Print cmake-modules manual and exit]'
'(- 1)--help-policy[Print help for one policy and exit]:policy-name: _cmake_list_names --help-policy-list "policy name"'
'(- 1)--help-policy-list[List policies with help available and exit]'
'(- 1)--help-policies[Print cmake-policies manual and exit]'
'(- 1)--help-property[Print help for one property and exit]:property-name: _cmake_list_names --help-property-list "property name" brakremove'
'(- 1)--help-property-list[List properties with help available and exit]'
'(- 1)--help-properties[Print cmake-properties manual and exit]'
'(- 1)--help-variable[Print help for one variable and exit]:variable-name: _cmake_list_names --help-variable-list "variable name" brakremove'
'(- 1)--help-variable-list[List variables with help available and exit]'
'(- 1)--help-variables[Print cmake-variables manual and exit]'
)
_cmake_help() {
_arguments -C -s - help "$cmake_help_actions[@]"
}
# -----------------
# _cmake_list_names
# -----------------
(( $+functions[_cmake_list_names] )) ||
_cmake_list_names() {
local command; command="$@[1]"
local desc; desc="$@[2]"
local opts; opts=($@[3])
local list_names; list_names=(${(f)"$($service $command 2> /dev/null)"})
# Older CMake (< 3.0) writes out the version
list_names=(${^list_names##cmake version*})
if [[ ${opts[(i)brakremove]} -le ${#opts} ]]; then
list_names=(${^list_names//\[/\\\[})
list_names=(${^list_names//\]/\\\]})
fi
_values ${desc} ${list_names[@]:-1} && 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}_COMPILER_LAUNCHER:${cmake_lang_desc} compiler launcher (e.g. ccache)"
"CMAKE_${cmake_lang}_FLAGS:${cmake_lang_desc} compiler flags for all builds"
"CMAKE_${cmake_lang}_FLAGS_DEBUG:${cmake_lang_desc} compiler flags for all Debug build"
"CMAKE_${cmake_lang}_FLAGS_RELEASE:${cmake_lang_desc} compiler flags for all Release 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"
"CMAKE_${cmake_lang}_STANDARD:${cmake_lang_desc} language standard"
"CMAKE_${cmake_lang}_STANDARD_REQUIRED:${cmake_lang_desc} language standard is required"
"CMAKE_${cmake_lang}_EXTENSIONS:${cmake_lang_desc} enable compiler specific extensions"
)
_describe -t "${cmake_lang//:/-}-property-names" "${cmake_lang_desc} property name" properties $@[0,-3] && return 0
}
# -----------------------------------
# _cmake_define_common_property_names
# -----------------------------------
(( $+functions[_cmake_define_common_property_names] )) ||
_cmake_define_common_property_names() {
local properties; properties=(
'CMAKE_MODULE_PATH:Search path for CMake modules (FindPROJECT.cmake)'
'CMAKE_PREFIX_PATH:Search path for installations (PROJECTConfig.cmake)'
'CMAKE_BUILD_TYPE:Specifies the build type for make based generators'
'BUILD_SHARED_LIBS:Global flag to cause add_library() to create shared libraries if on'
'CMAKE_TOOLCHAIN_FILE:Absolute or relative path to a CMake script which sets up toolchain related variables'
'CMAKE_COLOR_MAKEFILE:Enables/disables color output when using the Makefile generator'
'CMAKE_INSTALL_PREFIX:Install directory used by install'
'CMAKE_EXPORT_COMPILE_COMMANDS:Enable/disable output of compilation database during generation'
'CMAKE_RULE_MESSAGES:Specify whether to report a message for each make rule'
'CMAKE_VERBOSE_MAKEFILE:Enable verbose output from Makefile builds'
'CMAKE_UNITY_BUILD:Batch include source files'
)
_describe -t 'common-property-names' 'common property name' properties $@
}
local _cmake_build_types=('Debug' 'Release' 'RelWithDebInfo' 'MinSizeRel')
local _cmake_c_standards=(90 99 11)
local _cmake_cxx_standards=(98 11 14 17 20)
# ----------------------------
# _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' _values 'build type' ${_cmake_build_types[@]} && ret=0;;
(BUILD_SHARED_LIBS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
(CMAKE_CXX_STANDARD) _wanted cxx-standards expl 'cxx standard' _values 'cxx standard' ${_cmake_cxx_standards[@]} && ret=0;;
(CMAKE_C_STANDARD) _wanted c-standards expl 'c standard' _values 'c standard' ${_cmake_c_standards[@]} && 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_RULE_MESSAGES) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
(CMAKE_VERBOSE_MAKEFILE) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
(CMAKE_UNITY_BUILD) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
(CMAKE_INSTALL_PREFIX) _files -/ && ret=0;;
(CMAKE_EXPORT_COMPILE_COMMANDS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
(CMAKE_*_COMPILER) _wanted compilers expl 'compiler' _cmake_compilers && ret=0;;
(CMAKE_*_COMPILER_LAUNCHER) _wanted compilers expl 'compiler launcher' _cmake_launchers && ret=0;;
(CMAKE_*_FLAGS(|_?*)) _message -e compiler-flags 'compiler flags' && _dispatch $service -value-,CPPFLAGS,-default- && ret=0;;
(CMAKE_*_STANDARD_REQUIRED) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
(CMAKE_*_EXTENSIONS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
(*) _files && ret=0;;
esac
return ret
}
local -a _cmake_generator_list=(${(f)"$(cmake --help | awk '/^Generators/{flag=1} flag && /^[* ] [^ ]/ {sub(/^[* ] /, ""); sub(/=.*$/, ""); sub(/\[arch\]/, ""); sub(/ *$/, ""); print}')"})
# -----------------
# _cmake_generators
# -----------------
(( $+functions[_cmake_generators] )) ||
_cmake_generators() {
_describe -t generators 'generator' _cmake_generator_list
}
# ----------------------
# _cmake_toolchain_files
# ----------------------
(( $+functions[_cmake_toolchain_files] )) ||
_cmake_toolchain_files() {
_files -g '*\.cmake*'
}
(( $+functions[_cmake_booleans] )) ||
_cmake_booleans() {
_values booleans 'YES' 'NO'
}
# ---------------
# _cmake_compilers
#
# by default just executable commands, but can be overridden by users.
# ---------------
(( $+functions[_cmake_compilers] )) ||
_cmake_compilers() {
_command_names -e
}
# ---------------
# _cmake_launchers
#
# by default just executable commands, but can be overridden by users.
# useful commands might be ccache, distcc, ...
# ---------------
(( $+functions[_cmake_launchers] )) ||
_cmake_launchers() {
_command_names -e
}
local -a _cmake_commands=(
'capabilities:Report capabilities built into cmake in JSON format' \
'cat:concat the files and print them to the standard output' \
'chdir:run command in a given directory' \
'compare_files:check if file1 is same as file2' \
'copy:copy files to destination (either file or directory)' \
'copy_directory:copy content of <dir>... directories to destination directory' \
'copy_if_different:copy files if it has changed' \
'echo:displays arguments as text' \
'echo_append:displays arguments as text but no new line' \
'env:run command in a modified environment' \
'environment:display the current environment' \
'make_directory:create parent and <dir> directories' \
'md5sum:create MD5 checksum of files' \
'sha1sum:create SHA1 checksum of files' \
'sha224sum:create SHA224 checksum of files' \
'sha256sum:create SHA256 checksum of files' \
'sha384sum:create SHA384 checksum of files' \
'sha512sum:create SHA512 checksum of files' \
'remove:remove the file(s), use -f to force it' \
'remove_directory:remove directories and their contents' \
'rename:rename a file or directory (on one volume)' \
'rm:remove files or directories' \
'server:start cmake in server mode' \
'sleep:sleep for given number of seconds' \
'tar:create or extract a tar or zip archive' \
'time:run command and display elapsed time' \
'touch:touch a <file>' \
'touch_nocreate:touch a <file> but do not create it' \
'create_symlink:create a symbolic link new -> old' \
'create_hardlink:create a hard link new -> old' \
'true:do nothing with an exit code of 0' \
'false:do nothing with an exit code of 1'
)
_cmake_command() {
_arguments -C \
'-E[CMake command mode]:command:(("${_cmake_commands[@]}"))'
}
local cmake_suggest_build;cmake_suggest_build=(
'--build[build]:build dir:_cmake_suggest_builddirs'
)
local cmake_suggest_install;cmake_suggest_install=(
'--install[install]:install dir:_cmake_suggest_installdirs'
)
if [[ "$service" = -value-*CMAKE_GENERATOR* ]]; then
_cmake_generators
elif [ $CURRENT -eq 2 ] ; then
_arguments -C -s \
- help \
"$cmake_help_actions[@]" \
- command \
'-E[CMake command mode]:command:( )' \
- build_opts \
"$cmake_build_options[@]" \
- build_cmds \
"$cmake_suggest_build[@]" \
- install_cmds \
"$cmake_suggest_install[@]" && return 0
elif [[ $words[2] = --help* ]] ; then
_cmake_help
elif [[ $words[2] == --build ]] ; then
_cmake_on_build
elif [[ $words[2] == --install ]] ; then
_cmake_on_install
elif [[ $words[2] == -E ]]; then
_cmake_command
else
_arguments "$cmake_build_options[@]"
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,76 +0,0 @@
#compdef coffee
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Coffee.js v2.7.0 (https://coffeescript.org/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mario Fernandez (https://github.com/sirech)
# * Dong Weiming (https://github.com/dongweiming)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments -s -S \
'--ast[generate an abstract syntax tree of nodes]' \
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
'(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
'(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
'(- *)'{-h,--help}'[display this help message]' \
'(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
'(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]: :_files -g "*.coffee"' \
'(-l --literate)'{-l,--literate}'[treat stdio as literate style coffeescript]' \
'(-m --map)'{-m,--map}'[generate source map and save as .js.map files]' \
'(-M --inline-map)'{-M,--inline-map}'[generate source map and include it directly in output]' \
'(-n --nodes)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
'--nodejs[pass options directly to the "node" binary]' \
'(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]: :_files' \
'(-p --print --tokens)'{-p,--print}'[print out the compiled JavaScript]' \
'(-r --require)'\*{-r,--require}'[require the given module before eval or REPL]:module' \
'(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
'(-t --transpile)'{-t,--transpile}'[pipe generated JavaScript through Babel]' \
'(-p --print --tokens)--tokens[print out the tokens that the lexer/rewriter produce]' \
'(- *)'{-v,--version}'[display the version number]' \
'(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
'*:script or directory:_files' && ret=0
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,766 +0,0 @@
#compdef conan
# ------------------------------------------------------------------------------
# Copyright (c) 2010-2017 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for conan 2.0.0 (https://conan.io).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
# * Shohei Yoshida <https://github.com/syohex>
#
# ------------------------------------------------------------------------------
_conan_common_options=(
'(- *)'{-h,--help}'[show help message and exit]'
'-v[verbose output]'
'-vquiet[verbose level quiet]'
'-verror[verbose level error]'
'-vwarning[verbose level warning]'
'-vnotice[verbose level notice]'
'-vstatus[verbose level status]'
'-vverbose[verbose level verbose]'
'-vv[more verbose output]'
'-vdebug[verbose level debug]'
'-vvv[more and more verbose output]'
'-vtrace[verbose level trace]'
'--logger[show the output with log format, with time, type and message]'
)
_conan_package_options=(
'--name[Provide a package name if not specified in conanfile]:name'
'--version[Provide a package version if not specified in conanfile]:version'
'--user[Provide a user]:user'
'--channel[Provide a channel]:channel'
'--requires[directly provide requires instead of a conan file]:requires'
'--tool-requires[directly provide tool-requires instead of a conanfile]:tool_requires'
)
_conan_define_options=(
\*{-o,--options,'-o\:h','--options\:host'}'[define options of host machine]:option'
\*{'-o\:b','--options\:build'}'[define options of build machine]:option'
)
_conan_profile_options=(
'(-pr --profile -pr\:h --profile\:host)'{-pr,--profile,-pr:h,--profile:host}'[apply the specified profile to the host machine]: :_conan_profiles'
'(-pr\:b --profile\:build)'{-pr:b,--profile:build}'[apply the specified profile to the build machine]: :_conan_profiles'
)
_conan_setting_options=(
\*{-s,--settings,'-s\:h','--settings\:host'}'[overwrite the defaults of host machine to build]:setting'
\*{'-s\:b','--settings\:build'}'[overwrite the defaults of build machine to build]:setting'
)
_conan_configuration_options=(
\*{-c,--conf,'-c\:h','--conf\:host'}'[overwrite the defaults of host machine to configure]:config'
\*{'-c\:b','--conf\:build'}'[overwrite the defaults of build machine to configure]:config'
)
_conan_lockfile_options=(
'(-l --lockfile)'{-l,--lockfile}'[path to a lockfile]: :_files'
'--lockfile-partial[do not raise an error if some dependency is not found in lockfile]'
'--lockfile-out[filename of the updated lockfile]: :_files'
'--lockfile-packages[lock package-id and package-revision information]'
'--lockfile-clean[remove unused entries from the lockfile]'
)
_conan_remote_options=(
'(-r --remote -nr --no-remote)'{-r,--remote}'[look in the specified remote server]:remote'
'(-r --remote -nr --no-remote)'{-nr,--no-remote}'[do not use remote, resolve exclusively in the cache]'
)
_conan() {
local context state state_descr line
typeset -A opt_args
_arguments -C \
'(- : *)'{-h,--help}'[display help information]' \
'(- : *)'{-v,--version}'[display version information]' \
'(-h --help)1: :_conan_commands' \
'(-h --help)*:: :->command_args'
case $state in
command_args)
(( $+functions[_conan_${words[1]}] )) && _conan_${words[1]}
;;
esac
}
(( $+functions[_conan_commands] )) ||
_conan_commands() {
local -a commands=(
# consumer commands
'cache:perform file operations in the local cache'
'config:manages conan configuration information'
'graph:obtain information about the dependency graph without fetching binaries'
'inspect:inspect a conanfile.py to return its public fields'
'install:installs the requirements specified in a "conanfile.py" or "conanfile.txt"'
'list:list recipes, revisions or packages in the cache or the remotes'
'lock:create or manage lockfiles'
'profile:manage profiles'
'remote:manage the remote list and the users authenticated on them'
'remove:remove recipes or packages from local cache or a remote'
'search:search for package recipes in all the remotes or a remote'
# create commands
'build:install dependencies and call the build() method'
'create:create a package'
'download:download(without installing) a single conan package from a remote server'
'editable:allow working with a package that resides in user folder'
'export:export a recipe to the Conan package cache'
'export-pkg:create a package directly from pre-compiled binaries'
'new:create a new example recipe and source files from a template'
'source:call the source() method'
'test:test a package from a test_package folder'
'upload:upload packages to a remote'
)
_describe -t 'subcommands' 'subcommands' commands
}
(( $+functions[_conan_cache] )) ||
_conan_cache() {
local ret=1
_arguments -C \
'(- *)'{-h,--help}'[show help message and exit]' \
'1: :(clean path)' \
'*:: :->args'
case $state in
(args)
local -a opts=($_conan_common_options[@])
case $words[1] in
(clean)
opts+=(
'(-s --source)'{-s,--source}'[clean source folders]'
'(-b --build)'{-b,--build}'[clean build folders]'
'(-d --download)'{-d,--download}'[clean download folders]'
\*{-p,--package-query}'[remove only the packages matching a specific query]:query'
'1:pattern'
)
;;
(path)
opts+=(
'--folder[path to show]::type:(export_source source build)' \
'1:recipe_or_package_reference:_files'
)
;;
esac
_arguments "$opts[@]"
;;
esac
return $ret
}
(( $+functions[_conan_config] )) ||
_conan_config() {
_arguments -C \
'(- : *)'{-h,--help}'[display help information]' \
'1: :_conan_config_commands' \
'*:: :->args'
case $state in
(args)
local -a opts=($_conan_common_options[@])
case $words[1] in
(install)
opts+=(
'--verify-ssl[Verify SSL connection when downloading file]: :(True False)'
'(-t --type)'{-t,--type}'[Type of remote config]: :(git dir file url)'
\*{-a,--args}'[String with extra arguments for "git clone"]:arg'
\*{-sf,--source-folder}'[Install files only from a source subfolder from specified origin]: :_files -/'
'(-tf --target-folder)'{-tf,--target-folder}'[Install to that path in the conan cache]: :_files -/'
)
;;
(list)
opts+=(
'(-f --format)'{-f,--format}'[select the output format]:format:(json)'
)
;;
esac
_arguments "$opts[@]"
;;
esac
}
(( $+functions[_conan_config_commands] )) ||
_conan_config_commands() {
local -a commands=(
'home:show the Conan home folder'
'install:install the configuration into the Conan home folder'
'list:show all the Conan available configurations:'
)
_describe -t 'commands' "command" commands
}
(( $+functions[_conan_graph] )) ||
_conan_graph() {
_arguments -C \
'(- : *)'{-h,--help}'[display help information]' \
'1: :_conan_graph_commands' \
'*:: :->args'
local -a common_opts=(
$_conan_package_options[@]
\*{-b,--build}'[optional, specify which packages to build from source]:build'
$_conan_remote_options[@]
'(-u --update)'{-u,--update}'[will check the remote and in case a newer version]'
$_conan_define_options[@]
$_conan_profile_options[@]
$_conan_setting_options[@]
$_conan_configuration_options[@]
$_conan_lockfile_options[@]
)
case $state in
(args)
local -a opts=($_conan_common_options[@])
case $words[1] in
(build-order)
opts+=(
'(-f --format)'{-f,--format}'[select the output format]:format:(json)'
$common_opts[@]
)
;;
(build-order-merge)
opts+=(
'--file[files to be merged]:file:_files'
)
;;
(info)
opts+=(
$common_opts[@]
'(-f --format)'{-f,--format}'[select the output format]:format:(html json dot)'
'--check-updates[check if there are recipe updates]'
'*--filter[show only the specified fields]:filter'
'*--package-filter[print information only for packages that match the patterns]:package_filter'
'--deploy[deploy using the provided deployer to the output folder]:deployer'
)
;;
esac
_arguments "$opts[@]"
;;
esac
}
(( $+functions[_conan_graph_commands] )) ||
_conan_graph_commands() {
local -a commands=(
'build-order:compute the build order of a dependency graph'
'build-order-merge:merge more than 1 build-order file'
'info:compute the dependency graph and shows information about it'
)
_describe -t 'commands' "command" commands
}
(( $+functions[_conan_inspect] )) ||
_conan_inspect() {
_arguments \
"$_conan_common_options[@]" \
'(-f --format)'{-f,--format}'[select the output format]:format:(json)' \
'*:recipe_folder:_files -/'
}
(( $+functions[_conan_install] )) ||
_conan_install() {
local -a generators=(
cmake cmake_multi cmake_paths cmake_find_package cmake_find_package_multi
msbuild visual_studio visual_studio_multi visual_studio_legacy xcode compiler_args gcc
boost-build b2 qbs qmake scons pkg_config virtualenv virtualenv_python virtualbuildenv
virtualrunenv youcompleteme txt json premake make markdown deploy
)
local -a opts=(
$_conan_common_options[@]
'(-f --format)'{-f,--format}'[select the output format]:format:(json)'
\*{-b,--build}'[optional, specify which packages to build from source]:build'
$_conan_remote_options[@]
'(-u --update)'{-u,--update}'[will check the remote and in case a newer version]'
$_conan_define_options[@]
$_conan_profile_options[@]
$_conan_setting_options[@]
$_conan_configuration_options[@]
$_conan_lockfile_options[@]
'(-g --generator)'{-g,--generator}"[generators to use]:generator:($generators)"
'(-of --output)'{-of,--output-folder}'[the root output folder for generated and build files]:dir:_files -/'
'--deploy[deploy using the provided deployer to the output folder]:deployer'
'1:recipe_dir_or_conanfile:_files'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_list] )) ||
_conan_list() {
local -a opts=(
$_conan_common_options[@]
'(-f --format)'{-f,--format}'[select the output format]:format:(json html)'
\*{-p,--package-query}'[remove only the packages matching a specific query]:query'
'(-r --remote)'{-r,--remote}'[remote names]:remote'
'(-c --cache)'{-c,--cache}'[search in the local cache]'
'1:recipe_or_package_reference:_files'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_lock] )) ||
_conan_lock() {
_arguments -C \
'(- : *)'{-h,--help}'[display help information]' \
'1: :_conan_lock_commands' \
'*:: :->args'
case $state in
(args)
local -a opts=($_conan_common_options)
case $words[1] in
(add)
opts+=(
'*--requires[add references to lockfile]:requires'
'*--build-requires[add build-requires to lockfile]:build_requires'
'*--python-requires[add python-requires to lockfile]'
'--lockfile-out[file name of the created lockfile]:filename:_files'
'--lockfile[file name of the input lockfile]:filename:_files'
)
;;
(create)
opts+=(
\*{-b,--build}'[optional, specify which packages to build from source]:build'
$_conan_remote_options[@]
'(-u --update)'{-u,--update}'[will check the remote and in case a newer version]'
$_conan_define_options[@]
$_conan_profile_options[@]
$_conan_setting_options[@]
$_conan_configuration_options[@]
$_conan_lockfile_options[@]
'1: :_files'
)
;;
(merge)
opts+=(
'--lockfile-out[file name of the created lockfile]:filename:_files'
'--lockfile[file name of the input lockfile]:filename:_files'
)
;;
esac
_arguments "$opts[@]"
;;
esac
}
(( $+functions[_conan_lock_commands] )) ||
_conan_lock_commands() {
local -a commands=(
'add:add requires, build-requires or python requires to an existing or new lockfile'
'create:create a lockfile from a conanfile or a reference'
'merge:merge 2 or more lockfiles'
)
_describe -t 'commands' "command" commands
}
(( $+functions[_conan_profile] )) ||
_conan_profile() {
_arguments -C \
'(- : *)'{-h,--help}'[display help information]' \
'1: :_conan_profile_commands' \
'*:: :->args'
case $state in
(args)
local opts=($_conan_common_options[@])
case $words[1] in
(detect)
opts+=(
'--name[profile name, "default" if not specified]::name'
'(-f --force)'{-f,--force}'[overwrite if exists]'
)
;;
(list)
opts+=(
'(-f --format)'{-f,--format}'[select the output format]:format:(json)'
)
;;
(path|show)
opts+=(
$_conan_define_options[@]
$_conan_profile_options[@]
$_conan_setting_options[@]
$_conan_configuration_options[@]
)
;;
esac
_arguments "$opts[@]"
;;
esac
}
(( $+functions[_conan_profile_commands] )) ||
_conan_profile_commands() {
local -a commands=(
'detect:generate a profile using auto-detected values'
'list:list all profiles in the cache'
'path:show profile path location'
'show:show aggregated profiles from the passed arguments'
)
_describe -t 'commands' "command" commands
}
(( $+functions[_conan_remote] )) ||
_conan_remote() {
_arguments -C \
'(- : *)'{-h,--help}'[display help information]' \
'1: :_conan_remote_commands' \
'*:: :->args'
case $state in
(args)
local -a opts=($_conan_common_options[@])
case $words[1] in
(add)
opts+=(
'--insecure[allow insecure server connections when using SSL]'
'--index[insert the remote at a specific position in the remote list]:index'
'(-f --force)'{-f,--force}'[force the definition of the remote even if duplicated]'
'1:name'
'2:url'
)
;;
(auth)
opts+=(
'--with-user[only try to auth in those remotes that already have a user name]'
'1:remote:_conan_remotes'
)
;;
(list|list-users)
opts+=('(-f --format)'{-f,--format}'[select the output format]:format:(json)')
;;
(login)
opts+=(
'(-f --format)'{-f,--format}'[select the output format]:format:(json)'
'(-p --password)'{-p,--password}'[user password]:password'
'1:remote:_conan_remotes'
'2:username:'
)
;;
(logout)
opts+=(
'(-f --format)'{-f,--format}'[select the output format]:format:(json)'
'1:remote:_conan_remotes'
)
;;
(remove)
opts+=('1:remote:_conan_remotes')
;;
(rename)
opts+=(
'1:remote:_conan_remotes'
'2:new_name'
)
;;
(set-user)
opts+=(
'(-f --format)'{-f,--format}'[select the output format]:format:(json)'
'1:remote:_conan_remotes'
'2:user_name'
)
;;
(update)
opts+=(
'--url[new url for the remote]'
'--secure[do not allow insecure server connections when using SSL]'
'--insecure[allow insecure server connections when using SSL]'
'--index[insert the remote at a specific position in the remote list]:index'
'1:remote:_conan_remotes'
)
;;
esac
;;
esac
}
(( $+functions[_conan_remote_commands] )) ||
_conan_remote_commands() {
local -a commands=(
'add:add a remote'
'auth:authenticate in the defined remotes'
'disable:disable all the remotes matching a pattern'
'enable:enable all the remotes matching a pattern'
'list:list current remotes'
'list-users:list the users logged into all the remotes'
'login:login into the specified remotes matching a pattern'
'logout:clear the existing credentials for the specified remotes matching a pattern'
'remove:remove a remote'
'rename:rename a remote'
'set-user:associate a username with a remote matching pattern without performing the authentication'
'update:update a remote'
)
_describe -t 'commands' "command" commands
}
(( $+functions[_conan_remove] )) ||
_conan_remove() {
local -a opts=(
$_conan_common_options[@]
'(-c --confirm)'{-c,--confirm}'[remove without requesting a confirmation]'
\*{-p,--package-query}'[remove only the packages matching a specific query]:query'
\*{-r,--remote}'[will remove from the specified remote]:remote'
'*:recipe_or_package_reference:_files'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_search] )) ||
_conan_search() {
local -a opts=(
$_conan_common_options[@]
\*{-r,--remote}'[will remove from the specified remote]:remote'
'*:recipe_reference:_files'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_build] )) ||
_conan_build() {
local -a opts=(
$_conan_common_options[@]
$_conan_package_options[@]
\*{-b,--build}'[optional, specify which packages to build from source]:build'
$_conan_remote_options[@]
'(-u --update)'{-u,--update}'[will check the remote and in case a newer version]'
$_conan_define_options[@]
$_conan_profile_options[@]
$_conan_setting_options[@]
$_conan_configuration_options[@]
$_conan_lockfile_options[@]
'*: :_files'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_create] )) ||
_conan_create() {
local -a opts=(
$_conan_common_options[@]
$_conan_package_options[@]
\*{-b,--build}'[optional, specify which packages to build from source]:build'
$_conan_remote_options[@]
'(-u --update)'{-u,--update}'[will check the remote and in case a newer version]'
$_conan_define_options[@]
$_conan_profile_options[@]
$_conan_setting_options[@]
$_conan_configuration_options[@]
$_conan_lockfile_options[@]
'--build-require[whether the provided reference is a build-require]'
'(-tf --test-folder)'{-tf,--test-folder}'[alternative test folder name]:folder:_files -/'
'*: :_files -/'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_download] )) ||
_conan_download() {
local -a opts=(
$_conan_common_options[@]
'--only-recipe[download only the recipe, not the binary packages]'
\*{-p,--package-query}'[only download packages matching a specific query]:query'
'(-r --remote)'{-r,--remote}'[download from the specific remote]:remote:_conan_remotes'
'*:recipe_or_package_reference:_files'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_editable] )) ||
_conan_editable() {
_arguments -C \
'(- : *)'{-h,--help}'[display help information]' \
'1: :_conan_editable_commands' \
'*:: :->args'
case $state in
(args)
local opts=($_conan_common_options[@])
case $words[1] in
(add)
opts+=(
$_conan_package_options[@]
'(-of --output-folder)'{-of,--output-folder}'[the root output folder]:folder:_files -/'
)
;;
(list)
opts+=('(-f --format)'{-f,--format}'[select the output format]:format:(json)')
;;
(remove)
opts+=('(-r --refs)'{-r,--refs}'[directly provide reference patterns]:refs')
;;
esac
_arguments "$opts[@]"
;;
esac
}
(( $+functions[_conan_editable_commands] )) ||
_conan_editable_commands() {
local -a commands=(
'add:define the given path location as the package reference'
'list:list all the packages in editable mode'
'remove:remove the editable mode for this reference'
)
_describe -t 'commands' "command" commands
}
(( $+functions[_conan_export] )) ||
_conan_export() {
local -a opts=(
$_conan_common_options[@]
$_conan_package_options[@]
$_conan_remote_options[@]
$_conan_lockfile_options[@]
'--build-require[whether the provided reference is a build-require]'
'*: :_files -/'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_export-pkg] )) ||
_conan_export-pkg() {
local -a opts=(
$_conan_common_options[@]
$_conan_package_options[@]
$_conan_remote_options[@]
$_conan_lockfile_options[@]
$_conan_define_options[@]
$_conan_profile_options[@]
$_conan_setting_options[@]
$_conan_configuration_options[@]
'*: :_files -/'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_new] )) ||
_conan_new() {
local -a templates=(
basic cmake_lib cmake_exe meson_lib meson_exe msbuild_lib msbuild_exe
bezel_lib bezel_exe autotools_lib autotools_exe
)
local -a opts=(
$_conan_common_options[@]
\*{-d,--define}'[define a template argument as key=value]:key_value'
'(-f --force)'{-f,--force}'[overwrite file if it already exists]'
"1:template:($templates)"
)
_arguments "$opts[@]"
}
(( $+functions[_conan_source] )) ||
_conan_source() {
local -a opts=(
$_conan_common_options[@]
$_conan_package_options[@]
'1: :_files'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_test] )) ||
_conan_test() {
local -a opts=(
$_conan_common_options[@]
$_conan_package_options[@]
\*{-b,--build}'[optional, specify which packages to build from source]:build'
$_conan_remote_options[@]
'(-u --update)'{-u,--update}'[will check the remote and in case a newer version]'
$_conan_define_options[@]
$_conan_profile_options[@]
$_conan_setting_options[@]
$_conan_configuration_options[@]
$_conan_lockfile_options[@]
'1:path:_files -/'
'2:reference'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_upload] )) ||
_conan_upload() {
local -a opts=(
$_conan_common_options[@]
\*{-p,--package-query}'[only upload packages matching a specific query]:query'
'(-r --remote)'{-r,--remote}'[upload to this specific remote]:remote:_conan_remotes'
'--only-recipe[upload only the recipe, not the binary packages]'
'--force[force the upload of the artifacts]'
'--check[perform an integrity check before upload]'
'(-c --confirm)'{-c,--confirm}'[upload all matching recipes without confirmation]'
'1::reference'
)
_arguments "$opts[@]"
}
(( $+functions[_conan_remotes] )) ||
_conan_remotes() {
local -a remotes=(${(f)"$(_call_program remotes $service remote list)"})
_describe -t remotes 'remote' remotes "$@"
}
(( $+functions[_conan_profiles] )) ||
_conan_profiles() {
local -a profiles=(${(f)"$(_call_program profiles $service profile list 2>/dev/null)"})
_describe -t profiles 'profile' profiles "$@"
}
_conan "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

File diff suppressed because it is too large Load Diff

View File

@ -1,72 +0,0 @@
#compdef console
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for symfony console (https://github.com/symfony/Console).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * loranger (https://github.com/loranger)
# * Yohan Tamb<6D>«² (https://github.com/Cronos87)
#
# ------------------------------------------------------------------------------
_console_find_console() {
echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
}
_console_get_command_list() {
IFS=" "
`_console_find_console` --no-ansi | \
sed "1,/Available commands/d" | \
awk '/ [a-z]+/ { print $0 }' | \
sed -E 's/^[ ]+//g' | \
sed -E 's/[:]+/\\:/g' | \
sed -E 's/[ ]{2,}/\:/g'
}
_console() {
local -a commands
IFS=$'\n'
commands=(`_console_get_command_list`)
_describe 'commands' commands
}
compdef _console php console
compdef _console console
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,130 +0,0 @@
#compdef cppcheck
# ------------------------------------------------------------------------------
# Copyright (c) 2019 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for cppcheck -- a tool for static C/C++ code analysis (https://cppcheck.sourceforge.io/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Georgy Komarov (https://github.com/jubnzv)
#
# ------------------------------------------------------------------------------
# Notes
# -----
#
# Created for Cppcheck version 2.17.1 (https://github.com/danmar/cppcheck)
#
# ------------------------------------------------------------------------------
_cppcheck_files() {
_path_files -/ -g "*.(c|cpp|cxx|h|hpp|C)"
}
_cppcheck() {
local check_ids='(all warning style performance portability information unusedFunction missingInclude)'
local platforms='(unix32 unix64 win32A win32W win64 avr8 elbrus-e1cp pic8 pic8-enhanced pic16 mips32 native unspecified)'
local coding_standards='(normal autosar cert-c-2016 cert-cpp-2016 misra-c-2012 misra-c-2023 misra-cpp-2008 misra-cpp-2023)'
_arguments \
"--addon=[Execute addon]" \
"--addon-python=[Specify the python interpreter]: :_files" \
"--cppcheck-build-dir=[Analysis output directory]:directory:_files -/" \
"--check-config[Check cppcheck configuration]" \
"--check-level=[Configure how much valueflow analysis you want]:level:(reduced normal exhaustive)" \
"--check-library[Show information when library files have incomplete info]" \
"--checkers-report=[Write a report of all the active checkers to the given file]:file:_files" \
"--clang=[Use clang parser instead of the builtin Cppcheck parser]: :_files" \
"--config-exclude=[Path to be excluded from configuration checking]:directory:_files -/" \
"--config-exclude-files=[A file that contains a list of config-excludes]:file:_files" \
"--doc[Print a list of all available checks]" \
"*--disable=[Disable individual checks]:id:$check_ids" \
"--dump[Dump xml data for each translation unit]" \
"-D[Define preprocessor symbol]" \
"-U[Undefine preprocessor symbol]" \
"-E[Print preprocessor output on stdout and don't do any further processing]" \
"--enable=[Enable additional checks]:id:$check_ids" \
"--error-exitcode=[Integer to return if errors are found]" \
"--errorlist[Print a list of all the error messages in XML format]" \
"--exitcode-suppressions=[Used when certain messages should be displayed but should not cause a non-zero exitcode]:_files" \
"*--file-filter=[Analyze only those files matching the given filter str]:filter" \
"--file-list=[Specify the files to check in a text file]:_files" \
"(-f --force)"{-f,--force}"[Force checking of all configurations in files]" \
"(--fsigned-char --funsigned-char)--fsigned-char[Treat char type as signed]" \
"(--fsigned-char --funsigned-char)--funsigned-char[Treat char type as unsigned]" \
"(- 1 *)"{-h,--help}"[Print this help]" \
"-I[A file that contains a list of config-excludes]:directory:_files -/" \
"--include-file=[Specify directory paths to search for included header files in a text file]:file:_files" \
"--include=[Force inclusion of a file before the checked file]:file:_files" \
"-i[Give a source file or source file directory to exclude from the check]:directory or file:_files" \
"--inconclusive[Report even though the analysis is inconclusive]" \
"--inline-suppr[Enable inline suppressions]" \
"-j[Number of threads to do the checking simultaneously]::num" \
"-l[No new threads should be started if the load average is exceeds this value]::load_avg" \
{-x,--language=}"[Forces cppcheck to check all files as the given language]:language:(c c++)" \
"--library=[Load config file that contains information about types and functions]:config:_files" \
"--max-configs=[Maximum number of configurations to check in a file]" \
"--max-ctu-depth=[Maximum depth in whole program analysis]:num" \
"--output-file=[File to save results]:file:_files" \
"--output-format=[Specify the output format]:format:(text sarif xml)" \
"--platform=[Specified platform specific types and sizes]:platform:$platforms" \
"--plist-output=[Generate Clang-plist output files in folder]:_files" \
"--project=[Run Cppcheck on project]:file:_files" \
"--project-configuration=[Limit the configuration cppcheck should check]:configuration" \
"--platform=[Set platform specific types and sizes]:platforms:(unix32 unix64 win32A win32W win64 avr8 elbrus-e1cp pic8 pic8-enhanced pic16 mips32 native unspecified)" \
"(-q --quiet)"{-q,--quiet}"[Do not show progress reports]" \
{-rp,--relative-paths}"=[Use relative paths in output (separated with ;)]:_files" \
"--report-progress[Report progress messages while checking a file]" \
"--report-type=[Add guideline and classification fields for specified coding standard]:standard:$coding_standards" \
"--rule=[Match regular expression]:rule" \
"--rule-file=[Use given rule file]:file:_files" \
"--showtime=[show timing information]:type:(none file file-total summary top5_file top5_summary top5)" \
"--std=[Set standard]:std:(c89 c99 c11 c++03 c++11 c++14 c++17 c++20)" \
"--suppress=[Suppress warnings (format: \[error id\]:\[filename\]:\[line\])]" \
"--suppressions-list=[Suppress warnings listed in the file]:_files" \
"--suppress-xml=[Suppress warnings listed in a xml file]:_files" \
"--template=[Format the error messages]" \
"--template-location=[Format the error message location]" \
"*-U[Undefine preprocessor symbol]:symbol" \
"(-v --verbose)"{-v,--verbose}"[Output more detailed error information]" \
"--version[Print out version number]" \
"--xml[Write results in xml format to stderr]" \
"*: :_cppcheck_files"
}
_cppcheck "$@"
# 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

737
src/_dart
View File

@ -1,737 +0,0 @@
#compdef dart
# ------------------------------------------------------------------------------
# Copyright (c) 2023 Github zsh-users - https://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for dart 3.9.0 (https://dart.dev/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
_dart() {
typeset -A opt_args
local context state line
local curcontext="$curcontext"
local ret=1
_arguments -C -A "-*" \
'(-v --verbose)'{-v,--verbose}'[Show additional command output]' \
'(- *)--version[Print the Dart SDK version]' \
'(--enable-analytics --disable-analytics --suppress-analytics)--enable-analytics[Enable analytics]' \
'(--enable-analytics --disable-analytics --suppress-analytics)--disable-analytics[Disable analytics]' \
'(--enable-analytics --disable-analytics --suppress-analytics)--suppress-analytics[Disallow analytics for this "dart *" run without changing the analytics configuration]' \
'(- *)'{-h,--help}'[Print this usage information]' \
'1: :_dart_subcommands' \
'*::arg:->args' \
&& ret=0
case "$state" in
(args)
case $words[1] in
(help)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'1: :_dart_subcommands' \
&& ret=0
;;
(analyze)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'--fatal-infos[Treat info level issues as fatal]' \
'(--no-fatal-warnings --fatal-warnings)--fatal-warnings[Treat warnings level issue as fatal]' \
'(--no-fatal-warnings --fatal-warnings)--no-fatal-warnings[Do not treat warnings level issue as fatal]' \
'*: :_files -/' \
&& ret=0
;;
(compile)
_dart_compile && ret=0
;;
(create)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'(-t --template)'{-t,--template}'[The project template to use]:template:(cli console package server-shelf web)' \
'(--no-pub --pub)--pub[Run "pub get" after the project has been created]' \
'(--no-pub --pub)--no-pub[Do not run "pub get" after the project has been created]' \
'--force[Force project generation even if the target directory already exists]' \
'*: :_files -/' \
&& ret=0
;;
(devtools)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'(- *)--version[Prints the DevTools version]' \
'--host=[Hostname to serve DevTools on(defaults to localhost)]:host' \
'--port=[Port to serve DevTools on, specify 0 to automatically use any available port(defaults to 9100)]:port' \
'--dtd-uri=[A URI pointing to a Dart Tooling Daemon]:uri' \
'(--no-launch-browser --launch-browser)--launch-browser[Launches DevTools in a browser immediately at start]' \
'(--no-launch-browser --launch-browser)--no-launch-browser[Do not launches DevTools in a browser immediately at start]' \
'--machine[Sets output format to JSON for consumption in tools]' \
'--record-memory-profile=[Start devtools headlessly and write memory profiling samples to the indicated file]:file:_files' \
'--app-size-base=[Path to the base app size file used for app size]' \
'(--no-disable-cors --disable-cors)--disable-cors[Disable CORS]' \
'(--no-disable-cors --disable-cors)--no-disable-cors[Do not disable CORS]' \
'*:server_uri :' \
&& ret=0
;;
(doc)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'(-o --output)'{-o,--output=}'[Configuration the output directory(defaults to "doc/api")]:dir:_files -/' \
'(--dry-run)--validate-links[Display warnings for broken links]' \
'(--validate-links)--dry-run[Try to generate the docs without saving them]' \
'*:dir:_files -/' \
&& ret=0
;;
(fix)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'(-n --dry-run)'{-n,--dry-run}'[Preview the proposed changes but make no changes]' \
'--apply[Apply the proposed changes]' \
'--code=[Apply fixes for one or more diagnostics codes]:codes' \
'*: :_files' \
&& ret=0
;;
(format)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'(-v --verbose)'{-v,--verbose}'[Show all options and flags with --help]' \
'(-o --output)'{-o,--output}'[Set where to write formatted output]:format:_dart_format_output' \
'--show[Set which filenames to print]:show type:(all changed none)' \
'--summary[Show the specified summary after formatting]:summary type:(line none profile)' \
'--set-exit-if-changed[Return exit code 1 if there are any formatting changes]' \
'--page-width[Try to keep lines no longer than this(defaults to 80)]:width' \
'--trailing-commas[How trailing commas in input affect formatting]:style:(automate preserve)' \
'(-i --indent)'{-i,--indent}'[Add this many spaces of leading indentation]' \
'--follow-links[Follow links to files and directories]' \
'(- *)--version[Show dart_style version]' \
'--enable-experiment[Enable one or more experimental features]:features' \
'--selection[Track selection through formatting]:selection' \
'--stdin-name[Use this path in error messages when input is read from stdin]:name' \
'*:file_or_directory:_files' \
&& ret=0
;;
(info)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'(--no-remove-file-paths --remove-file-paths)--remove-file-paths[Remove file paths in displayed information]' \
'(--no-remove-file-paths --remove-file-paths)--no-remove-file-paths[Do not remove file paths in displayed information]' \
'*: :_files' \
&& ret=0
;;
(pub)
_dart_pub && ret=0
;;
(run)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'(-r --resident)'{-r,--resident}'[Enable faster startup times with the resident frontend compiler]' \
'--resident-compiler-info-file[The path to an info file to use to communicate with a resident frontend compiler]:file:_files' \
'--observe=[Specify debug port and bind address]:port_address' \
'--enable-vm-service=[Enable the VM service and listens on the specified port for connections(default port 8181)]:port_address' \
'(--serve-devtools --no-serve-devtools)--serve-devtools[Serves an instance of the Dart DevTools debugger and profiler]' \
'(--serve-devtools --no-serve-devtools)--no-serve-devtools[Do not serve an instance of the Dart DevTools debugger and profiler]' \
'--pause-isolates-on-exit[Pause isolates on exit when running with --enable-vm-service]' \
'--pause-isolates-on-unhandled-exceptions[Pause isolates when an unhandled exception is encountered when running with --enable-vm-service]' \
'--warn-on-pause-with-no-debugger[Print a warning when an isolate pauses with no attached debugger when running with --enable-vm-service]' \
'--timeline-streams=[Enables recording for specific timeline streams]:stream:_dart_run_timeline_streams' \
'--pause-isolates-on-start[Pause isolates on start when running with --enable-vm-service]' \
'--profile-microtasks[Record information about each microtask]' \
'(--enable-asserts --no-enable-asserts)--enable-asserts[Enable assert statements]' \
'(--enable-asserts --no-enable-asserts)--no-enable-asserts[Do not enable assert statements]' \
'--timeline-recorder=[Selects the timeline recorder to use]:recorder:(none ring endless startup systrace file callback)' \
'--verbosity[Sets the verbosity level of the compilation]:level:(all error info warning)' \
'*'{-d,--define=}'[Define an environment declaration]:key_value:' \
'--disable-service-auth-codes[Disables the requirement for an authentication code]' \
'--enable-service-port-fallback[Use 0 if binding port is failed]' \
'--root-certs-file=[The path to a file containing the trusted root certificates]:file:_files' \
'--root-certs-cache=[The path to a cache directory containing the trusted root certificates]:_files -/' \
'--trace-loading[Enable tracing of library and script loading]' \
'--packages=[The path to the package resolution configuration file]:file:_files'\
'--write-service-info=[Outputs information necessary to connect to the VM service]:service_info:_files' \
'(--no-dds --dds)--dds[Use the Dart Development Service for enhanced debugging functionality]' \
'(--no-dds --dds)--no-dds[Not use the Dart Development Service for enhanced debugging functionality]' \
'(--no-serve-observatory --serve-observatory)--serve-observatory[Enable hosting Observatory throught the VM service]' \
'(--no-serve-observatory --serve-observatory)--no-serve-observatory[Disable hosting Observatory throught the VM service]' \
'(--no-print-dtd --print-dtd)--print-dtd[Prints connection details for the Dart Tooling Daemon]' \
'(--no-print-dtd --print-dtd)--no-print-dtd[Not print connection details for the Dart Tooling Daemon]' \
'--enable-experiment=[Enable one or more experimental features]:features:_dart_run_enable_experiment' \
'*: :_files' \
&& ret=0
;;
(test)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'(- *)--version[Show the package:test version]' \
'*'{-n,--name}'[A substring of the name of the test to run]:name' \
'*'{-N,--plain-name}'[A plain-text substring of the name of the test to run]:plain_name' \
'*'{-t,--tags}'[Run only tests with all of the specified tags]:tag' \
'*'{-x,--exclude-tags}'[Do not run tests with any of the specified tags]:tag' \
'--run-skipped[Run skipped tests instead of skipping them]' \
'(-p --platform)'{-p,--platform}'[The platform on which to run the tests]:platform:(vm chrome firefox edge node experimental-chrome-wasm)' \
'(-c --compiler)'{-c,--compiler}'[The compiler to use to run tests]:compiler:(dart2js dart2wasm exe kernel source)' \
'(-P --preset)'{-P,--preset}'[The configuration preset to use]:preset' \
'(-j --concurrency)'{-j,--concurrency}'[The number of concurrent test suites run(defaults to 1)]:concurrency' \
'--total-shards[The total number of invocations of the test runner being run]:number' \
'--shard-index[The index of this test runner invocation]:index' \
'(--ignore-timeouts --timeout)--timeout[The default test timeout]:timeout' \
'(--ignore-timeouts --timeout)--ignore-timeouts[Ignore all timeouts]' \
'--pause-after-load[Pause for debugging before any tests execute]' \
'--debug[Run the VM and Chrome tests in debug mode]' \
'--coverage=[Gather coverage and output it to the specified directory]:dir:_files -/' \
'(--no-chain-stack-traces --chain-stack-traces)--chain-stack-traces[Use chained stack traces to provide greater exception]' \
'(--no-chain-stack-traces --chain-stack-traces)--no-chain-stack-traces[Do not use chained stack traces to provide greater exception]' \
'--no-retry[Do not rerun tests that have retry set]' \
'--test-randomize-ordering-seed[Use the specified seed to randomize the execution order of test cases]:seed' \
'(--no-fail-test --fail-test)--fail-test[Stop running tests after the first failure]' \
'(--no-fail-test --fail-test)--no-fail-test[Do not stop running tests after the first failure]' \
'(-r --reporter)'{-r,--reporter=}'[Set how to print test results]:reporter:_dart_test_reporter' \
'--file-reporter[Enable an additional reporter writing test results to a file]:reporter_file' \
'--verbose-trace[Emit stack traces with core library frames]' \
'--js-trace[Emit raw JavaScript stack traces for browser tests]' \
'(--color --no-color)--color[Use terminal colors]' \
'(--color --no-color)--no-color[Do not use terminal colors]' \
'*: :_files' \
&& ret=0
;;
esac
;;
esac
return ret
}
(( $+functions[_dart_compile] )) ||
_dart_compile() {
local ret=1
_arguments -C \
'(- *)'{-h,--help}'[Print this usage information]' \
'1: :_dart_compile_subcommands' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
local -a opts=(
'(- *)'{-h,--help}'[Print this usage information]'
'(-o --output)'{-o,--output}'[Write the output to file]:output:_files'
)
case $words[1] in
(aot-snapshot|exe|jit-snapshot|kernel)
opts+=(
'--verbosity[Sets the verbosity level of the compilation]:level:(all error info warning)'
'(-p --packages)'{-p,--packages=}'[Get package locations from the specified file instead of .dart_tool/package_config.json]:config:_files'
)
;|
(aot-snapshot|exe|jit-snapshot|kernel|wasm)
opts+=(
'*'{-d,--define=}'[Define an environment declaration]:key_value:'
)
;|
(aot-snapshot|exe|kernel)
opts+=(
'--depfile=[Path to output Ninja depfile]:file:_files'
)
;|
(aot-snapshot|exe)
opts+=(
'(-S --save-debugging-info)'{-S,--save-debugging-info=}'[Remove debugging information from the output and save it separately to the specified file]:file:_files'
'--target-os[Compile to a specific target operating system]:os:(android fuchsia ios linux macos windows)'
)
;|
(aot-snapshot|wasm)
opts+=(
'--enable-asserts[Enable assert statements]'
)
;|
(kernel)
opts+=(
'(--no-link-platform --link-platform)--link-platform[Include the platform kernel in the resulting kernel file]'
'(--no-link-platform --link-platform)--no-link-platform[Do not include the platform kernel in the resulting kernel file]'
'(--no-embed-sources --embed-sources)--embed-sources[Embed source files in the generated kernel component]'
'(--no-embed-sources --embed-sources)--no-embed-sources[Do not embed source files in the generated kernel component]'
)
;|
(wasm)
opts+=(
'(--no-source-maps --source-maps)--source-maps[Generate a source map file]'
'(--no-source-maps --source-maps)--no-source-maps[Not generate a source map file]'
)
;;
(js)
opts+=(
'-O-[Set the compiler optimization level(defaults to -O1)]:level:(0 1 2 3 4)'
)
;;
esac
opts+=('*:entry_point:_files')
_arguments "$opts[@]" && ret=0
;;
esac
return $ret
}
(( $+functions[_dart_compile_subcommands] )) ||
_dart_compile_subcommands() {
local -a commands=(
"aot-snapshot:Compile Dart to an AOT snapshot"
"exe:Compile Dart to a self-contained executable"
"jit-snapshot:Compile Dart to a JIT snapshot"
"js:Compile Dart to JavaScript"
"kernel:Compile Dart to a kernel snapshot"
"wasm:Compile Dart to a WebAssembly/WasmGC module"
)
_describe -t commands 'command' commands "$@"
}
(( $+functions[_dart_format_output] )) ||
_dart_format_output() {
local -a outputs=(
"json:Print code and selection as JSON"
"none:Discard output"
"show:Print code to terminal"
"write:Overwrite formatted files on disk(default)"
)
_describe -t outputs 'output' outputs "$@"
}
(( $+functions[_dart_pub] )) ||
_dart_pub() {
local ret=1
_arguments -C \
'(- *)'{-h,--help}'[Print this usage information]' \
'(-v --verbose)'{-v,--verbose}'[Print detailed logging]' \
'(--color --no-color)--color[Use colors in terminal output]' \
'(--color --no-color)--no-color[Do not use colors in terminal output]' \
'(-C --directory)'{-d,--directory=}'[Run the subcommand in the directory]:dir:_files -/'\
'1: :_dart_pub_subcommands' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
local -a opts=(
'(- *)'{-h,--help}'[Print this usage information]'
)
case $words[1] in
(add|downgrade|get|publish|remove|upgrade)
opts+=(
'(- *)'{-h,--help}'[Print this usage information]'
'(-n --dry-run)'{-n,--dry-run}'[Report what dependencies would change but do not change any]'
'(-C --directory)'{-C,--directory=}'[Run this in the directory]:dir:_files -/'
'*: :_files'
)
;|
(add|downgrade|get|upgrade)
opts+=(
'--offline[Use cached packages instead of accessing the network]'
)
;|
(add|get|remove|upgrade)
opts+=(
'--precompile[Build executables in immediate dependencies]'
)
;|
(get)
opts+=(
'--enforce-lockfile[Enforce pubspec.lock]'
)
;|
(publish)
opts+=(
'(-f --force)'{-f,--force}'[Publish without confirmation if there are no errors]'
'--skip-validation[Publish without validation and resolution]'
)
;|
(upgrade)
opts+=(
'--tighten[Updates lower bounds in pubspec.yaml to match the resolved version]'
'--unlock-transitive[Also upgrades the transitive dependencies of the listed dependencies]'
'--major-versions[Upgrades packages to their latest resolvable versions and updates pubspec.yaml]'
)
;|
(bump)
_dart_pub_bump && return 0
;;
(cache)
_dart_pub_cache && return 0
return 1
;;
(deps)
opts+=(
'(-s --style)'{-s,--style}'[How output should be displayed]:style:(compact tree list)'
'(--dev --no-dev)--dev[Include dev dependencies]'
'(--dev --no-dev)--no-dev[Do not include dev dependencies]'
'--executables[List all available executables]'
'--json[Output dependency information in a json format]'
'(-C --directory)'{-C,--directory=}'[Run this in the directory]:dir:_files -/'
)
;;
(global)
_dart_pub_global && return 0
return 1
;;
(outdated)
opts+=(
'(--no-dependency-overrides --dependency-overrides)--dependency-overrides[Show resolutions with "dependency_overrides"]'
'(--no-dependency-overrides --dependency-overrides)--no-dependency-overrides[Do not show resolutions with "dependency_overrides"]'
'(--no-dev-dependencies --dev-dependencies)--dev-dependencies[Take dev dependencies into account]'
'(--no-dev-dependencies --dev-dependencies)--no-dev-dependencies[Do not take dev dependencies into account]'
'--json[Output the results using a json format]'
'(--no-prereleased --prereleases)--prereleases[Include prereleases in latest version]'
'(--no-prereleased --prereleases)--no-prereleases[Do not include prereleases in latest version]'
'(--no-show-all --show-all)--show-all[Include dependencies that are already fulfilling --mode]'
'(--no-show-all --show-all)--no-show-all[Do not include dependencies that are already fulfilling --mode]'
'(--no-transitive --transitive)--transitive[Show transitive dependencies]'
'(--no-transitive --transitive)--no-transitive[Do not show transitive dependencies]'
'(-C --directory)'{-C,--directory=}'[Run this in the directory]:dir:_files -/' )
;;
(token)
_dart_pub_token && return 0
return 1
;;
esac
_arguments "$opts[@]" && ret=0
;;
esac
return $ret
}
(( $+functions[_dart_pub_subcommands] )) ||
_dart_pub_subcommands() {
local -a commands=(
"add:Add dependencies to 'pubspec.yaml'"
"bump:Increases the version number of the current package"
"cache:Work with the system cache"
"deps:Print package dependencies"
"downgrade:Downgrade the current package's dependencies to oldest versions"
"get:Get the current package's dependencies"
"global:Work with global packages"
"login:Log into pub.dev"
"logout:Log out of pub.dev"
"outdated:Analyze your dependencies to find which ones can be upgraded"
"publish:Publish the current package to pub.dev"
"remove:Removes dependencies from 'pubspec.yaml'"
"token:Manage authentication tokens for hosted pub repositories"
"unpack:Downloads a package and unpacks it in place"
"upgrade:Upgrade the current package's dependencies to latest versions"
"workspace:Work with the pub workspace"
)
_describe -t commands 'command' commands "$@"
}
(( $+functions[_dart_pub_bump] )) ||
_dart_pub_bump() {
local ret=1
_arguments -C \
'(- *)'{-h,--help}'[Print this usage information]' \
'1: :_dart_pub_bump_subcommands' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
local -a opts=(
'(- *)'{-h,--help}'[Print this usage information]'
'(-n --dry-run)'{-n,--dry-run}'[Report what would change, but do not change anything]'
)
_arguments "$opts[@]" && ret=0
;;
esac
return $ret
}
(( $+functions[_dart_pub_bump_subcommands] )) ||
_dart_pub_bump_subcommands() {
local -a commands=(
'breaking:Increment to the next breaking version(eg. 0.1.2 -> 0.2.0)'
'major:Increment the major version number(eg. 3.1.2 -> 4.0.0)'
'minor:Increment the minor version number(eg. 3.1.2 -> 3.2.0)'
'patch:Increment the patch version number(eg. 3.1.2 -> 3.1.3)'
)
_describe -t commands 'command' commands "$@"
}
(( $+functions[_dart_pub_cache] )) ||
_dart_pub_cache() {
local ret=1
_arguments -C \
'(- *)'{-h,--help}'[Print this usage information]' \
'1: :_dart_pub_cache_subcommands' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
local -a opts=(
'(- *)'{-h,--help}'[Print this usage information]'
'*: :_files'
)
case $words[1] in
(add)
opts+=(
'--all[Install all matching versions]'
'(-v --version)'{-v,--version}'[Version constraint]:version'
)
;;
(clean)
opts+=(
'(-f --force)'{-f,--force}'[Do not ask for confirmation]'
)
;;
esac
_arguments "$opts[@]" && ret=0
;;
esac
return $ret
}
(( $+functions[_dart_pub_cache_subcommands] )) ||
_dart_pub_cache_subcommands() {
local -a commands=(
"add:Install a package"
"clean:Clears the global PUB_CACHE"
"repair:Reinstall cached packages"
)
_describe -t commands 'command' commands "$@"
}
(( $+functions[_dart_pub_global] )) ||
_dart_pub_global() {
local ret=1
_arguments -C \
'(- *)'{-h,--help}'[Print this usage information]' \
'1: :_dart_pub_global_subcommands' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
local -a opts=(
'(- *)'{-h,--help}'[Print this usage information]'
'*: :_files'
)
case $words[1] in
(activate)
opts+=(
'(-s --source)'{-s,--source}'[The source used to find the package]:source'
'--git-path[Path of git package in repository]:git_path'
'--git-ref[Git branch or commit to be retrieved]:git_ref'
'(-x --executable --noexecutables)--no-executables[Do not put executables on PATH]'
'(-x --executable --noexecutables)'{-x,--executable}'[Executable to place on PATH]'
'--overwrite[Overwrite executables from other packages with the same name]'
'(-u --hosted-url)'{-u,--hosted-url}'[A custom pub server URL for the package]:server'
)
;;
(run)
opts+=(
'(--enable-asserts --no-enable-asserts)--enable-asserts[Enable assert statements]'
'(--enable-asserts --no-enable-asserts)--no-enable-asserts[Do not enable assert statements]'
'*--enable-experiment=[Runs the executable in a VM with the given experiments enabled]:experiment'
)
;;
esac
_arguments "$opts[@]" && ret=0
;;
esac
return $ret
}
(( $+functions[_dart_pub_global_subcommands] )) ||
_dart_pub_global_subcommands() {
local -a commands=(
"activate:Make a package's executables globally available"
"deactivate:Remove a previously activated package"
"list:List globally activated packages"
"run:Run an executable from a globally activated package"
)
_describe -t commands 'command' commands "$@"
}
(( $+functions[_dart_pub_token] )) ||
_dart_pub_token() {
local ret=1
_arguments -C \
'(- *)'{-h,--help}'[Print this usage information]' \
'1: :_dart_pub_token_subcommands' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
local -a opts=(
'(- *)'{-h,--help}'[Print this usage information]'
'*: :_files'
)
case $words[1] in
(add)
opts+=(
'--env-var=[Read the secret token from this environment variable]:envvar'
)
;;
(remove)
opts+=(
'--all[Remove all secret tokens]'
)
;;
esac
_arguments "$opts[@]" && ret=0
;;
esac
return $ret
}
(( $+functions[_dart_pub_token_subcommands] )) ||
_dart_pub_token_subcommands() {
local -a commands=(
"add:Add an authentication token for a package repository"
"list:List servers for which a token exists"
"remove:Remove secret token for package repository at hosted-url"
)
_describe -t commands 'command' commands "$@"
}
(( $+functions[_dart_pub_workspace] )) ||
_dart_pub_workspace() {
local ret=1
_arguments -C \
'(- *)'{-h,--help}'[Print this usage information]' \
'1: :_dart_pub_workspace_subcommands' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
local -a opts=(
'(- *)'{-h,--help}'[Print this usage information]'
'--json[Output information in a json format]'
)
_arguments "$opts[@]" && ret=0
;;
esac
return $ret
}
(( $+functions[_dart_pub_workspace_subcommands] )) ||
_dart_pub_workspace_subcommands() {
local -a commands=(
'list:List all packages in the workspace and their directory'
)
_describe -t commands 'command' commands "$@"
}
(( $+functions[_dart_run_timeline_streams] )) ||
_dart_run_timeline_streams() {
local -a streams=(all API Compiler CompilerVerbose Dart Debugger Embedder GC Isolate VM)
_values -s ',' streams $streams
}
(( $+functions[_dart_run_enable_experiment] )) ||
_dart_run_enable_experiment() {
local -a features=(
'augumentations:Augumentations - enhancing declarations from outside'
'const-function:Allow more of the Dart language to be executed in const expression'
'dot-shorthands:Shorter dot syntax for static accesses'
'enhanced-parts:Generalize parts to be nested and have exports/imports'
'getter-setter-error:Stop reporting errors about mismatching types in a getter/setter pair'
'inference-update-4:A bundle of updates to type inference'
'macros:Static meta-programming'
'native-asserts:Compile and bundle native asserts'
'null-aware-elements:Null-aware elements and map entries in collections'
'record-use:Output arguments used by static functions'
'sound-flow-analysis:Assume sound null safety when computing type promotion, reachability, definite assignment'
'test-experiment:Has no effect'
'unquoted-imports:Shorter import syntax'
'variance:Sound variance'
)
_describe -t features 'command' features "$@"
}
(( $+functions[_dart_test_reporter] )) ||
_dart_test_reporter() {
local -a reporters=(
"compact:A single line, updated continuously"
"expanded:A separate line for each update"
"failures-only:A separate line for failing tests with no output for passing tests"
"github:A custom reporter for GitHub Actions"
"json:A machine-readable format"
"silent:A reporter with no output"
)
_describe -t reporters 'reporter' reporters "$@"
}
(( $+functions[_dart_subcommands] )) ||
_dart_subcommands() {
local -a commands=(
"analyze:Analyze Dart code in a directory"
"compile:Compile Dart to various formats"
"create:Create a new Dart project"
"devtools:Open DevTools (optionally connecting to an existing application)"
"doc:Generate API documentation for Dart projects"
"fix:Apply automated fixes to Dart source code"
"format:Idiomatically format Dart source code"
"info:Show diagnostic information about the installed tooling"
"pub:Work with packages"
"run:Run a Dart program"
"test:Run tests for a project"
)
_describe -t commands 'command' commands "$@"
}
_dart "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,71 +0,0 @@
#compdef dget
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for dget 2.22.2
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Kris Shannon <k.shannon@amaze.com.au>
# * Shohei YOSHIDA <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
_dget() {
local context state line expl
local -A opt_args
_arguments -A "-*" \
'(- *)'{-h,--help}'[Show help message]' \
'(- *)'{-v,--version}'[Print license, copyright, and version information and exit]' \
'(-a --all)'{-a,--all}'[Package is a source package; download all binary packages]' \
'(--no-conf -b --backup)'{-b,--backup}'[Move files that would be overwritten to ./backup]' \
'(--no-conf -q --quiet)'{-q,--quiet}'[Suppress wget/curl output]' \
'(--no-conf -x --extract -d --download-only --build)'{-d,--download-only}'[Do not extract downloaded source]' \
'(--no-conf -x --extract -d --download-only --build)'{-x,--extract}'[Unpack downloaded source]' \
'(--no-conf -u --allow-unauthenticated)'{-u,--allow-unauthenticated}'[Make no attempt to verify source package signature]' \
'(--no-conf -x --extract -d --download-only --build)--build[Build package with dpkg-buildpackage after download]' \
'(--no-conf)--path[Check this directory in addition to the apt archive]:DIR:_files -/' \
'(--no-conf --insecure)--insecure[Do not check SSL certificates when downloading]' \
'(--no-conf --no-cache)--no-cache[Disable server-side HTTP cache]' \
"(--no-conf)--no-conf[Don't read devscripts config files]" \
'(-)*:debian package or URL: _alternative "_deb_packages available" "_urls"'
}
_dget "$@"
# 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