Compare commits

..

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

207 changed files with 7982 additions and 30426 deletions

View File

@ -1,5 +1,5 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at https://editorconfig.org/
; More information at http://EditorConfig.org
root = true

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.

3
.gitignore vendored
View File

@ -1,6 +1,3 @@
# 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,53 @@
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)
* Mac OS: [Homebrew](https://github.com/mxcl/homebrew/blob/master/Library/Formula/zsh-completions.rb)
* Debian based distributions (Debian/Ubuntu/Linux Mint...): Packager needed, please get in touch !
* RPM based distributions (Fedora/RHEL/CentOS...): Packager needed, please get in touch !
#### [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)
```
* You may have to force rebuild `zcompdump`:
```bash
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
License
-------
See each file for license details.
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.

187
src/_ack Normal file
View File

@ -0,0 +1,187 @@
#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>
#
# ------------------------------------------------------------------------------
_ack() {
local context curcontext="$curcontext" state line cmds update_policy ret=1
integer NORMARG
typeset -A opt_args
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 -s -S -n \
'(- 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 -/' \
'--invert-file-match[print/search handle files that do not match -g/-G]' \
'--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/ ##/\[}']' \
'*: :->args' \
&& ret=0
case $state in
args)
if [[ CURRENT -eq NORMARG && ${+opt_args[--match]} -eq 0 ]]
then
# If the current argument is the first non-option argument
# and --match isn't present then a pattern is expected
_message -e patterns 'pattern' && ret=0
else
_files
fi
;;
colors)
local colors; colors=(
'black' 'on_black'
'red' 'on_red'
'green' 'on_green'
'yellow' 'on_yellow'
'blue' 'on_blue'
'magenta' 'on_magenta'
'cyan' 'on_cyan'
'white' 'on_white'
'clear'
'reset'
'dark'
'bold'
'underline'
'underscore'
'blink'
'reverse'
'concealed'
)
_describe -t 'colors' 'color' colors && ret=0
;;
type-defs)
if compset -P '*='; then
local extensions; extensions=(*.*(:e))
_values -s ',' 'file extension' '.'$extensions && ret=0
else
_message -e type-name 'type name' && ret=0
fi
;;
types)
local types; types=({'','no'}${_ack_raw_types/ ##/:})
_describe -t 'types' 'type' types
;;
esac
return ret
}
_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 "$@"
# 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

417
src/_adb Normal file
View File

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

View File

@ -1,65 +0,0 @@
#compdef afew
# ------------------------------------------------------------------------------
# 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 afew(version 3.0.1) an initial tagging script for notmuch mail.
# (https://github.com/teythoon/afew)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
_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

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,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
# -----------
#
@ -213,8 +238,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 "$@"

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,30 +1,9 @@
#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.
#compdef attach
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for atach (https://github.com/sorin-ionescu/atach).
# Completion script for attach (http://github.com/sorin-ionescu/attach).
#
# ------------------------------------------------------------------------------
# Authors
@ -42,7 +21,7 @@ mode_values=(
"winch:use sigwinch to redraw"
)
existing_sessions=($(_call_program session atach))
existing_sessions=($(_call_program session attach))
_arguments -C -s -S \
'(--list -l)'{--list,-l}'[list sessions]' \

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

168
src/_baselayout Normal file
View File

@ -0,0 +1,168 @@
#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-Soloviov <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>
#
# ------------------------------------------------------------------------------
#<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
# 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,8 +1,5 @@
#compdef exportfs
#compdef bpython bpython2
# ------------------------------------------------------------------------------
# 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
@ -28,24 +25,28 @@
# Description
# -----------
#
# Completion script for nfs's exportfs - maintain table of exported NFS file systems.
# Completion script for bpython (http://bpython-interpreter.org/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Timofey Titovets <nefelim4ag@gmail.com>
# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
#
# ------------------------------------------------------------------------------
_exportfs() {
_values -w 'option' \
'(-i)-a[Export or unexport all directories]' \
'(-a -r -u)-i[Ignore the /etc/exports file and files under /etc/exports.d directory]' \
'(-i)-r[Reexport all directories]' \
'(-i)-u[Unexport one or more directories]' \
'-f[Flush everything out of export table]' \
'-o[option1,option2.. Specify a list of export options]' \
'-s[Display the current export list suitable for /etc/exports]' \
'-v[Be verbose]'
}
_exportfs "$@"
_arguments -A "-*" \
'(-h --help)'{-h,--help}'[Show help message]' \
'(-i --interactive)'{-i,--interactive}'[Drop to bpython shell after running file instead of exiting]' \
'(-q --quiet)'{-q,--quiet}"[Don't flush the output to stdout]" \
'(-V --version)'{-V,--version}'[Print version and exit]' \
'--config[Use CONFIG instead of default config file]:Config file:_files' \
'*: :_files'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

106
src/_brew Normal file
View File

@ -0,0 +1,106 @@
#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)
#
# ------------------------------------------------------------------------------
_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
# 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,349 +1,79 @@
#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/).
# Completion script for Bundler (http://gembundler.com).
#
# ------------------------------------------------------------------------------
# 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 "$@"
}
local curcontext="$curcontext" state line _gems _opts ret=1
_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' \
'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 $words[1] in
case $line[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
_values 'commands' 'install update package exec config check list show console open viz init gem help' && 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
'(--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)
_arguments \
'--keep-file-descriptors[exec will revert to the 1.9 behavior of passing all file descriptors to the new process]' \
'*:: :_normal' \
&& ret=0
_normal && ret=0
;;
config)
_arguments -C \
'1: :_bundle_config_subcommands' \
'--local[use local configuration]' \
'--global[use global configuration]' \
&& ret=0
(open|show)
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
if [[ $_gems != "" ]]; then
_values 'gems' $_gems && ret=0
fi
;;
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
*)
_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
;;

View File

@ -1,41 +1,15 @@
#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/)
# Completion script for Capistrano (http://capify.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Bruno Michel (https://github.com/nono)
# * Shohei Yoshida (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
@ -43,36 +17,25 @@
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]' \
{-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

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,6 +1,6 @@
#compdef choc
# ------------------------------------------------------------------------------
# Copyright (c) 2012 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,7 +28,7 @@
# Description
# -----------
#
# Completion script for choc (https://chocolatapp.com/)
# Completion script for choc (http://chocolatapp.com)
#
# ------------------------------------------------------------------------------
# Authors

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,6 +1,6 @@
#compdef coffee
# ------------------------------------------------------------------------------
# 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,40 +28,35 @@
# Description
# -----------
#
# Completion script for Coffee.js v2.7.0 (https://coffeescript.org/)
# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mario Fernandez (https://github.com/sirech)
# * Dong Weiming (https://github.com/dongweiming)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
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' \
_arguments -C \
'(- *)'{-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]' \
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
'(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
'(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
'(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
'(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]' \
'(--nodejs)--nodejs[pass options directly to the "node" binary]' \
'(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
'(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
'(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
'(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
'(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
'(-r --require)'{-r,--require}'[require a library before executing your script]:library' \
'(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
'(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
'*:script or directory:_files' && ret=0

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

81
src/_cpanm Normal file
View File

@ -0,0 +1,81 @@
#compdef cpanm
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for cpanm (http://search.cpan.org/dist/App-cpanminus/lib/App/cpanminus.pm).
#
# Source: https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ryushi (https://github.com/rshhh)
#
# ------------------------------------------------------------------------------
local arguments curcontext="$curcontext"
typeset -A opt_args
arguments=(
# Commands
# '(--install -i)'{--install,-i}'[Installs the modules]'
'(- :)--self-upgrade[Upgrades itself]'
'(- :)--info[Displays distribution info on CPAN]'
'(--installdeps)--installdeps[Only install dependencies]'
'(--look)--look[Download/unpack the distribution and then open the directory with your shell]'
'(- :)'{--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
# 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

View File

@ -1,75 +0,0 @@
#compdef dad
# ------------------------------------------------------------------------------
# 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 dad a command line manager of aria2 daemon. (https://github.com/baskerville/diana).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
#
# ------------------------------------------------------------------------------
_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:
# 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,6 +1,6 @@
#compdef archlinux-java
#compdef debuild
# ------------------------------------------------------------------------------
# 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,53 +28,33 @@
# Description
# -----------
#
# Completion script for archlinux-java a tool for selecting default Java runtime (https://wiki.archlinux.org/index.php/java).
# Completion script for debuild 2.10.
#
# Status: incomplete.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jindřich Pilař (https://github.com/JindrichPilar)
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_archlinux-java_command_arguments() {
case $words[1] in
(set)
local java_versions=("${(@f)$(archlinux-java status | tail -n +2 | tr -s ' ' | cut -d ' ' -f2)}")
_describe -t output 'Downloads to delete' java_versions
;;
esac
}
_archlinux-java() {
local -a commands
commands=(
"status:List installed Java environments and enabled one"
"get:Return the short name of the Java environment set as default"
"set:Force <JAVA_ENV> as default"
"unset:Unset current default Java environment"
"fix:Fix an invalid/broken default Java environment configuration"
"help:Show help"
)
_arguments -C \
'1:cmd:->cmds' \
'*:: :->args' \
case "$state" in
(cmds)
_describe -t commands 'commands' commands
;;
(*)
_archlinux-java_command_arguments
;;
esac
}
_archlinux-java
# FIXME --noconf is only allowed in first position
_arguments \
'(- 1 *)'{-h,--help}'[show help]' \
'(- 1 *)--version[show version and copyright information]' \
{--no-conf,--noconf}'[don'\''t read devscripts config files]' \
{-r-,--rootcmd=}'[command used to become root if debuild not setuid root (default: fakeroot)]: :_command_names' \
'*'{-e-,--preserve-envvar=}'[preserve environment variable]: :_vars' \
'(-e --preserve-envvar)--preserve-env[preserve all environment vars (except PATH)]' \
'*'{-e-,--set-envvar=}'[preserve environment variable]: :_vars -qS=' \
'--prepend-path=[prepend to the sanitised PATH]: :_files -/' \
'(-D)-d[skip checking of build dependencies]' \
'(-d)-D[force checking of build dependencies]' \
'--check-dirname-level[how much to check directory names]:level:((0\:never 1\:only\ if\ program\ changes\ directory\ \(default\) 2\:always))' \
'--check-dirname-regex[Perl regex defining matching directory names, the string PACKAGE will be replaced by the package name (default: '\''PACKAGE(-.+)?'\'')]:regex'
# Local Variables:
# mode: Shell-Script

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

View File

@ -1,9 +1,34 @@
#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 9.4.1 (http://roy.marples.name/projects/dhcpcd/)
# Completion script for dhcpcd 2.3.2.
#
# ------------------------------------------------------------------------------
# Authors
@ -13,42 +38,36 @@
#
# ------------------------------------------------------------------------------
_arguments \
'(-b --background)'{-b,--background}'[Background immediately]' \
'(-c --script)'{-c,--script}'[Use this script instead of the default]: :_files' \
'(-D --duid)'{-d,--duid}'[Use a DHCP Unique Identifier]:id' \
'(-d --debug)'{-d,--debug}'[Echo debug messages to the stderr and syslog]' \
'(-E --lastlease)'{-E,--lastlease}'[If dhcpcd cannot obtain a lease, then try to use the last lease acquired for the interface]' \
'--lastleaseextend[Same as the -E/--lastlease, but the lease will be retained even if it expires]' \
\*{-e,--env}'[Push value to the environment for use in dhcpcd-run-hooks(8)]:env' \
'(-g --reconfigure)'{-g,--reconfigure}'[dhcpcd will re-apply IP address, routing and run dhcpcd-run-hooks(8) for each interface]' \
'(-F --fqdn)'{-F,--fqdn}'[Requests that the DHCP server updates DNS using FQDN instead of just a hostname]:fqdn' \
'(-f --config)'{-f,--config}'[Specify a config to load instead of default]: :_files' \
'(-h --hostname)'{-h,--hostname}'[Sends hostname to the DHCP server so it can be registered in DNS]:hostname' \
'(-I --clientid)'{-I,--clientid}'[Send the clientid]:clientid' \
'(-i --vendorclassid)'{-i,--vendorclassid}'[Override the DHCPv4 venderclassid field sent]:vendorclassid' \
'(-j --logfile)'{-j,--logfile}'[Writes to the specified logfile]: :_files' \
\*{-k,--release}'[Release its lease and de-configure the interface regardless of -p, --persistent option]: :_net_interfaces' \
'(-l --leasetime)'{-l,--leasetime}'[Request a lease time of seconds. -1 represents an infinite lease time]:seconds' \
'(-M --manager)'{-M,--manager}'[Start dhcpcd in Manager mode even if only one interface specified on the command line]' \
'(-m --metric)'{-m,--metric}'[Metrics are used to prefer an interface over another one, lowest wins]:metric' \
\*{-n,--rebind}'[Notifies dhcpcd to reload its configuration and rebind the specified interface]: :_net_interfaces' \
\*{-N,--renew}'[Notifies dhcpcd to renew existing addresses on the specified interface]: :_net_interfaces' \
\*{-o,--option}'[Request the DHCP option variable for use in dhcpcd-run-hooks]:option' \
'(-p --persistent)'{-p,--persistent}"[Don't de-configure the interface and configuration at exit]" \
'(-r --request)'{-r,--request}'[Request the address in the DHCP DISCOVER message]:address' \
'(-s --inform)'{-s,--inform}'[Behaves exactly like -r, but sends a DHCP inform instead of a request]:address' \
'--inform6[Performs a DHCPv6 Information Request]' \
\*{-S,--static}'[Configures a static DHCP value]:value' \
'(-t --timeout)'{-t,--timeout}'[Timeout after seconds]:seconds' \
'(-u --userclass)'{-u,--userclass}'[Tags the DHCPv4 message with the userclass class]:class' \
'(-v --vendor)'{-v,--vendor}'[Add an encapsulated vendor option]:vendor' \
'(- *)--version[Display both program version and copyright information]' \
'-w[Wait for an address to be assigned before forking to the background]' \
'--waitip=[Wait for an address to assigned before forking to the background]: :(4 6)' \
\*{-x,--exit}'[This will signal an existing dhcpcd process running on the interface to exit]: :_net_interfaces' \
'(-y --reboot)'{-y,--reboot}'[Allow reboot seconds before moving to the discover phase if we have an old lease to use]:seconds' \
'1:network interface:_net_interfaces'
'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]'
# Local Variables:
# mode: Shell-Script

View File

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

View File

@ -1,133 +0,0 @@
#compdef direnv
# ------------------------------------------------------------------------------
# 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 OR THE AUTHOR 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 direnv 2.34.0 (https://direnv.net/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Nitai J. Perez <youcangetselfish@gmail.com>
#
# ------------------------------------------------------------------------------
(( $+functions[_direnv_commands] )) ||
_direnv_commands() {
local -a commands=(
'allow:Grants direnv permission to load the given .envrc or .env file'
'permit:Grants direnv permission to load the given .envrc or .env file'
'grant:Grants direnv permission to load the given .envrc or .env file'
'block:Revokes the authorization of a given .envrc or .env file'
'deny:Revokes the authorization of a given .envrc or .env file'
'revoke:Revokes the authorization of a given .envrc or .env file'
'edit:Opens PATH_TO_RC or the current .envrc or .env into an $EDITOR and allow the file to be loaded afterwards'
'exec:Executes a command after loading the first .envrc or .env found in DIR'
"fetchurl:Fetches a given URL into direnv's CAS"
'help:shows this help'
'hook:Used to setup the shell hook'
'prune:removes old allowed files'
'reload:triggers an env reload'
'status:prints some debug status information'
'stdlib:Displays the stdlib available in the .envrc execution context'
'version:prints the version or checks that direnv is older than VERSION_AT_LEAST'
)
_describe 'command' commands
}
_direnv() {
local curcontext="$curcontext" state line
typeset -A opt_args
local ret=1
_arguments -C \
'1: :_direnv_commands' \
'*:: :->command_args' && ret=0
case $state in
(command_args)
case $words[1] in
(allow|permit|grant|block|deny|revoke|edit)
_arguments \
'1:rc file:_files' \
&& ret=0
;;
(exec)
_arguments \
'1:directory:_files -/' \
'2:command:_command_names' \
&& ret=0
;;
(hook)
_arguments \
'1:shell:(bash zsh fish tcsh elvish)' \
&& ret=0
;;
(fetchurl)
_arguments \
'1:url:_urls' \
'2:integrity hash' \
&& ret=0
;;
(status)
_arguments \
'--json[print status information in JSON format]' \
&& ret=0
;;
(version)
_arguments \
'1:version at least' \
&& ret=0
;;
(help)
_arguments \
'1:show private:(SHOW_PRIVATE)' \
&& ret=0
;;
(prune|reload|status|stdlib)
# do not complete
ret=0
;;
(*)
_default && ret=0
;;
esac
;;
esac
return ret
}
_direnv "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

53
src/_ditz Normal file
View File

@ -0,0 +1,53 @@
#compdef ditz
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Ditz (http://ditz.rubyforge.org).
#
# Source: https://github.com/technolize/zsh-completion-funcs
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * technolize (https://github.com/technolize)
#
# ------------------------------------------------------------------------------
local ME=ditz
local COMMANDS=--commands
local OPTIONS='<options>'
if (($CURRENT == 2)); then
# We're completing the first word after the tool: the command.
_wanted command expl "$ME command" \
compadd -- $( "$ME" "$COMMANDS" )
else
# Find the options/files/URL/etc. for the current command by using the tool itself.
case "${words[$CURRENT]}"; in
-*)
_wanted args expl "Arguments for $ME ${words[2]}" \
compadd -- $( "$ME" "${words[2]}" "$OPTIONS" ; _files )
;;
ht*|ft*)
_arguments '*:URL:_urls'
;;
/*|./*|\~*|../*)
_arguments '*:file:_files'
;;
*)
_wanted args expl "Arguments for $ME ${words[2]}" \
compadd -- $( "$ME" "${words[2]}" "$OPTIONS" )
;;
esac
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,56 +0,0 @@
#compdef do-release-upgrade
# ------------------------------------------------------------------------------
# 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 do-release-upgrade 23.10.10
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments \
'(- *)'{-h,--help}'[Show this help message and exit]' \
'(- *)'{-v,--version}'[Show version and exit]' \
'(-d --devel-release)'{-d,--devel-release}'[Upgrade to the development release]' \
'--data-dir=[Directory that contains the data files]:dir:_files -/' \
'(-p --proposed)'{-p,--proposed}'[Try upgrading to the latest release using the upgrade from \$distro-proposed]' \
'(-m --mode)'{-m,--mode=}'[Run in a special upgrade mode]:mode:(desktop server)' \
'(-f --frontend)'{-f,--frontend}'[Run the specified frontend]:frontend' \
'(- *)--check-dist-upgrade-only[Check only if a new distribution release is available]' \
'--allow-third-party[Try the upgrade with third party mirrors and repositories]' \
'(-q --quiet)'{-q,--quiet}'[Quiet mode]' \
\*{-e,--env=}'[A comma-separated list of environment variables]'
# 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,90 +0,0 @@
#compdef docpad
# ------------------------------------------------------------------------------
# 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 docpad v6.38.2 (https://github.com/bevry/docpad).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Changwoo Park (https://github.com/pismute)
# * Shohei Yoshida (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
_docpad_subcommands() {
local -a commands=(
"run:run docpad on your project"
"init:initialize your project"
"generate:(re)generates your project"
"render:render the file at <path> and output its results to stdout"
"watch:watches your project for changes, and (re)generates whenever a change is made"
"clean:ensure everything is cleaned correctly (will remove your out directory)"
"update:update your local DocPad and plugin installations to their latest compatible version"
"upgrade:update your local DocPad and plugin installations to their latest compatible version"
"install:install plugins"
"uninstall:uninstall a plugin"
"info:display the information about your docpad instance"
)
_describe -t commands 'command' commands "$@"
}
_docpad() {
local ret=1
_arguments \
'--outpath[a custom directory to place the rendered project]: :_files -/' \
'--config[a custom configuration file to load in]: :_files' \
'--env[the environment name to use for this instance, multiple names can be separated with a comma]' \
'--log[the rfc log level to display]:level' \
'(-v --verbose)'{-v,--verbose}'[set log level to 7]' \
'(-d --debug)'{-d,--debug}'[output a log file]' \
'--global[whether or not we should just fire global installation of docpad]' \
'(--color --colour)'{--color,--colour}'[use color terminal output(default: true)]' \
'--silent[do not write anything that is not essential]' \
'--progress[output the progress as it occurs(default: true)]' \
'--version[show version]' \
'(- *)'{-h,--help}'[output usage information]'\
'1: :_docpad_subcommands'\
'*:: :_files' && ret=0
return ret
}
_docpad "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,191 +0,0 @@
#compdef drush
# ------------------------------------------------------------------------------
# Copyright (c) 2014 Github zsh-users - 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 Drush (https://drushcommands.com/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Vasily Kraev (https://github.com/vasilykraev)
#
# ------------------------------------------------------------------------------
_drush() {
local curcontext='$curcontext' state line cmds ret=1
integer NORMARG
typeset -A opt_args
global_args=('--debug' '--verbose' '--yes' '--no' '--simulate' '--root=' '--uri=')
_arguments -C \
'(--*)'{--version,--version}'[Show drush version.]' \
'(- *)'{-d,--debug}'[Display even more information, including internal messages.]' \
'(- *)'{-v,--verbose}'[Display extra information about the command.]' \
'(- *)'{-y,--yes}'[Assume "yes" as answer to all prompts.]' \
'(- *)'{-n,--no}'[Assume "no" as answer to all prompts.]' \
'(- *)'{-s,--simulate}'[Simulate all relevant actions (don'\''t actually change the system).]' \
'(- *)'{-r,--root=}'[Drupal root directory to use (default: current directory).]' \
'(- *)'{-l,--uri=}'[URI of the drupal site to use (only needed in multisite environments or when running on an alternate port).]' \
'1: :->cmds' \
'*::arg:->args' \
&& ret=0
case $state in
cmds)
_values 'drush command' \
'(archive-dump)'{archive-dump,ard,arb}'[Backup your code, files, and database into a single file.]' \
'(archive-restore)'{archive-restore,arr}'[Expand a site archive into a Drupal web site.]' \
'(cache-clear)'{cache-clear,cc}'[Clear a specific cache, or all drupal caches.]' \
'(core-status)'{core-status,status,st}'[Provides a birds-eye view of the current Drupal installation, if any.]' \
'(core-cron)'{core-cron,cron}'[Run all cron hooks in all active modules for specified site.]' \
'(core-execute)'{core-execute,exec}'[Execute a shell command. Usually used with a site alias.]' \
'(drupal-directory)'{drupal-directory,dd}'[Return the filesystem path for modules/themes and other key folders.]' \
'help[Print this help message.]' \
'image-flush[Flush all derived images for a given style.]' \
'(site-alias)'{site-alias,sa}'[Print an alias record.]' \
'(site-install)'{site-install,si}'[Install Drupal along with modules/themes/configuration using the specified install profile.]' \
'test-clean[Clean temporary tables and files.]' \
'test-run[Run tests. Note that you must use the --uri option.]' \
'(updatedb)'{updatedb,updb}'[Apply any database updates required (as with running update.php).]' \
'(variable-delete)'{variable-delete,vdel}'[Delete a variable.]' \
'(variable-get)'{variable-get,vget}'[Get a list of some or all site variables and values.]' \
'(variable-set)'{variable-set,vset}'[Set a variable.]' \
'(pm-list)'{pm-list,pml}'[Show a list of available extensions (modules and themes).]' \
'(pm-disable)'{pm-disable,dis}'[Disable one or more extensions (modules or themes). Disable dependent extensions as well.]' \
'(pm-download)'{pm-download,dl}'[Download projects from drupal.org or other sources.]' \
'(pm-enable)'{pm-enable,en}'[Enable one or more extensions (modules or themes). Enable dependent extensions as well.]' \
'pm-uninstall[Uninstall one or more modules.]' \
'pm-update[Update Drupal core and contrib projects and apply any pending database updates (Same as pm-updatecode + updatedb).]' \
'(sql-cli)'{sql-cli,sqlc}'[Open a SQL command-line interface using Drupals credentials.]' \
'sql-drop[Drop all tables in a given database.]' \
'sql-dump[Exports the Drupal DB as SQL using mysqldump or equivalent.]' \
'(sql-query)'{sql-query,sqlq}'[Execute a query against the site database.]' \
'sql-sync[Copy and import source database to target database. Transfers via rsync.]' \
'(user-login)'{user-login,uli}'[Display a one time login link for the given user account (defaults to uid 1).]' \
'(user-password)'{user-password,upwd}'[(Re)Set the password for the user account with the specified name.]' \
'(devel-reinstall)'{devel-reinstall,dre}'[Disable, Uninstall, and Install a list of projects. (devel)]' \
'(devel-token)'{devel-token,token}'[List available tokens (devel)]' \
'(generate-content)'{generate-content,genc}'[Create content. (devel_generate)]' \
'(generate-menus)'{generate-menus,genm}'[Create menus and menu items. (devel_generate)]' \
'(generate-terms)'{generate-terms,gent}'[Create terms in specified vocabulary. (devel_generate)]' \
'(generate-users)'{generate-users,genu}'[Create users. (devel_generate)]' \
'(generate-vocabs)'{generate-vocabs,genv}'[Create vocabularies. (devel_generate)]' \
'(features-diff)'{features-diff,fd}'[Show the difference between the default and overridden state of a feature.]' \
'(features-export)'{features-export,fe}'[Export a feature from your site into a module.]' \
'(features-list)'{features-list,fl}'[List all the available features for your site.]' \
'(features-revert)'{features-revert,fr}'[Revert a feature module on your site.]' \
'(features-revert-all)'{features-revert-all,fra}'[Revert all enabled feature module on your site.]' \
'(features-update)'{features-update,fu}'[Update a feature module on your site.]' \
'(features-update-all)'{features-update-all,fua}'[Update all feature modules on your site.]' \
&& ret=0
;;
args)
case $line[1] in
(archive-dump|ard)
_arguments \
'(--description)--description=[Filter out extensions that are provided by drupal core.]' \
'(--destination)--destination=[The full path and filename in which the archive should be stored. If omitted, it will be saved to the drush-backups directory.]' \
'(--no-core)--no-core[Exclude Drupal core, so the backup only contains the site specific stuff.]' \
'(--pipe)--pipe[Only print the destination of the archive. Useful for scripts that don'\''t pass --destination.]' \
'(--tar-options)--tar-options=[Options passed thru to the tar command.]' \
&& ret=0
compadd -a global_args
;;
(archive-restore|arr)
_arguments \
'(--db-prefix)--db-prefix[An optional table prefix to use during restore.]' \
'(--db-su)--db-su[Account to use when creating the new database. Optional.]' \
'(--db-su-pw)--db-su-pw[Password for the "db-su" account. Optional.]' \
'(--db-url)--db-url=[A Drupal 6 style database URL indicating the target for database restore. If not provided, the archived settings.php is used. ]' \
'(--destination)--destination[Specify where the Drupal site should be expanded, including the docroot. Defaults to the current working directory.]' \
'(--overwrite)--overwrite[Allow drush to overwrite any files in the destination.]' \
&& ret=0
compadd -a global_args
;;
(user-password|upwd)
_arguments \
'--password=:Set the password for the username someuser.' \
&& ret=0
;;
(help)
_values 'commands' 'arb' 'archive-dump' 'archive-restore' 'ard' 'arr' 'cache-clear' 'cc' 'core-cron' 'core-execute' 'core-status' 'cron' 'dd' 'devel-reinstall' 'devel-token' 'dis' 'dl' 'dre' 'drupal-directory' 'en' 'exec' 'fd' 'fe' 'features-diff' 'features-export' 'features-list' 'features-revert' 'features-revert-all' 'features-update' 'features-update-all' 'fl' 'fr' 'fra' 'fu' 'fua' 'genc' 'generate-content' 'generate-menus' 'generate-terms' 'generate-users' 'generate-vocabs' 'genm' 'gent' 'genu' 'genv' 'help' 'image-flush' 'pm-disable' 'pm-download' 'pm-enable' 'pm-list' 'pm-uninstall' 'pm-update' 'pml' 'sa' 'si' 'site-alias' 'site-install' 'sql-cli' 'sql-drop' 'sql-dump' 'sql-query' 'sql-sync' 'sqlc' 'sqlq' 'st' 'status' 'test-clean' 'test-run' 'token' 'uli' 'updatedb' 'updb' 'upwd' 'user-login' 'user-password' 'variable-delete' 'variable-get' 'variable-set' 'vdel' 'vget' 'vset'
;;
(cc)
_values 'options' 'all' 'drush' 'theme-registry' 'menu' 'css-js' 'block'
;;
(pm-list|pml)
_arguments \
'(--core)--core[Filter out extensions that are not in drupal core.]' \
'(--no-core)--no-core[Filter out extensions that are provided by drupal core.]' \
'(--pipe)--pipe[Returns a whitespace delimited list of the names of the resulting extensions.]' \
'(--status)--status=-[Filter by extension status. Choices: enabled, disabled and/or "not installed".]:status:(enabled disabled)' \
'(--type)--type=-[Filter by extension type. Choices: module, theme.]:type:(module theme)' \
&& ret=0
;;
(pm-disable|dis)
_modules=( $(drush pml --status=enabled --pipe) )
if [[ $_modules != "" ]]; then
_values 'enabled modules' $_modules
fi
;;
(pm-enable|en)
_arguments -C \
'--resolve-dependencies[Attempt to download any missing dependencies. At the moment, only works when the module name is the same as the project name.]' \
'--skip[Skip automatic downloading of libraries (c.f. devel).]' && ret=0
_modules=( $(drush pml --status="disabled,not installed" --pipe) )
if [[ $_modules != "" ]]; then
_values -s 'not yet enabled modules' $_modules && ret=0
fi
;;
(*)
_values 'Global options' \
{-d,--debug}'[Display even more information, including internal messages.]' \
{-v,--verbose}'[Display extra information about the command.]' \
{-y,--yes}'[Assume "yes" as answer to all prompts.]' \
{-n,--no}'[Assume "no" as answer to all prompts.]' \
{-s,--simulate}'[Simulate all relevant actions (don'\''t actually change the system).]' \
{-r,--root=}'[Drupal root directory to use (default: current directory).]' \
{-l,--uri=}'[URI of the drupal site to use (only needed in multisite environments or when running on an alternate port).]'
;;
esac
;;
esac
}
_drush '$@'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,53 +0,0 @@
#compdef ecdsautil
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for ecdsaultils v0.4.0 (https://github.com/freifunk-gluon/ecdsautils)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Robinhuett <https://github.com/Robinhuett>
#
# ------------------------------------------------------------------------------
_ecdsautil_args() {
case $words[1] in
(sign)
_arguments '1:somefile:_files'
;;
(verify)
_arguments '-s[signature]:secret:_files' '-p[publickey]:pubkey:_files'
'-n[signaturecount]:signaturecount:""' ':file:_files'
;;
esac
}
_ecdsautil() {
local -a commands
commands=(
"help:Show help"
"generate-key:generate a new secret on stdout"
"show-key:output public key of secret read from stdin"
"sign:sign file"
"verify:verify signature of file"
)
_arguments -C \
'1:cmd:->cmds' \
'*:: :->args' \
case "$state" in
(cmds)
_describe -t commands 'commands' commands
;;
(*)
_ecdsautil_args
;;
esac
}
_ecdsautil "$@"

View File

@ -1,105 +0,0 @@
#compdef emacs
# ------------------------------------------------------------------------------
# Copyright (c) 2022 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for emacs 29. (https://www.gnu.org/software/emacs/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei YOSHIDA (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
_arguments \
'--batch[do not do interactive display, implies -q]' \
'--chdir[change to directory]: :_files -/' \
'(--daemon --bg-daemon --fg-daemon)--daemon[start a server in the background]' \
'(--daemon --bg-daemon --fg-daemon)--bg-daemon=-[start a named server in the background]::name' \
'(--daemon --bg-daemon --fg-daemon)--fg-daemon=-[start a named server in the foreground]' \
'--debug-init[enable Emacs Lisp debugger for init file]' \
'(-d --display)'{-d,--display}'[use X server DISPLAY]:display' \
'--module-assertions[assert behavior of dynamic modules]' \
'--dump-file[read dumped state from FILE]: :_files' \
'(- *)--fingerprint[output fingerprint and exit]' \
'--seccomp=[read Seccomp BPF filter from FILE]: :_files' \
'--no-build-details[do not add build details such as time stamps]' \
'--no-desktop[do not load a saved desktop]' \
'(-q --no-init-file)'{-q,--no-init-file}'[loader neither ~/.emacs nor default.el]' \
'(-nl --no-loadup)'{-nl,--no-loadup}'[do not load loadup.el]' \
'--no-site-file[do not load site-start.el]' \
'--no-x-resources[do not load X resources]' \
'(-nsl --no-site-lisp)'{-nsl,--no-site-lisp}'[do not add site-lisp directories to load-path]' \
'--no-splash[do not display a splash screen on startup]' \
'(-nw --no-window-system)'{-nw,--no-window-system}'[do not communicate with X, ignoring $DISPLAY]' \
'--init-directory=[use DIR when looking for the Emacs init files]: :_files -/' \
'(-Q --quick)'{-Q,--quick}'[equivalent to -q --no-site-file --no-site-lisp --no-splash --no-x-resources]' \
'--script[run FILE as an Emacs Lisp script]: :_files' \
'(-t --terminal)'{-t,--terminal}'[use DEVICE for terminal IO]: :_files' \
'(-u --user)'{-u,--user}'[load ~USER/.emacs instead of your own]' \
\*{-L,--directory}'[prepend DIR to load-path(with :DIR, append DIR)]: :_files -/' \
{--eval,--execute}'[evaluate Emacs Lisp expression EXPR]:expr' \
\*{--file,--find-file,--visit}'[visit FILE]: :_files' \
\*{-f,--funcall}'[call Emacs Lisp function FUNC with no arguments]:func' \
'--kill[exit without asking for confirmation]' \
\*{-l,--load}'[load Emacs Lisp FILE using the load function]: :_files' \
'(-bg --background-color)'{-bg,--background-color}'[window background color]:color' \
'(-D --basic-display)'{-D,--basic-display}'[disable many display features]' \
'(-bg --border-color)'{-bg,--border-color}'[main border color]:color' \
'(-bw --border-width)'{-bw,--border-width}'[width of main border]' \
'--color=-[override color mode for character terminals]:: :(auto never always ansi8)' \
'(-cr --cursor-color)'{-cr,--cursor-color}'[color of the Emacs cursor indicating point]:color' \
'(-fn --font)'{-fn,--font}'[default font, must be fixed-width]:font' \
'(-fg --foreground)'{-fg,--foreground}'[window foreground color]:color' \
'(-fh --fullheight)'{-fh,--fullheight}'[make the first frame high as the screen]' \
'(-fs --fullscreen)'{-fs,--fullscreen}'[make the first frame fullscreen]' \
'(-fw --fullwidth)'{-fw,--fullwidth}'[make the first frame wide as the screen]' \
'(-mm --maximized)'{-mm,--maximized}'[make the first frame maximized]' \
'(-g --geometry)'{-g,--geometry}'[window geometry]:geometry' \
'(-nbi --no-bitmap-icon)'{-nbi,--no-bitmap-icon}'[do not use picture of gnu for Emacs icon]' \
'--iconic[start Emacs in iconified state]' \
'(-ib --internal-border)'{-ib,--internal-border}'[width between text and main border]:width' \
'(-lsp --line-spacing)'{-lsp,--line-spacing}'[additional space to put between lines]' \
'(-ms --mouse-color)'{-ms,--mouse-color}'[mouse cursor color in Emacs window]:color' \
'(-T --name --title)'{-T,--name,--title}'[title for initial Emacs frame]:title' \
'(-nbc,--no-blinking-cursor)'{-nbc,--no-blinking-cursor}'[disable blinking cursor]' \
'(-r -rv --reverse-video)'{-r,-rv,--reverse-video}'[switch foreground and background]' \
'(-vb --vertical-scroll-bars)'{-vb,--vertical-scroll-bars}'[enable vertical scroll bars]' \
'--xrm[set additional X resources]:resource' \
'--parent-id[set parent window]:xid' \
'(- *)--help{display help and exit}' \
'(- *)--version[output version information and exit]' \
'*: :_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,66 +0,0 @@
#compdef emacsclient
#
# ------------------------------------------------------------------------------
# Copyright (c) 2022 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for emacsclient 29
# - https://www.gnu.org/software/emacs/manual/html_node/emacs/Invoking-emacsclient.html
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei YOSHIDA (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
_arguments -s -n : \
'(- *)'{-V,--version}'[Print version information and exit]' \
'(- *)'{-H,--help}'[Print this usage information message and exit]' \
'(-nw -t --tty)'{-nw,-t,--tty}'[Open a new Emacs frame on the current terminal]' \
'(-c --create-frame)'{-c,--create-frame}'[Create a new frame instead of trying to use the current Emacs frame]' \
'(-r --reuse-frame)'{-r,--reuse-frame}'[Create a new frame if none exists, otherwise use the current Emacs frame]' \
'(-F --frame-parameters)'{-F,--frame-parameters=}'[Set the parameters of a new frame]:alist' \
'(-e --eval)'{-e,--eval}'[Evaluate as Emacs Lisp expressions]' \
'(-n --no-wait)'{-n,--no-wait}'[Returns immediately without waiting for finish]' \
'(-w --timeout)'{-w,--timeout=}'[Seconds to wait before timing out]:seconds' \
'(-q --quiet)'{-q,--quiet}"[Don't display messages on success]" \
'(-u --suppress-output)'{-u,--suppress-output}"[Don't display return values from the server]" \
'(-d --display)'{-d,--display=}'[Tell the server to display the files on the given display]:display:_x_display' \
'--parent-id=[Open in parent window ID, via XEmbed]' \
'(-s --socket-name)'{-s,--socket-name=}'[Set filename of the UNIX socket for communication]: :_files' \
'(-f --server-file)'{-f,--server-file=}'[Set filename of the TCP authentication file]: :_files' \
'(-a --alternate-editor)'{-a,--alternate-editor=}'[Editor to fallback to if the server is not running if EDITOR is the empty string]:editor:_files' \
'(-T --tramp)'{-T,--tramp=}'[PREFIX to prepend to filenames sent by emacsclient for locating files remotely via Tramp]:prefix' \
'*: :_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,10 +1,35 @@
#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
# (https://developer.android.com/studio/run/emulator-command).
# (http://developer.android.com/guide/developing/tools/emulator.html).
#
# ------------------------------------------------------------------------------
# Authors
@ -18,15 +43,11 @@
typeset -A opt_args
local context state line curcontext="$curcontext"
_list_avds() {
local -a _avds=($HOME/.android/avd/*.ini(N.:t:r))
echo "${_avds[@]}"
}
# 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
@ -43,11 +64,9 @@ _arguments \
'(- : *)-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,list-avds,sysdir,system,writable-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,cores,accel,no-accel,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]' \
'-list-avds[list available AVDs]' \
'(- : *)-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"' \
'-writable-system[make system image writable after '\''adb remount'\'']' \
'-datadir[write user data into the directory]: :_files -/' \
'-kernel[use specific emulated kernel]: :_files' \
'-ramdisk[ramdisk image (default <system>/ramdisk.img]: :_files -g "*.img"' \
@ -66,14 +85,11 @@ _arguments \
'-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:($(_list_avds))' \
'-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)' \
'-cores[Set number of CPU cores to emulator]:number' \
'(-no-accel)-accel[Configure emulation acceleration]:mode' \
'(-accel)-no-accel[Same as '\''-accel off'\'']' \
'-netspeed[maximum network download/upload speeds]:speed' \
'-netdelay[network latency emulation]:delay' \
'-netfast[disable network shaping]' \
@ -112,21 +128,7 @@ _arguments \
'-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' \
'1: :->cmds' \
'*:: :->args' && ret=0
case $state in
cmds)
local -a _avds=($(_list_avds))
for ((i=1; i<=${#_avds[@]}; i++)); do
_avds[i]="@${_avds[i]}"
done
_values 'avds' "${_avds[@]}"
;;
esac
return ret
'*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag'
# Local Variables:
# mode: Shell-Script

View File

@ -1,57 +0,0 @@
#compdef envdir
# ------------------------------------------------------------------------------
# Copyright (c) 2016, Github zsh-users (https://github.com/zsh-users)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for envdir (https://github.com/jezdez/envdir).
# It completes its few options and then a directory and command.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Daniel Hahler <https://daniel.hahler.de/>
#
# ------------------------------------------------------------------------------
local -a args=(
'(-h --help)'{-h+,--help}'[show this help message and exit]'
'(-)'--version'[display version information and exit]'
'(-)1:directory: _path_files -/'
'(-)2:command: _command_names -e'
'*::arguments: _precommand'
)
_arguments -S $args
# 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

207
src/_eselect Normal file
View File

@ -0,0 +1,207 @@
#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-Soloviov <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>
#
# ------------------------------------------------------------------------------
#<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 "$@"
# 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,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
#
@ -63,7 +38,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 +50,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

View File

@ -1,339 +0,0 @@
#compdef fail2ban-client
# ------------------------------------------------------------------------------
# Copyright (c) 2020 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for fail2ban-client (https://www.fail2ban.org/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Felix Neumärker <xdch47@posteo.de>
#
# ------------------------------------------------------------------------------
_f2bc_jails() {
LANG=C fail2ban-client status 2> /dev/null | sed -n -e 's/.*Jail list:\s\+//' -e 'T' -e 's/,\s\+/\'$'\n/g' -e 'p'
}
_complete_f2bc_cmds() {
local cmds=(
'unban:unbans all IP addresses'
'set:set property'
'get:get property'
'status:gets the current status of the server'
'reload:reloads the configuration/jails'
'restart:restarts the server'
'start:starts the server and the jails'
'stop:stops all jails and terminate the server'
'ping:tests if the server is alive'
'flushlogs:flushes the logtarget if a file and reopens it'
'help:return this output'
'version:return the server version'
)
_describe -V "fail2ban commands" cmds
}
_complete_f2bc_cmdargs() {
local f2barg="$words[$NORMARG]"
case "$f2barg" in
unban)
local jail
if (( $words[(I)(--all)] == 0 )) ; then
for jail in $(_f2bc_jails) ; do
_complete_f2bc_ips $jail
done
local unban_opts=(--all)
_describe -o "unban options" unban_opts
else
_nothing
fi
;;
(set|get))
if (( $NORMARG + 1 == $CURRENT )) ; then
_complete_f2bc_jails
_complete_f2bc_settings
else
_complete_f2bc_jail${f2barg}
fi
;;
status)
if (( $NORMARG + 1 == $CURRENT )) ; then
_complete_f2bc_jails
elif (( $NORMARG + 2 == $CURRENT )) ; then
_values "flavor" basic cymru
else
_nothing
fi
;;
esac
}
_complete_f2bc_jails() {
local jails=($(_f2bc_jails))
_describe -V "jails" jails
}
_complete_f2bc_ips() {
local ips=("${(@f)$(LANG=C fail2ban-client status $1 2> /dev/null | sed -n -e 's/^.*Banned IP list:\s\+//' -e 'T' -e 's/\s\+/\'$'\n/g' -e 'p')}")
if [[ -n "${ips[@]}" ]] ; then
_describe -t "f2b_jail_$1" -V "banned ips of jail $1" ips
else
_nothing
fi
}
_complete_f2bc_jailset() {
if (( $NORMARG + 2 == $CURRENT )) ; then
case $words[$NORMARG+1] in
loglevel)
local loglevel=(CRITICAL ERROR WARNING NOTICE INFO DEBUG TRACEDEBUG HEAVYDEBUG)
_describe -V "loglevel" loglevel ;;
logtarget)
local logtarget=(STDOUT STDERR SYSLOG)
_describe -V "logtarget" logtarget
_files ;;
syslogsocket)
local syslogsocket=(auto)
_describe -V "logtarget" syslogsocket
_files ;;
dbfile)
_files ;;
dbpurgeage)
_message "sets the max age in <SECONDS> that history of bans will be kept" ;;
*)
# jail
local jailsettings=(
unbanip
banip
action
addaction
addfailregex
addignoreip
addignoreregex
addjournalmatch
addlogpath
bantime
datepattern
delaction
delfailregex
delignoreip
delignorerexgex
deljournalmatch
dellogpath
findtime
idle
ignorecache
ignorecommand
ignoreself
logencoding
maxlines
maxretry
usedns
)
_describe -t "f2b_jail_setting" -V "jail setting" jailsettings ;;
esac
else
local jail="$words[$NORMARG+1]"
if (( $NORMARG + 3 == $CURRENT )) ; then
case $words[$NORMARG+2] in
unbanip)
_complete_f2bc_ips "$jail" ;;
delfailregex)
_complete_f2bc_regex fail "$jail" ;;
delignorerexgex)
_complete_f2bc_regex ignore "$jail" ;;
dellogpath)
local filelist=("${(@f)$(LANG=C fail2ban-client status $jail 2> /dev/null | sed -n -e 's/^.*File list:\s\+//' -e 'T' -e 's/\s\+/\'$'\n/g' -e 'p')}")
if [[ -n "${filelist[@]}" ]] ; then
_describe -t "f2b_filelist" -V "filelist of jail $1" filelist
else
_nothing
fi ;;
idle)
_values 'fail2ban idle' on off ;;
ignoreself)
_values 'fail2ban ignoreself' true false ;;
delignoreip)
local ignoreips=("${(@f)$(fail2ban-client get "$jail" ignoreip 2> /dev/null | sed -e 's/^[|`]-\s\+//p')}")
if [[ -n "${ignoreips[@]}" ]] ; then
_describe -t "f2b_ignoreip" -V "fail2ban ignored ips" ignoreips
else
_nothing
fi ;;
delaction|action)
_complete_f2bc_action "$jail" ;;
addlogpath)
_files ;;
*)
_message "No completion for ${words[NORMARG+2]}" ;;
esac
elif (( $NORMARG + 4 == $CURRENT )) ; then
case $words[$NORMARG+2] in
action)
_complete_f2bc_actionproperties "$jail" $words[$NORMARG+3] ;;
addaction)
_files ;;
*)
_nothing ;;
esac
else
_nothing
fi
fi
}
_complete_f2bc_jailget() {
if (( $NORMARG + 2 == $CURRENT )) ; then
case $words[$NORMARG+1] in
(loglevel|logtarget|syslogsocket|dbfile|dbpurgeage))
_nothing ;;
*)
# jail
local jailprops=(
logpath
logencoding
journalmatch
ignoreself
ignoreip
ignorecommand
failregex
ignoreregex
findtime
bantime
datepattern
usedns
maxretry
maxlines
actions
action
actionproperties
actionmethods
)
_describe -t "f2b_jail_props" -V "jail properties" jailprops ;;
esac
else
local jail="$words[$NORMARG+1]"
if (( $NORMARG + 3 == $CURRENT )) ; then
case $words[$NORMARG+2] in
(action|actionproperties|actionmethods))
_complete_f2bc_action "$jail" ;;
*)
_nothing ;;
esac
elif (( $NORMARG + 4 == $CURRENT )) ; then
case $words[$NORMARG+2] in
(action|actionproperties|actionmethods))
_complete_f2bc_actionproperties "$jail" $words[$NORMARG+3] ;;
*)
_nothing ;;
esac
else
_nothing
fi
fi
}
_complete_f2bc_action() {
local jailactions=("${(@f)$(fail2ban-client get $1 actions 2>/dev/null | sed -e '1d' -e 's/,\s\+/\'$'\n/g')}")
if [[ -n "${jailactions[@]}" ]] ; then
_describe -t "f2b_jail_actions" -V "jail actions" jailactions
else
_nothing
fi
}
_complete_f2bc_actionproperties() {
local default_actionproperties=(
actionstart
actionstop
actioncheck
actionban
actionunban
timeout
)
local all_actionproperties=("${(@f)$(fail2ban-client get $1 actionproperties $2 2>/dev/null | sed -e '1d' -e 's/,\s\+/\'$'\n/g')}")
local add_actionproperties=("${(@)all_actionproperties:|default_actionproperties}")
_describe -t "f2b_actions_defprops" -V "default action properties" default_actionproperties
if [[ -n "${add_actionproperties[@]}" ]] ; then
_describe -t "f2b_actions_remprops" -V "additional action properties" add_actionproperties
else
_nothing
fi
}
_complete_f2bc_regex() {
local regex=("${(@f)$(fail2ban-client get $2 ${1}regex 2> /dev/null | sed -n -e 's/[|`]- \[\([0-9]\+\)\]:\s\+/\1:/p')}")
if [[ -n "${regex[@]}" ]] ; then
_describe -t "f2b_regex" -V "jail $2 ${1}regex" regex
else
_nothing
fi
}
_complete_f2bc_settings() {
local setargs=(loglevel logtarget syslogsocket dbfile dbpurgeage)
_describe -t "f2b_settings" -V "fail2ban-client settings" setargs
}
integer NORMARG
_arguments -A "-*" -n \
'-c[configuration directory]:_files -/' \
'-s[socket path]:_files' \
'-p[pidfile path]:_files' \
'--loglevel[logging level]:(CRITICAL ERROR WARNING, NOTICE INFO, DEBUG, TRACEDEBUG HEAVYDEBUG)' \
'--logtarget[logging target]:(stdout stderr syslog sysout)' \
'--syslogsocket:_files' \
'-d[dump configuration]' \
'(--dp --dump-pretty)'{--dp,--dump-pretty}'[dump the configuration using more human readable representation]' \
'(-t --test)'{-t,--test}'[test configuration]' \
'-i[interactive mode]' \
'-v[increase verbosity]' \
'-q[decrease verbosity]' \
'-x[force execution of the server (remove socket file)]' \
'-b[start server in background]' \
'-f[start server in foreground]' \
'--str2sec[convert time abbreviation format to seconds]:_message str2sec' \
'(-h --help)'{-h,--help}'[display this help message]' \
'(-V --version)'{-V,--version}'[print the version]' \
'1:fail2ban command:_complete_f2bc_cmds' \
'*:fail2ban command argument:_complete_f2bc_cmdargs'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: set et sw=2 ts=2 ft=zsh:

View File

@ -1,57 +0,0 @@
#compdef fail2ban-regex
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for fail2ban-regex (https://www.fail2ban.org/).
# Environment:
# Linux 6.14.10-arch1-1 x86_64 GNU/Linux
# zsh 5.9 (x86_64-pc-linux-gnu)
# fail2ban 1.1.0-7
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jesse Ayala <jesserayala95@gmail.com>
#
# ------------------------------------------------------------------------------
integer NORMARG
_arguments -A "-*" -n \
'--version[show program''s version number]' \
'(-h --help)'{-h,--help}'[display the help message]' \
'(-c --config)'{-c,--config=}'[set alternate config directory]:directory:_files -/' \
'(-d --datepattern)'{-d,--datepattern=}'[set custom pattern used to match date/times]:DATEPATTERN' \
'(--timezone= --TZ=)'{--timezone=,--TZ=}'[set time-zone used by convert time format]:TIMEZONE' \
'(-e --encoding=)'{-e,--encoding=}'[use different encoding from system locale]:ENCODING' \
'(-r --raw)'{-r,--raw}'[raw hosts,don''t resolve dns]' \
'--usedns=[DNS specified replacement of tags <HOST> in regexp]::((yes\:matches all form of hosts no\:IP addresses only))' \
'(-L --maxlines=)'{-L,--maxlines}'[maxlines for multi-line regex]:MAXLINES' \
'(-m --journalmatch=)'{-m,--journalmatch=}'[journalctl style matches overriding filter file; "systemd-journal" only]:JOURNALMATCH' \
'(-l --log-level=)'{-l,--log-level}'[log level for the Fail2Ban logger to use]:LOG_LEVEL' \
'-V[get version in machine-readable short format]' \
'--verbosity=[set numerical level of verbosity]:(0 1 2 3 4)' \
'(--verbose-date --VD)'{--verbose-date,--VD}'[verbose date patterns/regex in output]' \
'(-D --debuggex)'{-D,--debuggex}'[produce debuggex.com urls for debugging there]' \
'--no-check-all[disable check for all regexes]' \
'(-o --out)'{-o,--out}'[set token to print failure information only (row, id, ip, msg, host, ip4, ip6, dns, matches, ...)]:out' \
'--print-no-missed[do not print any missed lines]' \
'--print-no-ignored[do not print any ignored lines]' \
'--print-all-matched[print all matched lines]' \
'--print-all-missed[print all missed lines, no matter how many]' \
'--print-all-ignored[print all ignored lines, no matter how many]' \
'(-t --log-traceback)'{-t,--log-traceback}'[enrich log-messages with compressed tracebacks]' \
'--full-traceback[enrich log-messages with full, uncompressed tracebacks]:' \
'1:file:_files -g \*.log' \
'2:file:_files -W /etc/fail2ban/filter.d -g \*\.\(conf\|local\)' \
'3:file:_files -W /etc/fail2ban/filter.d -g \*\.\(conf\|local\)'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: set et sw=2 ts=2 ft=zsh:

View File

@ -1,61 +0,0 @@
#compdef fallocate
# ------------------------------------------------------------------------------
# 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 fallocate, util-linux 2.40.2 (https://github.com/util-linux/util-linux/)
# - preallocate or deallocate space to a file
# https://man7.org/linux/man-pages/man1/fallocate.1.html
# ------------------------------------------------------------------------------
# Authors
# -------
# * Aditi Sharma (https://github.com/Aditi76117)
# ------------------------------------------------------------------------------
_arguments \
'(-c --collapse-range)'{-c,--collapse-range}'[Removes a byte range from a file without leaving a hole]' \
'(-d --dig-holes)'{-d,--dig-holes}'[Detect and dig holes]' \
'(-i --insert-range)'{-i,--insert-range}'[Insert a hole of length bytes from offset]' \
'(-l --length)'{-l+,--length}'[Specifies the length of the range, in bytes]:bytes' \
'(-n --keep-size)'{-n,--keep-size}'[Do not modify the apparent length of the file]' \
'(-o --offset)'{-o+,--offset}'[Specifies the beginning offset of the range, in bytes]:offset' \
'(-p --punch-hole)'{-p,--punch-hole}'[Deallocates space in the byte range starting at offset and continuing for length bytes]' \
'(-v --verbose)'{-v,--verbose}'[Enable verbose mode]' \
'(-x --posix)'{-p,--posix}'[Enable POSIX operation mode]' \
'(-z --zero-range)'{-z,--zero-range}'[Zeroes space in the byte range starting at offset and continuing for length bytes]' \
'(- *)'{-h,--help}'[Display help text and exit]' \
'(- *)'{-V,--version}'[Print version and exit]' \
'*:filename:_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,62 +0,0 @@
#compdef ffind
# ------------------------------------------------------------------------------
# Copyright (c) 2017 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 ffind (https://github.com/jaimebuelta/ffind).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Sergei Eremenko (https://github.com/SmartFinn)
#
# ------------------------------------------------------------------------------
_arguments -C \
'(-h --help)'{-h,--help}'[show help message and exit]' \
'--version[show version number and exit]' \
'-p[match whole path, not only name of files]' \
'--nocolor[do not display color]' \
'--nosymlinks[do not follow symlinks]' \
'--hidden[do not ignore hidden directories]' \
'-c[force case sensitive]' \
'-i[force case insensitive]' \
'--delete[delete files found]' \
'--exec[execute the given command with the file found]:command:_command_names' \
'--module[execute the given module with the file found]:module_name args:' \
'--command[execute the given python program with the file found]:program:_files' \
'--ignore-vcs[ignore version control system files and directories]' \
'-f[experimental fuzzy search]' \
'--return-results[for testing purposes only]' \
'1:directory to search:_path_files -/' \
'*:filepattern:'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,123 +0,0 @@
#compdef fleetctl
# ------------------------------------------------------------------------------
# Copyright (c) 2009-2015 Robby Russell and contributors (see
# https://github.com/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 fleetctl (https://github.com/coreos/fleet).
#
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Remi Paulmier (https://github.com/shtouff)
#
# ------------------------------------------------------------------------------
# fleetctl zsh completion
local -a _1st_arguments
_1st_arguments=(
'cat:Output the contents of a submitted unit'
'destroy:Destroy one or more units in the cluster'
'fd-forward:Proxy stdin and stdout to a unix domain socket'
'help:Show a list of commands or help for one command'
'journal:Print the journal of a unit in the cluster to stdout'
'list-machines:Enumerate the current hosts in the cluster'
'list-unit-files:List the units that exist in the cluster.'
'list-units:List the current state of units in the cluster'
'load:Schedule one or more units in the cluster, first submitting them if necessary.'
'ssh:Open interactive shell on a machine in the cluster'
'start:Instruct systemd to start one or more units in the cluster, first submitting and loading if necessary.'
'status:Output the status of one or more units in the cluster'
'stop:Instruct systemd to stop one or more units in the cluster.'
'submit:Upload one or more units to the cluster without starting them'
'unload:Unschedule one or more units in the cluster.'
'version:Print the version and exit'
)
__task_list ()
{
local expl
declare -a tasks
tasks=(cat destroy fd-forward help journal list-machines list-unit-files \
list-units load ssh start status stop submit unload version)
_wanted tasks expl 'help' compadd $tasks
}
__unit_list ()
{
_wanted application expl 'command' compadd $(command fleetctl list-units | \
tail -n +2 | awk '{print $1}')
}
local expl
local curcontext="$curcontext" state line
local -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _1st_arguments
return
;;
(options)
case $line[1] in
(help)
_arguments ':feature:__task_list'
;;
(destroy|journal|start|status|stop|unload|cat)
_arguments '*:feature:__unit_list'
;;
(load|submit)
_arguments '*:file:_files -g *.service'
;;
(ssh)
_arguments '*:host:_hosts'
;;
(*)
_arguments '*:file:_files'
;;
esac
;;
esac
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

File diff suppressed because it is too large Load Diff

View File

@ -1,179 +0,0 @@
#compdef fwupdmgr
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for fwupdmgr 1.8.12 (https://github.com/hughsie/fwupd).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
# * Shohei Yoshida (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
_fwupdmgr() {
local context state state_descr line
typeset -A opt_args
local ret=1
_arguments -C \
'(- : *)'{-h,--help}'[display help information]' \
'(- : *)'{-v,--version}'[display version information]' \
{-v,--verbose}'[show extra debugging information]' \
--offline'[schedule installation for next reboot when possible]' \
--allow-reinstall'[allow re-installing existing firmware versions]' \
--allow-older'[allow downgrading firmware versions]' \
--allow-branch-switch'[allow switching firmware branch]' \
--force'[override warnings and force the action]' \
'(-y, --assume-yes)'{-y,--assume-yes}'[answer yes to all questions]' \
--sign'[sign the uploaded data with the client certificate]' \
--no-unreported-check'[do not check for unreported history]' \
--no-metadata-check'[do not check for old metadata]' \
--no-reboot-check'[do not check for reboot after update]' \
--no-safety-check'[do not perform device safety checks]' \
--no-device-prompt'[do not prompt for devices]' \
--no-history'[do not write to the history database]' \
--show-all'[show all results]' \
--disable-ssl-strict'[ignore SSL strict checks when downloading files]' \
--ipfs'[only use IPFS when downloading files]' \
--filter'[filter with a set of device flags using a ~ prefix to exclude]:filter' \
--json'[output in JSON format]' \
--no-authenticate'[do not prompt for authentication]' \
'(-): :->command' \
'(-)*:: :->arguments' \
&& ret=0
case $state in
(command)
_fwupdmgr_commands
;;
(arguments)
case $words[1] in
(activate|downgrade|emulation-tag|emulation-untag|get-releases|get-updates|reinstall|update|verify|verify-update)
_arguments \
'1::device_id or GUID:_fwupdmgr_device_ids' \
&& ret=0
;;
(clear-results|get-results|unlock)
_arguments \
'1:device_id or GUID:_fwupdmgr_device_ids' \
&& ret=0
;;
(device-emulate|device-test|emulation-load|emulation-save|get-details|set-approved-firmware)
_arguments \
'*::files:_files' \
&& ret=0
;;
(disable-remote|modify-remote)
_arguments \
'1:remote ID:_fwupdmgr_remote_ids' \
&& ret=0
;;
(install)
_arguments \
'1:device_id or GUID:_fwupdmgr_device_ids' \
'2:version' \
&& ret=0
;;
(local-install)
_arguments \
'1:file:_files' \
'2:device_id or GUID:_fwupdmgr_device_ids' \
&& ret=0
;;
(refresh)
_arguments \
'1:file or remote ID:_alternative _files _fwupdmgr_remote_ids' \
&& ret=0
;;
(switch-branch)
_arguments \
'1:device_id or GUID:_fwupdmgr_device_ids' \
'2:branch' \
&& ret=0
;;
esac
;;
esac
return ret
}
(( $+functions[_fwupdmgr_commands] )) ||
_fwupdmgr_commands() {
local -a commands=(
'activate:activate devices'
'block-firmware:blocks a specific firmware from being installed'
'clear-results:clears the results from the last update'
'device-emulate:emulate a device using a JSON manifest'
'device-test:test a device using a JSON manifest'
'disable-remote:disables a given remote'
'downgrade:downgrades the firmware on a device'
'emulation-load:load device emulation data'
'emulation-save:save device emulation data'
'emulation-tag:adds devices to watch for future emulation'
'emulation-untag:removes devices to watch for future emulation'
'enable-remote:enables a given remote'
'get-approved-firmware:gets the list of approved firmware'
'get-bios-settings:retrieve BIOS settings'
'get-blocked-firmware:gets the list of blocked firmware'
'get-details:gets details about a firmware file'
'get-devices:get all devices that support firmware updates'
'get-history:show history of firmware updates'
'get-plugins:get all enabled plugins registered with the system'
'get-releases:gets the releases for a device'
'get-remotes:gets the configured remotes'
'get-results:gets the results from the last update'
'get-topology:get all devices according to the system topology'
'get-updates:gets the list of updates for connected hardware'
'inhibit:inhibit the system to prevent upgrades'
'install:install a firmware file on this hardware'
'local-install:install a firmware file on this hardware'
'modify-config:modifies a daemon configuration value'
'modify-remote:modifies a given remote'
'quit:asks the daemon to quit'
'refresh:refresh metadata from remote server'
'security:gets the host security attributes'
'report-history:share firmware history with the developers'
'set-approved-firmware:sets the list of approved firmware'
'set-bios-setting:sets one or more BIOS settings'
'switch-branch:switch the firmware branch on device'
'sync-bkc:sync firmware versions to the host best known configuration '
'unblock-firmware:unblocks a specific firmware from being installed'
'uninhibit:uninhibit the system to allow upgrades'
'unlock:unlocks the device for firmware access'
'update:updates all firmware to latest versions available'
'verify:gets the cryptographic hash of the dumped firmware'
'verify-update:update the stored metadata with current ROM contents'
)
_describe -t commands commands commands
}
(( $+functions[_fwupdmgr_device_ids] )) ||
_fwupdmgr_device_ids() {
# TODO add device name as description
local -a devices
devices=($(_call_program devices fwupdmgr get-devices | awk '/Device ID/||/DeviceId/{print $NF}'))
_describe -t devices 'device ID' devices
}
(( $+functions[_fwupdmgr_remote_ids] )) ||
_fwupdmgr_remote_ids() {
# TODO add remote description
local -a remotes
remotes=($(_call_program remotes fwupdmgr get-remotes | awk '/Remote ID/{print $NF}'))
_describe -t remotes 'remote ID' remotes
}
_fwupdmgr "$@"
# 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 wemux
#compdef gcc-config
# ------------------------------------------------------------------------------
# Copyright (c) 2015 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,55 +28,46 @@
# Description
# -----------
#
# Completion script for wemux (https://github.com/zolrath/wemux)
# Completion script for GCC config script (symlink manager for multiversioning).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Akira Maeda <https://github.com/glidenote>
# * Vadim A. Misbakh-Soloviov <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>
#
# ------------------------------------------------------------------------------
#<sys-devel/gcc-config-0.0>
_wemux() {
local arguments
local -a host_commands client_commands multi_host_commands
host_commands=(
'start:Start the wemux server/attach to an existing wemux server.'
'attach:Attach to an existing wemux server.'
'stop:Kill the wemux server '\''wemux'\'', delete its socket.'
'users:List all users currently attached to '\''wemux'\'''
'kick:Disconnect an SSH user, remove their wemux server.'
'config:Open the wemux configuration file in your $EDITOR.'
'help:Display this screen.'
'version:shows wemux version number'
arguments=(
'(- :)'{--use-old,-O}'[use the old profile if one was selected]'
'(- :)'{--use-portage-chost,-P}'[only set profile if its CHOST matches /etc/{portage/}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'
)
client_commands=(
'mirror:Attach to Host in read-only mode.'
'pair:Attach to Host in pair mode, which allows editing.'
'rogue:Attach to Host in rogue mode, which allows editing and switching to windows independently from the host.'
'logout:Log out of the wemux rogueing session.'
'users:List the currently attached wemux users.'
)
multi_host_commands=(
'join:Join wemux server with supplied name.'
'reset:Join default wemux server: wemux'
'list:List all currently active wemux servers.'
)
if (( CURRENT == 2 )); then
_describe -t host_commands 'HOST COMMANDS' host_commands
_describe -t client_commands 'CLIENT COMMANDS' client_commands
_describe -t multi_host_commands 'MULTI-HOST COMMANDS' multi_host_commands
fi
return 0
_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} }
}
_wemux
_arguments $arguments
# Local Variables:
# mode: Shell-Script

View File

@ -1,6 +1,6 @@
#compdef shellcheck
#compdef geany
# ------------------------------------------------------------------------------
# Copyright (c) 2021 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,34 +28,40 @@
# Description
# -----------
#
# Completion script for shellcheck v0.10.0 (https://github.com/koalaman/shellcheck)
# Completion script for Geany (http://www.geany.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Khue Nguyen (https://github.com/Z5483)
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments \
{-a,--check-sourced}'[include warnings from sourced file]' \
{-C,--color=}'[specify color]:color:(auto always never)' \
{-i,--include=}'[consider only given types of warnings]:error code' \
{-e,--exclude=}'[exclude given types of warnings]:error code' \
'--extended-analysis=[perform dataflow analysis]:bool:(true false)' \
{-f,--format=}'[specify output format]:format:(checkstyle diff gcc json json1 quiet tty)' \
'--list-optional[list checks disabled by default]' \
"--norc[don't look for .shellcheckrc files]" \
'--rcfile=[specify configuration file over searching for one]:rcfile:_files' \
{-o,--enable=}"[give list of optional checks to enable (or 'all')]:error code" \
{-P,--source-path=}'[specify path when looking for sourced files]:_files -/' \
{-s,--shell=}'[specify dialect]:dialect:(sh bash dash ksh busybox)' \
{-S,--severity=}'[specify minimum severity of errors to consider]:severity:(error warning info style)' \
{-V,--version}'[print version information]' \
{-W,--wiki-link-count=}'[specify number of wiki links to show, when applicable]:number' \
{-x,--external-sources}'[allow outside sources]' \
'(- *)--help[show this usage summary and exit]' \
'(- 1 *)'{-h,--help}'[Show help options]' \
'(- 1 *)--help-all[Show all help options]' \
'(- 1 *)--help-gtk[Show GTK+ Options]' \
'(- 1 *)'{-V,--version}'[Show version and exit]' \
'(--column)--column[Set initial column number for the first opened file (useful in conjunction with --line)]:column number' \
'(-c --config)'{-c,--config}'[Use an alternate configuration directory]:configuration file:_files' \
'(--ft-names)--ft-names[Print internal filetype names]' \
'(-g --generate-tags)'{-g,--generate-tags}'[Generate global tags file (see documentation)]' \
'(-P --no-preprocessing)'{-P,--no-preprocessing}'[Don'\''t preprocess C/C++ files when generating tags]' \
'(-i --new-instance)'{-i,--new-instance}'[Don'\''t open files in a running instance, force opening a new instance]' \
'(--socket-file)--socket-file[Use this socket filename for communication with a running Geany instance]:socket file:_files' \
'(--list-documents)--list-documents[Return a list of open documents in a running Geany instance]' \
'(-l --line)'{-l,--line}'[Set initial line number for the first opened file]:line number' \
'(-m --no-msgwin)'{-m,--no-msgwin}'[Don'\''t show message window at startup]' \
'(-n --no-ctags)'{-n,--no-ctags}'[Don'\''t load auto completion data (see documentation)]' \
'(-p --no-plugins)'{-p,--no-plugins}'[Don'\''t load plugins]' \
'(--print-prefix)--print-prefix[Print Geany'\''s installation prefix]' \
'(-s --no-session)'{-s,--no-session}'[Don'\''t load the previous session'\''s files]' \
'(-t --no-terminal)'{-t,--no-terminal}'[Don'\''t load terminal support]' \
'(--vte-lib)--vte-lib[Filename of libvte.so]:libvte.so filename:_files -g "*.so"' \
'(-v --verbose)'{-v,--verbose}'[Be verbose]' \
'(--display)--display[X display to use]:X display:_x_display' \
'*: :_files'
# Local Variables:

461
src/_gem Normal file
View File

@ -0,0 +1,461 @@
#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)
#
# ------------------------------------------------------------------------------
_gem() {
local -a gem_general_flags
gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]"
"(-V --verbose)"{-V,--verbose}"[Set the verbose level of output]"
"(-q --quiet)"{-q,--quiet}"[Silence commands]"
"--config-file[Use this config file instead of default]:file:_files"
"--backtrace[Show stack backtrace on errors]"
"--debug[Turn on Ruby debugging]"
$nul_arg
)
if (( CURRENT > 2 )); then
(( CURRENT-- ))
shift words
_call_function 1 _gem_${words[1]}
else
_values "gem command" \
"build[Build a gem from a gemspec]" \
"cert[Manage RubyGems certificates and signing settings]" \
"check[Check installed gems]" \
"cleanup[Clean up old versions of installed gems in the local repository]" \
"contents[Display the contents of the installed gems]" \
"dependency[Show the dependencies of an installed gem]" \
"environment[Display information about the RubyGems environment]" \
"fetch[Download a gem and place it in the current directory]" \
"generate_index[Generates the index files for a gem server directory]" \
"help[Provide help on the 'gem' command]" \
"install[Install a gem into the local repository]" \
"list[Display gems whose name starts with STRING]" \
"lock[Generate a lockdown list of gems]" \
"mirror[Mirror a gem repository]" \
"outdated[Display all gems that need updates]" \
"pristine[Restores installed gems to pristine condition from files located in the gem cache]" \
"query[Query gem information in local or remote repositories]" \
"rdoc[Generates RDoc for pre-installed gems]" \
"search[Display all gems whose name contains STRING]" \
"server[Documentation and gem repository HTTP server]" \
"sources[Manage the sources and cache file RubyGems uses to search for gems]" \
"specification[Display gem specification (in yaml)]" \
"stale[List gems along with access times]" \
"uninstall[Uninstall gems from the local repository]" \
"unpack[Unpack an installed gem to the current directory]" \
"update[Update the named gems (or all installed gems) in the local repository]" \
"which[Find the location of a library file you can require]"
fi
}
__all_gems() {
_gem_names=($(${service} list | awk '{print $1}'))
compadd "$@" -k _gem_names
}
__all_gems_all() {
_gem_names=($(gem list | awk '{print $1}') "--all")
compadd "$@" -k _gem_names
}
__gem_help_arguments() {
_args=("commands"
"examples"
"build"
"cert"
"check"
"cleanup"
"contents"
"dependency"
"environment"
"fetch"
"generate_index"
"help"
"install"
"list"
"lock"
"mirror"
"outdated"
"pristine"
"query"
"rdoc"
"search"
"server"
"sources"
"specification"
"stale"
"uninstall"
"unpack"
"update"
"which")
compadd "$@" -k _args
}
__gem_trust_policies() {
_args=("NoSecurity"
"LowSecurity"
"MediumSecurity"
"HighSecurity")
compadd "$@" -k _args
}
_gem_build() {
_arguments \
'*:file:_files -g "*.gemspec"' \
$gem_general_flags && ret=0
}
_gem_cert() {
_arguments \
"(-a --add)"{-a,--add}"[Add a trusted certificate.]":file:_files \
"(-l --list)"{-l,--list}"[List trusted certificates.]" \
"(-r --remove)"{-r,--remove}"[Remove trusted certificates containing STRING.]" \
"(-b --build)"{-b,--build}"[Build private key and self-signed certificate for EMAIL_ADDR.]" \
"(-C --certificate)"{-C,--certificate}"[Certificate for --sign command.]":file:_files \
"(-K --private-key)"{-K,--private-key}"[Private key for --sign command.]":file:_files \
"(-s --sign)"{-s,--sign}"[Sign a certificate with my key and certificate.]":file:_files \
$gem_general_flags && ret=0
}
_gem_check() {
_arguments \
"--verify[Verify gem file against its internal checksum]":file:_files \
"(-a --alien)"{-a,--alien}"[Report 'unmanaged' or rogue files in the gem repository]" \
"(-v --verbose)"{-v,--verbose}"[Spew more words]" \
"(-t --test)"{-t,--test}"[Run unit tests for gem]" \
"(-v --version)"{-v,--version}"[Specify version of gem to run tests for]" \
$gem_general_flags && ret=0
}
_gem_cleanup() {
_arguments \
"*:gemname:__all_gems" \
"(-d --dryrun)"{-d,--dryrun}"[]" \
$gem_general_flags && ret=0
}
_gem_contents() {
_arguments \
"*:gemname:__all_gems" \
"(-v --version)"{-v,--version}"[Specify version of gem to contents]" \
"--all[Contents for all gems]" \
"(-s --spec-dir)"{-s,--spec-dir}"[Search for gems under specific paths]" \
"(-l --no-lib-only)"{-l,--no-lib-only}"[Only return files in the Gem's lib_dirs]" \
"--no-prefix[Don't include installed path prefix]" \
$gem_general_flags && ret=0
}
_gem_dependency() {
_arguments \
":gemname:__all_gems" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
"(-v --version)"{-v,--version}"[Specify version of gem to dependency]" \
"--platform[Specify the platform of gem to dependency]" \
"(-R --no-reverse-dependencies)"{-R,--no-reverse-dependencies}"[Include reverse dependencies in the output]" \
"(-p --pipe)"{-p,--pipe}"[Pipe Format (name --version ver)]" \
$gem_general_flags && ret=0
}
_gem_environment() {
typeset -g _environment_arg=
_environment_arg='::environment:((packageversion\:"display the package version"
gemdir\:"display the path where gems are installed"
gempath\:"display path used to search for gems"
version\:"display the gem format version"
remotesources\:"display the remote gem servers"))'
_arguments \
$_environment_arg \
$gem_general_flags && ret=0
}
_gem_fetch() {
_arguments \
"*:gemname:__all_gems" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"--source[Use URL as the remote source for gems]" \
"(-v --version)"{-v,--version}"[Specify version of gem to fetch]" \
"--platform[Specify the platform of gem to fetch]" \
$gem_general_flags && ret=0
}
_gem_generate_index() {
_arguments \
"(-d --directory=DIRNAME)"{-d,--directory=-}"[repository base dir containing gems subdir]":directory:_directories \
"--no-legacy[Generate indexes for RubyGems older than 1.2.0]" \
"--no-modern[Generate indexes for RubyGems newer than 1.2.0]" \
"--update[Update modern indexes with gems added since the last update]" \
"--rss-gems-host=-[Host name where gems are served from, used for GUID and enclosure values]" \
"--rss-host=-[Host name for more gems information, used for RSS feed link]" \
"--rss-title=-[Set title for RSS feed]" \
$gem_general_flags && ret=0
}
_gem_help() {
_arguments \
":argument:__gem_help_arguments" \
$gem_general_flags && ret=0
}
_gem_install() {
_arguments \
"*:URI: _alternative 'files:file:_files -g *.gem' 'urls:URL:__all_gems'" \
"(-i --install-dir)"{-i,--install-dir}"[Gem repository directory to get installed gems]":directory:_directories \
"(-n --bindir)"{-n,--bindir}"[Directory where binary files are located]":directory:_directories \
"(-d --no-rdoc)"{-d,--no-rdoc}"[Generate RDoc documentation for the gem on install]" \
"--no-ri[Generate RI documentation for the gem on install]" \
"(-E --no-env-shebang)"{-E,--no-env-shebang}"[Rewrite the shebang line on installed scripts to use /usr/bin/env]" \
"(-f --no-force)"{-f,--no-force}"[Force gem to install, bypassing dependency checks]" \
"(-t --no-test)"{-t,--no-test}"[Run unit tests prior to installation]" \
"(-w --no-wrappers)"{-w,--no-wrappers}"[Use bin wrappers for executables Not available on dosish platforms]" \
"(-P --trust-policy)"{-P,--trust-policy}"[Specify gem trust policy]:trust policy:__gem_trust_policies" \
"--ignore-dependencies[Do not install any required dependent gems]" \
"(-y --include-dependencies)"{-y,--include-dependencies}"[Unconditionally install the required dependent gems]" \
"--no-format-executable[Make installed executable names match ruby. If ruby is ruby18, foo_exec will be foo_exec18]" \
"--no-user-install[Install in user's home directory instead of GEM_HOME. Defaults to using home only if GEM_HOME is not writable.]" \
"--development[Install any additional development dependencies]" \
"--prerelease[Install prerelease versions of a gem if available. Defaults to skipping prereleases.]" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
"--platform[Specify the platform of gem to install]" \
"(-v --version)"{-v,--version}"[Specify version of gem to install]" \
$gem_general_flags && ret=0
}
_gem_list() {
_arguments \
":gem name: " \
"(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
"(-v --version)"{-v,--version}"[Specify version of gem to list]" \
"(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
"--no-versions[Display only gem names]" \
"(-a --all)"{-a,--all}"[Display all gem versions]" \
"--prerelease[Display prerelease versions]" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
$gem_general_flags && ret=0
}
_gem_lock() {
_arguments \
":gemname:__all_gems" \
"(-s --no-strict)"{-s,--no-strict}"[fail if unable to satisfy a dependency]" \
$gem_general_flags && ret=0
}
_gem_mirror() {
_arguments \
$gem_general_flags && ret=0
}
_gem_outdated() {
_arguments \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
"--platform[Specify the platform of gem to outdated]" \
$gem_general_flags && ret=0
}
_gem_pristine() {
_arguments \
":gem name:__all_gems_all" \
"--all[Restore all installed gems to pristine condition]" \
"(-v --version)"{-v,--version}"[Specify version of gem to restore to pristine condition]" \
$gem_general_flags && ret=0
}
_gem_query() {
_arguments \
"(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
"(-v --version)"{-v,--version}"[Specify version of gem to query]" \
"(-n --name-matches)"{-n,--name-matches}"[Name of gem(s) to query on matches the provided REGEXP]" \
"(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
"--no-versions[Display only gem names]" \
"(-a --all)"{-a,--all}"[Display all gem versions]" \
"--prerelease[Display prerelease versions]" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
$gem_general_flags && ret=0
}
_gem_rdoc() {
_arguments \
":gem name:__all_gems_all" \
"--all[Generate RDoc/RI documentation for all installed gems]" \
"--no-rdoc[Include RDoc generated documents]" \
"--no-ri[Include RI generated documents]" \
"(-v --version)"{-v,--version}"[Specify version of gem to rdoc]" \
$gem_general_flags && ret=0
}
_gem_search() {
_arguments \
":gem name::" \
"(-i --no-installed)"{-i,--no-installed}"[Check for installed gem]" \
"(-v --version)"{-v,--version}"[Specify version of gem to search]" \
"(-d --no-details)"{-d,--no-details}"[Display detailed information of gem(s)]" \
"--no-versions[Display only gem names]" \
"(-a --all)"{-a,--all}"[Display all gem versions]" \
"--prerelease[Display prerelease versions]" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
$gem_general_flags && ret=0
}
_gem_server() {
_arguments \
"(-p --port=PORT)"{-p,--port=-}"[port to listen on]" \
"(-d --dir=GEMDIR)"{-d,--dir=-}"[directory from which to serve gems]":directory:_directories \
"--no-daemon[run as a daemon]" \
$gem_general_flags && ret=0
}
_gem_sources() {
_arguments \
"(-a --add)"{-a,--add}"[Add source]" \
"(-l --list)"{-l,--list}"[List sources]" \
"(-r --remove)"{-r,--remove}"[Remove source]" \
"(-c --clear-all)"{-c,--clear-all}"[Remove all sources (clear the cache)]" \
"(-u --update)"{-u,--update}"[Update source cache]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
$gem_general_flags && ret=0
}
_gem_specification() {
_arguments \
":gemname:__all_gems" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
"(-v --version)"{-v,--version}"[Specify version of gem to examine]" \
"--platform[Specify the platform of gem to specification]" \
"--all[Output specifications for all versions of the gem]" \
"--ruby[Output ruby format]" \
"--yaml[Output RUBY format]" \
"--marshal[Output Marshal format]" \
$gem_general_flags && ret=0
}
_gem_stale() {
_arguments \
$gem_general_flags && ret=0
}
_gem_uninstall() {
_arguments \
"*:gemname:__all_gems" \
"(-a --no-all)"{-a,--no-all}"[Uninstall all matching versions]" \
"(-I --no-ignore-dependencies)"{-I,--no-ignore-dependencies}"[Ignore dependency requirements while uninstalling]" \
"(-x --no-executables)"{-x,--no-executables}"[Uninstall applicable executables without confirmation]" \
"(-i --install-dir)"{-i,--install-dir}"[Directory to uninstall gem from]":directory:_directories \
"(-n --bindir)"{-n,--bindir}"[Directory to remove binaries from]":directory:_directories \
"--no-user-install[Uninstall from user's home directory in addition to GEM_HOME.]" \
"(-v --version)"{-v,--version}"[Specify version of gem to uninstall]" \
"--platform[Specify the platform of gem to uninstall]" \
$gem_general_flags && ret=0
}
_gem_unpack() {
_arguments \
":gemname:__all_gems" \
"--target=-[target directory for unpacking]":directory:_directories \
"(-v --version)"{-v,--version}"[Specify version of gem to unpack]" \
$gem_general_flags && ret=0
}
_gem_update() {
_arguments \
"*:gemname:__all_gems" \
"(-i --install-dir)"{-i,--install-dir}"[Gem repository directory to get installed gems]":directory:_directories \
"(-n --bindir)"{-n,--bindir}"[Directory where binary files are located]":directory:_directories \
"(-d --no-rdoc)"{-d,--no-rdoc}"[Generate RDoc documentation for the gem on install]" \
"--no-ri[Generate RI documentation for the gem on install]" \
"(-E --no-env-shebang)"{-E,--no-env-shebang}"[Rewrite the shebang line on installed scripts to use /usr/bin/env]" \
"(-f --no-force)"{-f,--no-force}"[Force gem to install, bypassing dependency checks]" \
"(-t --no-test)"{-t,--no-test}"[Run unit tests prior to installation]" \
"(-w --no-wrappers)"{-w,--no-wrappers}"[Use bin wrappers for executables Not available on dosish platforms]" \
"(-P --trust-policy)"{-P,--trust-policy}"[Specify gem trust policy]:trust policy:__gem_trust_policies" \
"--ignore-dependencies[Do not install any required dependent gems]" \
"(-y --include-dependencies)"{-y,--include-dependencies}"[Unconditionally install the required dependent gems]" \
"--no-format-executable[Make installed executable names match ruby. If ruby is ruby18, foo_exec will be foo_exec18]" \
"--no-user-install[Install in user's home directory instead of GEM_HOME. Defaults to using home only if GEM_HOME is not writable.]" \
"--development[Install any additional development dependencies]" \
"--prerelease[Install prerelease versions of a gem if available. Defaults to skipping prereleases.]" \
"(-l --local)"{-l,--local}"[Restrict operations to the LOCAL domain]" \
"(-r --remote)"{-r,--remote}"[Restrict operations to the REMOTE domain]" \
"(-b --both)"{-b,--both}"[Allow LOCAL and REMOTE operations]" \
"(-B --bulk-threshold)"{-B,--bulk-threshold}"[Threshold for switching to bulk synchronization (default 1000)]" \
"--source[Use URL as the remote source for gems]" \
"(-p --[no-]http-proxy)"{-p,--[no-]http-proxy}"[Use HTTP proxy for remote operations]" \
"(-u --no-update-sources)"{-u,--no-update-sources}"[Update local source cache]" \
"--system[Update the RubyGems system software]" \
"--platform[Specify the platform of gem to update]" \
$gem_general_flags && ret=0
}
_gem_which() {
_arguments \
*:file:_files -f \
"(-a --no-all)"{-a,--no-all}"[show all matching files]" \
"(-g --no-gems-first)"{-g,--no-gems-first}"[search gems before non-gems]" \
$gem_general_flags && ret=0
}
# 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

155
src/_genlop Normal file
View File

@ -0,0 +1,155 @@
#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-Soloviov <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>
#
# ------------------------------------------------------------------------------
#<app-portage/genlop-0.30.8>
_genlop () {
local prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]" days months arg single state lstate
days=(monday tuesday wednesday thursday friday saturday sunday)
months=(january february march april may june july august september october november december)
arg=( --current -c --time -t --gmt -g --info -i --file -f --rsync -r --unmerge -u --date --search -s --list -l )
single=( --current -c --pretend -p --help -h --version -v )
[[ ${prev2} == (1st|2nd|3rd|4th|5th) ]] &&
compadd in\ $months && return 0
[[ ${prev1} == ([2-9]|[1-9][0-9]*) && ${prev2} != \
(january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
_values '' 'days ago' 'months ago' 'years ago' 'weeks ago' && return 0
[[ ${prev1} == (1) && ${prev2} != \
(january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
_values '' 'day ago' 'month ago' 'year ago' 'week ago' && return 0
case "$prev1" in
last)
_values '' month week
compadd $days && return 0
;;
1st|2nd|3rd|4th|5th)
compadd $days && return 0
;;
january|february|march|april|may|june|july|august|september|october|november|december)
compadd {1..31} && return 0
;;
--date)
_message 'enter number for more options or use mm/dd/yyyy format'
_values '' \
last yesterday 1st 2nd 3rd 4th 5th
_alternative \
'*:*:_genlop_days' '*:*:_genlop_months' && return 0
;;
--file|-f)
_arguments '*:logfile:_files' && return 0
;;
*)
_arguments \
"($single $arg *)"{--current,-c}"[display the current merge in action]" \
"($single)*--date[specify date of event]:date:->date" \
"($single)*-f[specify the logfile to use]:logfile:_files" \
"($single --gmt -g)"{--gmt,-g}"[display time in GMT/UTC format (default is local time)]" \
"($single $arg *)"{--help,-h}"[display help information]" \
"($single --info -i --list -l)"{--info,-i}"[print brief summary about installed ebuild]" \
"($single --search -s --info -i --list -l *)"{--list,-l}"[list merge history]" \
"(--nocolor -n)"{--nocolor,-n}"[disable colored output]" \
"($single $arg *)"{--pretend,-p}"[estimate build time of a piped emerge -p]" \
"($single --search -s --info -i --time -t --unmerge -u --rsync -r *)"{--rsync,-r}"[display rsync history]" \
"($single --rsync -r --search -s --list -l *)"{--search,-s}"[select ebuilds matching the provided regular expression]:pattern:" \
"($single --time -t)"{--time,-t}"[display merge time]" \
"($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
"($single $arg *)"{--version,-v}"[display version information]" \
"($single)*:package:_gentoo_packages available"
;;
esac
while [[ -n "$state" ]]; do
lstate=$state
state=''
case "$lstate" in
date) _message 'enter number for more options or use mm/dd/yyyy format'
_values '' \
last yesterday 1st 2nd 3rd 4th 5th
_alternative \
':*:_genlop_days' ':*:_genlop_months' && return 0
;;
esac
done
}
_genlop_days() {
local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday"
local day=$(date +%u)
if [[ ${day} == 1 ]] then compadd $m
elif [[ ${day} == 2 ]] then compadd $m $t
elif [[ ${day} == 3 ]] then compadd $m $t $w
elif [[ ${day} == 4 ]] then compadd $m $t $w $T
elif [[ ${day} == 5 ]] then compadd $m $t $w $T $f
elif [[ ${day} == 6 ]] then compadd $m $t $w $T $f $s
elif [[ ${day} == 7 ]] then compadd $m $t $w $T $f $s $S
fi
}
_genlop_months() {
local j="january" f="february" m="march" a="april" M="may" ju="june" J="july" A="august" s="september" o="october" n="november" d="december"
local month=$(date +%m)
if [[ ${month} == 01 ]] then compadd $j
elif [[ ${month} == 02 ]] then compadd $j $f
elif [[ ${month} == 03 ]] then compadd $j $f $m
elif [[ ${month} == 04 ]] then compadd $j $f $m $a
elif [[ ${month} == 05 ]] then compadd $j $f $m $a $M
elif [[ ${month} == 06 ]] then compadd $j $f $m $a $M $ju
elif [[ ${month} == 07 ]] then compadd $j $f $m $a $M $ju $J
elif [[ ${month} == 08 ]] then compadd $j $f $m $a $M $ju $J $A
elif [[ ${month} == 09 ]] then compadd $j $f $m $a $M $ju $J $A $s
elif [[ ${month} == 10 ]] then compadd $j $f $m $a $M $ju $J $A $s $o
elif [[ ${month} == 11 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n
elif [[ ${month} == 12 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n $d
fi
}
# 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

245
src/_gentoo_packages Normal file
View File

@ -0,0 +1,245 @@
#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-Soloviov <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>
#
# ------------------------------------------------------------------------------
#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/portage/make.conf /etc/make.conf /usr/share/portage/config/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/portage/make.conf ]] &&
local $var="`. /etc/portage/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /usr/share/portage/config/make.globals ]] &&
local $var="`. /usr/share/portage/config/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/portage/make.conf ]] &&
local $var="`. /etc/portage/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /usr/share/portage/config/make.globals ]] &&
local $var="`. /usr/share/portage/config/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/portage/make.conf ]] &&
local $var="`. /etc/portage/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -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/portage/make.conf ]] &&
local $var="`. /etc/portage/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /usr/share/portage/config/make.globals ]] &&
local $var="`. /usr/share/portage/config/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/portage/make.conf ]] &&
local $var="`. /etc/portage/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /usr/share/portage/config/make.globals ]] &&
local $var="`. /usr/share/portage/config/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/portage/make.conf ]] &&
local $var="`. /etc/portage/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /usr/share/portage/config/make.globals ]] &&
local $var="`. /usr/share/portage/config/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/portage/make.conf ]] &&
local $var="`. /etc/portage/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /usr/share/portage/config/make.globals ]] &&
local $var="`. /usr/share/portage/config/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/portage/make.conf ]] &&
local PKGDIR="`. /etc/portage/make.conf 2>/dev/null; echo $PKGDIR`"
[[ -z $PKGDIR && -r /etc/make.conf ]] &&
local PKGDIR="`. /etc/make.conf 2>/dev/null; echo $PKGDIR`"
[[ -z $PKGDIR && -r /usr/share/portage/config/make.globals ]] &&
local PKGDIR="`. /usr/share/portage/config/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 "$@"
# 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

410
src/_gentoolkit Normal file
View File

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

618
src/_ghc
View File

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

126
src/_gist
View File

@ -1,126 +0,0 @@
#compdef gist
# ------------------------------------------------------------------------------
# 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 gist (https://github.com/defunkt/gist)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Akira Maeda <https://github.com/glidenote>
# * Patrick Ziegler <https://github.com/patrick96>
# * Shivam Mehta <https://github.com/maniac-en>
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments -C \
'(--login)--login[Authenticate gist on this computer.]' \
'(-f --filename)'{-f,--filename}'[Sets the filename and syntax type.]:NAME' \
'(-t --type)'{-t,--type}'[Sets the file extension and syntax type.]:EXT' \
'(-p --private --no-private)'{-p,--private}'[Makes your gist private.]' \
'(--no-private -p --private)'--no-private'[Makes your gist no private.]' \
'(-d --description)'{-d,--description}'[Adds a description to your gist.]:DESCRIPTION' \
'(-s --shorten)'{-s,--shorten}'[Shorten the gist URL using git.io.]' \
'(-u --update)'{-u,--update}'[Update an existing gist.]:URL ID:user_gists' \
'(-c --copy)'{-c,--copy}'[Copy the resulting URL to the clipboard]' \
'(-e --embed)'{-e,--embed}'[Copy the embed code for the gist to the clipboard]' \
'(-o --open --no-open)'{-o,--open}'[Open the resulting URL in a browser]' \
'(--no-open -o --open)'--no-open'[No open the resulting URL in a browser]' \
'(-P --paste)'{-P,--paste}'[Paste from the clipboard to gist]' \
'(-R --raw)'{-R,--raw}'[Display raw URL of the new gist]' \
'(-l --list)'{-l,--list}'[List all gists for user ]::user' \
'(-h --help)'{-h,--help}'[print options help]' \
'(-v --version)'{-v,--version}'[print version]' \
'(-r --read)'{-r,--read}'[Read a gist and print out the contents]:user gists:_gist_read_gists' \
'*: :_files' && ret=0
_gist_cache_policy() {
# rebuild if cache is more than a day old
local -a oldp
oldp=( "$1"(mh+1) )
(( $#oldp ))
}
_gist_read_gists() {
local update_policy ret=1
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
if [[ -z "$update_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy _gist_cache_policy
fi
# stores the gists of the logged in user in the format ID[Description]
_list=()
_cached_gists="user_gists"
# retrieve/Write gists from/to cache
if _cache_invalid $_cached_gists || ! _retrieve_cache $_cached_gists; then
_gists=$(gist -l)
if [ $? -eq 0 ]; then
_store_cache $_cached_gists _gists
else
# some error occurred, the user is probably not logged in
# set _gists to an empty string so that no completion is attempted
_gists=""
fi
else
_retrieve_cache $_cached_gists
fi
if [ -n "$_gists" ]; then
echo "$_gists" | while read -r line; do
# Splitting the gist -l output
url="$(echo "$line" | cut -d " " -f 1 | cut -d "/" -f 4)"
# gists w/o descriptions can have only one column in the output, those
# have their description set to an empty string
description="$(echo "$line" | awk '{if(NF > 1){$1=""; print $0}}')"
_list+=( "${url}[${description}]" )
done
_values "gists" $_list
ret=0
fi
return ret
}
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,30 +1,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,7 +15,6 @@
# * 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)
#
# ------------------------------------------------------------------------------
@ -70,8 +48,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 +65,6 @@ _git-flow ()
(feature)
__git-flow-feature
;;
(support)
__git-flow-support
;;
esac
;;
esac
@ -115,8 +87,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 +108,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 +138,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 +164,6 @@ __git-flow-hotfix ()
':hotfix:__git_flow_hotfix_list'
;;
(publish)
_arguments \
':hotfix:__git_flow_hotfix_list'
;;
*)
_arguments \
-v'[Verbose (more) output]'
@ -240,12 +190,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 +215,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 +260,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 +310,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

View File

@ -1,5 +1,30 @@
#compdef git-pulls
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#

View File

@ -1,71 +0,0 @@
#compdef git-revise
#description update, split and rearrange commits
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for git-revise 0.7.0
# (https://github.com/mystor/git-revise/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Hannu Hartikainen (https://github.com/dancek)
#
# ------------------------------------------------------------------------------
__git-revise_commits() {
local -a commits
if git rev-parse --is-inside-work-tree 1>/dev/null 2>/dev/null; then
commits=(${(f)"$(git log -20 --pretty=format:'%h:%d %s' | sed 's/: /:/')"})
_describe -V 'commit' commits
else
_message 'not a git repository'
fi
}
__git-revise_branches() {
local -a branches
if git rev-parse --is-inside-work-tree 1>/dev/null 2>/dev/null; then
branches=(${(f)"$(git for-each-ref --format='%(refname:short)' refs/heads/)"})
_describe 'branch' branches
else
_message 'not a git repository'
fi
}
_git-revise() {
local curcontext="$curcontext" ret=1
_arguments -s \
'(- :)'{-h,--help}'[show help message and exit]' \
'--root[revise starting at the root commit]' \
'--ref=[reference to update]: :__git-revise_branches' \
'--reauthor[reset the author of the targeted commit]' \
'(- :)--version[show version number and exit]' \
'(--edit -e)'{--edit,-e}'[edit commit message of targeted commit(s)]' \
'(--no-autosquash)--autosquash[automatically apply fixup! and squash! commits to their targets]' \
'(--autosquash)--no-autosquash[force disable revise.autoSquash behaviour]' \
'(--all -a)--no-index[ignore the index while rewriting history]' \
'(--no-index --all -a)'{--all,-a}'[stage all tracked files before running]' \
'(--interactive -i --message -m --cut -c --patch -p)'{--patch,-p}'[interactively stage hunks before running]' \
'(--interactive -i --message -m --cut -c --patch -p)'{--interactive,-i}'[interactively edit commit stack]' \
'(--interactive -i --message -m --cut -c --patch -p)'{--message,-m}'[specify commit message on command line]:MESSAGE:()' \
'(--interactive -i --message -m --cut -c --patch -p)'{--cut,-c}'[interactively cut a commit into two smaller commits]' \
'(--gpg-sign -S --no-gpg-sign)'{--gpg-sign,-S}'[GPG sign commits]' \
'(--gpg-sign -S --no-gpg-sign)--no-gpg-sign[do not GPG sign commits]' \
'1: :__git-revise_commits' && ret=0
return $ret
}
_git-revise "$@"
# 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 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,16 +36,9 @@
# -------
#
# * Mario Fernandez (https://github.com/sirech)
# * Shohei YOSHIDA (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
__git_wtf_branches() {
local -a branches
branches=(${(f)"$(git for-each-ref --format='%(refname:short)' refs/heads/)"})
_describe 'branch' branches
}
_arguments -w -C -s \
'(--long --short)'{-l,--long}'[include author info and date for each commit]' \
'(--long --short)'{-s,--short}'[do not show commits]' \
@ -54,7 +47,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

272
src/_github Normal file
View File

@ -0,0 +1,272 @@
#compdef github gh
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Github gem 0.6.2 (https://github.com/defunkt/github-gem).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud (https://github.com/nicoulaj)
#
# ------------------------------------------------------------------------------
_github() {
typeset -A opt_args
local context state line curcontext="$curcontext"
local ret=1
_arguments -C \
'1:cmd:->cmds' \
'*::arg:->args' \
&& ret=0
case "$state" in
(cmds)
local commands; commands=(
'admin:open this repo'\''s Admin panel a web browser'
'browse:open this repo in a web browser'
'clone:clone a repo'
'config:automatically set configuration info, or pass args to specify'
'create:create a new, empty GitHub repository'
'create-from-local:create a new GitHub repository from the current local repository'
'fetch:fetch from a remote to a local branch'
'fetch_all:fetch all refs from a user'
'fork:forks a GitHub repository'
'home:open this repo'\''s master branch in a web browser'
'ignore:ignore a SHA'
'info:info about this project'
'issues:project issues tools'
'network:project network tools'
'open:open the given user/project in a web browser'
'pull:pull from a remote'
'pull-request:generate the text for a pull request'
'search:search GitHub for the given repository name'
'track:track another user'\''s repository'
)
_describe -t commands 'command' commands && ret=0
;;
(args)
curcontext="${curcontext%:*:*}:github-cmd-$words[1]:"
case $words[1] in
(admin|fetch|fetch_all|home|info)
_message 'no more arguments' && ret=0
;;
(browse)
_arguments \
'1: :_github_users' \
'2: :_github_branches' \
&& ret=0
;;
(clone)
_arguments \
'1: :_github_users' \
'2: :_github_repos' \
'3: :_files -/' \
'--search[search for user or repo and clone selected repository]:user or repo' \
'--ssh[clone using the git@github.com style url]' \
&& ret=0
;;
(config)
_arguments \
'1: :_github_users' \
'2: :_github_repos' \
&& ret=0
;;
(create)
_arguments \
'1:repo name' \
'--markdown[create README.markdown]' \
'--mdown[create README.mdown]' \
'--private[create private repository]' \
'--rdoc[create README.rdoc]' \
'--rst[create README.rst]' \
'--textile[create README.textile]' \
&& ret=0
;;
(create-from-local)
_arguments \
'--private[create private repository]' \
&& ret=0
;;
(fork)
_arguments \
'1: :_github_user_slash_repos' \
&& ret=0
;;
(ignore)
_arguments \
'1: :_github_network_commits' \
&& ret=0
;;
(issues)
_arguments -C \
'1:issue-status:->issue-statuses' \
'2:: :_github_users' \
'--after[only show issues updated after a certain date]:date' \
'--label[only show issues with a certain label]:label' \
&& ret=0
case "$state" in
(issue-statuses)
local statuses; statuses=(
'open:show open issues'
'closed:show closed issues'
)
_describe -t statuses 'status' statuses && ret=0
;;
esac
;;
(network)
_arguments -C \
'1:network-subcommand:->network-subcommands' \
'*::network-arg:->network-args' \
'(--after)--before[only show commits before a certain date]:date' \
'(--before)--after[only show commits after a certain date]:date' \
'--applies[filter commits to patches that apply cleanly]' \
'--author[filter commits on a email address of author]:author' \
'--cache[use the network data even if it'\''s expired]' \
'--common[show common branch point]' \
'--limit[only look through the first X heads - useful for really large projects]:number' \
'--noapply[filter commits to patches that do not apply cleanly]' \
'--nocache[do not use the cached network data]' \
'--project[filter commits on a certain project]:project' \
'--shas[only show shas]' \
'--sort[how to sort : date, branch, author]:sort type:((date\:sort\ by\ date\ \(default\) branch\:sort\ by\ branch author\:sort\ by\ author))' \
'--thisbranch[look at branches that match the current one]' \
&& ret=0
case "$state" in
(network-subcommands)
local subcommands; subcommands=(
'web:open network in a web browser'
'list:list network members'
'fetch:fetch network members commits'
'commits:list network members commits'
)
_describe -t subcommands 'subcommand' subcommands && ret=0
;;
(network-args)
case $words[1] in
(web)
_arguments \
'1: :_github_users' \
&& ret=0
;;
esac
;;
esac
;;
(open)
_arguments \
'1: :_github_user_slash_repos' \
&& ret=0
;;
(pull)
_arguments \
'1: :_github_users' \
'2: :_github_branches' \
'--merge[automatically merge remote'\''s changes into your master]' \
&& ret=0
;;
(pull-request)
_arguments \
'1: :_github_users' \
'2: :_github_branches' \
&& ret=0
;;
(search)
_arguments \
'1:query' \
&& ret=0
;;
(track)
_arguments \
'1:: :((remote))' \
'*: :_github_user_slash_repos' \
{--private,--ssh}'[use git@github.com: instead of git://github.com/]' \
&& ret=0
;;
esac
;;
esac
return ret
}
(( $+functions[_github_users] )) ||
_github_users() {
_alternative \
'users:user:_users' \
'github-network-users:github network user:_github_network_users'
}
(( $+functions[_github_network_users] )) ||
_github_network_users() {
local users; users=(${(f)"$(_call_program users $service network list 2>/dev/null)"})
_describe -t github-network-users 'github network user' users "$@"
}
(( $+functions[_github_repos] )) ||
_github_repos() {
_message -e repos 'repo'
}
(( $+functions[_github_branches] )) ||
_github_branches() {
_message -e branches 'branch'
}
(( $+functions[_github_user_slash_repos] )) ||
_github_user_slash_repos() {
local ret=1
if compset -P '*/'; then
_wanted repos expl 'repo' _github_repos && ret=0
else
_wanted users expl 'user' _github_users -qS/ && ret=0
fi
return ret
}
(( $+functions[_github_network_commits] )) ||
_github_network_commits() {
local commits; commits=(${${(f)"$(_call_program commits $service network commits 2>/dev/null)"}%%[[:blank:]]*})
_describe -t commits 'commit' commits "$@"
}
_github "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,125 +0,0 @@
#compdef glances
# ------------------------------------------------------------------------------
# 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 glances (https://nicolargo.github.io/glances/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * loranger (https://github.com/loranger)
# * Shohei Yoshida (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
_glances() {
_arguments \
'(- *)'{-h,--help}'[show this help message and exit]' \
'(- *)'{-V,--version}"[show program's version number and exit]" \
'(-C,--config)'{-C,--config}'[path to the configuration file]: :_files' \
'(--modules-list --module-list)'{--modules-list,--module-list}'[display modules list and exit]' \
'(--disable-plugin --disable-plugins)'{--disable-plugin,--disable-plugins}'[disable plugin(comma separated list or all)]:plugin' \
'(--enable-plugin --enable-plugins)'{--enable-plugin,--enable-plugins}'[enable plugin(comma separated list)]:plugin' \
'--disable-process[disable process module]' \
'--disable-webui[disable the Web Interface]' \
'(--light --enable-light)'{--light,--enable-light}'[light mode for Curses UI]' \
'(-0 --disable-irix)'{-0,--disable-irix}"[task's cpu usage will be divided by the total number of CPUs]" \
'(-1 --percpu)'{-1,--percpu}'[start Clances in per CPU mode]' \
'(-2 --disable-left-sidebar)'{-2,--disable-left-sidebar}'[disable network, disk I/O, FS and sensors modules]' \
'(-3 --disable-quicklook)'{-3,--disable-quicklook}'[disable quick look module]' \
'(-4 --full-quicklook)'{-4,--full-quicklook}'[disable all but quick look and load]' \
'(-5 --disable-top)'{-5,--disable-top}'[disable top menu(QL, CPU, MEM, SWAP and LOAD)]' \
'(-6 --menugpu)'{-6,--menugpu}'[start Glances in mean GPU mode]' \
'--disable-history[disable stats history]' \
'--disable-bold[disable bold mode in the terminal]' \
'--disable-bg[disable background colors in the terminal]' \
'--enable-irq[enable IRQ mode]' \
'--enable-process-extended[enable extended stats on top process]' \
'(--separator --enable-separator)'{--separator,--enable-separator}'[enable separator in the UI]' \
'--sort-process[sort processes]: :(cpu_percent memory_percent username cpu_times io_counters name)' \
'(--programs --program)'{--programs,--program}'[Accumulate processes by program]' \
'--export[enable export module]:module' \
'--export-csv-file[file path for CSV exporter]: :_files' \
'--export-csv-overwrite[overwrite existing CSV file]' \
'--export-json-file[file path for JSON exporter]: :_files' \
'--export-graph-path[Folder for Graph exporter]: :_files -/' \
'(-c --client)'{-c,--client}'[connect to a Glances server]:host:_hosts' \
'(-s --server)'{-s,--server}'[run Glances in server mode]' \
'--browser[start the client browser]' \
'--disable-autodiscover[disable autodiscover feature]' \
'(-p --port)'{-p,--port}'[define the client/server TCP port]' \
'(-B --bind)'{-B,--bind}'[bind server to the given IPv4/IPv6 address or hostname]:host:_hosts' \
'--username[define a client/server username]' \
'--password[define a client/server password]' \
'-u[use the given client/server username]:user_name' \
'--snmp-community[SNMP community]:community' \
'--snmp-port[SNMP community]:port' \
'--snmp-version[SNMP version]:version:(1 2c 3)' \
'--snmp-user[SNMP user]:user' \
'--snmp-auth[SNMP auth]:auth' \
'--snmp-force[force SNMP mode]' \
'(-t --time)'{-t,--time}'[set minimum refresh rate in seconds(default: 2 sec)]:seconds' \
'(-w --webserver)'{-w,--webserver}'[run Glances in web server mode]' \
'--cached-time[set the server cache time(default: 1 sec)]:seconds' \
'--stop-after[stop Glances after n fresh]:' \
'--open-web-browser[try to open the Web UI in the default browser]' \
'(-q --quiet)'{-q,--quiet}'[do not display the curses interface]' \
'(-f --process-filter)'{-f,--process-filter}'[set the process filter pattern]:regexp' \
'--process-short-name[force short name for processes name]' \
'--process-long-name[force long name for processes name]' \
'--stdout[display stats to stdout one stat per line]:stats' \
'--stdout-json[display stats to stdout, JSON format]:stats' \
'--stdout-csv[display stats to CSV, JSON format]:stats' \
'--issue[test all plugins and exit]' \
'--trace-malloc[trace memory allocation and display it at the end of the process]' \
'--memory-leak[test memory leak]' \
'--api-doc[display fields descriptions]'\
'--hide-kernel-threads[hide kernel threads in process list]' \
'(-b --byte)'{-b,--byte}'[display network rate in byte per second]' \
'--diskio-show-ramfs[show RAM Fs in the DiskIO plugin]' \
'--diskio-iops[show IO per second in the DiskIO plugin]' \
'--fahrenheit[display temperature in Fahrenheit]' \
'--fs-free-space[display FS free space instead of used]' \
'--sparkline[display sparklines instead of bar in the curses interface]' \
'--disable-unicode[disable unicode characters in the curses interface]' \
'--theme-white[optimize display colors for white background ]' \
'--disable-check-update[disable online Glances version check]' \
'--strftime[strftime format string for displaying current date in standalone mode]' \
}
_glances "$@"
# 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,30 +1,5 @@
#compdef google
# ------------------------------------------------------------------------------
# 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
# -----------
#

View File

@ -1,80 +0,0 @@
#compdef gpgconf
# Copyright (c) 2021 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:
# Completions for gpgconf (configuration utility provided with GnuPG 2.4.4
# <https://gnupg.org>)
#
# Authors:
# * "score" <seejay.11@gmail.com> https://keybase.io/score_under
_gpgconf_component() {
local values=(
"${(@f)$(gpgconf --list-components | awk -F: '{printf "%s[%s]\n", $1, $2}')}"
)
if [ "${action[2]}" = all ]; then
values+=('all[All daemon components]')
fi
_values 'component' "${(o)values[@]}"
}
_arguments \
'--help[print help text]' \
'--list-components[list all components]' \
'--check-programs[check all programs]' \
'--apply-defaults[apply global default values]' \
'--list-dirs[get the configuration directories for gpgconf]' \
'--list-config[list global configuration file]' \
'--check-config[check global configuration file]' \
'--query-swdb[query the software version database]' \
'--reload[reload all or a given component]:component:_gpgconf_component all' \
'--launch[launch a given component]:component:_gpgconf_component all' \
'--kill[kill a given component]:component:_gpgconf_component all' \
'--create-socketdir[create a directory for sockets below /run/user or /var/run/user]' \
'--remove-socketdir[remove a directory created with command --create-socketdir]' \
'--list-options[list options]:component:_gpgconf_component' \
'--change-options[change options]:component:_gpgconf_component' \
'--check-options[check options]:component:_gpgconf_component' \
'--apply-profile[update configuration files using the specified file]:configuration file:_path_files' \
'--status-fd[write status info to the specified file descriptor]:file descriptor' \
'--homedir[specify an alternative gnupg configuration home directory]:directory:_directories' \
'--chuid[change the current user to uid which may either be a number or a name]:uid' \
'(--lock --unlock)--unlock[remove a stale lock file hold for file]:name' \
'(--lock --unlock)--lock[name of file protected by the lock]:name' \
'(-o --output)'{-o,--output}'[write output to the specified file]:output file:_path_files' \
'(-v --verbose)'{-v,--verbose}'[verbose]' \
'(-q --quiet)'{-q,--quiet}'[quiet]' \
'(-n --dry-run)'{-n,--dry-run}'[do not make any changes]' \
'(-r --runtime)'{-r,--runtime}'[activate changes at runtime, if possible]'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

135
src/_gradle Normal file
View File

@ -0,0 +1,135 @@
#compdef gradle gradlew
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Gradle 1.0-milestone-5 (http://www.gradle.org).
#
# Status: incomplete (see TODO/FIXME tags)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_gradle() {
typeset -A opt_args
local context state line
local curcontext="$curcontext"
_arguments \
'(- 1 *)'{-?,-h,--help}'[show help message]' \
'(-a --no-rebuild)'{-a,--no-rebuild}'[do not rebuild project dependencies]' \
'(-b --build-file)'{-b,--build-file}'[specify the build file]:build file:_gradle_scripts' \
'(-C --cache)'{-C,--cache}'[specify how compiled build scripts should be cached]:cache strategy:((rebuild\:rebuild\ the\ cache on\:use\ the\ cache\ \(default\)))' \
'(-c --settings-file)'{-c,--settings-file}'[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 "$@"
# 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,78 +0,0 @@
#compdef grpcurl
# ------------------------------------------------------------------------------
# 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 grpcurl v1.8.7. (https://github.com/fullstorydev/grpcurl)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments \
'*-H[Additional headers in "name:value" format]:header' \
'-allow-unknown-fields[If "json" format is used, allows unknown fields to be present]' \
'-authority[The authoritative name of the remote server]:authority' \
'-cacert[File containing trusted root certificates for the server]: :_files' \
'-cert[File containing client certificate(public key) to present to the server]: :_files' \
'-connect-timeout[The maximum time, in seconds, to wait for connection to be established]:seconds' \
'*-d[Data for request contents]:data' \
'-emit-defaults[Emit default values for JSON-encoded responses]' \
'-expand-headers[Headers may use "\${NAME}" syntax to reference environment variables]' \
'-format[The format of request data]: :(json text)' \
'-format-error[When a non-zero status is returned, format the response using the value set by the -format flag]' \
'*-import-path[The path to a directory from which proto sources can be imported]: :_files -/' \
'-insecure[Skip server certificate and domain verification]' \
'-keepalive-time[The maximum idle time in seconds]:seconds' \
'-key[File containing client private key, to present to the server]: :_files' \
'-max-msg-sz[The maximum encoded size of a response message in bytes, that grpcurl will accept]:bytes' \
'-max-time[The maximum total time the operation can take, in seconds]:seconds' \
'-msg-template[When describing messages, show a template of input data]' \
'-plaintext[Use plain-text HTTP/2 when connecting to server(no TLS)]' \
'*-proto[The name of a proto source file]: :_files' \
'*-protoset[The name of a file containing an encoded FileDescriptorSet]: :_files' \
'-protoset-out[The name of a file to be written that will contain a FileDescriptorSet]: :_files' \
'*-reflect-header[Additional reflection headers in "name:value" format]:header' \
'*-rpc-header[Additional RPC headers in "name:value" format]' \
'-servername[Override server name when validating TLS certificate]' \
'-unix[Indicates that the server address is the path to a Unix domain socket]' \
'-use-reflection[Server reflection will be used to determine the RPC schema]' \
'-user-agent[The specified value will be added to the User-Agent header set by the grpc-go library]:user_agent' \
'-v[Enable verbose output]' \
'(- *)-version[Print version]' \
'-vv[Enable very verbose output]' \
'(- *)-h[Show help message]' \
'*:: :_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,84 +0,0 @@
#compdef gtk-launch gtk4-launch
# ------------------------------------------------------------------------------
# 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 gtk-launch on gtk+-3.24.37, gtk4-launch-4.10.4
# (https://www.gtk.org/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * ncaq <ncaq@ncaq.net>
#
# ------------------------------------------------------------------------------
_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:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,19 +0,0 @@
#compdef hello
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for GNU hello (https://www.gnu.org/software/hello/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Wu Zhenyu <wuzy01@qq.com>
#
# ------------------------------------------------------------------------------
_arguments -s '(- *)'{-h,--help}'[display this help and exit]' \
'(- *)'{-v,--version}'[display version information and exit]' \
{-t,--traditional}'[use traditional greeting]' \
{-g,--greeting=}'[use TEXT as the greeting message]:TEXT'

174
src/_heroku Normal file
View File

@ -0,0 +1,174 @@
#compdef heroku
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for the Heroku client gem (https://github.com/heroku/heroku)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ali B. (http://awhitebox.com)
#
# ------------------------------------------------------------------------------
local -a _1st_arguments
_1st_arguments=(
"account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
"addons":"list installed addons"
"addons\:list":"list all available addons"
"addons\:add":"install an addon"
"addons\:upgrade":"upgrade an existing addon"
"addons\:downgrade":"downgrade an existing addon"
"addons\:remove":"uninstall an addon"
"addons\:open":"open an addon's dashboard in your browser"
"apps":"list your apps"
"apps\:info":"show detailed app information"
"apps\:create":"create a new app"
"apps\:rename":"rename the app"
"apps\:open":"open the app in a web browser"
"apps\:destroy":"permanently destroy an app"
"auth\:login":"log in with your heroku credentials"
"auth\:logout":"clear local authentication credentials"
"config":"display 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
# 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,286 +0,0 @@
#compdef hledger
# ------------------------------------------------------------------------------
# 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 hledger 1.10 ( https://hledger.org/ )
# Last updated: 07.08.2018
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Valodim ( https://github.com/Valodim )
# * fdw ( https://github.com/fdw )
#
# ------------------------------------------------------------------------------
# Notes
# -----
#
# account completion depends on availability of a ~/.hledger.journal file
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" curstate state line expl grp cmd ret=1
typeset -a args
typeset -A opt_args
args=(
'(- *)'{-h,--help}'[print help information]'
'(-f --file)'{-f,--file}'=[use a different input file]:input file:_files'
'--rules-file=[CSV conversion rules file]:rules file:_files'
'--alias=[display accounts named OLD as NEW]:alias specification'
'--anon=[anonymize accounts and payees]'
'(-b --begin)'{-b,--begin}'=[include postings/txns on or after this date]:date'
'(-e --end)'{-e,--end}'=[include postings/txns before this date]:date'
'(-D --daily)'{-D,--daily}'[multiperiod/multicolumn report by day]'
'(-W --weekly)'{-W,--weekly}'[multiperiod/multicolumn report by week]'
'(-M --monthly)'{-M,--monthly}'[multiperiod/multicolumn report by month]'
'(-Q --quarterly)'{-Q,--quarterly}'[multiperiod/multicolumn report by quarter]'
'(-Y --yearly)'{-Y,--yearly}'[multiperiod/multicolumn report by year]'
'(-p --period)'{-p,--period}'=[set start date, end date, and/or reporting interval all at once]'
'(-C --cleared)'{-C,--cleared}'[include only cleared postings/txns]'
'(-U --uncleared)'{-U,--uncleared}'[include only uncleared postings/txns]'
'(-R --real)'{-R,--real}'[include only non-virtual postings]'
'(--depth)--depth=[hide accounts/postings deeper than N]:depth'
'(-E --empty)'{-E,--empty}'[show empty/zero things which are normally omitted]'
'(-B --cost)'{-B,--cost}'[show amounts in their cost price'\''s commodity]'
'(-V --value)'{-V,--value}'[converts reported amounts to the current market value]'
'(-I --ignore-assertions)'{-I,--ignore-assertions}'[ignore any failing balance assertions]'
'--forecast=[apply periodic transaction rules to generate future transactions]'
)
_arguments -C "$args[@]" -A "-*" \
'(- *)--version[print version information]' \
'--debug[show debug output]' \
'1: :->cmds' \
'*:: :->args' && ret=0
while (( $#state )); do
curstate=$state
shift state
case $curstate in
cmds)
typeset -a cmds
cmds=(
'accounts:show account names (a)'
'activity:show an ascii barchart of posting counts per interval'
'add:prompt for transactions and add them to the journal'
'balance:show accounts and balances (b, bal)'
'balancesheet:show a balance sheet (bs)'
'balancesheetequity:like balancesheet, but also reports equity'
'cashflow:show a cashflow statement (cf)'
'check-dates:check that transactions are sorted by increasing date'
'check-dupes:report account names having the same leaf but different prefixes'
'close:print closing/opening transactions that bring some or all account balances to zero and back'
'help:show any of the hledger manuals'
'import:read new transactions added to each file since last run, and add them to the main journal file'
'incomestatement:show an income statement (is)'
'prices:print market price directives from the journal'
'print:show transaction entries (p, txns)'
'print-unique:print transactions which do not reuse an already-seen description'
'register:show postings and running total (r, reg)'
'register-patch:print the one posting whose transaction description is closest to the description'
'rewrite:print all transactions, adding custom postings to the matched ones'
'stats:show some journal statistics'
'tags:list all the tag names used in the journal'
'test:run built-in unit tests'
)
_describe 'subcommands' cmds && ret=0
;;
args)
: $words
local cmd=$words[1]
(( $+cmd )) || return 1
# curcontext="${curcontext%:*:*}:$service-$cmd:"
case $cmd in
accounts)
args=(
'(--declared)--declared[show account names declared with account directives]'
'(--used)--used[show account names posted to by transactions]'
'(--tree)--tree[show accounts as a tree (default in simple reports)]'
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
'(--drop)--drop=[flat mode, omit N leading account name parts]:drop n'
)
;;
activity)
;;
add)
args=(
'(--no-new-accounts)--no-new-accounts=[do not allow creating new accounts]'
)
;;
bal|balance)
args+=(
'(--change)--change[show balance change in each period (default)]'
'(--cumulative)--cumulative[show balance change accumulated across periods]'
'(-H --historical)'{-H,--historical}'[show historical ending balance in each period]'
'(--tree)--tree[show accounts as a tree (default in simple reports)]'
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
'(-A --average)'{-A,--average}'[show a row average column (in multicolumn mode)]'
'(-T --row-total)'{-T,--row-total}'[show a row total column]'
'(-N --no-total)'{-N,--no-total}'[do not show the final total row]'
'(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n'
'(--no-elide)--no-elide[tree mode, do not squash boring parent accounts]'
'(--format)--format=[in tree mode, use this custom line format]:custom line format'
'(-O --output-format)'{-O,--output-format}='[select the output format from txt, csv, html]:format'
'(-o --output-file)'{-o,--output-file}'=[write output to file]:file'
'(--pretty-tables)--pretty-tables[use unicode to display prettier tables]'
'(--sort-amount)--sort-amount[sort by amount instead of account code/name]'
'(--invert)--invert[display all amounts with reversed sign]'
'(--budget)--budget[show performance compared to budget goals]'
'(--show-unbudgeted)--show-unbudgeted[with --budget, show unbudgeted accounts also]'
)
;;
bl|balancesheet|balancesheetequity)
args+=(
'(--change)--change[show balance change in each period (default)]'
'(--cumulative)--cumulative[show balance change accumulated across periods]'
'(-H --historical)'{-H,--historical}'[show historical ending balance in each period]'
'(--tree)--tree[show accounts as a tree (default in simple reports)]'
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
'(-A --average)'{-A,--average}'[show a row average column (in multicolumn mode)]'
'(-T --row-total)'{-T,--row-total}'[show a row total column]'
'(-N --no-total)'{-N,--no-total}'[do not show the final total row]'
'(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n'
'(--no-elide)--no-elide[tree mode, do not squash boring parent accounts]'
'(--format)--format=[in tree mode, use this custom line format]:custom line format'
'(--sort-amount)--sort-amount[sort by amount instead of account code/name]'
)
;;
cashflow|cf|balancesheet|bs|incomestatement|is)
args+=(
'(--change)--change[show balance change in each period (default)]'
'(--cumulative)--cumulative[show balance change accumulated across periods]'
'(-H --historical)'{-H,--historical}'[show historical ending balance in each period]'
'(--tree)--tree[show accounts as a tree (default in simple reports)]'
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
'(-A --average)'{-A,--average}'[show a row average column (in multicolumn mode)]'
'(-T --row-total)'{-T,--row-total}'[show a row total column]'
'(-N --no-total)'{-N,--no-total}'[do not show the final total row]'
'(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n'
'(--no-elide)--no-elide[tree mode, do not squash boring parent accounts]'
'(--format)--format=[in tree mode, use this custom line format]:custom line format'
'(--sort-amount)--sort-amount[sort by amount instead of account code/name]'
)
;;
import)
args=(
'(--dry-run)--dry-run[just show the transactions to be imported]'
)
;;
is|incomestatement)
args+=(
'(--change)--change[show balance change in each period (default)]'
'(--cumulative)--cumulative[show balance change accumulated across periods]'
'(-H --historical)'{-H,--historical}'[show historical ending balance in each period]'
'(--tree)--tree[show accounts as a tree (default in simple reports)]'
'(--flat)--flat[show accounts as a list (default in multicolumn)]'
'(-A --average)'{-A,--average}'[show a row average column (in multicolumn mode)]'
'(-T --row-total)'{-T,--row-total}'[show a row total column]'
'(-N --no-total)'{-N,--no-total}'[do not show the final total row]'
'(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n'
'(--no-elide)--no-elide[tree mode, do not squash boring parent accounts]'
'(--format)--format=[in tree mode, use this custom line format]:custom line format'
'(--sort-amount)--sort-amount[sort by amount instead of account code/name]'
)
;;
print)
args=(
'(-m --match)'{-m,--match}'[show the transaction whose description is most similar]:string'
'(--new)--new[show only newer-dated transactions added in each file since last run]'
'(-x --explicit)'{-x,--explicit}'[show all amounts explicitly]'
'(-O --output-format)'{-O,--output-format}='[select the output format from txt, csv, html]:format'
'(-o --output-file)'{-o,--output-file}'=[write output to file]:file'
)
;;
register|reg)
args+=(
'(--cumulative)--cumulative[show balance change accumulated across periods]'
'(-H --historical)'{-H,--historical}'[show historical ending balance in each period]'
'(-A --average)'{-A,--average}'[show a row average column (in multicolumn mode)]'
'(-r --related)'{-r,--related}'[show postings'\'' siblings instead]'
'(-w --width)'{-w,--width}'=[set output width to 120, or N]:width (default 80)'
'(-O --output-format)'{-O,--output-format}='[select the output format from txt, csv, html]:format'
'(-o --output-file)'{-o,--output-file}'=[write output to file]:file'
)
;;
stats)
args=(
'(-o --output-file)'{-o,--output-file}'=[write output to file]:file'
)
;;
# fallback to _default
*) _arguments -C -A "-*" "$args[@]" \
'*: :_default' && ret=0
continue
esac
_arguments -C -A "-*" "$args[@]" \
'*:query patterns:->query' && ret=0
;;
query)
local -a accs keywords
keywords=(
'acct\::match account names'
'code\::match by transaction code'
'desc\::match transaction descriptions'
'tag\::match by tag name'
'depth\::match at or above depth'
'status\::match cleared/uncleared transactions'
'real\::match real/virtual transactions'
'empty\::match if amount is/is not zero'
'amt\::match transaction amount'
'cur\::match by currency'
)
if compset -P 'amt:'; then
_message 'match amount (<, <=, >, >=, add sign for non-absolute match)' && ret=0
continue
fi
if compset -P '(#b)(code|desc|tag|depth|status|real|empty):'; then
_message "'$match[1]' parameter" && ret=0
continue
fi
accs=( ${(f)"$(_call_program hledger hledger accounts $PREFIX 2>/dev/null)"} )
if (( $? )); then
_message "error fetching accounts from hledger"
fi
# decided against partial matching here. these lines can
# be uncommented to complete subaccounts hierarchically
# (add -S '' -q to the compadd below, too)
# if compset -P '(#b)(*):'; then
# accs=( ${(M)accs:#$match[1]:*} )
# accs=( ${accs#$IPREFIX} )
# fi
# accs=( ${accs%%:*} )
_wanted accounts expl "accounts" compadd -a accs && ret=0
_describe "matcher keywords" keywords -S '' && ret=0
# not is special, it doesn't need the -S ''
keywords=(
'not:negate expression'
)
_describe "matcher keywords" keywords && ret=0
;;
esac
done
return ret

View File

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

View File

@ -1,218 +0,0 @@
#compdef http https=http
# ------------------------------------------------------------------------------
# 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 httpie 3.2.2 (https://httpie.io/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Akira Maeda <https://github.com/glidenote>
# * Valodim <https://github.com/Valodim>
# * Claus Klingberg <https://github.com/cjk>
# * Shohei YOSHIDA <https://github.com/syohex>
#
# ------------------------------------------------------------------------------
_httpie_params() {
local ret=1 expl
# or a url
if (( CURRENT <= NORMARG+1 )) && [[ $words[NORMARG] != *:* ]] ; then
_httpie_urls && ret=0
# regular param, if we already have a url
elif (( CURRENT > NORMARG )); then
# if the suffix is precisely : this is shorthand for a header
if [[ -prefix ':' ]]; then
PREFIX=
SUFFIX=:
fi
# if we are in front of a : (possibly due to the PREFIX move before)
if [[ -suffix ':' ]]; then
# this is rather buggy with normal tab behavior :
compstate[insert]=menu
_wanted http_header expl 'HTTP Header' \
compadd -s ':' -S '' -- Content-Type Cookie && return 0
fi
# ignore all prefix stuff
compset -P '(#b)([^:@=]#)'
local name=$match[1]
if compset -P '='; then
_message "$name data field value"
elif compset -P '@'; then
_files
elif compset -P ':=@'; then
_files
elif compset -P ':='; then
_message "$name raw json data"
elif compset -P '=='; then
_message "$name url parameter value"
elif compset -P ':'; then
_message "$name header content"
else
typeset -a ops
ops=(
'=:data field'
'\::header'
'==:request parameter'
'@:data file field'
'\:=:raw json field'
'\:=@:raw json field file path'
)
_describe -t httpparams "parameter types" ops -Q -S ''
fi
ret=0
fi
# first arg may be a request method
(( CURRENT == NORMARG )) &&
_wanted http_method expl 'Request Method' \
compadd GET POST PUT DELETE HEAD OPTIONS TRACE CONNECT PATCH LINK UNLINK && ret=0
return $ret
}
_httpie_urls() {
local ret=1
if ! [[ -prefix [-+.a-z0-9]#:// ]]; then
local expl
compset -S '[^:/]*' && compstate[to_end]=''
_wanted url-schemas expl 'URL schema' compadd -S '' http:// https:// && ret=0
else
_urls && ret=0
fi
return $ret
}
_httpie_printflags() {
local ret=1
# not sure why this is necessary, but it will complete "-pH" style without it
[[ $IPREFIX == "-p" ]] && IPREFIX+=" "
compset -P '(#b)([a-zA-Z]#)'
local -a flags
[[ $match[1] != *H* ]] && flags+=( "H:request headers" )
[[ $match[1] != *B* ]] && flags+=( "B:request body" )
[[ $match[1] != *h* ]] && flags+=( "h:response headers" )
[[ $match[1] != *b* ]] && flags+=( "b:response body" )
_describe -t printflags "print flags" flags -S '' && ret=0
return $ret
}
_httpie_styles() {
local -a styles=(abap algol algol_nu arduino auto autumn borland bw
colorful default dracula emacs friendly
friendly_grayscale fruity github-dark gruvbox-dark gruvbox-light
igor inkpot lilypond lovelace manni material monokai
murphy native nord nord-darker one-dark paraiso-dark paraiso-light
pastie perldoc pie pie-dark pie-light rainbow_dash
rrt sas solarized solarized-dark solarized-light stata
stata-dark stata-light tango trac vim vs xcode zenburn)
_describe -t styles 'style' styles
}
integer NORMARG
_arguments -n -C -s \
'(-j --json -f)'{-j,--json}'[Data items from the command line are serialized as a JSON object]' \
'(-f --form -j)'{-f,--form}'[Data items from the command line are serialized as form fields]' \
'--multipart[Similar to --form, but always sends a multipart/form-data request]' \
'--boundary=[Specify a custom boundary string for multipart/form-data requests]' \
'--raw=[This option allows you to pass raw request data without extra processing]' \
'(-x --compress)'{-x,--compress}'[Content compressed with Deflate algorithm]' \
'--pretty=[Controls output processing]:output format:(all colors format none)' \
'(-s --style)'{-s,--style}'=[Output coloring style]:STYLE:_httpie_styles' \
'--unsorted[Disables all sorting while formatting output]' \
'--sorted[Re-enables all sorting options while formatting output]' \
'--response-charset=[Override the response encoding for terminal display purposes]:encoding' \
'--response-mime=[Override the response mime type for coloring and formatting for the terminal]:mine' \
'--format-options=[Controls output formatting]:format' \
'(-p --print)'{-p,--print}'=[String specifying what the output should contain]:print flags:_httpie_printflags' \
'(-v --verbose)'{-v,--verbose}'[Print the whole request as well as the response]' \
'(-p -h --headers)'{-h,--headers}'[Print only the response headers]' \
'(-p -m --meta)'{-m,--meta}'[Print only the response metadata]' \
'(-p -b --body)'{-b,--body}'[Print only the response body]' \
'--all[By default, only the final request/response is shown]' \
'(-S --stream)'{-S,--stream}'[Always stream the output by line, i.e., behave like `tail -f`]' \
'(-o --output)'{-o,--output}'=[Save output to FILE]:output file:_files' \
'(-d --download)'{-d,--download}'=[Do not print the response body to stdout]' \
'(-c --continue)'{-c,--continue}'[Resume an interrupted download]' \
'(-q --quiet)'{-q,--quiet}'[Do not print to stdout or stderr, except for errors and warnings when provided once]' \
'(--session-read-only)--session=[Create, or reuse and update a session]:session name (or path)' \
'(--session)--session-read-only=[Create or read a session without updating it form the request/response exchange]:session name (or path)' \
'(-a --auth)'{-a,--auth}'=[If only the username is provided (-a username)]:USER\:PASS' \
'--auth-type=[The authentication mechanism to be used. Defaults to "basic"]:AUTH-TYPE:(basic digest bearer)' \
'--ignore-netrc[Ignore credentials from .netrc]' \
'--offline[Build the request and print it but do not actually send it]' \
'--proxy=[String mapping protocol to the URL of the proxy]:PROXY' \
'(-F --follow)'{-F,--follow}'[Allow full redirects]' \
'--max-redirects=[A limit of redirects]:number:' \
'--max-headers=[The maximum number of response headers to be read]:number:' \
"--verify=[Enable or disable verification of ssl certificates]:verify certificate:(yes no)" \
'--ssl=[The desired protocol version to use]:ssl version:(ssl2.3 tls1 tls1.1 tls1.2)' \
'--ciphers=[A string in the OpenSSL cipher list format]:ciphers' \
'--cert=[Specify a local cert to use as client side SSL certificate]:cert:_files' \
'--cert-key=[Specify the private to key to use with SSL]:cert key:_files' \
'--cert-key-pass=[The passphrase to be used to with the given private key]' \
'--timeout=[Float describes the timeout of the request (Use socket.setdefaulttimeout() as fallback)]:timeout (seconds)' \
'--check-status[This flag instructs HTTPie to also check the HTTP status code and exit with an error if the status indicates one]' \
'--path-as-is[Bypass dot segment URL squashing]' \
'--chunked[Enable streaming via chunked transfer encoding]' \
'(-I --ignore-stdin)'{-I,--ignore-stdin}'[Do not attempt to read stdin]' \
'(- *)--help[show help message]' \
'(- *)--manual[show the full manual]' \
"(- *)--version[show program's version number and exit]" \
'--traceback[Prints exception traceback should one occur]' \
'--default-scheme=[The default scheme to use if not specified in the URL]:scheme:' \
'--debug[Prints exception traceback should one occur and other information useful for debugging HTTPie itself]' \
'*:args:_httpie_params' && 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

109
src/_ibus
View File

@ -1,109 +0,0 @@
#compdef ibus
# ------------------------------------------------------------------------------
# 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 ibus 1.5.27 (https://github.com/ibus/ibus).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Tomo Kazahaya <https://github.com/tomonacci>
#
# ------------------------------------------------------------------------------
# The completion of "ibus emoji --lang=" depends on _language_codes from
# https://github.com/zsh-users/zsh-completions.
local context state state_descr line
typeset -A opt_args
local curcontext=$curcontext
_arguments -C \
":command:(($(ibus help|sed -ne 's/^ \(\S\+\) \+\(.*\)/"\1\\:\2"/p')))" \
'*:: :->args' \
&& return
case $state in
args)
case $line[1] in
(engine)
_arguments \
":engine:(($(ibus list-engine|sed -ne 's/:/\\\\:/g' -e 's/^ \(\S\+\) - \(.*\)$/"\1:\2"/p')))" \
&& return
;;
(start|restart)
_arguments \
'--type=[start or restart daemon type with direct or systemd type]: :(direct systemd)' \
'--file=[start or restart daemon with SYSTEMD_SERVICE file]: :_files' \
'--verbose[Show debug message]' \
'(- *)--help[Show help message]' \
&& return
;;
(read-cache)
_arguments \
'--system[show the content of the system registry cache]' \
'--file=[custom registry cache to show]:registry cache:_files' \
'(- *)--help[Show help message]' \
&& return
;;
(write-cache)
_arguments \
'--system[save the system registry cache]' \
'--file=[custom registry cache to save]:registry cache:_files' \
'(- *)--help[Show help message]' \
&& return
;;
(emoji)
_arguments \
'--font=[emoji font]:emoji font: ' \
'--lang=[language of emoji annotations]:language:_language_codes ISO-639-1' \
'--partial-match[match annotations with a partial string]' \
'(- *)--help[Show help message]' \
&& return
;;
(im-module)
_arguments \
'--type=[Set im-module TYPE]: :(gtk2 gtk3 gtk4)' \
'(- *)--help[Show help message]' \
&& return
;;
esac
;;
esac
return 1
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,87 +0,0 @@
#compdef include-what-you-use iwyu
# Copyright 2018 CERN for the benefit of the LHCb Collaboration.
# All rights reserved.
#
# Developed by:
#
# CERN LBC group
#
# CERN
#
# https://home.web.cern.ch/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# with 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:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimers.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimers in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of the LBC group, CERN, nor the names of its
# contributors may be used to endorse or promote products derived from
# this Software without specific prior written permission.
#
# 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
# CONTRIBUTORS 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 WITH
# THE SOFTWARE.
#
# 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.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for include-what-you-use 0.19 (https://github.com/include-what-you-use/include-what-you-use).
#
# ------------------------------------------------------------------------------
# TODO:
# - prevent _iwyu_opts from running once the first clang option got passed
_iwyu_opts() {
_arguments \
'--check_also=[print iwyu-violation info for files matching the given glob pattern]:glob pattern:' \
'--keep=[tells iwyu to always keep these includes]:glob pattern' \
'*'"--mapping_file=[iwyu mapping file]:iwyu mapping file:_path_files -g '*(/) *.imp'" \
"--no_default_mappings[do not add iwyu's default mappings]" \
'--pch_in_code[mark the first include in a translation unit as a precompiled header]' \
'--prefix_header_includes=[what to do with command line includes]:command line include treatment:(add keep remove)' \
"--transitive_includes_only[do not suggest that a file add headers that aren't already visible]" \
'--max_line_length=[maximum line length for includes]:a number:' \
'--comment_style=[set verbosity of "why" comments to]:comment style:(none short long)' \
'--no_comments[do not add "why" comments]' \
'--no_fwd_decls[do not use forward declarations]' \
'--verbose=[the higher the level, the more output]:a number:' \
'--quoted_includes_first[when sorting includes, place quoted ones first]' \
'--cxx17ns[suggests the more concise syntax introduced in C++17]' \
'--error=-[exit with N(default: 1) for iwyu violations]::exit code' \
'--error_always=-[always exit with N (default: 1)]::exit code' \
'--debug=[debug flags]:flag' \
'--regex=[use specified regex dialect in iwyu]:dialect:(llvm ecmascript)' \
'*: :_files'
}
_alternative \
'iwyu:iwyu_option:_iwyu_opts' \
'gcc:gcc_option:_gcc' \
# 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

199
src/_inxi
View File

@ -1,199 +0,0 @@
#compdef inxi
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script of inxi 3.3.21-00 (https://smxi.org/docs/inxi.htm)
#
# a full featured CLI system information tool
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Oleksii Filonenko <brightone@protonmail.com>
#
# ------------------------------------------------------------------------------
_inxi() {
typeset -A opt_args
local context state line
local curcontext="$curcontext"
local ret=1
local colors=($(seq 0 42))
_arguments -C -s \
'(-A --audio)'{-A,--audio}"[Show Audio/sound card(s) information]" \
'(-b --basic)'{-b,--basic}"[Show basic output, short form]" \
'(-B --battery)'{-B,--battery}"[Show system Battery information]" \
'(-C --cpu)'{-C,--cpu}"[Show full CPU output]" \
'(-d --disk-full --optical)'{-d,--disk-full,--optical}"[Show hard + optical drive info]" \
'(-D --disk)'{-D,--disk}"[Show hard Disk info]" \
'(-E --bluetooth)'{-E,--bluetooth}'[Show bluetooth device data report, if available]' \
'--edid[Full graphics data, triggers -a -G]' \
'(-f --flags)'{-f,--flags}"[Show all CPU flags used]" \
'(-F --full)'{-F,--full}"[Show Full output]" \
'(-G --graphics)'{-G,--graphics}"[Show Graphic card(s) information]" \
'(- *)'{-h,--help}"[Show list of command-line options]" \
'(-i --ip)'{-i,--ip}"[Show WAN IP address and local interfaces]" \
'(-I --info)'{-I,--info}"[Show Information: processes, uptime, etc.]" \
'(-j --swap)'{-j,--swap}'[Swap in use]' \
'(-J --usb)'{-J,--usb}"[Show USB data for attached Hubs and Devices]" \
'(-l --label)'{-l,--label}"[Show partition labels]" \
'(-L --logical)'{-L,--logical}'[Logical devices]' \
'(-m --memory)'{-m,--memory}"[Memory (RAM) data]" \
'(--memory-modules --mm)'{--memory-modules,--mm}'[Memory (RAM) data. Exclude empty module slots]' \
'(--memory-short --ms)'{--memory-short,--ms}'[Memory (RAM) data. Show only short Memory RAM report]' \
'(-M --machine)'{-M,--machine}"[Show Machine data]" \
'(-n --network-advanced)'{-n,--network-advanced}"[Show Advanced Network card information]" \
'(-N --network)'{-N,--network}"[Show Network card(s) information]" \
'(-o --unmounted)'{-o,--unmounted}"[Show unmounted partition information]" \
'(-p --partitions-full)'{-p,--partitions-full}"[Show full Partition information]" \
'(-P --partitions)'{-P,--partitions}"[Show basic Partition information]" \
'(-r --repos)'{-r,--repos}"[Show distro repository data]" \
'(-R --raid)'{-R,--raid}"[Show RAID data]" \
"(- *)"--recommends"[Check inxi dependencies + recommends]" \
'(-s --sensors)'{-s,--sensors}"[Show output from configured sensors]" \
"--slots[Show PCI slots]" \
'(-S --system)'{-S,--system}"[Show System information]" \
'(-t --processes)'{-t+,--processes=}"[Show processes]:processes:((c\:'CPU only' m\:'Memory only' cm\:'CPU+memory'))" \
'(-u --uuid)'{-u,--uuid}"[Show partition UUIDs]" \
"(- *)"{-U,--update}"[Auto-update inxi]" \
"(- *)"{-V,--version}"[Show version of inxi]" \
'(-v --verbosity)'{-v+,--verbosity=}"[Script verbosity levels]:verbosity:_inxi_verbosity" \
'(-w --weather)'{-w,--weather}"[Adds weather line]" \
'(-W --weather-location)'{-W+,--weather-location=}"[Get weather/time for an alternate location]:weather location: " \
"--weather-source=[Change weather data source]: :(1 2 3 4 5 6 7 8 9)" \
"--weather-unit=[Set weather unit]:weather unit:((m\:metric i\:imperial mi\:'metric (imperial)' im\:'imperial (metric)'))" \
"--host[Turns on hostname in System line]" \
"--no-host[Turns off hostname in System line]" \
{-z,--filter}"[Adds security filters]" \
'(--za --filter-all)'{--za,--filter-all}'[Shortcut triggers, -z, --zl, --zu, --zv]' \
'(--zl --filter-label)'{--zl,--filter-label}'[Filter out partition labels in -j, -o, -p, -P, -Sa]' \
'(--zu --filter-uuid)'{--zu,--filter-uuid}'[Filter out partition UUIDs in -j, -o, -p, -P, -Sa]' \
'(--zv --filter-vulnerabilities)'{--zv,--filter-vulnerabilities}'[Filters out Vulnerabilities report in -Ca]' \
'(-Z --no-filter)'{-Z,--no-filter}"[Disable output filters]" \
'(-c --color)'{-c+,--color=}"[Set color scheme]:color:(${colors[*]})" \
"--indent=[Change default wide mode primary indentation width]:integer:(11 12 13 14 15 16 17 18 19 20)" \
"--indents=[Change wrapped mode primary indentation width]:integer:(0 1 2 3 4 5 6 7 8 9 10)" \
"--limit[Limit max IP addresses for -i]:limit (-1 removes the limit): " \
'(--max-wrap --wrap-max)'{--max-wrap,--warp-max}='[Set maximum width where inxi autowraps line starters]' \
"--output[Change data output type]:type:(json screen xml)" \
"--output-file[Path to output file]:output file:->output_file" \
"--partition-sort[Change default sort order of partition output]:order:_inxi_partition_sort" \
'(-y --width)'{-y+,--width=}"[Set width override]:columns (80 minimum): " \
'(-Y --height)'{-Y+,--height=}"[Output height control]:" \
\*{-x,--extra}"[Extra data options]" \
'(-a --admin)'{-a,--admin}"[Admin extra data options]:admin option:->admin" \
"--alt[Bypass a downloader option]:downloader:_inxi_alt" \
'--bt-tool[Force use of given tool for bluetooth report]' \
'(--no-dig --dig)--dig[Overrides configuration item NO_DIG]' \
"--display[Get display data out of X]:\:<integer>: " \
"--dmidecode[Force use of dmidecode]" \
"--downloader[Force inxi to use a specific downloader]:downloader:(curl fetch perl wget)" \
'--force[Force use items]:' \
'--hddtemp[Force use of hddtemp for disk temps]' \
'(--no-html-wan --html-wan)--html-wan[Overrides configuration item NO_HTML_WAN]' \
'(--dig --no-dig)--no-dig[Skip dig for WAN IP checks]' \
'--no-doas[Skip internal program use of doas features]' \
'(--no-html-wan --html-wan)--no-html-wan[Skip HTML IP sources for WAN IP checks]' \
"--no-ssl[Skip SSL certificate checks]" \
"--no-sudo[Skip internal program use of sudo features]" \
'--rpm[Force use of disabled package manager counts for packages feature with -rx/-Ix ]' \
'--sensors-default[Removes configuration item SENSORS_USE and SENSORS_EXCLUDE]' \
'--sensors-exclude[Exclude supplied sensor array for -s output]' \
'--sensors-use[Use only supplied sensor array for -s output]' \
"--sleep[Change CPU sleep time]:sleep time (usually in decimals): " \
"--tty[Forces internal IRC flag to off]" \
"--usb-sys[Forces the USB data generator to use /sys as data source]" \
"--usb-tool[Forces the USB data generator to use lsusb as data source]" \
"--wan-ip-url[Force -i to use supplied URL as WAN ip source]:URL: " \
"--wm[Force System item wm to use wmctrl as data source]" \
"--dbg[Debug downloader failures]:level:(1)" \
"--debug[On screen debugger output]:level:(1 2 3 10 11 20 21 22)" \
"--debug-proc[Force debugger to parse /proc directory data when run as root]" \
"--debug-proc-print[Use this to locate file that /proc debugger hangs on]" \
"--debug-no-exit[Skip exit on error when running debugger]" \
"--debug-no-proc[Skip /proc debugging in case of a hang]" \
"--debug-no-sys[Skip /sys debugging in case of a hang]" \
"--debug-sys[Force PowerPC debugger parsing of /sys as sudo/root]" \
"--debug-proc[Force debugger to parse /proc directory data when run as root]" \
"--debug-sys-print[Use this to locate file that /sys debugger hangs on]" \
"--ftp[Set alternate ftp upload location]:FTP URL: " \
&& ret=0
case "$state" in
(admin)
_arguments -s \
'-C[Adds CPU family, model-id, and stepping]' \
'-d[Adds logical and physical block size in bytes]' \
{-p,-P}'[Adds raw partition / filesystem block size]' \
&& ret=0
;;
(output_file)
_alternative \
"outputs:output file:((print\:'Print to stdout'))" \
"outputs:output file:_files"
;;
esac
return ret
}
(( $+functions[_inxi_partition_sort] )) ||
_inxi_partition_sort() {
local -a orders=(
'dev-base:/dev partition identifier'
'fs:partition filesystem'
'id:mount point of partition (default)'
'label:label of partition'
'percent-used:percentage of partition size used'
'size:KiB size of partition'
'uuid:UUID of the partition'
'used:KiB used of partition'
)
_describe 'sort order' orders
}
(( $+functions[_inxi_alt] )) ||
_inxi_alt() {
local -a downloaders=(
'40:Perl'
'41:Curl'
'42:Fetch'
'43:Wget'
'44:Curl, Fetch, and Wget'
)
_describe 'downloader' downloaders
}
(( $+functions[_inxi_verbosity] )) ||
_inxi_verbosity() {
local -a levels=(
'0:Short output, same as: inxi'
'1:Basic verbose, -S + basic CPU'
'2:Adds -N, -M, -B, same as: inxi -b'
'3:Adds -C, -n, -x'
'4:Adds -P, -D'
'5:Adds -A, -m, -s, -l, -u'
'6:Adds -p, -o, -d, --usb, -xx'
'7:Adds -i, -xxx'
'8:Adds -r, --slots, -tcm, --admin'
)
_describe 'script verbosity level' levels
}
_inxi "$@"
# 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,55 +0,0 @@
#compdef ipcmk
# ------------------------------------------------------------------------------
# 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 ipcmk, util-linux 2.40.2 (https://github.com/util-linux/util-linux/)
# - create various IPC resources
#
# Author:
# * Aditi Sharma (https://github.com/Aditi76117)
# ------------------------------------------------------------------------------
_arguments -s \
'(-M --shmem)'{-M,--shmem}'[Create a shared memory segment of size bytes]:size' \
'(-Q --queue)'{-Q,--queue}'[Create a message queue]' \
'(-S --semaphore)'{-S,--semaphore}'[Create a semaphore array with number of elements]:number' \
'(-p --mode)'{-p,--mode}'[Access permissions for the resource]: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
# Note: This script is useful only on systems with `ipcmk` (typically Linux).
# macOS does not include this command.

View File

@ -1,57 +0,0 @@
#compdef ipcrm
# ------------------------------------------------------------------------------
# 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 ipcrm, util-linux 2.40.2 (https://github.com/util-linux/util-linux/)
# - remove System V IPC objects
#
# Author:
# * Aditi Sharma (https://github.com/Aditi76117)
# ------------------------------------------------------------------------------
_arguments -s \
'(-a --all)'{-a,--all}'-[Remove all resources]:resource:(shm msg sem)' \
'(-M --shmem-key)'{-M,--shmem-key}'[Remove the shared memory segment created with shemkey]:shmkey' \
'(-m --shmem-id)'{-m,--shmem-id}'[Remove the shared memory segment identified by shmid]:shmid' \
'(-Q --queue-key)'{-Q,--queue-key}'[Remove the message queue created with msgkey]:msgkey' \
'(-q --queue-id)'{-q,--queue-id}'[Remove the message queue identified by msgid]:msgid' \
'(-S --semaphore-key)'{-S,--semaphore-key}'[Remove the semaphore created with semkey]:semkey' \
'(-s --semaphore-id)'{-s,--semaphore-id}'[Remove the semaphore identified by semid]' \
'(- *)'{-h,--help}'[Display help text and exit]' \
'(- *)'{-V,--version}'[Print version and exit]' \
'1:type:(shm msg sem)' \
'*:id'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -1,60 +0,0 @@
#compdef ipcs
# ------------------------------------------------------------------------------
# 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 ipcs, util-linux 2.40.2 (https://github.com/util-linux/util-linux/)
# - show information on IPC facilities
#
# Author:
# * Aditi Sharma (https://github.com/Aditi76117)
# ------------------------------------------------------------------------------
_arguments -s \
'(-i --id)'{-i,--id}'[Show full details on just one resource element identified by id]:id' \
'(- *)'{-h,--help}'[Display help text and exit]' \
'(- *)'{-V,--version}'[Print version and exit]' \
'(-m --shmems)'{-m,--shmems}'[Write information about active shared memory segments]' \
'(-q --queues)'{-q,--queues}'[Write information about active message queues]' \
'(-s --semaphores)'{-s,--semaphores}'[Write information about active semaphore sets]' \
'(-a --all -s --semaphores -q --queues -m --shmems)'{-a,--all}'[Write information about all three resources]' \
'(-c --creator)'{-c,--creator}'[Show creator and owner]' \
'(-l --limits)'{-l,--limits}'[Show resource limits]' \
'(-p --pid)'{-p,--pid}'[Show PIDs of creator and last operator]' \
'(-t --time)'{-t,--time}'[Write time information]' \
'(-u --summary)'{-u,--summary}'[Show status summary]' \
'(--human -b --bytes)'{-b,--bytes}'[Print the sizes in bytes rather than in a human-readable format]' \
'(--human -b --bytes)--human[Print sizes in human-readable format]'
# 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

169
src/_jest
View File

@ -1,169 +0,0 @@
#compdef jest jest.js
# ------------------------------------------------------------------------------
# Copyright (c) 2023 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 Jest 29.7.0 (https://jestjs.io/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shotaro Aoyama (https://github.com/aoyama-val)
#
# ------------------------------------------------------------------------------
local curcontext=$curcontext state line ret=1
declare -A opt_args
_arguments -C -s \
'(- : *)'{-h,--help}'[Show help]' \
'(- : *)'--version'[Show version number]' \
--all'[The opposite of `onlyChanged`.]' \
--automock'[Automock all files by default.]' \
'(-b --bail)'{-b,--bail}'[Exit the test suite immediately after `n` number of failing tests.]' \
--cache'[Whether to use the transform cache.]' \
--cacheDirectory'[The directory where Jest should store its cached dependency information.]:directories:_dirs' \
--changedFilesWithAncestor'[Runs tests related to the current changes and the changes made in the last commit.]' \
--changedSince'[Runs tests related to the changes since the provided branch.]:string' \
--ci'[Whether to run Jest in continuous integration (CI) mode.]' \
--clearCache'[Clears the configured Jest cache directory and then exits.]' \
--clearMocks'[Automatically clear mock calls, instances, contexts and results before every test.]' \
--collectCoverageFrom'[A glob pattern relative to <rootDir> matching the files that coverage info needs to be collected from.]:string' \
'(--color --colors)'{--color,--colors}'[Forces test results output color highlighting (even if stdout is not a TTY).]' \
'(-c --config)'{-c,--config}'[The path to a jest config file specifying how to find and execute tests.]:files:_files' \
'(--coverage --collectCoverage)'{--coverage,--collectCoverage}'[Indicates that test coverage information should be collected and reported in the output.]' \
--coverageDirectory'[The directory where Jest should output its coverage files.]:directories:_dirs' \
--coveragePathIgnorePatterns'[An array of regexp pattern strings that are matched against all file paths before executing the test.]:array:' \
--coverageProvider'[Select between Babel and V8 to collect coverage]:choices:(babel v8)' \
--coverageReporters'[A list of reporter names that Jest uses when writing coverage reports.]:array' \
--coverageThreshold'[A JSON string with which will be used to configure minimum threshold enforcement for coverage results]:string' \
--debug'[Print debugging info about your jest config.]' \
--detectLeaks'[**EXPERIMENTAL**: Detect memory leaks in tests.]' \
--detectOpenHandles'[Print out remaining open handles preventing Jest from exiting at the end of a test run.]' \
'(--env --testEnvironment)'{--env,--testEnvironment}'[The test environment used for all tests.]:files:_files' \
--errorOnDeprecated'[Make calling deprecated APIs throw helpful error messages.]' \
'(-e --expand)'{-e,--expand}'[Use this flag to show full diffs instead of a patch.]' \
--filter'[Path to a module exporting a filtering function.]:string' \
--findRelatedTests'[Find related tests for a list of source files that were passed in as arguments.]' \
--forceExit'[Force Jest to exit after all tests have completed running.]' \
--globalSetup'[The path to a module that runs before All Tests.]:files:_files' \
--globalTeardown'[The path to a module that runs after All Tests.]:files:_files' \
--globals'[A JSON string with map of global variables that need to be available in all test environments.]:string' \
--haste'[A JSON string with map of variables for the haste module system]:string' \
--ignoreProjects'[Ignore the tests of the specified projects.]:array' \
--init'[Generate a basic configuration file]' \
--injectGlobals'[Should Jest inject global variables or not]' \
--json'[Prints the test results in JSON.]' \
--lastCommit'[Run all tests affected by file changes in the last commit made.]' \
--listTests'[Lists all tests Jest will run given the arguments and exits.]' \
--logHeapUsage'[Logs the heap usage after every test.]' \
--maxConcurrency'[Specifies the maximum number of tests that are allowed to run concurrently.]:number' \
'(-w --maxWorkers)'{-w,--maxWorkers}'[Specifies the maximum number of workers the worker-pool will spawn for running tests.]:string' \
--moduleDirectories'[An array of directory names to be searched recursively up from the requiring module'"'"'s location.]:directories:_dirs' \
--moduleFileExtensions'[An array of file extensions your modules use.]:array' \
--moduleNameMapper'[A JSON string with a map from regular expressions to module names or to arrays of module names that allow to stub out resources]:string' \
--modulePathIgnorePatterns'[An array of regexp pattern strings that are matched against all module paths before those paths are to be considered "visible" to the module loader.]:array' \
--modulePaths'[An array of absolute paths to additional locations to search when resolving modules.]:directories:_dirs' \
--no-cache'[Do not use the transform cache.]' \
--no-watchman'[Disable watchman for file crawling.]' \
--noStackTrace'[Disables stack trace in test results output]' \
--notify'[Activates notifications for test results.]' \
--notifyMode'[Specifies when notifications will appear for test results.]:string' \
'(-o --onlyChanged)'{-o,--onlyChanged}'[Attempts to identify which tests to run based on which files have changed in the current repository.]' \
'(-f --onlyFailures)'{-f,--onlyFailures}'[Run tests that failed in the previous execution.]' \
--openHandlesTimeout'[Print a warning about probable open handles if Jest does not exit cleanly after this number of milliseconds.]:number' \
--outputFile'[Write test results to a file when the --json option is also specified.]:files:_files' \
--passWithNoTests'[Will not fail if no tests are found (for example while using `--testPathPattern`.)]' \
--preset'[A preset that is used as a base for Jest'"'"'s configuration.]:string' \
--prettierPath'[The path to the "prettier" module used for inline snapshots.]:string' \
--projects'[A list of projects that use Jest to run all tests of all projects in a single instance of Jest.]:array' \
--randomize'[Shuffle the order of the tests within a file.]' \
--reporters'[A list of custom reporters for the test suite.]:array' \
--resetMocks'[Automatically reset mock state before every test.]' \
--resetModules'[If enabled, the module registry for every test file will be reset before running each individual test.]' \
--resolver'[A JSON string which allows the use of a custom resolver.]:string' \
--restoreMocks'[Automatically restore mock state and implementation before every test.]' \
--rootDir'[The root directory that Jest should scan for tests and modules within.]:directories:_dirs' \
--roots'[A list of paths to directories that Jest should use to search for files in.]:array' \
'(-i --runInBand)'{-i,--runInBand}'[Run all tests serially in the current process.]' \
--runTestsByPath'[Used when provided patterns are exact file paths.]' \
--runner'[Allows to use a custom runner instead of Jest'"'"'s default test runner.]:string' \
--seed'[Sets a seed value that can be retrieved in a tests file via `jest.getSeed()`.]:number' \
--selectProjects'[Run the tests of the specified projects.]:array' \
--setupFiles'[A list of paths to modules that run some code to configure or set up the testing environment before each test.]:files:_files' \
--setupFilesAfterEnv'[A list of paths to modules that run some code to configure or set up the testing framework before each test]:files:_files' \
--shard'[Shard tests and execute only the selected shard]:files:_files' \
--showConfig'[Print your jest config and then exits.]' \
--showSeed'[Prints the seed value in the test report summary.]' \
--silent'[Prevent tests from printing messages through the console.]' \
--skipFilter'[Disables the filter provided by --filter.]' \
--snapshotSerializers'[A list of paths to snapshot serializer modules Jest should use for snapshot testing.]:files:_files' \
--testEnvironmentOptions'[A JSON string with options that will be passed to the `testEnvironment`.]:string' \
--testFailureExitCode'[Exit code of `jest` command if the test run failed]:string' \
--testLocationInResults'[Add `location` information to the test results]' \
--testMatch'[The glob patterns Jest uses to detect test files.]:array' \
'(-t --testNamePattern)'{-t,--testNamePattern}'[Run only tests with a name that matches the regex pattern.]:string' \
--testPathIgnorePatterns'[An array of regexp pattern strings that are matched against all test paths before executing the test.]:array' \
--testPathPattern'[A regexp pattern string that is matched against all tests paths before executing the test.]:array' \
--testRegex'[A string or array of string regexp patterns that Jest uses to detect test files.]:array' \
--testResultsProcessor'[Allows the use of a custom results processor.]:string' \
--testRunner'[Allows to specify a custom test runner.]:string' \
--testSequencer'[Allows to specify a custom test sequencer.]:string' \
--testTimeout'[This option sets the default timeouts of test cases.]:number' \
--transform'[A JSON string which maps from regular expressions to paths to transformers.]:string' \
--transformIgnorePatterns'[An array of regexp pattern strings that are matched against all source file paths before transformation.]:array' \
--unmockedModulePathPatterns'[An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them.]:array' \
'(-u --updateSnapshot)'{-u,--updateSnapshot}'[Use this flag to re-record snapshots.]' \
--useStderr'[Divert all output to stderr.]' \
--verbose'[Display individual test results with the test suite hierarchy.]' \
--watch'[Watch files for changes and rerun tests related to changed files.]' \
--watchAll'[Watch files for changes and rerun all tests.]' \
--watchPathIgnorePatterns'[An array of regexp pattern strings that are matched against all paths before trigger test re-run in watch mode.]:array' \
--watchman'[Whether to use watchman for file crawling.]' \
--workerThreads'[Whether to use worker threads for parallelization.]' \
'*: :->file' \
&& ret=0
case $state in
(file)
(( CURRENT > 0 )) && line[CURRENT]=()
line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} )
_files -F line && 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,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
#
@ -17,7 +42,6 @@
_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,29 +49,21 @@ _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 -/'
{-X,--remoteexit}'[exit the remote servers at end of test (non-GUI)]'
# Local Variables:
# mode: Shell-Script

View File

@ -1,10 +1,35 @@
#compdef jmeter-plugins
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for jmeter-plugins command line tool 0.4.2
# (https://jmeter-plugins.org/).
# (http://code.google.com/p/jmeter-plugins).
#
# ------------------------------------------------------------------------------
# Authors

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
@ -70,7 +95,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]' \

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