refactor: remove for submodule
This commit is contained in:
parent
d1d2f75a70
commit
728fcfcfbb
@ -1,10 +0,0 @@
|
||||
; This file is for unifying the coding style for different editors and IDEs.
|
||||
; More information at http://EditorConfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[_*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
end_of_line = LF
|
@ -1 +0,0 @@
|
||||
|
@ -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.
|
@ -1,6 +0,0 @@
|
||||
# zsh word code files
|
||||
*.zwc
|
||||
|
||||
# IDE files
|
||||
.vscode/
|
||||
.idea/
|
@ -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`.
|
@ -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.
|
@ -1,71 +0,0 @@
|
||||
zsh-completions ![GitHub release](https://img.shields.io/github/release/zsh-users/zsh-completions.svg) ![GitHub contributors](https://img.shields.io/github/contributors/zsh-users/zsh-completions.svg) [![IRC](https://img.shields.io/badge/IRC-%23zsh--completions-yellow.svg)](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)
|
||||
=============
|
||||
|
||||
**Additional completion definitions for [Zsh](http://www.zsh.org).**
|
||||
|
||||
*This projects aims at gathering/developing new completion scripts that are not available in Zsh yet. The scripts may be contributed to the Zsh project when stable enough.*
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
### Using packages
|
||||
|
||||
| System | Package |
|
||||
| ------------- | ------------- |
|
||||
| Debian / Ubuntu | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
|
||||
| Fedora / CentOS / RHEL / Scientific Linux | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
|
||||
| OpenSUSE / SLE | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
|
||||
| Arch Linux / 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](http://packages.gentoo.org/package/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/zsh-completions.rb), [MacPorts](https://github.com/macports/macports-ports/blob/master/sysutils/zsh-completions/Portfile) |
|
||||
| NetBSD | [pkgsrc](http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/zsh-completions/README.html) |
|
||||
| FreeBSD | [shells/zsh-completions](https://www.freshports.org/shells/zsh-completions) |
|
||||
|
||||
|
||||
### Using zsh frameworks
|
||||
|
||||
#### [antigen](https://github.com/zsh-users/antigen)
|
||||
|
||||
Add `antigen bundle zsh-users/zsh-completions` to your `~/.zshrc`.
|
||||
|
||||
#### [oh-my-zsh](http://github.com/robbyrussell/oh-my-zsh)
|
||||
|
||||
* Clone the repository inside your oh-my-zsh repo:
|
||||
|
||||
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
|
||||
|
||||
* Add it to `FPATH` in your `.zshrc` by adding the following line before `source "$ZSH/oh-my-zsh.sh"`:
|
||||
|
||||
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
|
||||
|
||||
Note: adding it as a regular Oh My ZSH! plugin will not work properly (see [#603](https://github.com/zsh-users/zsh-completions/issues/603)).
|
||||
|
||||
#### [zinit](https://github.com/zdharma-continuum/zinit)
|
||||
|
||||
Add `zinit light zsh-users/zsh-completions` to your `~/.zshrc`.
|
||||
|
||||
### Manual installation
|
||||
|
||||
* Clone the repository:
|
||||
|
||||
git clone https://github.com/zsh-users/zsh-completions.git
|
||||
|
||||
* Include the directory in your `$fpath`, for example by adding in `~/.zshrc`:
|
||||
|
||||
fpath=(path/to/zsh-completions/src $fpath)
|
||||
|
||||
* You may have to force rebuild `zcompdump`:
|
||||
|
||||
rm -f ~/.zcompdump; compinit
|
||||
|
||||
### Contributing
|
||||
|
||||
Contributions are welcome, see [CONTRIBUTING](https://github.com/zsh-users/zsh-completions/blob/master/CONTRIBUTING.md).
|
||||
|
||||
|
||||
## License
|
||||
Completions use the Zsh license, unless explicitly mentioned in the file header.
|
||||
See [LICENSE](https://github.com/zsh-users/zsh-completions/blob/master/LICENSE) for more information.
|
@ -1,66 +0,0 @@
|
||||
#compdef afew
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for afew an initial tagging script for notmuch mail. (https://github.com/teythoon/afew)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Jindřich Pilař (https://github.com/JindrichPilar)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'(- 1 *)-h[display usage information]' \
|
||||
"(-c --classify -l --learn= -t --tag -u --update -U --update-reference -m --move-mails)"{-w,--watch}"[continuously monitor the mailbox for new messages matching the given query]" \
|
||||
"(-c --classify -l --learn= -u --update -U --update-reference -m --move-mails -w --watch)"{-t,--tag}"[run the tag filters]" \
|
||||
"(-c --classify -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-l,--learn=}"[train category with the messages matching query]" \
|
||||
"(-c --classify -l --learn= -t --tag -U --update-reference -m --move-mails -w --watch)"{-u,--update}"[update the categories (requires no query)]" \
|
||||
"(-c --classify -l --learn= -t --tag -u --update -m --move-mails -w --watch)"{-U,--update-reference}"[update the reference category (takes quite some time) (requires no query)]" \
|
||||
"(-l --learn= -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-c,--classify}"[classify each message matching the iven query]" \
|
||||
"(-c --classify -l --learn= -t --tag -u --update -U --update-reference -w --watch)"{-m,--move-mails}"[move mail files between maildir folders]" \
|
||||
"(-n --all)"{-a,--all}"[operate on all email]" \
|
||||
"(-a --new)"{-n,--new}"[operate on all new email]" \
|
||||
{-C,--notmuch-config=}"[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]" \
|
||||
{--verbose,-v}"[be more verbose]" \
|
||||
'*: :_guard "^-*" query'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,308 +0,0 @@
|
||||
#compdef android
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for the android command (Revision 12)
|
||||
# (http://developer.android.com/guide/developing/tools/android.html).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_android() {
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext"
|
||||
|
||||
local ret=1
|
||||
|
||||
_arguments -C -A "-*" \
|
||||
'(- : *)'{-h,--help}'[get help on a specific command]:command:_android_cmds' \
|
||||
'(-s --silent -v --verbose)'{-v,--verbose}'[verbose mode: errors, warnings and informational messages are printed]' \
|
||||
'(-v --verbose -s --silent)'{-s,--silent}'[silent mode: only errors are printed out]' \
|
||||
'1: :_android_cmds' \
|
||||
'*::arg:->args' \
|
||||
&& ret=0
|
||||
|
||||
case "$state" in
|
||||
(args)
|
||||
curcontext="${curcontext%:*:*}:android-cmd-$words[1]:"
|
||||
case $words[1] in
|
||||
(list)
|
||||
_arguments -C \
|
||||
'1: :_android_list_entities' \
|
||||
'*::list-arg:->list-args' \
|
||||
&& ret=0
|
||||
case "$state" in
|
||||
(list-args)
|
||||
case $words[1] in
|
||||
(avd|target)
|
||||
_arguments \
|
||||
'(-0 --null)'{-0,--null}'[terminate lines with \0 instead of \n (e.g. for xargs -0)]' \
|
||||
'(-c --compact)'{-c,--compact}'[compact output (suitable for scripts)]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(sdk)
|
||||
_arguments \
|
||||
'(-o --obsolete)'{-o,--obsolete}'[install obsolete packages]' \
|
||||
'--proxy-host[HTTP/HTTPS proxy host (overrides settings if defined)]:proxy host:_hosts' \
|
||||
'--proxy-port[HTTP/HTTPS proxy port (overrides settings if defined)]:proxy port number' \
|
||||
'(-s --no-https)'{-s,--no-https}'[use HTTP instead of HTTPS (the default) for downloads]' \
|
||||
'(-u --no-ui)'{-u,--no-ui}'[display list result on console (no GUI)]' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(create)
|
||||
_arguments -C \
|
||||
'1: :_android_create_entities' \
|
||||
'*::create-arg:->create-args' \
|
||||
&& ret=0
|
||||
case "$state" in
|
||||
(create-args)
|
||||
case $words[1] in
|
||||
(avd)
|
||||
_arguments \
|
||||
'(-c --sdcard)'{-c,--sdcard}'[path to a shared SD card image, or size of a new sdcard for the new AVD]:SD card image or size:_files -g "*.img"' \
|
||||
'(-n --name)'{-n,--name}'[name of the new AVD]:name' \
|
||||
'(-a --snapshot)'{-a,--snapshot}'[place a snapshots file in the AVD, to enable persistence]' \
|
||||
'(-p --path)'{-p,--path}'[directory where the new AVD will be created]: :_files -/' \
|
||||
'(-f --force)'{-f,--force}'[forces creation (overwrites an existing AVD)]' \
|
||||
'(-s --skin)'{-s,--skin}'[skin for the new AVD]:skin' \
|
||||
'(-t --target)'{-t,--target}'[target ID of the new AVD]: :_android_targets' \
|
||||
&& ret=0
|
||||
;;
|
||||
(project)
|
||||
_arguments \
|
||||
'(-n --name)'{-n,--name}'[project name]:project name' \
|
||||
'(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
|
||||
'(-k --package)'{-k,--package}'[Android package name for the application]:package name' \
|
||||
'(-a --activity)'{-a,--activity}'[name of the default Activity that is created]:activity name' \
|
||||
'(-t --target)'{-t,--target}'[target ID of the new project]: :_android_targets' \
|
||||
&& ret=0
|
||||
;;
|
||||
(test-project)
|
||||
_arguments \
|
||||
'(-n --name)'{-n,--name}'[project name]:project name' \
|
||||
'(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
|
||||
'(-m --main)'{-m,--main}'[path to directory of the app under test, relative to the test project directory]:path' \
|
||||
&& ret=0
|
||||
;;
|
||||
(lib-project)
|
||||
_arguments \
|
||||
'(-n --name)'{-n,--name}'[project name]:project name' \
|
||||
'(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
|
||||
'(-k --package)'{-k,--package}'[Android package name for the application]:package name' \
|
||||
'(-t --target)'{-t,--target}'[target ID of the new project]: :_android_targets' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(update)
|
||||
_arguments -C \
|
||||
'1: :_android_update_entities' \
|
||||
'*::update-arg:->update-args' \
|
||||
&& ret=0
|
||||
case "$state" in
|
||||
(update-args)
|
||||
case $words[1] in
|
||||
(avd)
|
||||
_arguments \
|
||||
'(-n --name)'{-n,--name}'[name of the AVD to update]: :_android_avd_names' \
|
||||
&& ret=0
|
||||
;;
|
||||
(project)
|
||||
_arguments \
|
||||
'(-l --library)'{-l,--library}'[directory of an Android library to add, relative to this project'\''s directory]: :_files -/' \
|
||||
'(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
|
||||
'(-n --name)'{-n,--name}'[project name]:name' \
|
||||
'(-t --target)'{-t,--target}'[target ID to set for the project]: :_android_targets' \
|
||||
'(-s --subprojects)'{-s,--subprojects}'[also updates any projects in sub-folders, such as test projects]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(test-project)
|
||||
_arguments \
|
||||
'(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
|
||||
'(-m --main)'{-m,--main}'[directory of the app under test, relative to the test project directory]:path' \
|
||||
&& ret=0
|
||||
;;
|
||||
(lib-project)
|
||||
_arguments \
|
||||
'(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
|
||||
'(-t --target)'{-t,--target}'[target ID to set for the project]: :_android_targets' \
|
||||
&& ret=0
|
||||
;;
|
||||
(sdk)
|
||||
_arguments \
|
||||
'(-o --obsolete)'{-o,--obsolete}'[install obsolete packages]' \
|
||||
'--proxy-host[HTTP/HTTPS proxy host (overrides settings if defined)]:proxy host:_hosts' \
|
||||
'--proxy-port[HTTP/HTTPS proxy port (overrides settings if defined)]:proxy port number' \
|
||||
'(-s --no-https)'{-s,--no-https}'[use HTTP instead of HTTPS (the default) for downloads]' \
|
||||
'(-u --no-ui)'{-u,--no-ui}'[update from command-line (no GUI)]' \
|
||||
'(-f --force)'{-f,--force}'[force replacement of a package or its parts, even if something has been modified]' \
|
||||
'(-t --filter)'{-t,--filter}'[a filter that limits the update to the specified types of packages]: :_android_sdk_update_filters -s ,' \
|
||||
'(-n --dry-mode)'{-n,--dry-mode}'[simulate the update but does not download or install anything]' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(move)
|
||||
_arguments -C \
|
||||
'1: :_android_move_entities' \
|
||||
'*::move-arg:->move-args' \
|
||||
&& ret=0
|
||||
case "$state" in
|
||||
(move-args)
|
||||
case $words[1] in
|
||||
(avd)
|
||||
_arguments \
|
||||
'(-n --name)'{-n,--name}'[name of the AVD to move or rename]: :_android_avd_names' \
|
||||
'(-p --path)'{-p,--path}'[path to the AVD'\''s new directory]: :_files -/' \
|
||||
'(-r --rename)'{-r,--rename}'[new name of the AVD]:name' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(delete)
|
||||
_arguments -C \
|
||||
'1: :_android_delete_entities' \
|
||||
'*::delete-arg:->delete-args' \
|
||||
&& ret=0
|
||||
case "$state" in
|
||||
(delete-args)
|
||||
case $words[1] in
|
||||
(avd)
|
||||
_arguments \
|
||||
'(-n --name)'{-n,--name}'[name of the AVD to delete]: :_android_avd_names' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
(display)
|
||||
_arguments \
|
||||
'1: :_android_display_entities' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_android_cmds] )) ||
|
||||
_android_cmds() {
|
||||
local commands; commands=(
|
||||
'list:list existing targets or virtual devices'
|
||||
'create:create new virtual devices or projects'
|
||||
'update:update a virtual device, project, SDK or adb'
|
||||
'move:move a virtual device'
|
||||
'delete:delete a virtual device'
|
||||
'avd:displays the AVD Manager window'
|
||||
'sdk:displays the SDK Manager window'
|
||||
'display:display manager windows'
|
||||
)
|
||||
_describe -t commands 'command' commands "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_android_list_entities] )) ||
|
||||
_android_list_entities() {
|
||||
local entities; entities=(
|
||||
'avd:list existing Android Virtual Devices'
|
||||
'target:list existing targets'
|
||||
'sdk:list remote SDK repository'
|
||||
)
|
||||
_describe -t entities 'entity' entities "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_android_create_entities] )) ||
|
||||
_android_create_entities() {
|
||||
local entities; entities=(
|
||||
'avd:create a new Android Virtual Device'
|
||||
'project:create a new Android project'
|
||||
'test-project:create a new Android project for a test package'
|
||||
'lib-project:create a new Android library project'
|
||||
)
|
||||
_describe -t entities 'entity' entities "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_android_update_entities] )) ||
|
||||
_android_update_entities() {
|
||||
local entities; entities=(
|
||||
'avd:update an Android Virtual Device to match the folders of a new SDK'
|
||||
'project:update an Android project'
|
||||
'test-project:update the Android project for a test package'
|
||||
'lib-project:update an Android library project'
|
||||
'adb:update adb to support the USB devices declared in the SDK add-ons'
|
||||
'sdk:update the SDK by suggesting new platforms to install if available'
|
||||
)
|
||||
_describe -t entities 'entity' entities "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_android_move_entities] )) ||
|
||||
_android_move_entities() {
|
||||
local entities; entities=(
|
||||
'avd:move or rename an Android Virtual Device'
|
||||
)
|
||||
_describe -t entities 'entity' commands "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_android_delete_entities] )) ||
|
||||
_android_delete_entities() {
|
||||
local entities; entities=(
|
||||
'avd:delete an Android Virtual Device'
|
||||
)
|
||||
_describe -t entities 'entity' entities "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_android_display_entities] )) ||
|
||||
_android_display_entities() {
|
||||
local entities; entities=(
|
||||
'sdk:display the SDK Manager window'
|
||||
'avd:display the AVD Manager window'
|
||||
)
|
||||
_describe -t entities 'entity' entities "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_android_targets] )) ||
|
||||
_android_targets() {
|
||||
local targets; targets=(${(f)"$(_call_program targets $service list target --compact)"//:/\\:})
|
||||
_describe -t targets 'target' targets "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_android_avd_names] )) ||
|
||||
_android_avd_names() {
|
||||
local avd_names; avd_names=(${(f)"$(_call_program targets $service list avd --compact)"//:/\\:})
|
||||
_describe -t avd-names 'AVD name' avd_names "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_android_sdk_update_filters] )) ||
|
||||
_android_sdk_update_filters() {
|
||||
local filters; filters=(platform tool platform-tool doc sample extra)
|
||||
_values $@ 'filter' "${filters[@]}"
|
||||
}
|
||||
|
||||
_android "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,85 +0,0 @@
|
||||
#compdef archlinux-java
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for archlinux-java a tool for selecting default Java runtime (https://wiki.archlinux.org/index.php/java).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Jindřich Pilař (https://github.com/JindrichPilar)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_archlinux-java_command_arguments() {
|
||||
case $words[1] in
|
||||
(set)
|
||||
local java_versions=("${(@f)$(archlinux-java status | tail -n +2 | tr -s ' ' | cut -d ' ' -f2)}")
|
||||
_describe -t output 'Downloads to delete' java_versions
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_archlinux-java() {
|
||||
local -a commands
|
||||
|
||||
commands=(
|
||||
"status:List installed Java environments and enabled one"
|
||||
"get:Return the short name of the Java environment set as default"
|
||||
"set:Force <JAVA_ENV> as default"
|
||||
"unset:Unset current default Java environment"
|
||||
"fix:Fix an invalid/broken default Java environment configuration"
|
||||
"help:Show help"
|
||||
)
|
||||
|
||||
_arguments -C \
|
||||
'1:cmd:->cmds' \
|
||||
'*:: :->args' \
|
||||
|
||||
case "$state" in
|
||||
(cmds)
|
||||
_describe -t commands 'commands' commands
|
||||
;;
|
||||
(*)
|
||||
_archlinux-java_command_arguments
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_archlinux-java
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,63 +0,0 @@
|
||||
#compdef artisan
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for artisan (http://laravel.com/docs/artisan).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * loranger (https://github.com/loranger)
|
||||
# * Yohan Tambè (https://github.com/Cronos87)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_artisan_get_command_list () {
|
||||
IFS=" "
|
||||
php artisan --no-ansi | \
|
||||
sed "1,/Available commands/d" | \
|
||||
awk '/ [a-z]+/ { print $1 }' | \
|
||||
sed -E 's/^[ ]+//g' | \
|
||||
sed -E 's/[:]+/\\:/g' | \
|
||||
sed -E 's/[ ]{2,}/\:/g'
|
||||
}
|
||||
|
||||
_artisan () {
|
||||
if [ -f artisan ]; then
|
||||
local -a commands
|
||||
IFS=$'\n'
|
||||
commands=(`_artisan_get_command_list`)
|
||||
_describe 'commands' commands
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _artisan php artisan
|
||||
compdef _artisan artisan
|
@ -1,71 +0,0 @@
|
||||
#compdef atach
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for atach (https://github.com/sorin-ionescu/atach).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local state mode_values existing_sessions ret=1
|
||||
|
||||
mode_values=(
|
||||
"none:disable redrawing"
|
||||
"ctrl_l:use ctrl + l to redraw"
|
||||
"winch:use sigwinch to redraw"
|
||||
)
|
||||
|
||||
existing_sessions=($(_call_program session atach))
|
||||
|
||||
_arguments -C -s -S \
|
||||
'(--list -l)'{--list,-l}'[list sessions]' \
|
||||
'(--sockets -L)'{--sockets,-L}'[list sockets]' \
|
||||
'(--session -s)'{--session=,-s+}'[set the session name]:session' \
|
||||
'(--char -c)'{--char=,-c+}'[set the detach character (default: ^\\)]:char' \
|
||||
'(--redraw -r)'{--redraw=,-r+}'[set the redraw method (none, ctrl_l, or winch)]:mode:->mode' \
|
||||
'(--detached -d)'{--detached,-d}'[start the session detached]' \
|
||||
'(--no-detach -D)'{--no-detach,-D}'[disable detaching]' \
|
||||
'(--no-suspend -Z)'{--no-suspend,-Z}'[disable suspending]' \
|
||||
'(--version -v)'{--version,-v}'[display version and copyright]' \
|
||||
'(--help -h)'{--help,-h}'[display help]' \
|
||||
'(-)::args:->session-or-command' && ret=0
|
||||
|
||||
case "$state" in
|
||||
(mode)
|
||||
_describe -t mode 'redraw mode' mode_values && ret=0
|
||||
;;
|
||||
(session-or-command)
|
||||
_describe -t 'session' 'sessions' existing_sessions && ret=0
|
||||
_path_commands && ret=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return $ret
|
||||
|
@ -1,211 +0,0 @@
|
||||
#compdef bitcoin-cli
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for bitcoin-cli (https://bitcoin.org).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Ian Ker-Seymer (https://github.com/ianks)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_bitcoin-cli() {
|
||||
local context state line curcontext="$curcontext"
|
||||
|
||||
_arguments -C \
|
||||
-?'[This help message]' \
|
||||
-conf='[Specify configuration file. 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, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.]' \
|
||||
-named'[Pass named instead of positional arguments (default: false)]' \
|
||||
-stdin'[Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases)]' \
|
||||
-rpcport='[Connect to JSON-RPC on <port> (default: 8332, testnet: 18332, regtest: 18443)]: :_guard "[[\:digit\:]]#" "PORT"' \
|
||||
-rpcwait'[Wait for RPC server to start]' \
|
||||
-rpcuser='[Username for JSON-RPC connections]:RPCUSER:()' \
|
||||
-rpcpassword='[Password for JSON-RPC connections]:RPCPASSWORD:()' \
|
||||
-rpcconnect='[Send commands to node running on <ip> (default: 127.0.0.1)]:RPCCONNECT:_hosts' \
|
||||
-rpcclienttimeout='[Timeout during HTTP requests, or 0 for no timeout. (default: 900)]: :_guard "[[\:digit\:]]#" "RPCCLIENTTIMEOUT"' \
|
||||
':subcommand:->subcommand' && ret=0
|
||||
|
||||
case $state in
|
||||
subcommand)
|
||||
subcommands=(
|
||||
'getbestblockhash'
|
||||
'getblock'
|
||||
'getblockchaininfo'
|
||||
'getblockcount'
|
||||
'getblockfilter'
|
||||
'getblockhash'
|
||||
'getblockheader'
|
||||
'getblockstats'
|
||||
'getchaintips'
|
||||
'getchaintxstats'
|
||||
'getdifficulty'
|
||||
'getmempoolancestors'
|
||||
'getmempooldescendants'
|
||||
'getmempoolentry'
|
||||
'getmempoolinfo'
|
||||
'getrawmempool'
|
||||
'gettxout'
|
||||
'gettxoutproof'
|
||||
'gettxoutsetinfo'
|
||||
'preciousblock'
|
||||
'pruneblockchain'
|
||||
'savemempool'
|
||||
'scantxoutset'
|
||||
'verifychain'
|
||||
'verifytxoutproof'
|
||||
'getmemoryinfo'
|
||||
'getrpcinfo'
|
||||
'help'
|
||||
'logging'
|
||||
'stop'
|
||||
'uptime'
|
||||
'generatetoaddress'
|
||||
'getblocktemplate'
|
||||
'getmininginfo'
|
||||
'getnetworkhashps'
|
||||
'prioritisetransaction'
|
||||
'submitblock'
|
||||
'submitheader'
|
||||
'addnode'
|
||||
'clearbanned'
|
||||
'disconnectnode'
|
||||
'getaddednodeinfo'
|
||||
'getconnectioncount'
|
||||
'getnettotals'
|
||||
'getnetworkinfo'
|
||||
'getnodeaddresses'
|
||||
'getpeerinfo'
|
||||
'listbanned'
|
||||
'ping'
|
||||
'setban'
|
||||
'setnetworkactive'
|
||||
'analyzepsbt'
|
||||
'combinepsbt'
|
||||
'combinerawtransaction'
|
||||
'converttopsbt'
|
||||
'createpsbt'
|
||||
'createrawtransaction'
|
||||
'decodepsbt'
|
||||
'decoderawtransaction'
|
||||
'decodescript'
|
||||
'finalizepsbt'
|
||||
'fundrawtransaction'
|
||||
'getrawtransaction'
|
||||
'joinpsbts'
|
||||
'sendrawtransaction'
|
||||
'signrawtransactionwithkey'
|
||||
'testmempoolaccept'
|
||||
'utxoupdatepsbt'
|
||||
'createmultisig'
|
||||
'deriveaddresses'
|
||||
'estimatesmartfee'
|
||||
'getdescriptorinfo'
|
||||
'signmessagewithprivkey'
|
||||
'validateaddress'
|
||||
'verifymessage'
|
||||
'abandontransaction'
|
||||
'abortrescan'
|
||||
'addmultisigaddress'
|
||||
'backupwallet'
|
||||
'bumpfee'
|
||||
'createwallet'
|
||||
'dumpprivkey'
|
||||
'dumpwallet'
|
||||
'encryptwallet'
|
||||
'getaddressesbylabel'
|
||||
'getaddressinfo'
|
||||
'getbalance'
|
||||
'getbalances'
|
||||
'getnewaddress'
|
||||
'getrawchangeaddress'
|
||||
'getreceivedbyaddress'
|
||||
'getreceivedbylabel'
|
||||
'gettransaction'
|
||||
'getunconfirmedbalance'
|
||||
'getwalletinfo'
|
||||
'importaddress'
|
||||
'importmulti'
|
||||
'importprivkey'
|
||||
'importprunedfunds'
|
||||
'importpubkey'
|
||||
'importwallet'
|
||||
'keypoolrefill'
|
||||
'listaddressgroupings'
|
||||
'listlabels'
|
||||
'listlockunspent'
|
||||
'listreceivedbyaddress'
|
||||
'listreceivedbylabel'
|
||||
'listsinceblock'
|
||||
'listtransactions'
|
||||
'listunspent'
|
||||
'listwalletdir'
|
||||
'listwallets'
|
||||
'loadwallet'
|
||||
'lockunspent'
|
||||
'removeprunedfunds'
|
||||
'rescanblockchain'
|
||||
'sendmany'
|
||||
'sendtoaddress'
|
||||
'sethdseed'
|
||||
'setlabel'
|
||||
'settxfee'
|
||||
'setwalletflag'
|
||||
'signmessage'
|
||||
'signrawtransactionwithwallet'
|
||||
'unloadwallet'
|
||||
'walletcreatefundedpsbt'
|
||||
'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
|
@ -1,163 +0,0 @@
|
||||
#compdef bower
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Bower (http://bower.io).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Joe Lencioni (https://github.com/lencioni)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local curcontext="$curcontext" state line _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
|
@ -1,134 +0,0 @@
|
||||
#compdef bundle
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Bundler (http://gembundler.com).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Bruno Michel (https://github.com/nono)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local curcontext="$curcontext" state line _gems _opts ret=1
|
||||
|
||||
_arguments -C -A "-v" -A "--version" \
|
||||
'(- 1 *)'{-v,--version}'[display version information]' \
|
||||
'1: :->cmds' \
|
||||
'*:: :->args' && ret=0
|
||||
|
||||
case $state in
|
||||
cmds)
|
||||
_values "bundle command" \
|
||||
"install[Install the gems specified by the Gemfile or Gemfile.lock]" \
|
||||
"update[Update dependencies to their latest versions]" \
|
||||
"package[Package the .gem files required by your application]" \
|
||||
"exec[Execute a script in the context of the current bundle]" \
|
||||
"config[Specify and read configuration options for bundler]" \
|
||||
"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]" \
|
||||
"list[Show all of the gems in the current bundle]" \
|
||||
"show[Show the source location of a particular gem in the bundle]" \
|
||||
"console[Start an IRB session in the context of the current bundle]" \
|
||||
"open[Open an installed gem in the editor]" \
|
||||
"viz[Generate a visual representation of your dependencies]" \
|
||||
"init[Generate a simple Gemfile, placed in the current directory]" \
|
||||
"gem[Create a simple gem, suitable for development with bundler]" \
|
||||
"help[Describe available tasks or one specific task]" \
|
||||
"platform[Displays platform compatibility information]" \
|
||||
"clean[Clean up unused gems in your Bundler directory]" \
|
||||
"doctor[Display warnings about common problems]" \
|
||||
"remove[Removes gems from the Gemfile]" \
|
||||
"outdated[Show all of the outdated gems in the current bundle]"
|
||||
ret=0
|
||||
;;
|
||||
args)
|
||||
case $line[1] in
|
||||
help)
|
||||
_values 'commands' 'install' 'update' 'package' 'exec' 'config' 'add' 'binstubs' 'check' 'list' 'show' 'console' 'open' 'viz' 'init' 'gem' 'help' 'platform' 'clean' 'doctor' 'remove' 'outdated' && ret=0
|
||||
;;
|
||||
install)
|
||||
_policies=('HighSecurity' 'MediumSecurity' 'LowSecurity' 'AlmostNoSecurity' 'NoSecurity')
|
||||
_arguments \
|
||||
'(--no-color)--no-color[disable colorization in output]' \
|
||||
'(--local)--local[do not attempt to connect to rubygems.org]' \
|
||||
'(--quiet)--quiet[only output warnings and errors]' \
|
||||
'(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
|
||||
'(--system)--system[install to the system location]' \
|
||||
'(--deployment)--deployment[install using defaults tuned for deployment environments]' \
|
||||
'(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
|
||||
'(--path)--path=-[specify a different path than the system default]:path:_files' \
|
||||
'(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
|
||||
'(--without)--without=-[exclude gems that are part of the specified named group]:groups' \
|
||||
'(--with)--with=-[include gems that are part of the specified named group]:groups' \
|
||||
'(--clean)--clean[remove any gems not present in the current Gemfile]' \
|
||||
'(--full-index)--full-index[download and cache the index file of all gems]' \
|
||||
'(--jobs)--jobs=-[install gems parallelly]:number' \
|
||||
'(--force)--force[force download every gem]' \
|
||||
'(--no-cache)--no-cache[do not update the cache in vendor/cache with newly installed gems]' \
|
||||
'(--no-prune)--no-prune[do not remove stale gem from cache after installation]' \
|
||||
'(--retry)--retry=-[number of times to retry failed network or git requests]:number' \
|
||||
'(--sheband)--shebang=-[specify ruby executable to execute scripts]:ruby' \
|
||||
'(--standalone)--standalone=-[create standalone bundles]:groups' \
|
||||
"(--trust-policy)--trust-policy=-[apply the Rubygems security policy]:arg:($_policies)"
|
||||
ret=0
|
||||
;;
|
||||
exec)
|
||||
_normal && ret=0
|
||||
;;
|
||||
(open|show)
|
||||
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
|
||||
if [[ $_gems != "" ]]; then
|
||||
_values 'gems' $_gems && ret=0
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
_opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
|
||||
_opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
|
||||
if [[ $_opts != "" ]]; then
|
||||
_values 'options' $_opts && ret=0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,50 +0,0 @@
|
||||
#compdef caffeinate
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for the macOS 'caffeinate' tool (man 8 caffeinate).
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Nicolas Despres <nicolas.despres@gmail.com> (initial version)
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
_arguments -s \
|
||||
'-d[prevent the display from sleeping]' \
|
||||
'-i[prevent the system from idle sleeping]' \
|
||||
'-m[prevent the disk from idle sleeping]' \
|
||||
'-s[prevent the system from sleeping but only when running on AC power]' \
|
||||
'-u[declare that user is active]' \
|
||||
'-t+[assertion timeout value]:delay in seconds' \
|
||||
'-w+[waits for process to exit]:pid:_pids' \
|
||||
'(-):command: _command_names -e' \
|
||||
'*::args: _normal'
|
@ -1,81 +0,0 @@
|
||||
#compdef cap
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Capistrano (http://capify.org).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Bruno Michel (https://github.com/nono)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local curcontext="$curcontext" state line cmds ret=1
|
||||
|
||||
_arguments -C \
|
||||
{-d,--debug}'[Prompts before each remote command execution]' \
|
||||
{-e,--explain}'[Displays help (if available) for the task]:task' \
|
||||
{-F,--default-config}'[Always use default config, even with -f]' \
|
||||
{-f,--file}'[A recipe file to load. May be given more than once]:file:_files' \
|
||||
{-H,--long-help}'[Explain these options and environment variables]' \
|
||||
{-h,--help}'[Display this help message]' \
|
||||
{-l,--logger}'[Choose logger method. STDERR used by default]:file:_files' \
|
||||
{-n,--dry-run}'[Prints out commands without running them]' \
|
||||
{-p,--password}'[Immediately prompt for the password]' \
|
||||
{-q,--quiet}'[Make the output as quiet as possible]' \
|
||||
{-r,--preserve-roles}'[Preserve task roles]' \
|
||||
{-S,--set-before}'[Set a variable before the recipes are loaded]:variable' \
|
||||
{-s,--set}'[Set a variable after the recipes are loaded]:variable' \
|
||||
{-T,--tasks}'[List all tasks (matching optional PATTERN) in the loaded recipe files]:pattern' \
|
||||
{-t,--tool}'[Abbreviates the output of -T for tool integration]' \
|
||||
{-V,--version}'[Display the Capistrano version, and exit]' \
|
||||
{-v,--verbose}'[Be more verbose. May be given more than once]' \
|
||||
{-X,--skip-system-config}'[Do not load the system config file (capistrano.conf)]' \
|
||||
{-x,--skip-user-config}'[Do not load the user config file (.caprc)]' \
|
||||
'*: :->cmds' && ret=0
|
||||
|
||||
case $state in
|
||||
cmds)
|
||||
cmds=( ${(f)"$(_call_program commands cap -T 2> /dev/null | sed -e '/ # /!d; s/:/\\:/g; s/cap \([A-Za-z0-9\\:_-]*\) .*# /\1:/')"} )
|
||||
_describe -t commands 'cap command' cmds && ret=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,89 +0,0 @@
|
||||
#compdef cask
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for cask (http://cask.readthedocs.org)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * ptrv <mail@petervasil.net>
|
||||
# * Johan Andersson <johan.rejeep@gmail.com>
|
||||
# * Sebastien Duthil <duthils@free.fr>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
function _cask() {
|
||||
local ret=1 state
|
||||
_arguments \
|
||||
':subcommand:->subcommand' \
|
||||
'*:: :->subcmds' && ret=0
|
||||
|
||||
case $state in
|
||||
subcommand)
|
||||
subcommands=(
|
||||
"build:build all Elisp files in the files directive"
|
||||
"clean-elc:remove all byte compiled Elisp files in the files directive"
|
||||
"exec:execute command with correct 'exec-path' and 'load-path'"
|
||||
"exec-path:print 'exec-path' for all packages and dependencies"
|
||||
"files:print list of files specified in the files directive"
|
||||
"help:display usage information or documentation for specified command"
|
||||
"info:show info about the current package"
|
||||
"init:initialize the current directory with a Cask-file"
|
||||
"install:install all packages specified in the Cask-file"
|
||||
"link:manage links"
|
||||
"list:list dependencies"
|
||||
"load-path:print 'load-path' for all packages and dependencies"
|
||||
"outdated:print list of outdated packages"
|
||||
"package:build package and put in specified directory (default: dist)"
|
||||
"package-directory:print current package installation directory"
|
||||
"path:print 'exec-path' for all packages and dependencies"
|
||||
"pkg-file:write a 'define-package' file"
|
||||
"update:update package version"
|
||||
"upgrade-cask:upgrade Cask itself and its dependencies"
|
||||
"upgrade:upgrade Cask itself and its dependencies"
|
||||
"version:print program version"
|
||||
)
|
||||
_describe -t subcommands 'cask subcommands' subcommands && ret=0
|
||||
esac
|
||||
|
||||
case "$words[1]" in
|
||||
init)
|
||||
_arguments \
|
||||
'(--dev)--dev[Run in dev mode]' && ret=0 ;;
|
||||
exec)
|
||||
_generic
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
_cask "$@"
|
@ -1,325 +0,0 @@
|
||||
#compdef ccache -P -value-,CCACHE_*,-default-
|
||||
|
||||
# zsh completion script for ccache
|
||||
|
||||
# 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; description=${1:-boolean}
|
||||
local booleans; booleans=(
|
||||
'true'
|
||||
'yes'
|
||||
)
|
||||
_describe -t booeans "$description" booleans
|
||||
}
|
||||
|
||||
(( $+functions[_ccache_compressionlevels] )) ||
|
||||
_ccache_compressionlevels() {
|
||||
local -a one_nine
|
||||
one_nine=(1 2 3 4 5 6 7 8 9)
|
||||
_describe -t onetonine "compression level (if using compression)" one_nine
|
||||
}
|
||||
|
||||
(( $+functions[_ccache_sloppiness] )) ||
|
||||
_ccache_sloppiness() {
|
||||
_values -s ',' \
|
||||
"file_macro[ignore __FILE__]" \
|
||||
"file_stat_matches[rely on mtimes and ctimes]" \
|
||||
"include_file_ctime[ignore headers' ctime too new]" \
|
||||
"include_file_mtime[ignore headers' mtime too new]" \
|
||||
"no_system_headers[exclude system headers from cache]" \
|
||||
"pch_defines[be sloppy about #defines in pch]" \
|
||||
"time_macros[ignore __date__ and __time__]"
|
||||
}
|
||||
|
||||
(( $+functions[_ccache_compilerchecks] )) ||
|
||||
_ccache_compilerchecks() {
|
||||
local -a compiler_check_values
|
||||
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_dirlevels] )) ||
|
||||
_ccache_dirlevels() {
|
||||
local -a one_eight
|
||||
one_eight=(1 2 3 4 5 6 7 8)
|
||||
_describe -t onetoeight "directory levels in the cache directory" one_eight
|
||||
}
|
||||
|
||||
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_NLEVELS*)
|
||||
_ccache_dirlevels
|
||||
;;
|
||||
*CCACHE_CC*)
|
||||
_ccache_compilers
|
||||
;;
|
||||
*CCACHE_COMPILERCHECK*)
|
||||
_ccache_compilerchecks
|
||||
;;
|
||||
*CCACHE_*COMPRESS*)
|
||||
_ccache_booleans "write compressed cache"
|
||||
;;
|
||||
*CCACHE_COMPRESSLEVEL*)
|
||||
_ccache_compressionlevels
|
||||
;;
|
||||
*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 "normalise sources prior to processing"
|
||||
;;
|
||||
esac
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
__ccache_config_keys() {
|
||||
local -a keys
|
||||
keys=(
|
||||
'compression:write compressed cache'
|
||||
'direct_mode:use direct mode'
|
||||
'disable:disable cache usage'
|
||||
'hard_link:create hard links rather than copies'
|
||||
'hash_dir:include the cwd in the hash'
|
||||
'keep_comments_cpp:consider comments in hashing'
|
||||
'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'
|
||||
'run_second_cpp:pass original rather than preprocessed source code to compiler'
|
||||
'stats:update statistics counters'
|
||||
'unify:normalise sources prior to processing'
|
||||
'base_dir:specify relative to which top level paths are hashed'
|
||||
'temporary_dir:specify where temporary files are kept'
|
||||
'cache_dir:specify where the cache is kept'
|
||||
'compiler:specify compiler'
|
||||
'cache_dir_levels:directory levels in the cache directory'
|
||||
'compiler_check:compiler information included in the hash'
|
||||
'compression_level:cache compression level'
|
||||
'cpp_extension:set extensions for intermediate files'
|
||||
'extra_files_to_hash:additional files to consider in hashing'
|
||||
'ignore_headers_in_manifest:set paths to headers to ignore in hashing'
|
||||
'limit_multiple:cleanup level'
|
||||
'log_file:specify a log file'
|
||||
'max_files:maximum number of files in the cache'
|
||||
'max_size:maximum size of the cache'
|
||||
'path:PATH for compiler lookup (instead of $PATH)'
|
||||
'prefix_command:prefixes for compiler invocation'
|
||||
'prefix_command_cpp:prefixes for preprocessor invocation'
|
||||
'sloppiness:hash files sloppy'
|
||||
'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
|
||||
*=compression= | *=direct_mode= | *=disable= | *=hard_link= | *=hash_dir= | *=keep_comments_cpp= | *=read_only= | *=read_only_direct= | *=recache= | *=run_second_cpp= | *=stats= | *=unify= )
|
||||
local booleans; booleans=(
|
||||
'true'
|
||||
'false'
|
||||
)
|
||||
_describe -t booleans 'boolean' booleans
|
||||
;;
|
||||
*=base_dir= | *=temporary_dir= | *=cache_dir=)
|
||||
_path_files -/
|
||||
;;
|
||||
*=compiler=)
|
||||
_ccache_compilers
|
||||
;;
|
||||
*=cache_dir_levels=)
|
||||
_ccache_dirlevels
|
||||
;;
|
||||
*=compiler_check=)
|
||||
_ccache_compilerchecks
|
||||
;;
|
||||
*=compression_level=)
|
||||
_ccache_compressionlevels
|
||||
;;
|
||||
*=cpp_extension=)
|
||||
_alternative ':set extension for intermediate files: '
|
||||
;;
|
||||
*=extra_files_to_hash=)
|
||||
local sep=:
|
||||
compset -P "*${sep}"
|
||||
compset -S "${sep}*" || suf="$sep"
|
||||
|
||||
_files "" -r "${sep}"' /\t\t\-' "$@"
|
||||
;;
|
||||
*=ignore_headers_in_manifest=)
|
||||
_dir_list
|
||||
;;
|
||||
*=limit_multiple=)
|
||||
_alternative ":clean up down to level (e.g. 0.8): "
|
||||
;;
|
||||
*=log_file=)
|
||||
_path_files -g "*(/) *.log"
|
||||
;;
|
||||
*=max_files=)
|
||||
_alternative ":maximum number of files in the cache (0= no limit): "
|
||||
;;
|
||||
*=max_size=)
|
||||
_alternative ':maximum cache size (0= no limit) with suffix k,M,G,T or Ki,Mi,Gi,Ti: '
|
||||
;;
|
||||
*=path=)
|
||||
_alternative ':PATH for compiler lookup (instead of $PATH):_dir_list'
|
||||
;;
|
||||
*=prefix_command=)
|
||||
_alternative ':prefixes for compiler invocation: '
|
||||
;;
|
||||
*=prefix_command_cpp=)
|
||||
_alternative ':prefixes for preprocessor invocation: '
|
||||
;;
|
||||
*=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]' \
|
||||
'(-z --zero-stats)'{-z,--zero-stats}'[zero statistics counters]' \
|
||||
'(-c --cleanup)'{-c,--cleanup}'[delete old files and recalculate size counters]' \
|
||||
'(-C --clear)'{-C,--clear}'[clear the cache completely (except configuration)]' \
|
||||
'(-p --show-config)'{-p,--show-config}'[show current configuration options]' \
|
||||
'(-s --show-stats)'{-s,--show-stats}'[show statistics summary]' \
|
||||
'(-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: '
|
||||
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
|
@ -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
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
#
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Cloud Foundry CLI (https://github.com/cloudfoundry/cli#downloads)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
#
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Ferran Rodenas (https://github.com/frodenas)
|
||||
# * Danny Rosen (https://github.com/dannyzen)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# ----------------------
|
||||
# ----- Helper functions
|
||||
# ----------------------
|
||||
|
||||
# Output a selectable list of organizations
|
||||
__cf_orgs() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf orgs | awk 'NR>3{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'ORG' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of spaces
|
||||
__cf_spaces() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf spaces | awk 'NR>3{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'SPACE' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of applications
|
||||
__cf_apps() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf apps | awk 'NR>4{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'APP' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of stacks
|
||||
__cf_stacks() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf stacks | awk 'NR>4{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'STACK' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of services
|
||||
__cf_marketplace_services() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf marketplace | awk 'NR>4{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'SERVICE' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of services
|
||||
__cf_services() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf services | awk 'NR>4{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'SERVICE' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of domains
|
||||
__cf_domains() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf domains | grep -v shared | awk 'NR>2{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'DOMAIN' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of shared domains
|
||||
__cf_shared_domains() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf domains | grep -v owned | awk 'NR>2{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'SHARED-DOMAIN' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of hostnames
|
||||
__cf_hostnames() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf routes | awk 'NR>3{print $2}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'ROUTE' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of buildpacks
|
||||
__cf_buildpacks() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf buildpacks | awk 'NR>3{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'BUILDPACK' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of feature flags
|
||||
__cf_feature_flags() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf feature-flags | awk 'NR>4{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'FEATURE-FLAG' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of plugin repos
|
||||
__cf_repo_plugins() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(CF_COLOR=false CF_TRACE=false cf list-plugin-repos | awk 'NR>3{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'REPO-PLUGIN' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of plugins
|
||||
__cf_plugins() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(cf plugins | awk 'NR>4{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'PLUGIN' cont_cmd
|
||||
}
|
||||
|
||||
# Output a selectable list of targets (requires cf-targets plugin)
|
||||
__cf_targets() {
|
||||
declare -a cont_cmd
|
||||
cont_cmd=($(cf targets | awk '{print $1}'))
|
||||
if [[ 'X$cont_cmd' != 'X' ]]
|
||||
_describe 'TARGET' cont_cmd
|
||||
}
|
||||
|
||||
|
||||
# --------------------------
|
||||
# ----- end Helper functions
|
||||
# --------------------------
|
||||
|
||||
# --------------
|
||||
# ----- Commands
|
||||
# --------------
|
||||
|
||||
__login() {
|
||||
_arguments \
|
||||
'-a=[API endpoint (e.g. https://api.example.com)]:api endpoint:' \
|
||||
'-u=[Username]:username:' \
|
||||
'-p=[Password]:password:' \
|
||||
'-o=[Organization]:organization name:__cf_orgs' \
|
||||
'-s=[Space]:space name:__cf_spaces' \
|
||||
'--sso[Use a one-time password to login]' \
|
||||
'--skip-ssl-validation[Skip SSL validation]'
|
||||
}
|
||||
|
||||
__logout() {
|
||||
# no arguments
|
||||
}
|
||||
|
||||
__passwd() {
|
||||
_arguments \
|
||||
'1:password:'
|
||||
}
|
||||
|
||||
__target() {
|
||||
_arguments \
|
||||
'-o=[Organization]:organization name:__cf_orgs' \
|
||||
'-s=[Space]:space name:__cf_spaces'
|
||||
}
|
||||
|
||||
__api() {
|
||||
_arguments \
|
||||
'1:API url:' \
|
||||
'--unset[Remove all api endpoint targeting]' \
|
||||
'--skip-ssl-validation[Skip SSL validation]'
|
||||
}
|
||||
|
||||
__auth() {
|
||||
# no arguments
|
||||
}
|
||||
|
||||
__apps() {
|
||||
# no arguments
|
||||
}
|
||||
|
||||
__app() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'--guid[Retrieve and display the given app guid. All other health and status output for the app is suppressed]'
|
||||
}
|
||||
|
||||
__push() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'-b=[Custom buildpack by name (e.g. my-buildpack) or GIT URL or GIT BRANCH URL]:buildpack name:__cf_buildpacks' \
|
||||
'-c=[Startup command, set to null to reset to default start command]:startup command:' \
|
||||
'-d=[Domain (e.g. example.com)]:domain (e.g. example.com):__cf_domains' \
|
||||
'-f=[Path to manifest]:file:_files:' \
|
||||
'-i=[Number of instances]:number of instances:' \
|
||||
'-k=[Disk limit (e.g. 256M, 1024M, 1G)]:disk limit (e.g. 256M, 1024M, 1G):' \
|
||||
'-m=[Memory limit (e.g. 256M, 1024M, 1G)]:memory limit (e.g. 256M, 1024M, 1G):' \
|
||||
'-n=[Hostname (e.g. my-subdomain)]:hostname (e.g. my-subdomain):' \
|
||||
'-p=[Path to app directory or to a zip file of the contents of the app directory]:file:_files' \
|
||||
'-s=[Stack to use (a stack is a pre-built file system, including an operating system, that can run apps)]:stack name:__cf_stacks:' \
|
||||
'-t=[Maximum time (in seconds) for CLI to wait for application start, other server side timeouts may apply]:maximum time (in seconds):' \
|
||||
'--no-hostname[Map the root domain to this app]' \
|
||||
'--no-manifest[Ignore manifest file]' \
|
||||
'--no-route[Do not map a route to this app and remove routes from previous pushes of this app]' \
|
||||
'--no-start[Do not start an app after pushing]' \
|
||||
'--random-route[Create a random route for this app]'
|
||||
}
|
||||
|
||||
__scale() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'-i=[Number of instances]:number of instances:' \
|
||||
'-k=[Disk limit (e.g. 256M, 1024M, 1G)]:disk limit (e.g. 256M, 1024M, 1G):' \
|
||||
'-m=[Memory limit (e.g. 256M, 1024M, 1G)]:memory limit (e.g. 256M, 1024M, 1G):' \
|
||||
'-f[Force restart of app without prompt]'
|
||||
}
|
||||
|
||||
__delete() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'--f[Force deletion without confirmation]' \
|
||||
'--r[Also delete any mapped routes]'
|
||||
}
|
||||
|
||||
__rename() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'2:application name:'
|
||||
}
|
||||
|
||||
__start() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps'
|
||||
}
|
||||
|
||||
__stop() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps'
|
||||
}
|
||||
|
||||
__restart() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps'
|
||||
}
|
||||
|
||||
__restage() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps'
|
||||
}
|
||||
|
||||
__restart-app-instance() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'2:application index:'
|
||||
}
|
||||
|
||||
__events() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps'
|
||||
}
|
||||
|
||||
__files() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'2::path:' \
|
||||
'-i=[instance]'
|
||||
}
|
||||
|
||||
__logs() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'--recent[Dump recent logs instead of tailing]'
|
||||
}
|
||||
|
||||
__env() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps'
|
||||
}
|
||||
|
||||
__set-env() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'2:env var name:' \
|
||||
'3:env var value:'
|
||||
}
|
||||
|
||||
__unset-env() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'2:env var name:'
|
||||
}
|
||||
|
||||
__stacks() {
|
||||
# no arguments
|
||||
}
|
||||
|
||||
__stack() {
|
||||
_arguments \
|
||||
'1:stack name:__cf_stacks' \
|
||||
'--guid[Retrieve and display the given stack guid. All other output for the stack is suppressed]'
|
||||
}
|
||||
|
||||
__copy-source() {
|
||||
_arguments \
|
||||
'1:source application name:__cf_apps' \
|
||||
'2:target application name:' \
|
||||
'-o=[Org that contains the target application]:organization name:__cf_orgs' \
|
||||
'-s=[Space that contains the target application]:space name:__cf_spaces' \
|
||||
'--no-restart[Override restart of the application in target environment after copy-source completes]'
|
||||
}
|
||||
|
||||
__create-app-manifest() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'-p=[Specify a path for file creation. If path not specified, manifest file is created in current working directory]:path:_files'
|
||||
}
|
||||
|
||||
__marketplace() {
|
||||
_arguments \
|
||||
'-s=[Show plan details for a particular service offering]'
|
||||
}
|
||||
|
||||
__services() {
|
||||
# no arguments
|
||||
}
|
||||
|
||||
__service() {
|
||||
_arguments \
|
||||
'1:service name:__cf_services' \
|
||||
'--guid[Retrieve and display the given service guid. All other output for the service is suppressed]'
|
||||
}
|
||||
|
||||
__create-service() {
|
||||
_arguments \
|
||||
'1:service:__cf_marketplace_services' \
|
||||
'2:plan:' \
|
||||
'3:service name:' \
|
||||
'-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]' \
|
||||
'-t=[User provided tags]'
|
||||
}
|
||||
|
||||
__update-service() {
|
||||
_arguments \
|
||||
'1:service name:__cf_services' \
|
||||
'-p=[Change service plan for a service instance]' \
|
||||
'-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]' \
|
||||
'-t=[User provided tags]'
|
||||
}
|
||||
|
||||
__rename-service() {
|
||||
_arguments \
|
||||
'1:service name:__cf_services' \
|
||||
'2:service name:'
|
||||
}
|
||||
|
||||
__delete-service() {
|
||||
_arguments \
|
||||
'1:service name:__cf_services' \
|
||||
'-f[Force deletion without confirmation]'
|
||||
}
|
||||
|
||||
__create-service-key() {
|
||||
_arguments \
|
||||
'1:service name:__cf_services' \
|
||||
'2:service key:' \
|
||||
'-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]'
|
||||
}
|
||||
|
||||
__service-keys() {
|
||||
_arguments \
|
||||
'1:service name:__cf_services'
|
||||
}
|
||||
|
||||
__service-key() {
|
||||
_arguments \
|
||||
'1:service name:__cf_services' \
|
||||
'2:service key:'
|
||||
}
|
||||
|
||||
__delete-service-key() {
|
||||
_arguments \
|
||||
'1:service name:__cf_services' \
|
||||
'2:service key:' \
|
||||
'-f[Force deletion without confirmation]'
|
||||
}
|
||||
|
||||
__bind-service() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'2:service name:__cf_services' \
|
||||
'-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]'
|
||||
}
|
||||
|
||||
__unbind-service() {
|
||||
_arguments \
|
||||
'1:application name:__cf_apps' \
|
||||
'2:service name:__cf_services'
|
||||
}
|
||||
|
||||
__create-user-provided-service() {
|
||||
_arguments \
|
||||
'1:service name:' \
|
||||
'-p=[Credentials]' \
|
||||
'-l=[Syslog Drain Url]'
|
||||
}
|
||||
|
||||
__update-user-provided-service() {
|
||||
_arguments \
|
||||
'1:service name:__cf_services' \
|
||||
'-p=[Credentials]' \
|
||||
'-l=[Syslog Drain Url]'
|
||||
}
|
||||
|
||||
__orgs() {
|
||||
# no arguments
|
||||
}
|
||||
|
||||
__org() {
|
||||
_arguments \
|
||||
'1:organization name:__cf_orgs' \
|
||||
'--guid[Retrieve and display the given org guid. All other output for the org is suppressed]'
|
||||
}
|
||||
|
||||
__create-org() {
|
||||
_arguments \
|
||||
'1:organization name:' \
|
||||
'-q=[Quota to assign to the newly created org (excluding this option results in assignment of default quota)]'
|
||||
}
|
||||
|
||||
__delete-org() {
|
||||
_arguments \
|
||||
'1:organization name:__cf_orgs' \
|
||||
'-f[Force deletion without confirmation]'
|
||||
}
|
||||
|
||||
__spaces() {
|
||||
# no arguments
|
||||
}
|
||||
|
||||
__space() {
|
||||
_arguments \
|
||||
'1:space name:__cf_spaces' \
|
||||
'--guid[Retrieve and display the given space guid. All other output for the space is suppressed]' \
|
||||
'--security-group-rules[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
|
@ -1,60 +0,0 @@
|
||||
#compdef choc
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for choc (http://chocolatapp.com)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Nicholas Penree (https://github.com/drudge)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local curcontext="$curcontext" state line ret=1
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
'(-a --async)'{-a,--async}'[do not wait for the user to close the file in Chocolat]' \
|
||||
'(-w --wait)'{-w,--wait}'[wait for file to be closed by Chocolat]' \
|
||||
'(-n --no-reactivation)'{-n,--no-reactivation}'[after editing with -w, do not reactivate the calling app]' \
|
||||
'(-h --help)'{-h,--help}'[show help information]' \
|
||||
'(-v --version)'{-v,--version}'[print version information]' \
|
||||
'*:script or directory:_files' && ret=0
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -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
|
||||
}
|
@ -1,598 +0,0 @@
|
||||
#compdef cmake -value-,CMAKE_GENERATOR,-default-
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for CMake (http://www.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 cmake_build_options;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'
|
||||
|
||||
# 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]'
|
||||
|
||||
'-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]"'
|
||||
|
||||
'--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'
|
||||
|
||||
'--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]'
|
||||
|
||||
'(--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]'
|
||||
|
||||
'--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() {
|
||||
# TODO: Problems with quotes need eval
|
||||
# would need a way to exec the array
|
||||
local -a list_presets;
|
||||
|
||||
if [[ -e CMakePresets.json ]]; then
|
||||
# some old projects uses BOM in json file. strip UTF-8 BOM and then parse JSON
|
||||
list_presets=("${(@f)$(sed '1s/^\xEF\xBB\xBF//' < CMakePresets.json | perl -0777 -MJSON::PP -nE 'do{$k=$_;($e=$k)=~s/:/\\:/g; printf "$_->{name}:$_->{description}\n"} for @{decode_json($_)->{configurePresets}}' 2>/dev/null)}")
|
||||
fi
|
||||
|
||||
_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 cmake_help_actions;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'
|
||||
'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;;
|
||||
(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 _cmake_generator_list
|
||||
_cmake_generator_list=(
|
||||
'Green Hills MULTI'
|
||||
'Unix Makefiles'
|
||||
'Ninja'
|
||||
'Ninja Multi-Config'
|
||||
'CodeBlocks - Ninja'
|
||||
'CodeBlocks - Unix Makefiles'
|
||||
'CodeLite - Ninja'
|
||||
'CodeLite - Unix Makefiles'
|
||||
'Eclipse CDT4 - Ninja'
|
||||
'Eclipse CDT4 - Unix Makefiles'
|
||||
'Kate - Ninja'
|
||||
'Kate - Unix Makefiless'
|
||||
'Sublime Text 2 - Ninja'
|
||||
'Sublime Text 2 - Unix Makefiles'
|
||||
)
|
||||
|
||||
# -----------------
|
||||
# _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*'
|
||||
}
|
||||
|
||||
|
||||
local _cmake_booleans=(_describe -t booleans 'boolean' '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 _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
|
@ -1,81 +0,0 @@
|
||||
#compdef coffee
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Mario Fernandez (https://github.com/sirech)
|
||||
# * Dong Weiming (https://github.com/dongweiming)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local curcontext="$curcontext" state line ret=1 version opts first second third
|
||||
typeset -A opt_args
|
||||
version=(${(f)"$(_call_program version $words[1] --version)"})
|
||||
version=${${(z)${version[1]}}[3]}
|
||||
first=$(echo $version|cut -d '.' -f 1)
|
||||
second=$(echo $version|cut -d '.' -f 2)
|
||||
third=$(echo $version|cut -d '.' -f 3)
|
||||
if (( $first < 2 )) && (( $second < 7 )) && (( $third < 3 ));then
|
||||
opts+=('(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]'
|
||||
'(-r --require)'{-r,--require}'[require a library before executing your script]:library')
|
||||
fi
|
||||
|
||||
|
||||
_arguments -C \
|
||||
'(- *)'{-h,--help}'[display this help message]' \
|
||||
'(- *)'{-v,--version}'[display the version number]' \
|
||||
$opts \
|
||||
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
|
||||
'(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
|
||||
'(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
|
||||
'(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
|
||||
'(--nodejs)--nodejs[pass options directly to the "node" binary]' \
|
||||
'(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
|
||||
'(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
|
||||
'(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
|
||||
'(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
|
||||
'(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
|
||||
'(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
|
||||
'(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
|
||||
'*:script or directory:_files' && ret=0
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,76 +0,0 @@
|
||||
#compdef composer
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for composer (https://getcomposer.org/).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Daniel Gomes (me@danielcsgomes.com)
|
||||
# * Valerii Hiora (https://github.com/vhbit)
|
||||
# * loranger (https://github.com/loranger)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local curcontext=$curcontext state line
|
||||
declare -A opt_args
|
||||
|
||||
_composer_get_command_list () {
|
||||
composer --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }'
|
||||
}
|
||||
|
||||
_composer_get_required_list () {
|
||||
composer show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }'
|
||||
}
|
||||
|
||||
|
||||
_composer () {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments \
|
||||
'1: :->command'\
|
||||
'*: :->args'
|
||||
if [ -f composer.json ]; then
|
||||
case $state in
|
||||
command)
|
||||
compadd `_composer_get_command_list`
|
||||
;;
|
||||
*)
|
||||
compadd `_composer_get_required_list`
|
||||
;;
|
||||
esac
|
||||
else
|
||||
compadd create-project init search selfupdate show
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _composer composer
|
@ -1,626 +0,0 @@
|
||||
#compdef conan
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2010-2017 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for conan 0.28.1 (https://www.conan.io).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_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]}_args] )) && _conan_${words[1]}_args
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
(( $+functions[_conan_commands] )) ||
|
||||
_conan_commands() {
|
||||
local consumer_commands creator_commands package_development_commands misc_commands deprecated_commands
|
||||
consumer_commands=(
|
||||
'install:installs the requirements specified in a "conanfile.py" or "conanfile.txt"'
|
||||
'config:manages conan configuration information'
|
||||
'get:gets a file or list a directory of a given reference or package'
|
||||
'info:prints information about a package recipe'\''s dependency graph'
|
||||
'search:search package recipes and binaries in the local cache or in a remote server'
|
||||
)
|
||||
creator_commands=(
|
||||
'new:creates a new package recipe template with a '\''conanfile.py'\'''
|
||||
'create:export, build package and test it with a consumer project'
|
||||
'upload:uploads a package recipe and the generated binary packages to a specified remote'
|
||||
'export:copies the package recipe (conanfile.py and associated files) to your local cache'
|
||||
'export-pkg:exports a recipe & creates a package with given files calling '\''package'\'''
|
||||
'test:runs a test-folder/conanfile.py to test an existing package'
|
||||
)
|
||||
package_development_commands=(
|
||||
'source:calls your conanfile.py "source()" method to configure the source directory'
|
||||
'build:utility command to run your current project "conanfile.py" build() method'
|
||||
'package:calls your conanfile.py "package" method for a specific package recipe'
|
||||
)
|
||||
misc_commands=(
|
||||
'profile:list profiles in the ".conan/profiles" folder, or show profile details'
|
||||
'remote:handles the remote list and the package recipes associated to a remote'
|
||||
'user:update your cached user name (and auth token) to avoid it being requested later'
|
||||
'imports:execute the "imports" stage of a conanfile.txt or a conanfile.py'
|
||||
'copy:copy conan recipes and packages to another user/channel.'
|
||||
'remove:remove any package recipe or binary matching a pattern'
|
||||
'alias:creates and export an alias recipe'
|
||||
)
|
||||
_describe -t 'consumer-commands' "consumer commands" consumer_commands
|
||||
_describe -t 'creator-commands' "creator commands" creator_commands
|
||||
_describe -t 'package-development-commands' "package development commands" package_development_commands
|
||||
_describe -t 'misc-commands' "misc commands" misc_commands
|
||||
}
|
||||
|
||||
(( $+functions[_conan_alias_args] )) ||
|
||||
_conan_alias_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1:alias reference:_conan_package_references' \
|
||||
'(-h --help)2:target reference:_conan_package_references'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_build_args] )) ||
|
||||
_conan_build_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
"(-h --help -f --file)"{-f,--file}'[specify conanfile filename]: :_conan_conanfiles' \
|
||||
"(-h --help -sf --source-folder)"{-sf,--source-folder}'[local folder containing the sources. Defaulted to the directory of the conanfile. A relative path can also be specified (relative to the current directory)]: :_files -/' \
|
||||
"(-h --help -bf --build-folder)"{-bf,--build-folder}'[build folder, working directory of the build process. Defaulted to the current directory. A relative path can also be specified (relative to the current directory)]: :_files -/' \
|
||||
"(-h --help -pf --package-folder)"{-pf,--package-folder}'[folder to install the package (when the build system or build() method does it). Defaulted to the '\''{build_folder}/package'\'' folder. A relative path can be specified, relative to the current folder. Also an absolute path is allowed.]: :_files -/' \
|
||||
"(-h --help -if --install-folder)"{-if,--install-folder}'[local folder containing the conaninfo.txt and conanbuildinfo.txt files (from a previous conan install execution). Defaulted to --build-folder]: :_files -/' \
|
||||
'(-h --help)1: :_conan_conanfiles'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_config_args] )) ||
|
||||
_conan_config_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_config_commands' \
|
||||
'(-h --help)*:: :->command_args'
|
||||
|
||||
case $state in
|
||||
command_args)
|
||||
(( $+functions[_conan_config_${words[1]}_args] )) && _conan_config_${words[1]}_args
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
(( $+functions[_conan_config_commands] )) ||
|
||||
_conan_config_commands() {
|
||||
local commands
|
||||
commands=(
|
||||
'rm:rm an existing config element'
|
||||
'set:set/add value'
|
||||
'get:get the value of existing element'
|
||||
'install:install a full configuration from a zip file, local or remote'
|
||||
)
|
||||
_describe -t 'commands' "command" commands
|
||||
}
|
||||
|
||||
(( $+functions[_conan_config_rm_args] )) ||
|
||||
_conan_config_rm_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_config_keys'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_config_get_args] )) ||
|
||||
_conan_config_get_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_config_keys'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_config_set_args] )) ||
|
||||
_conan_config_set_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_config_set_key_values'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_config_set_key_values] )) ||
|
||||
_conan_config_set_key_values() {
|
||||
local ret=1
|
||||
if compset -P '*='; then
|
||||
_wanted property-values expl 'config value' _conan_config_values ${IPREFIX%=} && ret=0
|
||||
else
|
||||
_wanted property-names expl 'config key' _conan_config_keys -qS= && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_conan_config_install_args] )) ||
|
||||
_conan_config_install_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1:config file:_files'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_copy_args] )) ||
|
||||
_conan_copy_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
"(-h --help --all -p --package)"{-p,--package}'[copy specified package ID]:package reference:_conan_package_references' \
|
||||
'(-h --help --all -p --package)--all[copy all packages from the specified package recipe]' \
|
||||
'(-h --help --force)--force[override destination packages and the package recipe]' \
|
||||
'(-h --help)1: :_conan_package_references' \
|
||||
'(-h --help)2: :_conan_user_channels'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_export_args] )) ||
|
||||
_conan_export_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help -p --path)'{-p,--path}'[folder with a conanfile.py (default current directory)]: :_files -/' \
|
||||
'(-h --help -k --keep-source)'{-k,--keep-source}'[do not remove the source folder in the local cache]' \
|
||||
'(-h --help -f --file)'{-f,--file}'[specify conanfile filename]: :_conan_conanfiles' \
|
||||
'(-h --help)1: :_conan_channel_or_package_references'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_get_args] )) ||
|
||||
_conan_get_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
"(-h --help -p --package)"{-p,--package}'[package ID]: :_conan_package_references' \
|
||||
'(-h --help -r --remote)'{-r,--remote}'[get from this specific remote]: :_conan_remotes' \
|
||||
'(-h --help -raw --raw)'{-raw,--raw}'[do not decorate the text]' \
|
||||
'(-h --help)1: :_conan_package_references' \
|
||||
'(-h --help)2:file or directory path:_files'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_imports_args] )) ||
|
||||
_conan_imports_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help -f --file)'{-f,--file}'[use another filename]: :_conan_conanfiles' \
|
||||
'(-h --help -imf --import-folder)'{-imf,--import-folder}'[directory to copy the artifacts to. By default it will be the current directory]: :_files -/' \
|
||||
'(-h --help -if --install-folder)'{-if,--install-folder}'[local folder containing the conaninfo.txt and conanbuildinfo.txt files (from a previous conan install execution)]: :_files -/' \
|
||||
'(-h --help -u --undo)'{-u,--undo}'[undo imports (remove imported files)]' \
|
||||
'(-h --help)1: :_conan_directory_or_package_references'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_info_args] )) ||
|
||||
_conan_info_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help -f --file)'{-f,--file}'[specify conanfile filename]: :_conan_conanfiles' \
|
||||
'(-h --help -n --only)'{-n,--only}'[filter fields]: :_conan_info_only_values' \
|
||||
'(-h --help --paths)--paths[show package paths in local cache]' \
|
||||
'(-h --help --package-filter)--package-filter[print information only for packages that match the filtere.g., MyPackage/1.2@user/channel or MyPackage*]: :_conan_package_references' \
|
||||
'(-h --help -bo --build_order)'{-bo,--build_order}'[given a modified reference, return an ordered list to build (CI)]' \
|
||||
'(-h --help -j --json)'{-j,--json}'[only with --build_order option, return the information in a json]: :_files -g "*.json"' \
|
||||
'(-h --help -g --graph)'{-g,--graph}'[creates file with project dependencies graph]: :_files -g "*.(dot|html)"' \
|
||||
'(-h --help -u --update)'{-u,--update}'[check updates exist from upstream remotes]' \
|
||||
'(-h --help -sc --scope)'{-sc,--scope}'[use the specified scope in the install command]: :_conan_scopes' \
|
||||
'(-h --help -pr --profile)'{-pr,--profile}'[apply the specified profile to the install command]: :_conan_profiles' \
|
||||
'(-h --help -r --remote)'{-r,--remote}'[look in the specified remote server]: :_conan_remotes' \
|
||||
'(-h --help)'{-o,--options}'[options to build the package, overwriting the defaults. e.g., -o with_qt=true]: :_conan_options' \
|
||||
'(-h --help)'{-s,--settings}'[settings to build the package, overwriting the defaults. e.g., -s compiler=gcc]: :_conan_settings' \
|
||||
'(-h --help)'{-e,--env}'[environment variables that will be set during the package build, -e CXX=/usr/bin/clang++]: :_conan_environment_variables' \
|
||||
'(-h --help -b --build)'{-b,--build}'[given a build policy (same install command "build" parameter), return an ordered list of packages that would be built from sources in install command (simulation)]: :_conan_build_policies' \
|
||||
'(-h --help)1: :_conan_conanfiles_or_package_references'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_info_only_values] )) ||
|
||||
_conan_info_only_values() {
|
||||
local values
|
||||
values=(
|
||||
'id:show only "id"'
|
||||
'build_id:show only "build_id"'
|
||||
'remote:show only "remote"'
|
||||
'url:show only "url"'
|
||||
'license:show only "license"'
|
||||
'requires:show only "requires"'
|
||||
'update:show only "update"'
|
||||
'required:show only "required"'
|
||||
'date:show only "date"'
|
||||
'author:show only "author"'
|
||||
'export_folder:use with --paths'
|
||||
'build_folder:use with --paths'
|
||||
'package_folder:use with --paths'
|
||||
'source_folder:use with --paths'
|
||||
'None:show only references'
|
||||
)
|
||||
_describe -t 'values' "value" values
|
||||
}
|
||||
|
||||
(( $+functions[_conan_install_args] )) ||
|
||||
_conan_install_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help -f --file)'{-f,--file}'[specify conanfile filename]: :_conan_conanfiles' \
|
||||
'(-h --help -g --generator)'{-g,--generator}'[generators to use]: :_conan_generators' \
|
||||
'(-h --help --werror)--werror[error instead of warnings for graph inconsistencies]' \
|
||||
'(-h --help -if --install-folder)'{-if,--install-folder}'[Use this directory as the directory where to put the generatorfiles, conaninfo/conanbuildinfo.txt etc.]: :_files -/' \
|
||||
'(-h --help -m --manifests)'{-m,--manifests}'[install dependencies manifests in folder for later verify]: :_files -/' \
|
||||
'(-h --help -mi --manifests-interactive)'{-mi,--manifests-interactive}'[install dependencies manifests in folder for later verify]: :_files -/' \
|
||||
'(-h --help -v --verify)'{-v,--verify}'[verify dependencies manifests against stored ones]: :_files -/' \
|
||||
'(-h --help --no-imports)--no-imports[install specified packages but avoid running imports]' \
|
||||
'(-h --help -u --update)'{-u,--update}'[check updates exist from upstream remotes]' \
|
||||
'(-h --help -sc --scope)'{-sc,--scope}'[use the specified scope in the install command]: :_conan_scopes' \
|
||||
'(-h --help -pr --profile)'{-pr,--profile}'[apply the specified profile to the install command]: :_conan_profiles' \
|
||||
'(-h --help -r --remote)'{-r,--remote}'[look in the specified remote server]: :_conan_remotes' \
|
||||
'(-h --help)'{-o,--options}'[options to build the package, overwriting the defaults. e.g., -o with_qt=true]: :_conan_options' \
|
||||
'(-h --help)'{-s,--settings}'[settings to build the package, overwriting the defaults. e.g., -s compiler=gcc]: :_conan_settings' \
|
||||
'(-h --help)'{-e,--env}'[environment variables that will be set during the package build, -e CXX=/usr/bin/clang++]: :_conan_environment_variables' \
|
||||
'(-h --help -b --build)'{-b,--build}'[given a build policy (same install command "build" parameter), return an ordered list of packages that would be built from sources in install command (simulation)]: :_conan_build_policies' \
|
||||
'(-h --help)1: :_conan_conanfiles'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_new_args] )) ||
|
||||
_conan_new_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help -t --test)'{-t,--test}'[create test_package skeleton to test package]' \
|
||||
'(-h --help -i --header)'{-i,--header}'[create a headers only package template]' \
|
||||
'(-h --help -c --pure_c)'{-c,--pure_c}'[create a C language package only package, deleting "self.settings.compiler.libcxx" setting in the configure method]' \
|
||||
'(-h --help -s --sources)'{-s,--sources}'[create a package with embedded sources in "src" folder, using "exports_sources" instead of retrieving external code with the "source()" method]' \
|
||||
'(-h --help -b --bare)'{-b,--bare}'[create the minimum package recipe, without build() or package() methods. Useful in combination with "package_files" command]' \
|
||||
'(-h --help -cis --ci_shared)'{-cis,--ci_shared}'[package will have a "shared" option to be used in CI]' \
|
||||
'(-h --help -cilg --ci_travis_gcc)'{-cilg,--ci_travis_gcc}'[generate travis-ci files for linux gcc]' \
|
||||
'(-h --help -cilc --ci_travis_clang)'{-cilc,--ci_travis_clang}'[generate travis-ci files for linux clang]' \
|
||||
'(-h --help -cilg --ci_travis_gcc)'{-cilg,--ci_travis_gcc}'[generate travis-ci files for linux gcc]' \
|
||||
'(-h --help -cio --ci_travis_osx)'{-cio,--ci_travis_osx}'[generate travis-ci files for OSX apple-clang]' \
|
||||
'(-h --help -ciw --ci_appveyor_win)'{-ciw,--ci_appveyor_win}'[generate appveyor files for Appveyor Visual Studio]' \
|
||||
'(-h --help -ciglg --ci_gitlab_gcc)'{-ciglg,--ci_gitlab_gcc}'[generate GitLab files for linux gcc]' \
|
||||
'(-h --help -ciglc --ci_gitlab_clang)'{-ciglc,--ci_gitlab_clang}'[generate GitLab files for linux clang]' \
|
||||
'(-h --help -cilg --ci_travis_gcc)'{-cilg,--ci_travis_gcc}'[generate travis-ci files for linux gcc]' \
|
||||
'(-h --help -gi --gitignore)'{-gi,--gitignore}'[generate a .gitignore with the known patterns to excluded]' \
|
||||
'(-h --help -ciu --ci_upload_url)'{-ciu,--ci_upload_url}'[define URL of the repository to upload]: :_urls' \
|
||||
'(-h --help)1: :_conan_package_references'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_package_args] )) ||
|
||||
_conan_package_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
"(-h --help -sf --source-folder)"{-sf,--source-folder}'[local folder containing the sources. Defaulted to the directory of the conanfile. A relative path can also be specified (relative to the current directory)]: :_files -/' \
|
||||
"(-h --help -bf --build-folder)"{-bf,--build-folder}'[build folder, working directory of the build process. Defaulted to the current directory. A relative path can also be specified (relative to the current directory)]: :_files -/' \
|
||||
"(-h --help -pf --package-folder)"{-pf,--package-folder}'[folder to install the package (when the build system or build() method does it). Defaulted to the '\''{build_folder}/package'\'' folder. A relative path can be specified, relative to the current folder. Also an absolute path is allowed.]: :_files -/' \
|
||||
"(-h --help -if --install-folder)"{-if,--install-folder}'[local folder containing the conaninfo.txt and conanbuildinfo.txt files (from a previous conan install execution). Defaulted to --build-folder]: :_files -/' \
|
||||
'(-h --help)1: :_conan_package_references' \
|
||||
'(-h --help)2:package ID:'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_profile_args] )) ||
|
||||
_conan_profile_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_profile_commands' \
|
||||
'(-h --help)*:: :->command_args'
|
||||
|
||||
case $state in
|
||||
command_args)
|
||||
(( $+functions[_conan_profile_${words[1]}_args] )) && _conan_profile_${words[1]}_args
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
(( $+functions[_conan_profile_commands] )) ||
|
||||
_conan_profile_commands() {
|
||||
local commands
|
||||
commands=(
|
||||
'list:list current profiles'
|
||||
'show:show the values defined for a profile'
|
||||
'new:creates a new empty profile'
|
||||
'update:update a profile'
|
||||
'get:get a profile key'
|
||||
'remove:remove a profile key'
|
||||
)
|
||||
_describe -t 'commands' "command" commands
|
||||
}
|
||||
|
||||
(( $+functions[_conan_profile_list_args] )) ||
|
||||
_conan_profile_list_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_profile_show_args] )) ||
|
||||
_conan_profile_show_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_profiles'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_profile_new_args] )) ||
|
||||
_conan_profile_new_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)--detect[autodetect settings and fill \[settings\] section]' \
|
||||
'(-h --help)1:profile name:'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_profile_update_args] )) ||
|
||||
_conan_profile_update_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_settings' \
|
||||
'(-h --help)2: :_conan_profiles'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_profile_get_args] )) ||
|
||||
_conan_profile_get_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_setting_keys' \
|
||||
'(-h --help)2: :_conan_profiles'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_profile_remove_args] )) ||
|
||||
_conan_profile_remove_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_setting_keys' \
|
||||
'(-h --help)2: :_conan_profiles'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_remote_args] )) ||
|
||||
_conan_remote_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_remote_commands' \
|
||||
'(-h --help)*:: :->command_args'
|
||||
|
||||
case $state in
|
||||
command_args)
|
||||
(( $+functions[_conan_remote_${words[1]}_args] )) && _conan_remote_${words[1]}_args
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
(( $+functions[_conan_remote_commands] )) ||
|
||||
_conan_remote_commands() {
|
||||
local commands
|
||||
commands=(
|
||||
'list:list current remotes'
|
||||
'add:add a remote'
|
||||
'remove:remove a remote'
|
||||
'update:update the remote url'
|
||||
'list_ref:list the package recipes and its associated remotes'
|
||||
'add_ref:associate a recipe'\''s reference to a remote'
|
||||
'remove_ref:dissociate a recipe'\''s reference and its remote'
|
||||
'update_ref:update the remote associated with a package recipe'
|
||||
)
|
||||
_describe -t 'commands' "command" commands
|
||||
}
|
||||
|
||||
(( $+functions[_conan_remote_list_args] )) ||
|
||||
_conan_remote_list_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_remote_add_args] )) ||
|
||||
_conan_remote_add_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1:name of the remote:' \
|
||||
'(-h --help)2:url of the remote:_urls' \
|
||||
'(-h --help)3:verify SSL certificated:(True False)'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_remote_remove_args] )) ||
|
||||
_conan_remote_remove_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_remotes'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_remote_update_args] )) ||
|
||||
_conan_remote_update_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]' \
|
||||
'(-h --help)1: :_conan_remotes' \
|
||||
'(-h --help)2:url of the remote:_urls' \
|
||||
'(-h --help)3:verify SSL certificated:(True False)'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_remote_list_ref_args] )) ||
|
||||
_conan_remote_list_ref_args() {
|
||||
_arguments -C \
|
||||
'(- : *)'{-h,--help}'[display help information]'
|
||||
}
|
||||
|
||||
# TODO complete conan remote add_ref
|
||||
# TODO complete conan remote remove_ref
|
||||
# TODO complete conan remote update_ref
|
||||
# TODO complete conan remove
|
||||
# TODO complete conan search
|
||||
# TODO complete conan source
|
||||
# TODO complete conan upload
|
||||
# TODO complete conan user
|
||||
# TODO complete conan export-pkg
|
||||
# TODO complete conan test
|
||||
|
||||
|
||||
(( $+functions[_conan_conanfiles] )) ||
|
||||
_conan_conanfiles() {
|
||||
_files -g '*.py'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_conanfiles_or_package_references] )) ||
|
||||
_conan_conanfiles_or_package_references() {
|
||||
_alternative \
|
||||
'conanfile: :_conan_conanfiles' \
|
||||
'package-references: :_conan_package_references'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_directory_or_package_references] )) ||
|
||||
_conan_directory_or_package_references() {
|
||||
_alternative \
|
||||
'directory: :_files -/' \
|
||||
'package-references: :_conan_package_references'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_channel_or_package_references] )) ||
|
||||
_conan_channel_or_package_references() {
|
||||
_alternative \
|
||||
'package-references: :_conan_package_references' \
|
||||
'user-channels: :_conan_user_channels'
|
||||
}
|
||||
|
||||
(( $+functions[_conan_package_references] )) ||
|
||||
_conan_package_references() {
|
||||
_guard '[^\-]#' 'package reference' # TODO complete package references
|
||||
}
|
||||
|
||||
(( $+functions[_conan_user_channels] )) ||
|
||||
_conan_user_channels() {
|
||||
_guard '[^\-]#' 'user channel' # TODO complete user channels
|
||||
}
|
||||
|
||||
(( $+functions[_conan_remotes] )) ||
|
||||
_conan_remotes() {
|
||||
local remotes; remotes=(${(f)"$(_call_program remotes $service remote list)"})
|
||||
_describe -t remotes 'remote' remotes "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_conan_scopes] )) ||
|
||||
_conan_scopes() {
|
||||
_guard '[^\-]#' 'scope' # TODO complete scopes
|
||||
}
|
||||
|
||||
(( $+functions[_conan_build_policies] )) ||
|
||||
_conan_build_policies() {
|
||||
_guard '[^\-]#' 'build policy' # TODO complete build policies
|
||||
}
|
||||
|
||||
(( $+functions[_conan_generators] )) ||
|
||||
_conan_generators() {
|
||||
_guard '[^\-]#' 'generator' # TODO complete generators
|
||||
}
|
||||
|
||||
(( $+functions[_conan_profiles] )) ||
|
||||
_conan_profiles() {
|
||||
local profiles; profiles=(${(f)"$(_call_program profiles $service profile list)"})
|
||||
_describe -t profiles 'profile' profiles "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_conan_config_keys] )) ||
|
||||
_conan_config_keys() {
|
||||
_guard '[^\-]#' 'config key' # TODO complete config keys
|
||||
}
|
||||
|
||||
(( $+functions[_conan_config_values] )) ||
|
||||
_conan_config_values() {
|
||||
_guard '[^\-]#' 'config value' # TODO complete config values
|
||||
}
|
||||
|
||||
(( $+functions[_conan_options] )) ||
|
||||
_conan_options() {
|
||||
local ret=1
|
||||
if compset -P '*='; then
|
||||
_wanted option-values expl 'option value' _conan_option_values ${IPREFIX%=} && ret=0
|
||||
else
|
||||
_wanted option-names expl 'option key' _conan_option_keys -qS= && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_conan_option_keys] )) ||
|
||||
_conan_option_keys() {
|
||||
_guard '[^\-]#' 'option key' # TODO complete option keys
|
||||
}
|
||||
|
||||
(( $+functions[_conan_option_values] )) ||
|
||||
_conan_option_values() {
|
||||
_guard '[^\-]#' 'option value' # TODO complete option values
|
||||
}
|
||||
|
||||
(( $+functions[_conan_settings] )) ||
|
||||
_conan_settings() {
|
||||
local ret=1
|
||||
if compset -P '*='; then
|
||||
_wanted setting-values expl 'setting value' _conan_setting_values ${IPREFIX%=} && ret=0
|
||||
else
|
||||
_wanted setting-names expl 'setting key' _conan_setting_keys -qS= && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_conan_setting_keys] )) ||
|
||||
_conan_setting_keys() {
|
||||
_guard '[^\-]#' 'setting key' # TODO complete setting keys
|
||||
}
|
||||
|
||||
(( $+functions[_conan_setting_values] )) ||
|
||||
_conan_setting_values() {
|
||||
_guard '[^\-]#' 'setting value' # TODO complete setting values
|
||||
}
|
||||
|
||||
(( $+functions[_conan_environment_variables] )) ||
|
||||
_conan_environment_variables() {
|
||||
local ret=1
|
||||
if compset -P '*='; then
|
||||
_wanted environment_variable-values expl 'environment variable value' _conan_environment_variable_values ${IPREFIX%=} && ret=0
|
||||
else
|
||||
_wanted environment_variable-names expl 'environment variable' _conan_environment_variable_keys -qS= && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_conan_environment_variable_keys] )) ||
|
||||
_conan_environment_variable_keys() {
|
||||
_parameters -g "*export*"
|
||||
}
|
||||
|
||||
(( $+functions[_conan_environment_variable_values] )) ||
|
||||
_conan_environment_variable_values() {
|
||||
_guard '[^\-]#' 'environment variable value' # TODO complete environment variable values
|
||||
}
|
||||
|
||||
|
||||
_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
@ -1,64 +0,0 @@
|
||||
#compdef console
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for symfony console (https://github.com/symfony/Console).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * loranger (https://github.com/loranger)
|
||||
# * Yohan Tambè (https://github.com/Cronos87)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_find_console () {
|
||||
echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
|
||||
}
|
||||
|
||||
_console_get_command_list () {
|
||||
IFS=" "
|
||||
`_find_console` --no-ansi | \
|
||||
sed "1,/Available commands/d" | \
|
||||
awk '/ [a-z]+/ { print $0 }' | \
|
||||
sed -E 's/^[ ]+//g' | \
|
||||
sed -E 's/[:]+/\\:/g' | \
|
||||
sed -E 's/[ ]{2,}/\:/g'
|
||||
}
|
||||
|
||||
_console () {
|
||||
local -a commands
|
||||
IFS=$'\n'
|
||||
commands=(`_console_get_command_list`)
|
||||
_describe 'commands' commands
|
||||
}
|
||||
|
||||
compdef _console php console
|
||||
compdef _console console
|
@ -1,115 +0,0 @@
|
||||
#compdef cppcheck
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2019 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 cppcheck -- a tool for static C/C++ code analysis (http://cppcheck.sourceforge.net)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Georgy Komarov (https://github.com/jubnzv)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Notes
|
||||
# -----
|
||||
#
|
||||
# Created for Cppcheck version 1.90.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_cppcheck_files() {
|
||||
_path_files -/ -g "*.(c|cpp|cxx|h|hpp|C)"
|
||||
}
|
||||
|
||||
_cppcheck() {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
"--addon=[Execute addon]" \
|
||||
"--cppcheck-build-dir=[Analysis output directory]:directory:_files -/" \
|
||||
"--check-config[Check cppcheck configuration]" \
|
||||
"--check-library[Show information when library files have incomplete info]" \
|
||||
"--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]" \
|
||||
"--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:(all warning style performance portability information unusedFunction missingInclude)" \
|
||||
"--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-list=[Specify the files to check in a text file]:_files" \
|
||||
{-f,--force}"[Force checking of all configurations in files]" \
|
||||
{-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]" \
|
||||
"-l[No new threads should be started if the load average is exceeds this value]" \
|
||||
{-x,--language=}"[Forces cppcheck to check all files as the given language]:language:(c c++)" \
|
||||
"--cfg=[Load file that contains information about types and functions]" \
|
||||
"--max-ctu-depth=[Maximum depth in whole program analysis]" \
|
||||
"--output-file=[File to save results]:file:_files" \
|
||||
"--project=[Run Cppcheck on project]:file:_files" \
|
||||
"--max-configs=[Maximum number of configurations to check in a file]" \
|
||||
"--platform=[Set platform specific types and sizes]:platforms:(unix32 unix64 win32A win32W win64 native unspecified)" \
|
||||
"--plist-output=[Generate Clang-plist output files in folder]:_files" \
|
||||
{-q,--quiet}"[Do not show progress reports]" \
|
||||
{-rp,--relative-paths}"[Use relative paths in output]" \
|
||||
{-rp,--relative-paths}"=[Use relative paths in output (separated with ;)]:_files" \
|
||||
"--report-progress[Report progress messages while checking a file]" \
|
||||
"--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" \
|
||||
"--template=[Format the error messages]" \
|
||||
"--template=[Format the error message location]" \
|
||||
{-v,--verbose}"[Output more detailed error information]" \
|
||||
"--version[Print out version number]" \
|
||||
"--xml[Write results in xml format to stderr]" \
|
||||
"--xml-version=[Select the XML file version]" \
|
||||
'*: :_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
|
||||
|
@ -1,68 +0,0 @@
|
||||
#compdef dad
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for dad a command line manager of aria2 daemon. (https://github.com/baskerville/diana).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Jindřich Pilař (https://github.com/JindrichPilar)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_dad() {
|
||||
local -a commands
|
||||
|
||||
commands=(
|
||||
"start:Start aria2c daemon"
|
||||
"stop:Stop aria2c daemon"
|
||||
)
|
||||
|
||||
_arguments -C \
|
||||
'(- 1 *)'-h"[Show help and exit]" \
|
||||
"-d[Set download dir]:download_dir:->val" \
|
||||
"-s[Set secret token]:secret_token:->val" \
|
||||
"-u[Set aria2c username]:username:->val" \
|
||||
"-p[Set aria2c password]:password:->val" \
|
||||
'1:cmd:->cmds' \
|
||||
'*: : :->args' \
|
||||
|
||||
case "$state" in
|
||||
(cmds)
|
||||
_describe -t commands 'commands' commands
|
||||
;;
|
||||
(*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_dad
|
||||
|
@ -1,40 +0,0 @@
|
||||
#compdef debuild
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for debuild 2.10.
|
||||
#
|
||||
# Status: incomplete.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# FIXME --noconf is only allowed in first position
|
||||
_arguments \
|
||||
'(- 1 *)'{-h,--help}'[show help]' \
|
||||
'(- 1 *)--version[show version and copyright information]' \
|
||||
{--no-conf,--noconf}'[don'\''t read devscripts config files]' \
|
||||
{-r-,--rootcmd=}'[command used to become root if debuild not setuid root (default: fakeroot)]: :_command_names' \
|
||||
'*'{-e-,--preserve-envvar=}'[preserve environment variable]: :_vars' \
|
||||
'(-e --preserve-envvar)--preserve-env[preserve all environment vars (except PATH)]' \
|
||||
'*'{-e-,--set-envvar=}'[preserve environment variable]: :_vars -qS=' \
|
||||
'--prepend-path=[prepend to the sanitised PATH]: :_files -/' \
|
||||
'(-D)-d[skip checking of build dependencies]' \
|
||||
'(-d)-D[force checking of build dependencies]' \
|
||||
'--check-dirname-level[how much to check directory names]:level:((0\:never 1\:only\ if\ program\ changes\ directory\ \(default\) 2\:always))' \
|
||||
'--check-dirname-regex[Perl regex defining matching directory names, the string PACKAGE will be replaced by the package name (default: '\''PACKAGE(-.+)?'\'')]:regex'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,70 +0,0 @@
|
||||
#compdef dget
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for dget
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Kris Shannon <k.shannon@amaze.com.au>
|
||||
# * Shohei YOSHIDA <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_dget() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments -A "-*" \
|
||||
'(--no-conf -h --help)'{-h,--help}'[Show help message]' \
|
||||
'(--no-conf -V --version)'{-v,--version}'[Print license, copyright, and version information and exit]' \
|
||||
'(--no-conf -b --backup)'{-b,--backup}'[Move files that would be overwritten to ./backup]' \
|
||||
'(--no-conf -q --quiet)'{-q,--quiet}'[Suppress wget/curl output]' \
|
||||
'(--no-conf -x --extract -d --download-only --build)'{-d,--download-only}'[Do not extract downloaded source]' \
|
||||
'(--no-conf -x --extract -d --download-only --build)'{-x,--extract}'[Unpack downloaded source]' \
|
||||
'(--no-conf -x --extract -d --download-only --build)--build[Build package with dpkg-buildpackage after download]' \
|
||||
'(--no-conf -u --allow-unauthenticated)'{-u,--allow-unauthenticated}'[Make no attempt to verify source package signature]' \
|
||||
'(--no-conf)--path[Check this directory in addition to the apt archive]:DIR:_files -/' \
|
||||
'(--no-conf --insecure)--insecure[Do not check SSL certificates when downloading]' \
|
||||
'(--no-conf --no-cache)--no-cache[Disable server-side HTTP cache]' \
|
||||
"(--no-conf)--no-conf[Don't read devscripts config files]" \
|
||||
'(-)*:debian package 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
|
@ -1,53 +0,0 @@
|
||||
#compdef dhcpcd
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for dhcpcd 2.3.2.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_arguments \
|
||||
'1:network interface:_net_interfaces' \
|
||||
- release \
|
||||
'(-k --release)'{-k,--release}'[causes an existing dhcpcd process running on the interface to release it'\''s lease, deconfigure the interface and then exit]' \
|
||||
- exit \
|
||||
'(-x --exit)'{-x,--exit}'[causes an existing dhcpcd process running on the interface to exit]' \
|
||||
- main \
|
||||
'(-d --debug)'{-d,--debug}'[echo debug and informational messages to the console]' \
|
||||
'(-h --hostname)'{-h,--hostname}'[specify the hostname sent, or an empty string to stop any hostname from being sent]:hostname:_hosts' \
|
||||
'(-i --classid)'{-i,--classid}'[override the DHCP vendor classid field we send]:classid' \
|
||||
'(-l --leasetime)'{-l,--leasetime}'[request a specific lease time in seconds]:lease time \(seconds\)' \
|
||||
'(-m --metric)'{-m,--metric}'[added routes will use the metric on systems where this is supported]:metric' \
|
||||
'(-n --renew)'{-n,--renew}'[notifies an existing dhcpcd process running on the interface to renew it'\''s lease]' \
|
||||
'(-p --persistent)'{-p,--persistent}'[don'\''t deconfigure the interface and configuration at exit]' \
|
||||
'(-r --request)'{-r,--request}'[skip the broadcast request step and just request an address]:address' \
|
||||
'(-s --inform)'{-s,--inform}'[behaves exactly like -r, but sends a DHCP inform instead of a request]:address' \
|
||||
'(-t --timeout)'{-t,--timeout}'[timeout after seconds, instead of the default 20]:timeout \(seconds\)' \
|
||||
'(-u --userclass)'{-u,--userclass}'[tags the DHCP message with the userclass class]:class' \
|
||||
'*'{-H,--sethostname}'[forces dhcpcd to set the hostname as supplied by the DHCP server]' \
|
||||
'({-I --clientid)'{-I,--clientid}'[send clientid as a client identifier string]:clientid' \
|
||||
'*'{-S,--mscsr}'[request Microsoft specific Classless Static Routes (RFC 3442) code as well]' \
|
||||
'(-A --noarp)'{-A,--noarp}'[don'\''t request or claim the address by ARP]' \
|
||||
'(-G --nogateway)'{-G,--nogateway}'[don'\''t set any default routes]' \
|
||||
'(-L --noipv4ll)'{-L,--noipv4ll}'[don'\''t use IPv4LL at all]' \
|
||||
'(-M --nomtu)'{-M,--nomtu}'[don'\''t set the MTU of the interface]' \
|
||||
'(-N --nontp)'{-N,--nontp}'[don'\''t touch /etc/ntpd.conf or restart the ntp service]' \
|
||||
'(-R --nodns)'{-R,--nodns}'[don'\''t send DNS information to resolvconf or touch /etc/resolv.conf]' \
|
||||
'(-T --test)'{-T,--test}'[on receipt of discover messages, simply print the contents of the DHCP message to the console]' \
|
||||
'(-Y --nonis)'{-Y,--nonis}'[don'\''t touch /etc/yp.conf or restart the ypbind service]'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,150 +0,0 @@
|
||||
#compdef diana
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Diana a command line interface to the aria2 daemon. (https://github.com/baskerville/diana).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Jindřich Pilař (https://github.com/JindrichPilar)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local GIDs PGIDs
|
||||
|
||||
_diana_load_gids() {
|
||||
GIDs=()
|
||||
local downloads hashArr fileName
|
||||
|
||||
downloads=$(diana list | cut -d' ' -f1)
|
||||
|
||||
if [ ${#downloads} -eq "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
hashArr=("${(f)$(echo "$downloads")}")
|
||||
for ((i=1; i<=${#hashArr[@]}; i++)); do
|
||||
fileName=$(diana files $hashArr[i] | grep "[X]" | rev | cut -d'/' -f1 | rev);
|
||||
GIDs+=("$hashArr[i]:$fileName");
|
||||
done
|
||||
}
|
||||
|
||||
_diana_load_paused_gids() {
|
||||
PGIDs=()
|
||||
local downloads hashArr fileName
|
||||
|
||||
downloads=$(diana paused | cut -d' ' -f1)
|
||||
|
||||
if [ ${#downloads} -eq "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
hashArr=("${(f)$(echo "$downloads")}")
|
||||
for ((i=1; i<=${#hashArr[@]}; i++)); do
|
||||
fileName=$(diana files $hashArr[i] | grep "[X]" | rev | cut -d'/' -f1 | rev);
|
||||
PGIDs+=("$hashArr[i]:$fileName");
|
||||
done
|
||||
}
|
||||
|
||||
_diana_command_arguments() {
|
||||
case $words[1] in
|
||||
(remove)
|
||||
_diana_load_gids
|
||||
_describe -t output 'Downloads to delete' GIDs
|
||||
;;
|
||||
(info)
|
||||
_diana_load_gids
|
||||
_describe -t output 'Downloads to get info' GIDs
|
||||
;;
|
||||
(files)
|
||||
_diana_load_gids
|
||||
_describe -t output 'Get files for downloads' GIDs
|
||||
;;
|
||||
(forcerm)
|
||||
_diana_load_gids
|
||||
_describe -t output 'Downloads to delete' GIDs
|
||||
;;
|
||||
(pause)
|
||||
_diana_load_gids
|
||||
_describe -t output 'Downloads to pause' GIDs
|
||||
;;
|
||||
(resume)
|
||||
_diana_load_paused_gids
|
||||
_describe -t output 'Downloads to resume' PGIDs
|
||||
;;
|
||||
(preview)
|
||||
_diana_load_gids
|
||||
_describe -t output 'Downloads to preview' GIDs
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
}
|
||||
|
||||
_diana() {
|
||||
local -a commands
|
||||
|
||||
commands=(
|
||||
"list:Output the list of active downloads."
|
||||
"paused:Output the list of paused downloads."
|
||||
"stopped:Output the list of stopped downloads."
|
||||
"info:Output 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
|
||||
|
@ -1,83 +0,0 @@
|
||||
#compdef docpad
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for docpad (https://github.com/bevry/docpad).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Changwoo Park (https://github.com/pismute)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local curcontext="$curcontext" state line ret=1
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'run: run [options], does everything - skeleton, generate, watch, server'
|
||||
'server: server [options], creates a server for your generated project'
|
||||
'skeleton: skeleton [options], will create a new project in your cwd based off an existing skeleton'
|
||||
'render: render [path], render the file at <path> and output its results to stdout:path:_files'
|
||||
'generate: (re)generates your project'
|
||||
'watch: watches your project for changes, and (re)generates whenever a change is made'
|
||||
'install: ensure everything is installed correctly'
|
||||
'clean: ensure everything is cleaned correctly'
|
||||
'info: display the information about your docpad instance'
|
||||
'help: output the help'
|
||||
)
|
||||
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[output usage information]'\
|
||||
'(-V --version)'{-V,--version}'[output the version number]'\
|
||||
'(-o --out)'{-o,--out}'[where to output the rendered directory or files]:path:_files'\
|
||||
'(-c --config)'{-c,--config}'[a custom configuration file to load in]:path:_files'\
|
||||
'(-e --env)'{-e,--env}'[the environment name to use for this instance, multiple names can be separated with a comma]'\
|
||||
'(-d --debug)'{-d,--debug}'+[the level of debug messages you would like to display, if specified defaults to 7, otherwise 6]:number'\
|
||||
'(-f --force)'{-f,--force}'[force a re-install of all modules]'\
|
||||
'1: :->cmds'\
|
||||
'*: :_files'&& ret=0
|
||||
|
||||
case $state in
|
||||
cmds)
|
||||
_describe -t commands 'docpad command' _1st_arguments && ret=0
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,191 +0,0 @@
|
||||
#compdef drush
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Drush (http://drush.ws).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Vasily Kraev (https://github.com/vasilykraev)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_drush() {
|
||||
local curcontext='$curcontext' state line cmds ret=1
|
||||
integer NORMARG
|
||||
typeset -A opt_args
|
||||
|
||||
global_args=('--debug' '--verbose' '--yes' '--no' '--simulate' '--root=' '--uri=')
|
||||
|
||||
_arguments -C \
|
||||
'(--*)'{--version,--version}'[Show drush version.]' \
|
||||
'(- *)'{-d,--debug}'[Display even more information, including internal messages.]' \
|
||||
'(- *)'{-v,--verbose}'[Display extra information about the command.]' \
|
||||
'(- *)'{-y,--yes}'[Assume "yes" as answer to all prompts.]' \
|
||||
'(- *)'{-n,--no}'[Assume "no" as answer to all prompts.]' \
|
||||
'(- *)'{-s,--simulate}'[Simulate all relevant actions (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
|
@ -1,53 +0,0 @@
|
||||
#compdef ecdsautil
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for ecdsaultils v0.4.0 (https://github.com/tcatm/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 "$@"
|
@ -1,137 +0,0 @@
|
||||
#compdef emulator
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for emulator (Android Emulator) 12.0
|
||||
# (http://developer.android.com/guide/developing/tools/emulator.html).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext"
|
||||
|
||||
_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 -logcat: use completer from _adb
|
||||
# TODO Complete options with device values
|
||||
# TODO Complete -prop
|
||||
_arguments \
|
||||
'(- : *)-version[display emulator version number]' \
|
||||
'(- : *)-help[display help information]' \
|
||||
'(- : *)-help-disk-images[about disk images]' \
|
||||
'(- : *)-help-keys[supported key bindings]' \
|
||||
'(- : *)-help-debug-tags[debug tags for -debug <tags>]' \
|
||||
'(- : *)-help-char-devices[character <device> specification]' \
|
||||
'(- : *)-help-environment[environment variables]' \
|
||||
'(- : *)-help-keyset-file[key bindings configuration file]' \
|
||||
'(- : *)-help-virtual-device[virtual device management]' \
|
||||
'(- : *)-help-sdk-images[about disk images when using the SDK]' \
|
||||
'(- : *)-help-build-images[about disk images when building Android]' \
|
||||
'(- : *)-help-all[prints all help content]' \
|
||||
'(- : *)-help-'{version,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]' \
|
||||
'-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"' \
|
||||
'-initdata[same as '\''-init-data <file>'\'']: :_files' \
|
||||
'-data[data image (default <datadir>/userdata-qemu.img]: :_files -g "*.img"' \
|
||||
'-partition-size[system/data partition size]:size (in MBs)' \
|
||||
'(-no-cache -nocache)-cache[cache partition image (default is temporary file)]: :_files -g "*.img"' \
|
||||
'(-cache -no-cache -nocache)'{-no-cache,-nocache}'[disable the cache partition]' \
|
||||
'-sdcard[SD card image (default <system>/sdcard.img]: :_files -g "*.img"' \
|
||||
'(-no-snapstorage)-snapstorage[file that contains all state snapshots (default <datadir>/snapshots.img)]: :_files -g "*.img"' \
|
||||
'(-snapstorage)-no-snapstorage[do not mount a snapshot storage file (this disables all snapshot functionality)]' \
|
||||
'-snapshot[name of snapshot within storage file for auto-start and auto-save (default '\''default-boot'\'')]:snapshot name' \
|
||||
'-no-snapshot[perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage]' \
|
||||
'-no-snapshot-save[do not auto-save to snapshot on exit: abandon changed state]' \
|
||||
'-no-snapshot-load[do not auto-start from snapshot: perform a full boot]' \
|
||||
'-snapshot-list[show a list of available snapshots]' \
|
||||
'-no-snapshot-update-time[do not do try to correct snapshot time on restore]' \
|
||||
'-wipe-data[reset the user data image (copy it from initdata)]' \
|
||||
'-avd[use a specific android virtual device]:android virtual device name:($(_list_avds))' \
|
||||
'-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]' \
|
||||
'-trace[enable code profiling (F9 to start)]:trace name' \
|
||||
'-show-kernel[display kernel messages]' \
|
||||
'-shell[enable root shell on current terminal]' \
|
||||
{-no-jni,-nojni}'[disable JNI checks in the Dalvik runtime]' \
|
||||
'-logcat[enable logcat output with given tags]:logcat tags' \
|
||||
'(-audio -noaudio -no-audio)'{-noaudio,-no-audio}'[disable audio support]' \
|
||||
'(-noaudio -no-audio)-audio[use specific audio backend]:audio backend' \
|
||||
'-raw-keys[disable Unicode keyboard reverse-mapping]' \
|
||||
'-radio[redirect radio modem interface to character device]:device' \
|
||||
'-port[TCP port that will be used for the console]:port number' \
|
||||
'-ports[TCP ports used for the console and adb bridge]:console port,adb port' \
|
||||
'-onion[use overlay PNG image over screen]: :_files -g "*.(png|PNG)"' \
|
||||
'-onion-alpha[specify onion-skin translucency]:percentage' \
|
||||
'-onion-rotation[specify onion-skin rotation]:rotation:((1 2 3 4))' \
|
||||
'-scale[scale emulator window]:scale' \
|
||||
'-dpi-device[specify device'\''s resolution in dpi (default 165)]:dpi' \
|
||||
'-http-proxy[make TCP connections through a HTTP/HTTPS proxy]:proxy' \
|
||||
'-timezone[use this timezone instead of the host'\''s default]:timezone' \
|
||||
'-dns-server[use this DNS server(s) in the emulated system]:DNS servers' \
|
||||
'-cpu-delay[throttle CPU emulation]:CPU delay' \
|
||||
'-no-boot-anim[disable animation for faster boot]' \
|
||||
'-no-window[disable graphical window display]' \
|
||||
'-report-console[report console port to remote socket]: :_socket' \
|
||||
'-gps[redirect NMEA GPS to character device]:device' \
|
||||
'-keyset[specify keyset file name]: :_files' \
|
||||
'-shell-serial[specific character device for root shell]:device' \
|
||||
'-tcpdump[capture network packets to file]: :_files' \
|
||||
'-bootchart[enable bootcharting]:timeout' \
|
||||
'-charmap[use specific key character map]: :_files' \
|
||||
'*-prop[set system property on boot]:name=value' \
|
||||
'-shared-net-id[join the shared network, using IP address 10.1.2.<number>]:number' \
|
||||
'-nand-limits[enforce NAND/Flash read/write thresholds]:limits' \
|
||||
'-memcheck[enable memory access checking]:flags' \
|
||||
'-qemu[pass arguments to qemu]:arguments' \
|
||||
'-verbose[same as '\''-debug-init'\'']' \
|
||||
'*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag' \
|
||||
'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
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,49 +0,0 @@
|
||||
#compdef envdir
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Github zsh-users (https://github.com/zsh-users)
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for envdir (https://github.com/jezdez/envdir).
|
||||
# It completes its few options and then a directory and command.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Daniel Hahler <https://daniel.hahler.de/>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
args=(
|
||||
'(-h --help)'{-h+,--help}'[show this help message and exit]'
|
||||
'(-)'--version'[display version information and exit]'
|
||||
'(-)1:directory: _path_files -/'
|
||||
'(-)2:command: _command_names -e'
|
||||
'*::arguments: _precommand'
|
||||
)
|
||||
_arguments -S $args
|
@ -1,51 +0,0 @@
|
||||
#compdef exportfs
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for nfs's exportfs - maintain table of exported NFS file systems.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Timofey Titovets <nefelim4ag@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
_exportfs() {
|
||||
_values -w 'option' \
|
||||
'(-i)-a[Export or unexport all directories]' \
|
||||
'(-a -r -u)-i[Ignore the /etc/exports file and files under /etc/exports.d directory]' \
|
||||
'(-i)-r[Reexport all directories]' \
|
||||
'(-i)-u[Unexport one or more directories]' \
|
||||
'-f[Flush everything out of export table]' \
|
||||
'-o[option1,option2.. Specify a list of export options]' \
|
||||
'-s[Display the current export list suitable for /etc/exports]' \
|
||||
'-v[Be verbose]'
|
||||
}
|
||||
_exportfs "$@"
|
@ -1,109 +0,0 @@
|
||||
#compdef fab
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Fabric (http://fabfile.org)
|
||||
#
|
||||
# Source: https://github.com/vhbit/fabric-zsh-autocomplete
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Valerii Hiora (https://github.com/vhbit)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local curcontext=$curcontext state line
|
||||
declare -A opt_args
|
||||
|
||||
declare target_list
|
||||
target_list=(`fab --shortlist 2>/dev/null`)
|
||||
|
||||
_targets() {
|
||||
_describe -t commands "fabric targets" target_list
|
||||
}
|
||||
|
||||
output_levels=(
|
||||
'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.'
|
||||
'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!'
|
||||
'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.'
|
||||
'running: Printouts of commands being executed or files transferred, e.g. [myserver] run: ls /var/www. Also controls printing of tasks being run, e.g. [myserver] Executing task ''foo''.'
|
||||
'stdout: Local, or remote, stdout, i.e. non-error output from commands.'
|
||||
'stderr: Local, or remote, stderr, i.e. error-related output from commands.'
|
||||
'user: User-generated output, i.e. local output printed by fabfile code via use of the fastprint or puts functions.'
|
||||
)
|
||||
|
||||
_arguments -w -S -C \
|
||||
'(-)'{-h,--help}'[show this help message and exit]: :->noargs' \
|
||||
'(-)'{-V,--version}'[show program'\''s version number and exit]: :->noargs' \
|
||||
'(-)--list[print list of possible commands and exit]: :->noargs' \
|
||||
'(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \
|
||||
'(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \
|
||||
'(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \
|
||||
"(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \
|
||||
'(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \
|
||||
'(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \
|
||||
'(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \
|
||||
'(-p+ --password=-)'{-p+,--password=-}'[password for use with authentication and/or sudo]: :' \
|
||||
'(-H+ --hosts=-)'{-H+,--hosts=-}'[comma separated list of hosts to operate on]: :' \
|
||||
'(-R+ --roles=-)'{-R+,--roles=-}'[comma separated list of roles to operate on]: :' \
|
||||
'(-a --no-agent)'{-a,--no-agent}'[don'\''t use the running SSH agent]' \
|
||||
'(-k --no-keys)'{-k,--no-keys}'[don'\''t load private key files from ~/.ssh/]' \
|
||||
'(-w --warn-only)'{-w,--warn-only}'[warn instead of abort, when commands fail]' \
|
||||
'-i+[path to SSH private key file. May be repeated]: :_files' \
|
||||
"(-f+ --fabfile=)"{-f+,--fabfile=}"[Python module file to import]: :_files -g *.py" \
|
||||
'(-c+ --config=-)'{-c+,--config=-}'[specify location of config file to use]: :_files' \
|
||||
'(-s+ --shell=-)'{-s+,--shell=-}'[specify a new shell, defaults to ''/bin/bash -l -c'']: :' \
|
||||
'(--ssh-config-path=)--ssh-config-path=[ssh config path]: :_files' \
|
||||
'(--hide=-)--hide=-[comma-separated list of output levels to hide]: :->levels' \
|
||||
'(--show=-)--show=-[comma-separated list of output levels to show]: :->levels' \
|
||||
'*::: :->subcmds' && return 0
|
||||
|
||||
if [[ CURRENT -ge 1 ]]; then
|
||||
case $state in
|
||||
noargs)
|
||||
_message "nothing to complete";;
|
||||
levels)
|
||||
_describe -t commands "output levels" output_levels;;
|
||||
*)
|
||||
_targets;;
|
||||
esac
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,339 +0,0 @@
|
||||
#compdef fail2ban-client
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2020 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for 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:
|
@ -1,62 +0,0 @@
|
||||
#compdef ffind
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for ffind (https://github.com/jaimebuelta/ffind).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Sergei Eremenko (https://github.com/SmartFinn)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[show help message and exit]' \
|
||||
'--version[show version number and exit]' \
|
||||
'-p[match whole path, not only name of files]' \
|
||||
'--nocolor[do not display color]' \
|
||||
'--nosymlinks[do not follow symlinks]' \
|
||||
'--hidden[do not ignore hidden directories]' \
|
||||
'-c[force case sensitive]' \
|
||||
'-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
|
@ -1,123 +0,0 @@
|
||||
#compdef fleetctl
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2009-2015 Robby Russell and contributors (see
|
||||
# https://github.com/robbyrussell/oh-my-zsh/contributors)
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for fleetctl (https://github.com/coreos/fleet).
|
||||
#
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Remi Paulmier (https://github.com/shtouff)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# fleetctl zsh completion
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'cat:Output the contents of a submitted unit'
|
||||
'destroy:Destroy one or more units in the cluster'
|
||||
'fd-forward:Proxy stdin and stdout to a unix domain socket'
|
||||
'help:Show a list of commands or help for one command'
|
||||
'journal:Print the journal of a unit in the cluster to stdout'
|
||||
'list-machines:Enumerate the current hosts in the cluster'
|
||||
'list-unit-files:List the units that exist in the cluster.'
|
||||
'list-units:List the current state of units in the cluster'
|
||||
'load:Schedule one or more units in the cluster, first submitting them if necessary.'
|
||||
'ssh:Open interactive shell on a machine in the cluster'
|
||||
'start:Instruct systemd to start one or more units in the cluster, first submitting and loading if necessary.'
|
||||
'status:Output the status of one or more units in the cluster'
|
||||
'stop:Instruct systemd to stop one or more units in the cluster.'
|
||||
'submit:Upload one or more units to the cluster without starting them'
|
||||
'unload:Unschedule one or more units in the cluster.'
|
||||
'version:Print the version and exit'
|
||||
)
|
||||
|
||||
__task_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a tasks
|
||||
|
||||
tasks=(cat destroy fd-forward help journal list-machines list-unit-files \
|
||||
list-units load ssh start status stop submit unload version)
|
||||
|
||||
_wanted tasks expl 'help' compadd $tasks
|
||||
}
|
||||
|
||||
__unit_list ()
|
||||
{
|
||||
_wanted application expl 'command' compadd $(command fleetctl list-units | \
|
||||
tail -n +2 | awk '{print $1}')
|
||||
}
|
||||
|
||||
local expl
|
||||
|
||||
local curcontext="$curcontext" state line
|
||||
local -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
_describe -t commands "gem subcommand" _1st_arguments
|
||||
return
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(help)
|
||||
_arguments ':feature:__task_list'
|
||||
;;
|
||||
|
||||
(destroy|journal|start|status|stop|unload|cat)
|
||||
_arguments '*:feature:__unit_list'
|
||||
;;
|
||||
|
||||
(load|submit)
|
||||
_arguments '*:file:_files -g *.service'
|
||||
;;
|
||||
|
||||
(ssh)
|
||||
_arguments '*:host:_hosts'
|
||||
;;
|
||||
|
||||
(*)
|
||||
_arguments '*:file:_files'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,471 +0,0 @@
|
||||
#compdef flutter
|
||||
# ------------------------------------------------------------------------------
|
||||
#MIT License
|
||||
#
|
||||
#Copyright (c) 2018 Nickolay Simonov
|
||||
#
|
||||
#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 the Flutter.io sdk's cli tool (https://flutter.io)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Nikolai Simonov (https://github.com/NiKoTron) <nickolay.simonov@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
_flutter() {
|
||||
|
||||
typeset -A opt_args
|
||||
local context state line
|
||||
|
||||
local curcontext="$curcontext"
|
||||
|
||||
local ret=1
|
||||
|
||||
_arguments -C -A "-*" \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Noisy logging, including all shell commands executed.]' \
|
||||
'--quiet[Reduce the amount of output from some commands.]' \
|
||||
'(-d --device-id)'{-d,--device-id}'[Target device id or name (prefixes allowed).]' \
|
||||
'--version[Reports the version of this tool.]' \
|
||||
'--color[Whether to use terminal colors.]' \
|
||||
'--no-color[Whether to use terminal colors.]' \
|
||||
'--suppress-analytics[Suppress analytics reporting when this command runs.]' \
|
||||
'--bug-report[Captures a bug report file to submit to the Flutter team (contains local paths, device identifiers, and log snippets).]' \
|
||||
'--packages[Path to your ".packages" file. (required, since the current directory does not contain a ".packages" file)]' \
|
||||
'--flutter-root[The root directory of the Flutter repository (uses $FLUTTER_ROOT if set).]' \
|
||||
'1: :_root_commands' \
|
||||
'*::arg:->args' \
|
||||
&& ret=0
|
||||
|
||||
case "$state" in
|
||||
(args)
|
||||
case $words[1] in
|
||||
(help)
|
||||
_arguments -C \
|
||||
'1: :_root_commands' \
|
||||
&& ret=0
|
||||
;;
|
||||
(analyze)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--flutter-repo[Include all the examples and tests from the Flutter repository.]' \
|
||||
'--no-flutter-repo[Include all the examples and tests from the Flutter repository.]' \
|
||||
'--current-package[Include the lib/main.dart file from the current directory, if any. (defaults to on)]' \
|
||||
'--no-current-package[Include the lib/main.dart file from the current directory, if any. (defaults to on)]' \
|
||||
'--watch[Run analysis continuously, watching the filesystem for changes.]' \
|
||||
'--preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \
|
||||
'--no-preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \
|
||||
'--write=[Also output the results to a file. This is useful with --watch if you want a file to always contain the latest results.]: :_files -/' \
|
||||
'--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
|
||||
'--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
|
||||
'--congratulate[When analyzing the flutter repository, show output even when there are no errors, warnings, hints, or lints. (defaults to on)]' \
|
||||
'--no-congratulate[When analyzing the flutter repository, show output even when there are no errors, warnings, hints, or lints. (defaults to on)]' \
|
||||
'--preamble[When analyzing the flutter repository, display the number of files that will be analyzed. (defaults to on)]' \
|
||||
'--no-preamble[When analyzing the flutter repository, display the number of files that will be analyzed. (defaults to on)]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(assemble)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(attach)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(bash-completion)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(build)
|
||||
_arguments -C \
|
||||
'1: :_build_entities' \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(channel)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(clean)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(config)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--analytics[Enable or disable reporting anonymously tool usage statistics and crash reports.]' \
|
||||
'--no-analytics[Enable or disable reporting anonymously tool usage statistics and crash reports.]' \
|
||||
'--clear-ios-signing-cert[Clear the saved development certificate choice used to sign apps for iOS device deployment.]' \
|
||||
'--gradle-dir[The gradle install directory.]' \
|
||||
'--android-sdk[The Android SDK directory.]' \
|
||||
'--android-studio-dir[The Android Studio install directory.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
|
||||
(create)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--pub[Whether to run "flutter packages get" after the project has been created. (defaults to on)]' \
|
||||
'--no-pub[Whether to run "flutter packages get" after the project has been created. (defaults to on)]' \
|
||||
'--offline[When "flutter packages get" is run by the create command, this indicates whether to run it in offline mode or not. In offline mode, it will need to have all dependencies already available in the pub cache to succeed.]' \
|
||||
'--no-offline[When "flutter packages get" is run by the create command, this indicates whether to run it in offline mode or not. In offline mode, it will need to have all dependencies already available in the pub cache to succeed.]' \
|
||||
"--with-driver-test[Also add a fl:_root_commandsutter_driver dependency and generate a sample 'flutter drive' test.]" \
|
||||
"--no-with-driver-test[Also add a flutter_driver dependency and generate a sample 'flutter drive' test.]" \
|
||||
'(-t= --template=)'{-t=,--template=}'[Specify the type of project to create.]: :_project_templates' \
|
||||
"--description[The description to use for your new Flutter project. This string ends up in the pubspec.yaml file. (defaults to 'A new Flutter project.')]" \
|
||||
"--org[The organization responsible for your new Flutter project, in reverse domain name notation. This string is used in Java package names and as prefix in the iOS bundle identifier. (defaults to 'com.example')]" \
|
||||
'(-i= --ios-language)'{-i=,--ios-language}'[iOS project language]: :_ios_languages' \
|
||||
'(-a= --android-language)'{-a=,--android-language}'[Android project language]: :_droid_languages' \
|
||||
&& ret=0
|
||||
;;
|
||||
|
||||
(daemon)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(devices)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(doctor)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
"--android-licenses[Run the Android SDK manager tool to accept the SDK's licenses.]" \
|
||||
&& ret=0
|
||||
;;
|
||||
(drive)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--debug[Build a debug version of your app (default mode).]' \
|
||||
'--profile[Build a version of your app specialized for performance profiling.]' \
|
||||
'--release[Build a release version of your app.]' \
|
||||
'--flavor[Build a custom app flavor as defined by platform-specific build setup. Supports the use of product flavors in Android Gradle scripts. Supports the use of custom Xcode schemes.]' \
|
||||
'--trace-startup[Start tracing during startup.]' \
|
||||
'--route[Which route to load when running the app.]' \
|
||||
'--target-platform[Specify the target platform when building the app for an Android device. Ignored on iOS.]: :_target_platforms' \
|
||||
'(-t= --target=)'{-t=,-target=}'[The main entry-point file of the application, as run on the device. If the --target option is omitted, but a file name is provided on the command line, then that is used instead. (defaults to "lib/main.dart")]: :_files -g "*.dart"' \
|
||||
'--observatory-port[Listen to the given port for an observatory debugger connection. Specifying port 0 will find a random free port. Defaults to the first available port after 8100.]' \
|
||||
'--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
|
||||
'--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
|
||||
'--no-keep-app-running[Will keep the Flutter application running when done testing. By default, "flutter drive" stops the application after tests are finished, and --keep-app-running overrides this. On the other hand, if --use-existing-app is specified, then "flutter drive" instead defaults to leaving the application running, and --no-keep-app-running overrides it.]' \
|
||||
'--keep-app-running[Will keep the Flutter application running when done testing. By default, "flutter drive" stops the application after tests are finished, and --keep-app-running overrides this. On the other hand, if --use-existing-app is specified, then "flutter drive" instead defaults to leaving the application running, and --no-keep-app-running overrides it.]' \
|
||||
'--use-existing-app=[Connect to an already running instance via the given observatory URL. If this option is given, the application will not be automatically started, and it will only be stopped if --no-keep-app-running is explicitly set.]' \
|
||||
'--driver=[The test file to run on the host (as opposed to the target file to run on the device). By default, this file has the same base name as the target file, but in the "test_driver/" directory instead, and with "_test" inserted just before the extension, so e.g. if the target is "lib/main.dart", the driver will be "test_driver/main_test.dart".]: :_files' \
|
||||
'--preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \
|
||||
'--no-preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(emulators)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(format)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(fuchsia_reload)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--debug[Build a debug version of your app (default mode).]' \
|
||||
'--profile[Build a version of your app specialized for performance profiling.]' \
|
||||
'--release[Build a release version of your app.]' \
|
||||
'(-a --address)'{-a,--address}'[Fuchsia device network name or address.]' \
|
||||
'(-b --build-dir)'{-b,--build-dir}'[Fuchsia build directory, e.g. out/release-x86-64.]' \
|
||||
'(-g --gn-target)'{-g,--gn-target}'[GN target of the application, e.g //path/to/app:app.]' \
|
||||
'(-i --isolate-number)'{-i,--isolate-number}'[To reload only one instance, specify the isolate number, e.g. the number in foo$main-###### given by --list.]' \
|
||||
'(-l --list)'{-l,--list}'[Lists the running modules.]' \
|
||||
'(-l --no-list)'{-l,--no-list}'[Lists the running modules.]' \
|
||||
'(-n --name-override)'{-n,--name-override}'[On-device name of the application binary.]' \
|
||||
'(-2 --preview-dart-2)'{-2,--preview-dart-2}'[Preview Dart 2.0 functionality.]' \
|
||||
'(-2 --no-preview-dart-2)'{-2,--no-preview-dart-2}'[Preview Dart 2.0 functionality.]' \
|
||||
'(-t --target)'{-t,--target}'[Target app path / main entry-point file. Relative to --gn-target path, e.g. lib/main.dart. (defaults to "lib/main.dart")]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(ide-config)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--overwrite[When performing operations, overwrite existing files.]' \
|
||||
'--no-overwrite[When performing operations, overwrite existing files.]' \
|
||||
'--update-templates[Update the templates in the template directory from the current configuration files. This is the opposite of what ide-config usually does. Will search the flutter tree for .iml files and copy any missing ones into the template directory. If --overwrite is also specified, it will update any out-of-date files, and remove any deleted files from the template directory.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(inject-plugins)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(install)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(logs)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'(-c --clear)'{-c,--clear}'[Clear log history before reading from logs.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(packages)
|
||||
_arguments -C \
|
||||
'1: :_package_subcomands' \
|
||||
'*::pkg-arg:->pkg-args' \
|
||||
&& ret=0
|
||||
case "$state" in
|
||||
(pkg-args)
|
||||
case $words[1] in
|
||||
(get)
|
||||
_arguments \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--offline[Use cached packages instead of accessing the network.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(pub)
|
||||
_arguments \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(test)
|
||||
_arguments \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(upgrade)
|
||||
_arguments \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--offline[Use cached packages instead of accessing the network.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
(precache)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'(-a --all-platforms)]'{-a--all-platforms}'[Precache artifacts for all platforms.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(run)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--debug[Build a debug version of your app (default mode).]' \
|
||||
'--profile[Build a version of your app specialized for performance profiling.]' \
|
||||
'--release[Build a release version of your app.]' \
|
||||
'--flavor[Build a custom app flavor as defined by platform-specific build setup. Supports the use of product flavors in Android Gradle scripts. Supports the use of custom Xcode schemes.]' \
|
||||
'--trace-startup[Start tracing during startup.]' \
|
||||
'--route[Which route to load when running the app.]' \
|
||||
'--target-platform[Specify the target platform when building the app for an Android device. Ignored on iOS.]: :_target_platforms' \
|
||||
'(-t= --target=)'{-t=,--target=}'[The main entry-point file of the application, as run on the device. If the --target option is omitted, but a file name is provided on the command line, then that is used instead. (defaults to "lib/main.dart")]: :_files -g "*.dart"' \
|
||||
'--observatory-port[Listen to the given port for an observatory debugger connection. Specifying port 0 will find a random free port.Defaults to the first available port after 8100.]' \
|
||||
'--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
|
||||
'--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
|
||||
'--full-restart[Stop any currently running application process before running the app. (defaults to on)]' \
|
||||
'--no-full-restart[Stop any currently running application process before running the app. (defaults to on)]' \
|
||||
'--start-paused[Start in a paused mode and wait for a debugger to connect.]' \
|
||||
'--enable-software-rendering[Enable rendering using the Skia software backend. This is useful when testing Flutter on emulators. By default, Flutter will attempt to either use OpenGL or Vulkan and fall back to software when neither is available.]' \
|
||||
'--skia-deterministic-rendering When combined with --enable-software-rendering, provides 100% deterministic Skia rendering.]' \
|
||||
'--trace-skia[Enable tracing of Skia code. This is useful when debugging the GPU thread. By default, Flutter will not log skia code.]' \
|
||||
'--use-test-fonts[Enable (and default to) the "Ahem" font. This is a special font used in tests to remove any dependencies on the font metrics. It is enabled when you use "flutter test". Set this flag when running a test using "flutter run" for debugging purposes. This flag is only available when running in debug mode.]' \
|
||||
'--no-use-test-fonts[Enable (and default to) the "Ahem" font. This is a special font used in tests to remove any dependencies on the font metrics. It is enabled when you use "flutter test". Set this flag when running a test using "flutter run" for debugging purposes. This flag is only available when running in debug mode.]' \
|
||||
'--build[If necessary, build the app before running. (defaults to on)]' \
|
||||
'--no-build[If necessary, build the app before running. (defaults to on)]' \
|
||||
'--hot[Run with support for hot reloading. (defaults to on)]' \
|
||||
'--no-hot[Run with support for hot reloading. (defaults to on)]' \
|
||||
'--pid-file[Specify a file to write the process id to. You can send SIGUSR1 to trigger a hot reload and SIGUSR2 to trigger a full restart.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(screenshot)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'(-o --out)'{-o,--out}'[Location to write the screenshot.]: :_files' \
|
||||
'--skia=[Retrieve the last frame rendered by a Flutter app as a Skia picture using the specified observatory port. To find the observatory port number, use "flutter run --verbose" and look for "Forwarded host port ... for Observatory" in the output.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(stop)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(test)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
|
||||
'--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
|
||||
'--name=[A regular expression matching substrings of the names of tests to run.]' \
|
||||
'--plain-name=[A plain-text substring of the names of tests to run.]' \
|
||||
'--start-paused[Start in a paused mode and wait for a debugger to connect. You must specify a single test file to run, explicitly. Instructions for connecting with a debugger and printed to the console once the test has started.]' \
|
||||
'--coverage[Whether to collect coverage information.]' \
|
||||
'--merge-coverage[Whether to merge coverage data with "coverage/lcov.base.info". Implies collecting coverage data. (Requires lcov)]' \
|
||||
'--coverage-path[Where to store coverage information (if coverage is enabled). (defaults to "coverage/lcov.info")]' \
|
||||
&& ret=0
|
||||
(trace)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--start[Start tracing.]' \
|
||||
'--stop[Stop tracing.]' \
|
||||
'--out[Specify the path of the saved trace file.]' \
|
||||
'(-d --duration)'{-d,--duration}'[Duration in seconds to trace. (defaults to "10")]' \
|
||||
'--debug-port[Local port where the observatory is listening. (defaults to "8100")]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(update-packages)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
'--force-upgrade[Attempt to update all the dependencies to their latest versions. This will actually modify the pubspec.yaml files in your checkout.]' \
|
||||
'--no-force-upgrade[Attempt to update all the dependencies to their latest versions. This will actually modify the pubspec.yaml files in your checkout.]' \
|
||||
'--paths[Finds paths in the dependency chain leading from package specified in --from to package specified in --to.]' \
|
||||
'--no-paths[Finds paths in the dependency chain leading from package specified in --from to package specified in --to.]' \
|
||||
'--from[Used with flag --dependency-path. Specifies the package to begin searching dependency path from.]' \
|
||||
'--to[Used with flag --dependency-path. Specifies the package that the sought after dependency path leads to.]' \
|
||||
'--transitive-closure[Prints the dependency graph that is the transitive closure of packages the Flutter SDK depends on.]' \
|
||||
'--no-transitive-closure[Prints the dependency graph that is the transitive closure of packages the Flutter SDK depends on.]' \
|
||||
'--verify-only[verifies the package checksum without changing or updating deps]' \
|
||||
'--no-verify-only[verifies the package checksum without changing or updating deps]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(upgrade)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(version)
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[Print this usage information.]' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
return ret
|
||||
|
||||
}
|
||||
|
||||
|
||||
(( $+functions[_root_commands] )) ||
|
||||
_root_commands() {
|
||||
local commands;
|
||||
commands=(
|
||||
"analyze:Analyze the project's Dart code."
|
||||
'assemble:Assemble and build flutter resources.'
|
||||
'attach:Attach to a running application.'
|
||||
'bash-completion:Output command line shell completion setup scripts.'
|
||||
'build:Flutter build commands.'
|
||||
'channel:List or switch flutter channels.'
|
||||
'clean:Delete the build/ directory.'
|
||||
'config:Configure Flutter settings.'
|
||||
'create:Create a new Flutter project.'
|
||||
'daemon:Run a persistent, JSON-RPC based server to communicate with devices.'
|
||||
'devices:List all connected devices.'
|
||||
'doctor:Show information about the installed tooling.'
|
||||
'drive:Runs Flutter Driver tests for the current project.'
|
||||
'emulators:List, launch and create emulators.'
|
||||
'format:Format one or more dart files.'
|
||||
'fuchsia_reload:Hot reload on Fuchsia.'
|
||||
'help:Display help information for flutter.'
|
||||
'ide-config:Configure the IDE for use in the Flutter tree.'
|
||||
'inject-plugins:Re-generates the GeneratedPluginRegistrants.'
|
||||
'install:Install a Flutter app on an attached device.'
|
||||
'logs:Show log output for running Flutter apps.'
|
||||
'packages:Commands for managing Flutter packages.'
|
||||
"precache:Populates the Flutter tool's cache of binary artifacts."
|
||||
'run:Run your Flutter app on an attached device.'
|
||||
'screenshot:Take a screenshot from a connected device.'
|
||||
'stop:Stop your Flutter app on an attached device.'
|
||||
'test:Run Flutter unit tests for the current project.'
|
||||
'trace:Start and stop tracing for a running Flutter app.'
|
||||
'update-packages:Update the packages inside the Flutter repo.'
|
||||
'upgrade:Upgrade your copy of Flutter.'
|
||||
'version:List or switch flutter versions.')
|
||||
_describe -t commands 'command' commands "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_build_entities] )) ||
|
||||
_build_entities() {
|
||||
local entities;
|
||||
entities=("aot:Build an ahead-of-time compiled snapshot of your app's Dart code."
|
||||
"apk:Build an Android APK file from your app."
|
||||
"flx:Build a Flutter FLX file from your app."
|
||||
"ios:Build an iOS application bundle (Mac OS X host only).")
|
||||
_describe -t entities 'entity' entities "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_project_templates] )) ||
|
||||
_project_templates() {
|
||||
local templates;
|
||||
templates=("app:(default) Generate a Flutter application."
|
||||
"package:Generate a shareable Flutter project containing modular Dart code."
|
||||
"plugin:Generate a shareable Flutter project containing an API in Dart code with a platform-specific implementation for Android, for iOS code, or for both.")
|
||||
_describe -t templates 'template' templates "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_ios_languages] )) ||
|
||||
_ios_languages() {
|
||||
local languages;
|
||||
languages=("objc:(default) Objective-C."
|
||||
"swift:Swift.")
|
||||
_describe -t languages 'language' languages "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_droid_languages] )) ||
|
||||
_droid_languages() {
|
||||
local languages;
|
||||
languages=("java:(default) Java."
|
||||
"kotlin:Kotlin.")
|
||||
_describe -t languages 'language' languages "$@"
|
||||
}
|
||||
|
||||
(( $+functions[_target_platforms] )) ||
|
||||
_target_platforms() {
|
||||
local platforms;
|
||||
platforms=("default:(default) default."
|
||||
"android-arm:android-arm."
|
||||
"android-arm64:android-arm64.")
|
||||
_describe -t platforms 'platform' platforms "$@"
|
||||
}
|
||||
|
||||
|
||||
(( $+functions[_package_subcomands] )) ||
|
||||
_package_subcomands() {
|
||||
local subcommands;
|
||||
subcommands=("get:Get packages in a Flutter project."
|
||||
"pub:Pass the remaining arguments to Dart's 'pub' tool."
|
||||
"test:Run the 'test' package."
|
||||
"upgrade:Upgrade packages in a Flutter project.")
|
||||
_describe -t subcommands 'subcommand' subcommands "$@"
|
||||
}
|
||||
|
||||
_flutter "$@"
|
@ -1,221 +0,0 @@
|
||||
#compdef force
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for force CLI 0.22.39 (https://github.com/heroku/force).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Peter Limbach <https://github.com/pelim>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'apiversion:Display/Set current API version'
|
||||
'login:force login [-i=<instance>] [<-u=username> <-p=password>]'
|
||||
'logout:Log out from force.com'
|
||||
'logins:List force.com logins used'
|
||||
'active:Show or set the active force.com account'
|
||||
'whoami:Show information about the active account'
|
||||
'describe:Describe the object or list of available objects'
|
||||
'sobject:Manage standard & custom objects'
|
||||
'bigobject:Manage big objects'
|
||||
'field:Manage sobject fields'
|
||||
'record:Create, modify, or view records'
|
||||
'bulk:Load csv file use Bulk API'
|
||||
'fetch:Export specified artifact(s) to a local directory'
|
||||
'import:Import metadata from a local directory'
|
||||
'export:Export metadata to a local directory'
|
||||
'query:Execute a SOQL statement'
|
||||
'apex:Execute anonymous Apex code'
|
||||
'trace:Manage trace flags'
|
||||
'log:Fetch debug logs'
|
||||
'eventlogfile:List and fetch event log file'
|
||||
'oauth:Manage ConnectedApp credentials'
|
||||
'test:Run apex tests'
|
||||
'security:Displays the OLS and FLS for a give SObject'
|
||||
'version:Display current version'
|
||||
'update:Update to the latest version'
|
||||
'push:Deploy artifact from a local directory'
|
||||
'aura:force aura push -f <filepath>'
|
||||
'password:See password status or reset password'
|
||||
'notify:Should notifications be used'
|
||||
'limits:Display current limits'
|
||||
'help:Show this help'
|
||||
'datapipe:Manage DataPipes'
|
||||
)
|
||||
|
||||
local -a _field_arguments
|
||||
|
||||
|
||||
_apex_types=(
|
||||
'string' 'textarea' 'longtextarea' 'richtextarea'
|
||||
'boolean' 'double' 'number' 'autonumber' 'picklist'
|
||||
'lookup' 'masterdetail' 'geolocation'
|
||||
)
|
||||
|
||||
_field_arguments=(
|
||||
'list' 'create' 'delete' 'type'
|
||||
)
|
||||
|
||||
_sobject_arguments=(
|
||||
'list' 'create' 'delete'
|
||||
)
|
||||
|
||||
_bulk_arguments=(
|
||||
'insert:upload a .csv file to insert records'
|
||||
'update:upload a .csv file to update records'
|
||||
'query:run a SOQL statement to generate a .csv file on the server'
|
||||
'retrieve:retrieve a query generated .csv file from the server'
|
||||
'job:get information about a job based on job Id'
|
||||
'batch:get detailed information about a batch within a job based on job Id and batch Id'
|
||||
'batches:get a list of batches associated with a job based on job Id'
|
||||
)
|
||||
|
||||
__sobject_list() {
|
||||
_wanted application expl 'sobjects' compadd $(force sobject list)
|
||||
}
|
||||
|
||||
__log_list() {
|
||||
_wanted application expl 'logfiles' compadd $(force log | grep -o -e '07\w*')
|
||||
}
|
||||
|
||||
__login_user_list() {
|
||||
# remove active user string, remove colors & print the username
|
||||
_wanted application expl 'usernames' compadd $(force logins | sed 's/(active)//' | sed 's,$(printf "\033"")\\[[0-9;]*[a-zA-Z],,g' | awk '{print $1}')
|
||||
}
|
||||
|
||||
__login_instance_list() {
|
||||
_wanted application expl 'instances' compadd $(force logins | awk '{print $3}' | sed 's/https:\/\///')
|
||||
}
|
||||
|
||||
__sobject_command () {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
_describe -t commands "sobject commands" _sobject_arguments
|
||||
return
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(delete)
|
||||
_arguments ':feature:__sobject_list'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__field_command () {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
_describe -t commands "field commands" _field_arguments
|
||||
return
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(list)
|
||||
_arguments ':feature:__sobject_list'
|
||||
;;
|
||||
(type)
|
||||
_describe -t commands "apex types" _apex_types
|
||||
return
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
local expl
|
||||
local -a active logins
|
||||
|
||||
local curcontext="$curcontext" state line
|
||||
local -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
_describe -t commands "force commands" _1st_arguments
|
||||
return
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(help)
|
||||
_describe -t commands "command help" _1st_arguments
|
||||
return
|
||||
;;
|
||||
|
||||
(login)
|
||||
_arguments \
|
||||
'-u[salesforce user]:userame:__login_user_list' \
|
||||
'-i[salesforce instance]:instance:__login_instance_list' \
|
||||
'-p[salesforce password]'
|
||||
;;
|
||||
(bulk)
|
||||
_arguments \
|
||||
'-c[bulk command]:_bulk_arguments'
|
||||
;;
|
||||
|
||||
(log)
|
||||
_arguments ':feature:__log_list'
|
||||
;;
|
||||
|
||||
(field)
|
||||
__field_command
|
||||
;;
|
||||
|
||||
(sobject)
|
||||
__sobject_command
|
||||
;;
|
||||
|
||||
esac
|
||||
;;
|
||||
esac
|
@ -1,293 +0,0 @@
|
||||
#compdef fwupdmgr
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for fwupdmgr 1.2.9 (https://github.com/hughsie/fwupd).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_fwupdmgr() {
|
||||
|
||||
local context state state_descr line
|
||||
typeset -A opt_args
|
||||
|
||||
_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]' \
|
||||
--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-history'[do not write to the history database]' \
|
||||
--show-all-devices'[show devices that are not updatable]' \
|
||||
'(-): :->command' \
|
||||
'(-)*:: :->arguments' \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
_fwupdmgr_commands
|
||||
;;
|
||||
(arguments)
|
||||
curcontext=${curcontext%:*:*}:fwupdmgr-$words[1]:
|
||||
if (( $+functions[_fwupdmgr_${words[1]}_args] )); then
|
||||
_fwupdmgr_${words[1]}_args
|
||||
else
|
||||
_message "unknown command ${words[1]}" && ret=1
|
||||
fi
|
||||
;;
|
||||
(*)
|
||||
_message "unknown state $state" && ret=1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_commands] )) ||
|
||||
_fwupdmgr_commands() {
|
||||
local commands=(
|
||||
'activate:activate devices'
|
||||
'clear-history:erase all firmware update history'
|
||||
'clear-offline:clears any updates scheduled to be updated offline'
|
||||
'clear-results:clears the results from the last update'
|
||||
'disable-remote:disables a given remote'
|
||||
'downgrade:downgrades the firmware on a device'
|
||||
'enable-remote:enables a given remote'
|
||||
'get-approved-firmware:gets the list of approved 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-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'
|
||||
'install:install a firmware file on this hardware'
|
||||
'modify-config:modifies a daemon configuration value'
|
||||
'modify-remote:modifies a given remote'
|
||||
'refresh:refresh metadata from remote server'
|
||||
'report-history:share firmware history with the developers'
|
||||
'set-approved-firmware:sets the list of approved firmware'
|
||||
'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_activate_args] )) ||
|
||||
_fwupdmgr_activate_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_device_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_clear-history_args] )) ||
|
||||
_fwupdmgr_clear-history_args() {
|
||||
_message 'no more arguments' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_clear-results_args] )) ||
|
||||
_fwupdmgr_clear-results_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_device_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_disable-remote_args] )) ||
|
||||
_fwupdmgr_disable-remote_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_remote_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_downgrade_args] )) ||
|
||||
_fwupdmgr_downgrade_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_device_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_enable-remote_args] )) ||
|
||||
_fwupdmgr_enable-remote_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_remote_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_get-approved-firmware_args] )) ||
|
||||
_fwupdmgr_get-approved-firmware_args() {
|
||||
_message 'no more arguments' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_get-details_args] )) ||
|
||||
_fwupdmgr_get-details_args() {
|
||||
_files
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_get-devices_args] )) ||
|
||||
_fwupdmgr_get-devices_args() {
|
||||
_message 'no more arguments' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_get-history_args] )) ||
|
||||
_fwupdmgr_get-history_args() {
|
||||
_message 'no more arguments' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_get-releases_args] )) ||
|
||||
_fwupdmgr_get-releases_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_device_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_get-remotes_args] )) ||
|
||||
_fwupdmgr_get-remotes_args() {
|
||||
_message 'no more arguments' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_get-results_args] )) ||
|
||||
_fwupdmgr_get-results_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_device_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_get-topology_args] )) ||
|
||||
_fwupdmgr_get-topology_args() {
|
||||
_message 'no more arguments' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_get-updates_args] )) ||
|
||||
_fwupdmgr_get-updates_args() {
|
||||
_message 'no more arguments' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_install_args] )) ||
|
||||
_fwupdmgr_install_args() {
|
||||
_arguments -C \
|
||||
'1: :_files' \
|
||||
'2: :_fwupdmgr_device_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_TODO_args] )) ||
|
||||
_fwupdmgr_TODO_args() {
|
||||
_message 'no more arguments' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_modify-config_args] )) ||
|
||||
_fwupdmgr_modify-config_args() {
|
||||
local ret=1
|
||||
if compset -P '*,'; then
|
||||
_wanted config-value expl 'config value' _fwupdmgr_config_values ${IPREFIX%=} && ret=0
|
||||
else
|
||||
_wanted config-key expl 'config key' _fwupdmgr_config_keys -qS, && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_modify-remote_args] )) ||
|
||||
_fwupdmgr_modify-remote_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_remote_ids' \
|
||||
'2: :_fwupdmgr_remote_keys' \
|
||||
'3: :_fwupdmgr_remote_values'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_refresh_args] )) ||
|
||||
_fwupdmgr_refresh_args() {
|
||||
_arguments -C \
|
||||
'1: :_files' \
|
||||
'2:file signature:' \
|
||||
'3: :_fwupdmgr_remote_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_report-history_args] )) ||
|
||||
_fwupdmgr_report-history_args() {
|
||||
_message 'no more arguments' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_set-approved-firmware_args] )) ||
|
||||
_fwupdmgr_set-approved-firmware_args() {
|
||||
_message 'checksum' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_unlock_args] )) ||
|
||||
_fwupdmgr_unlock_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_device_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_update_args] )) ||
|
||||
_fwupdmgr_update_args() {
|
||||
_message 'no more arguments' && ret=0
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_verify_args] )) ||
|
||||
_fwupdmgr_verify_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_device_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_verify-update_args] )) ||
|
||||
_fwupdmgr_verify-update_args() {
|
||||
_arguments -C \
|
||||
'1: :_fwupdmgr_device_ids'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_device_ids] )) ||
|
||||
_fwupdmgr_device_ids() {
|
||||
# TODO add device name as description
|
||||
local devices=($(_call_program devices fwupdmgr get-devices | grep -Po 'DeviceId:\s+\K(.*)'))
|
||||
_describe -t devices 'device ID' devices
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_remote_ids] )) ||
|
||||
_fwupdmgr_remote_ids() {
|
||||
# TODO add remote description
|
||||
local remotes=($(_call_program remotes fwupdmgr get-remotes | grep -Po 'Remote ID:\s+\K(.*)'))
|
||||
_describe -t remotes 'remote ID' remotes
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_checksums] )) ||
|
||||
_fwupdmgr_checksums() {
|
||||
_guard '[^\-]#' 'checksum'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_config_keys] )) ||
|
||||
_fwupdmgr_config_keys() {
|
||||
_guard '[^\-]#' 'config key'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_config_values] )) ||
|
||||
_fwupdmgr_config_values() {
|
||||
_guard '[^\-]#' 'config value'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_remote_keys] )) ||
|
||||
_fwupdmgr_remote_keys() {
|
||||
_guard '[^\-]#' 'remote key'
|
||||
}
|
||||
|
||||
(( $+functions[_fwupdmgr_remote_values] )) ||
|
||||
_fwupdmgr_remote_values() {
|
||||
_guard '[^\-]#' 'remote value'
|
||||
}
|
||||
|
||||
_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
|
@ -1,69 +0,0 @@
|
||||
#compdef gas
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for gas (https://github.com/walle/gas).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Fredrik Wallgren <fredrik.wallgren@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local curcontext="$curcontext" state line cmds ret=1
|
||||
|
||||
_arguments -C \
|
||||
'(- 1 *)'{-v,--version}'[display version information]' \
|
||||
'(-h|--help)'{-h,--help}'[show help information]' \
|
||||
'1: :->cmds' \
|
||||
'*: :->args' && ret=0
|
||||
|
||||
case "$state" in
|
||||
(cmds)
|
||||
cmds=(
|
||||
"version:Prints Gas's version"
|
||||
"use:Uses author"
|
||||
"show:Shows your current user"
|
||||
"list:Lists your authors"
|
||||
"import:Imports current user to gasconfig"
|
||||
"help:Describe available tasks or one specific task"
|
||||
"delete:Deletes author"
|
||||
"add:Adds author to gasconfig"
|
||||
)
|
||||
_describe -t commands 'gas command' cmds && ret=0
|
||||
;;
|
||||
(args)
|
||||
case "$line[1]" in
|
||||
(use|delete)
|
||||
_values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
@ -1,618 +0,0 @@
|
||||
#compdef ghc ghci ghc-pkg
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for ghc (http://www.haskell.org/ghc/)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Gérard Milmeister
|
||||
# * Philip Dexter <philip.dexter@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local state
|
||||
local WORDS
|
||||
|
||||
#
|
||||
# ghci
|
||||
#
|
||||
|
||||
_ghc_ghci () { _ghc_compiler }
|
||||
|
||||
#
|
||||
# ghc
|
||||
#
|
||||
|
||||
_ghc_compiler ()
|
||||
{
|
||||
_arguments \
|
||||
"-no-hs-main[Don't assume this program contains main]" \
|
||||
"-no-user-package-conf[Don't load the user's package config file]" \
|
||||
'(- *)'{--help,-\?}'[Show help information]' \
|
||||
'*-I-[Add directory to path for #include files]:directory:_files -/' \
|
||||
'*-X-[Language flags]:flag:_ghc_language_flags' \
|
||||
'*-d-[Debugging options]:flag:_ghc_debugging_options' \
|
||||
'*-f-[Compiler options]:flag:_ghc_compiler_flags' \
|
||||
'*-hide-package[Hide package]:Package:_ghc_pkg_list_packages' \
|
||||
'*-trust[Expose package and set it to be trusted]:Package:_ghc_pkg_list_packages' \
|
||||
'*-distrust[Expose package and set it to be distrusted]:Package:_ghc_pkg_list_packages' \
|
||||
'*-distrust-all[Distrust all packages by default]' \
|
||||
'*-i-[Add directory to import path]:directory:->ghc_include_directory' \
|
||||
'*-package[Expose package]:Package:_ghc_pkg_list_packages' \
|
||||
'*:file:_files -g \*.\{lhs,hs,hc,c,s\}' \
|
||||
'--info[Display information about the compiler]' \
|
||||
'--show-options[Display the supported command line options]' \
|
||||
'--interactive[Interactive mode]' \
|
||||
'--make[Compile and link a complete Haskell program]:file:_files -g "*.{lhs,hs,hc,c,s}"' \
|
||||
'--numeric-version[Display GHC version (numeric only)]' \
|
||||
'--print-libdir[Display GHC library directory]' \
|
||||
'--show-iface[Show interface]:file:_files -g "*.hi"' \
|
||||
{--supported-languages,--supported-extensions}'[Display the supported language extensions]' \
|
||||
'-C[Stop after generating C]' \
|
||||
'-E[Stop after generating preprocessed, de-litted Haskell]' \
|
||||
'-H[Minimum heap size]:size:' \
|
||||
'-M[Output Makefile rules]' \
|
||||
'-O-[Enable optimization]:level:(0 1 2)' \
|
||||
'-Rghc-timing[Summarise timing stats for GHC]' \
|
||||
'-S[Stop after generating assembler]' \
|
||||
'-V[Display GHC version]' \
|
||||
'-W[Enable normal warnings]' \
|
||||
'-Wall[Enable almost all warnings]' \
|
||||
'-Werror[Make warnings fatal]' \
|
||||
'-Wwarn[Make warnings non-fatal]' \
|
||||
'-c[Stop after generating object files]' \
|
||||
'-eventlog[Enable runtime event tracing]' \
|
||||
'-debug[Use the debugging runtime]' \
|
||||
"-dylib-install-name[On Darwin/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
|
@ -1,120 +0,0 @@
|
||||
#compdef gist
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for 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>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local curcontext="$curcontext" state line ret=1
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
'(--login)--login[Authenticate gist on this computer.]' \
|
||||
'(-f --filename)'{-f,--filename}'[Sets the filename and syntax type.]:NAME' \
|
||||
'(-t --type)'{-t,--type}'[Sets the file extension and syntax type.]:EXT' \
|
||||
'(-p --private)'{-p,--private}'[Makes your gist private.]' \
|
||||
'(--no-private)'--no-private'[Makes your gist no private.]' \
|
||||
'(-d --description)'{-d,--description}'[Adds a description to your gist.]:DESCRIPTION' \
|
||||
'(-s --shorten)'{-s,--shorten}'[Shorten the gist URL using git.io.]' \
|
||||
'(-u --update)'{-u,--update}'[Update an existing gist.]:URL ID:user_gists' \
|
||||
'(-a --anonymous)'{-a,--anonymous}'[Create an anonymous gist.]' \
|
||||
'(-c --copy)'{-c,--copy}'[Copy the resulting URL to the clipboard]' \
|
||||
'(-e --embed)'{-e,--embed}'[Copy the embed code for the gist to the clipboard]' \
|
||||
'(-o --open)'{-o,--open}'[Open the resulting URL in a browser]' \
|
||||
'(--no-open)'--no-open'[No open the resulting URL in a browser]' \
|
||||
'(-P --paste)'{-P,--paste}'[Paste from the clipboard to gist]' \
|
||||
'(-h --help)'{-h,--help}'[print options help]' \
|
||||
'(-v --version)'{-v,--version}'[print version]' \
|
||||
'(-r --read)'{-r,--read}'[Read a gist and print out the contents]:user gists:user_gists' \
|
||||
'*: :_files' && ret=0
|
||||
|
||||
_user_gists_cache_policy() {
|
||||
# rebuild if cache is more than a day old
|
||||
local -a oldp
|
||||
oldp=( "$1"(mh+1) )
|
||||
(( $#oldp ))
|
||||
}
|
||||
|
||||
user_gists() {
|
||||
local update_policy ret=1
|
||||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
if [[ -z "$update_policy" ]]; then
|
||||
zstyle ":completion:${curcontext}:" cache-policy _user_gists_cache_policy
|
||||
fi
|
||||
|
||||
# stores the gists of the logged in user in the format ID[Description]
|
||||
_list=()
|
||||
_cached_gists="user_gists"
|
||||
|
||||
# retrieve/Write gists from/to cache
|
||||
if _cache_invalid $_cached_gists || ! _retrieve_cache $_cached_gists; then
|
||||
_gists=$(gist -l)
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
_store_cache $_cached_gists _gists
|
||||
else
|
||||
# some error occurred, the user is probably not logged in
|
||||
# set _gists to an empty string so that no completion is attempted
|
||||
_gists=""
|
||||
fi
|
||||
else
|
||||
_retrieve_cache $_cached_gists
|
||||
fi
|
||||
|
||||
if [ -n "$_gists" ]; then
|
||||
echo "$_gists" | while read -r line; do
|
||||
# Splitting the gist -l output
|
||||
url="$(echo "$line" | cut -d " " -f 1 | cut -d "/" -f 4)"
|
||||
# gists w/o descriptions can have only one column in the output, those
|
||||
# have their description set to an empty string
|
||||
description="$(echo "$line" | awk '{if(NF > 1){$1=""; print $0}}')"
|
||||
|
||||
_list+=( "${url}[${description}]" )
|
||||
done
|
||||
|
||||
_values "gists" $_list
|
||||
ret=0
|
||||
fi
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
return ret
|
@ -1,444 +0,0 @@
|
||||
#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 (http://github.com/nvie/gitflow).
|
||||
#
|
||||
# Source: https://github.com/bobthecow/git-flow-completion
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Justin Hileman (https://github.com/bobthecow)
|
||||
# * Yusuke Muraoka (https://github.com/jbking)
|
||||
# * Vincent Driessen (https://github.com/nvie)
|
||||
# * Zifei Tong (https://github.com/chevalun)
|
||||
# * Ben O'Hara (https://github.com/benohara)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_git-flow ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'init:Initialize a new git repo with support for the branching model.'
|
||||
'feature:Manage your feature branches.'
|
||||
'release:Manage your release branches.'
|
||||
'hotfix:Manage your hotfix branches.'
|
||||
'support:Manage your support branches.'
|
||||
'version:Shows version information.'
|
||||
)
|
||||
_describe -t commands 'git flow' subcommands
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(init)
|
||||
_arguments \
|
||||
-f'[Force setting of gitflow branches, even if already configured]' \
|
||||
-d'[Use default branch naming conventions and prefixes]'
|
||||
;;
|
||||
|
||||
(version)
|
||||
;;
|
||||
|
||||
(hotfix)
|
||||
__git-flow-hotfix
|
||||
;;
|
||||
|
||||
(release)
|
||||
__git-flow-release
|
||||
;;
|
||||
|
||||
(feature)
|
||||
__git-flow-feature
|
||||
;;
|
||||
|
||||
(support)
|
||||
__git-flow-support
|
||||
;;
|
||||
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-release ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new release branch.'
|
||||
'finish:Finish a release branch.'
|
||||
'list:List all your release branches. (Alias to `git flow release`)'
|
||||
'publish:Publish this release branch to origin.`)'
|
||||
'track:Track a release branch from origin.`)'
|
||||
)
|
||||
_describe -t commands 'git flow release' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-s'[Sign the release tag cryptographically]'\
|
||||
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
|
||||
-m'[Use the given tag message]'\
|
||||
-n'[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]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-hotfix ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new hotfix branch.'
|
||||
'finish:Finish a hotfix branch.'
|
||||
'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
|
||||
'publish:Publish this hotfix branch to origin`)'
|
||||
)
|
||||
_describe -t commands 'git flow hotfix' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':hotfix:__git_flow_version_list'\
|
||||
':branch-name:__git_branch_names'
|
||||
;;
|
||||
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-s'[Sign the release tag cryptographically]'\
|
||||
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
|
||||
-m'[Use the given tag message]'\
|
||||
-p'[Push to $ORIGIN after performing finish]'\
|
||||
':hotfix:__git_flow_hotfix_list'
|
||||
;;
|
||||
|
||||
(publish)
|
||||
_arguments \
|
||||
':hotfix:__git_flow_hotfix_list'
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-feature ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new feature branch.'
|
||||
'finish:Finish a feature branch.'
|
||||
'list:List all your feature branches. (Alias to `git flow feature`)'
|
||||
'publish:Publish this feature branch to origin.'
|
||||
'track:Track a feature branch from origin.'
|
||||
'diff:Show a diff of changes since this feature branched off.'
|
||||
'rebase:Rebase a feature branch on top of develop.'
|
||||
'checkout:Check out (switch to) the given feature branch.'
|
||||
'pull:Pull a feature branch from a remote peer.'
|
||||
)
|
||||
_describe -t commands 'git flow feature' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':feature:__git_flow_feature_list'\
|
||||
':branch-name:__git_branch_names'
|
||||
;;
|
||||
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-r'[Finish branch by rebasing first]'\
|
||||
-k'[Keep branch after performing finish]'\
|
||||
-D'[Force delete feature branch after finish]'\
|
||||
':feature:__git_flow_feature_list'
|
||||
;;
|
||||
|
||||
(publish)
|
||||
_arguments \
|
||||
':feature:__git_flow_feature_list'\
|
||||
;;
|
||||
|
||||
(track)
|
||||
_arguments \
|
||||
':feature:__git_flow_feature_list'\
|
||||
;;
|
||||
|
||||
(diff)
|
||||
_arguments \
|
||||
':branch:__git_branch_names'\
|
||||
;;
|
||||
|
||||
(rebase)
|
||||
_arguments \
|
||||
-i'[Do an interactive rebase]' \
|
||||
':branch:__git_branch_names'
|
||||
;;
|
||||
|
||||
(checkout)
|
||||
_arguments \
|
||||
':branch:__git_flow_feature_list'\
|
||||
;;
|
||||
|
||||
(pull)
|
||||
_arguments \
|
||||
':remote:__git_remotes'\
|
||||
':branch:__git_branch_names'
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-support ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new support branch.'
|
||||
'list:List all your support branches. (Alias to `git flow support`)'
|
||||
)
|
||||
_describe -t commands 'git flow support' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':feature:__git_flow_support_list'\
|
||||
':branch-name:__git_branch_names'
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_version_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a versions
|
||||
|
||||
versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted versions expl 'version' compadd $versions
|
||||
}
|
||||
|
||||
__git_flow_feature_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a features
|
||||
|
||||
features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted features expl 'feature' compadd $features
|
||||
}
|
||||
|
||||
__git_remotes () {
|
||||
local expl gitdir remotes
|
||||
|
||||
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
|
||||
__git_command_successful || return
|
||||
|
||||
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
|
||||
__git_command_successful || return
|
||||
|
||||
# TODO: Should combine the two instead of either or.
|
||||
if (( $#remotes > 0 )); then
|
||||
_wanted remotes expl remote compadd $* - $remotes
|
||||
else
|
||||
_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
|
||||
fi
|
||||
}
|
||||
|
||||
__git_flow_hotfix_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a hotfixes
|
||||
|
||||
hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted hotfixes expl 'hotfix' compadd $hotfixes
|
||||
}
|
||||
|
||||
__git_flow_support_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a support
|
||||
|
||||
support=(${${(f)"$(_call_program support git flow support list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted hotfixes expl 'support' compadd $support
|
||||
}
|
||||
|
||||
|
||||
__git_branch_names () {
|
||||
local expl
|
||||
declare -a branch_names
|
||||
|
||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||
}
|
||||
|
||||
__git_command_successful () {
|
||||
if (( ${#pipestatus:#0} > 0 )); then
|
||||
_message 'not a git repository'
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
_git-flow "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,225 +0,0 @@
|
||||
#compdef git-journal
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for git-journal:
|
||||
# https://github.com/saschagrunert/git-journal
|
||||
#
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Sascha Grunert <mail@saschagruenrt.de>
|
||||
# * Nico Wagner <nico@cryptopone.org>
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_git-journal() {
|
||||
typeset -A opt_args
|
||||
local ret=1
|
||||
|
||||
local context curcontext="$curcontext" state line
|
||||
_arguments -s -S -C \
|
||||
"-p+[Sets a custom working path.]" \
|
||||
"--path+[Sets a custom working path.]" \
|
||||
"-n+[The number of tags until the parser stops when a single revision is given.]" \
|
||||
"--tags-count+[The number of tags until the parser stops when a single revision is given.]" \
|
||||
"-e+[A pattern to exclude git tags from the processing.]" \
|
||||
"-t+[Use a custom output template.]" \
|
||||
"--template+[Use a custom output template.]" \
|
||||
"-o+[The output file for the changelog.]" \
|
||||
"--output+[The output file for the changelog.]" \
|
||||
"-a[Do not stop parsing at the first tag when a single revision is given. Overwrites '-n/--tags-count'.]" \
|
||||
"--all[Do not stop parsing at the first tag when a single revision is given. Overwrites '-n/--tags-count'.]" \
|
||||
"-g[Generate a fresh output template from a commit range.]" \
|
||||
"--generate[Generate a fresh output template from a commit range.]" \
|
||||
"-s[Print only the shortlog (summary) form.]" \
|
||||
"--short[Print only the shortlog (summary) form.]" \
|
||||
"-u[Skip entries without any relation to a git TAG.]" \
|
||||
"--skip-unreleased[Skip entries without any relation to a git TAG.]" \
|
||||
"-h[Prints help information]" \
|
||||
"--help[Prints help information]" \
|
||||
"-V[Prints version information]" \
|
||||
"--version[Prints version information]" \
|
||||
"1:: :_git-journal_commands" \
|
||||
"*:: :->git-journal" \
|
||||
&& ret=0
|
||||
case $state in
|
||||
(git-journal)
|
||||
curcontext="${curcontext%:*:*}:git-journal-command-$words[1]:"
|
||||
case $line[1] in
|
||||
(p)
|
||||
_arguments -s -S -C \
|
||||
"-h[Prints help information]" \
|
||||
"--help[Prints help information]" \
|
||||
"-V[Prints version information]" \
|
||||
"--version[Prints version information]" \
|
||||
"1:: :_git-journal_prepare_commands" \
|
||||
&& ret=0
|
||||
;;
|
||||
(prepare)
|
||||
_arguments -s -S -C \
|
||||
"-h[Prints help information]" \
|
||||
"--help[Prints help information]" \
|
||||
"-V[Prints version information]" \
|
||||
"--version[Prints version information]" \
|
||||
"1:: :_git-journal_prepare_commands" \
|
||||
&& ret=0
|
||||
;;
|
||||
(s)
|
||||
_arguments -s -S -C \
|
||||
"-h[Prints help information]" \
|
||||
"--help[Prints help information]" \
|
||||
"-V[Prints version information]" \
|
||||
"--version[Prints version information]" \
|
||||
&& ret=0
|
||||
;;
|
||||
(setup)
|
||||
_arguments -s -S -C \
|
||||
"-h[Prints help information]" \
|
||||
"--help[Prints help information]" \
|
||||
"-V[Prints version information]" \
|
||||
"--version[Prints version information]" \
|
||||
&& ret=0
|
||||
;;
|
||||
(v)
|
||||
_arguments -s -S -C \
|
||||
"-h[Prints help information]" \
|
||||
"--help[Prints help information]" \
|
||||
"-V[Prints version information]" \
|
||||
"--version[Prints version information]" \
|
||||
"1:: :_git-journal_verify_commands" \
|
||||
&& ret=0
|
||||
;;
|
||||
(verify)
|
||||
_arguments -s -S -C \
|
||||
"-h[Prints help information]" \
|
||||
"--help[Prints help information]" \
|
||||
"-V[Prints version information]" \
|
||||
"--version[Prints version information]" \
|
||||
"1:: :_git-journal_verify_commands" \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
_arguments -s -S -C \
|
||||
"-h[Prints help information]" \
|
||||
"--help[Prints help information]" \
|
||||
"-V[Prints version information]" \
|
||||
"--version[Prints version information]" \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
(( $+functions[_git-journal_commands] )) ||
|
||||
_git-journal_commands() {
|
||||
local commands; commands=(
|
||||
"prepare:Prepare a commit message before the user can edit it." \
|
||||
"p:Prepare a commit message before the user can edit it." \
|
||||
"setup:Creates all necessary git hooks and an initial configuration file. Shell completions for bash and fish will be available inside the current working directory." \
|
||||
"s:Creates all necessary git hooks and an initial configuration file. Shell completions for bash and fish will be available inside the current working directory." \
|
||||
"verify:Verify the specified commit message." \
|
||||
"v:Verify the specified commit message." \
|
||||
"help:Prints this message or the help of the given subcommand(s)" \
|
||||
"REVISION_RANGE:Specifies the revision range to be processed. If a single revision is specified, the output will stop at the first following git TAG." \
|
||||
)
|
||||
_describe -t commands 'git-journal commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_git-journal_help_commands] )) ||
|
||||
_git-journal_help_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
_describe -t commands 'git-journal help commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_git-journal_p_commands] )) ||
|
||||
_git-journal_p_commands() {
|
||||
local commands; commands=(
|
||||
"MESSAGE:The path to the commit message which should be prepared." \
|
||||
"TYPE:The type of the commit. For example "message"." \
|
||||
)
|
||||
_describe -t commands 'git-journal p commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_p_commands] )) ||
|
||||
_p_commands() {
|
||||
local commands; commands=(
|
||||
"MESSAGE:The path to the commit message which should be prepared." \
|
||||
"TYPE:The type of the commit. For example "message"." \
|
||||
)
|
||||
_describe -t commands 'p commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_git-journal_prepare_commands] )) ||
|
||||
_git-journal_prepare_commands() {
|
||||
local commands; commands=(
|
||||
"MESSAGE:The path to the commit message which should be prepared." \
|
||||
"TYPE:The type of the commit. For example "message"." \
|
||||
)
|
||||
_describe -t commands 'git-journal prepare commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_git-journal_s_commands] )) ||
|
||||
_git-journal_s_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
_describe -t commands 'git-journal s commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_s_commands] )) ||
|
||||
_s_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
_describe -t commands 's commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_git-journal_setup_commands] )) ||
|
||||
_git-journal_setup_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
_describe -t commands 'git-journal setup commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_git-journal_v_commands] )) ||
|
||||
_git-journal_v_commands() {
|
||||
local commands; commands=(
|
||||
"MESSAGE:The path to the commit message which should be prepared." \
|
||||
)
|
||||
_describe -t commands 'git-journal v commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_v_commands] )) ||
|
||||
_v_commands() {
|
||||
local commands; commands=(
|
||||
"MESSAGE:The path to the commit message which should be prepared." \
|
||||
)
|
||||
_describe -t commands 'v commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_git-journal_verify_commands] )) ||
|
||||
_git-journal_verify_commands() {
|
||||
local commands; commands=(
|
||||
"MESSAGE:The path to the commit message which should be prepared." \
|
||||
)
|
||||
_describe -t commands 'git-journal verify commands' commands "$@"
|
||||
}
|
||||
|
||||
_git-journal "$@"
|
@ -1,83 +0,0 @@
|
||||
#compdef git-pulls
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for git-pulls 0.3.1 (https://git-pulls.com/schacon/git-pulls).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud (https://github.com/nicoulaj)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_git-pulls() {
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext"
|
||||
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
'(- 1 *)--help[show usage]' \
|
||||
'1:cmd:->cmds' \
|
||||
'*::arg:->args' \
|
||||
&& ret=0
|
||||
|
||||
case "$state" in
|
||||
(cmds)
|
||||
local commands; commands=(
|
||||
'update:update pull requests list'
|
||||
'list:list pull requests'
|
||||
'show:show pull request'
|
||||
'browse:open pull request in a web browser'
|
||||
'merge:merge pull request'
|
||||
)
|
||||
_describe -t commands 'command' commands && ret=0
|
||||
;;
|
||||
(args)
|
||||
curcontext="${curcontext%:*:*}:git-pulls-cmd-$words[1]:"
|
||||
case $words[1] in
|
||||
(update)
|
||||
_message 'no more arguments' && ret=0
|
||||
;;
|
||||
(list)
|
||||
_arguments \
|
||||
'--reverse[list in reverse order]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(show)
|
||||
_arguments \
|
||||
'1: :_git-pulls_pull_requests_numbers' \
|
||||
'--full[use verbose output]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(browse|merge)
|
||||
_arguments \
|
||||
'1: :_git-pulls_pull_requests_numbers' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_git-pulls_pull_requests_numbers] )) ||
|
||||
_git-pulls_pull_requests_numbers() {
|
||||
local pull_requests; pull_requests=(${${${(M)${(f)"$(_call_program users $service list)"}:#[[:digit:]]##[[:space:]]*}//:/\\:}/[[:space:]]##/:})
|
||||
_describe -t pull-request-numbers 'pull request number' pull_requests "$@"
|
||||
}
|
||||
|
||||
_git-pulls "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,67 +0,0 @@
|
||||
#compdef git-revise
|
||||
#description update, split and rearrange commits
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for git-revise 0.5.1
|
||||
# (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]' \
|
||||
'--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)'{--interactive,-i}'[interactively edit commit stack]' \
|
||||
'(--interactive -i --message -m --cut -c)'{--message,-m}'[specify commit message on command line]:MESSAGE:()' \
|
||||
'(--interactive -i --message -m --cut -c)'{--cut,-c}'[interactively cut a commit into two smaller 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
|
@ -1,65 +0,0 @@
|
||||
#compdef git-wtf
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for git-wtf, authored by
|
||||
# William Morgan (http://git-wt-commit.rubyforge.org/git-wtf)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Mario Fernandez (https://github.com/sirech)
|
||||
# * 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]' \
|
||||
'(--all)'{-a,--all}'[show all branches across all remote repos, not just those from origin]' \
|
||||
'(--all-commits)'{-A,--all-commits}'[show all commits, not just the first 5]' \
|
||||
'(--key)'{-k,--key}'[show key]' \
|
||||
'(--relations)'{-r,--relations}'[show relation to features / integration branches]' \
|
||||
'(--dump-config)--dump-config[print out current configuration and exit]' \
|
||||
'*: :__git_wtf_branches'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,75 +0,0 @@
|
||||
#compdef glances
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for glances (http://nicolargo.github.com/glances/).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * loranger (https://github.com/loranger)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_glances() {
|
||||
|
||||
_arguments \
|
||||
"-0[Divide task CPU usage by the total number of CPUs]" \
|
||||
"-1[Start Glances in per CPU mode]" \
|
||||
"-2[Disable left sidebar]" \
|
||||
"-3[Disable quick look module]" \
|
||||
"-4[Disable all but quick look and load]" \
|
||||
"-5[Disable top menu]" \
|
||||
"-6[Start Glances in mean GPU mode]" \
|
||||
"-b[Display network rate in Byte per second]" \
|
||||
"-B[Bind server to the given IP or host NAME]:host:_hosts" \
|
||||
"-c[Connect to a Glances server]:host:_hosts" \
|
||||
"-C[Path to the configuration file]:configuration path:_files -/" \
|
||||
"-d[Enable debug mode]" \
|
||||
"-h[Display the syntax and exit]" \
|
||||
"-o[Define additional output (available: HTML or CSV)]:output type:(HTML CSV)" \
|
||||
"-p[Define the client or server TCP port (default: 61209)]:port:_ports" \
|
||||
"-q[Disable the curses interface]" \
|
||||
"-s[Run Glances in server mode]" \
|
||||
"-t[Set the refresh time in seconds (default: 3)]:seconds:" \
|
||||
"-V[Display the version and exit]" \
|
||||
"-w[Run Glances in web server mode]" \
|
||||
"-z[Do not use the bold color attribute]" \
|
||||
"--browser[Start the client browser]" \
|
||||
"--disable-bg[Disable background colors in the terminal]" \
|
||||
"--disable-bold[Disable bold mode in the terminal]" \
|
||||
"--hide-kernel-threads[Hide kernel threads in process list]" \
|
||||
"--password[Define a client/server password]" \
|
||||
"--theme-white[Optimize display colors for white background]" \
|
||||
"--tree[Display processes as tree]" \
|
||||
"--username[Define a client/server username]" \
|
||||
}
|
||||
|
||||
_glances "$@"
|
File diff suppressed because it is too large
Load Diff
@ -1,94 +0,0 @@
|
||||
#compdef google
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for googlecl (https://code.google.com/p/googlecl/)
|
||||
#
|
||||
# Source: https://raw.github.com/dadrc/zsh-cfg/master/completions/_google
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * dadrc (https://github.com/dadrc)
|
||||
# * Ben O'Hara (https://github.com/benohara)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_google() {
|
||||
# init variables
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
# init state
|
||||
_arguments \
|
||||
'1: :->service'\
|
||||
'2: :->task'
|
||||
|
||||
case $state in
|
||||
service)
|
||||
_arguments '1:service:(picasa blogger youtube docs contacts calendar finance)'
|
||||
;;
|
||||
*)
|
||||
case $words[2] in
|
||||
picasa)
|
||||
compadd "$@" get create list list-albums tag post delete
|
||||
;;
|
||||
blogger)
|
||||
compadd "$@" post tag list delete
|
||||
;;
|
||||
youtube)
|
||||
compadd "$@" post tag list delete
|
||||
;;
|
||||
docs)
|
||||
compadd "$@" edit delete list upload get
|
||||
;;
|
||||
contacts)
|
||||
compadd "$@" list list-groups add add-groups delete-groups delete
|
||||
;;
|
||||
calendar)
|
||||
compadd "$@" add list today delete
|
||||
;;
|
||||
finance)
|
||||
compadd "$@" list-txn delete-pos create-pos delete-txn create create-txn list list-pos delete
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
esac
|
||||
}
|
||||
|
||||
_google "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,69 +0,0 @@
|
||||
#compdef gpgconf
|
||||
# Copyright (c) 2021 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:
|
||||
# Completions for gpgconf (configuration utility provided with GnuPG
|
||||
# <https://gnupg.org>)
|
||||
#
|
||||
# Authors:
|
||||
# * "score" <seejay.11@gmail.com> https://keybase.io/score_under
|
||||
|
||||
_gpgconf_component() {
|
||||
local values=(
|
||||
"${(@f)$(gpgconf --list-components | perl -F: -ale 'print "${F[0]}[$F[1]]"')}"
|
||||
)
|
||||
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' \
|
||||
'(-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]'
|
@ -1,87 +0,0 @@
|
||||
#compdef gtk-launch
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for gtk-launch on gtk+-3.14.8 (http://www.gtk.org/).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * ncaq <ncaq@ncaq.net> (version 3.14.8)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_gtk-launch() {
|
||||
_arguments \
|
||||
{-h,--help}'[Show help options]' \
|
||||
--help-all'[Show all help options]' \
|
||||
--help-gtk'[Show GTK+ Options]' \
|
||||
--display='[X display to use]' \
|
||||
'1: :_applications'
|
||||
}
|
||||
|
||||
_applications() {
|
||||
local -a applications
|
||||
|
||||
for file in /usr/share/applications/*.desktop; do
|
||||
applications+=`_format_entry $file`
|
||||
done
|
||||
|
||||
_values -w \
|
||||
'applications' \
|
||||
$applications
|
||||
}
|
||||
|
||||
_format_entry() {
|
||||
echo "`_remove_path_extension $1`[`_get_description $1`]"
|
||||
}
|
||||
|
||||
_remove_path_extension() {
|
||||
# echo arg
|
||||
# remove path string
|
||||
# remove extension string
|
||||
echo $1 | \
|
||||
sed 's/.*\///' | \
|
||||
sed 's/\.desktop//'
|
||||
}
|
||||
|
||||
_get_description() {
|
||||
# grep --no-messages option is handling of not UTF-8 text
|
||||
grep --no-messages '^Comment=\|^Exec=' $1 | \
|
||||
tr '\n' ' '
|
||||
}
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -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'
|
@ -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
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for hledger 1.10 ( http://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
|
@ -1,53 +0,0 @@
|
||||
#compdef homestead
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for homestead (http://laravel.com/docs/homestead).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * loranger (https://github.com/loranger)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_homestead_get_command_list () {
|
||||
homestead --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }'
|
||||
}
|
||||
|
||||
_homestead () {
|
||||
if [ -f homestead ]; then
|
||||
compadd `_homestead_get_command_list`
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _homestead php homestead
|
||||
compdef _homestead homestead
|
@ -1,199 +0,0 @@
|
||||
#compdef http
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for httpie 0.7.2 (http://httpie.org)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Akira Maeda <https://github.com/glidenote>
|
||||
# * Valodim <https://github.com/Valodim>
|
||||
# * Claus Klingberg <https://github.com/cjk>
|
||||
# * 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
|
||||
|
||||
}
|
||||
|
||||
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.]' \
|
||||
'(-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:(autumn borland bw colorful default emacs friendly fruity manni monokai murphy native pastie perldoc ttr solarized tango trac vim vs)' \
|
||||
'(-p --print)'{-p,--print}'=[String specifying what the output should contain]:print flags:_httpie_printflags' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Print the whole request as well as the response.]' \
|
||||
'(-p -h --headers)'{-h,--headers}'[Print only the response headers.]' \
|
||||
'(-p -b --body)'{-b,--body}'[Print only the response body.]' \
|
||||
'--all[By default, only the final request/response is shown]' \
|
||||
'(--P --history-print)'{-P,--history-print}'=[The same as --print but applies only to intermediary requests/response]:print flags:_httpie_printflags' \
|
||||
'(-S --stream)'{-S,--stream}'[Always stream the output by line, i.e., behave like `tail -f`.]' \
|
||||
'(-o --output)'{-o,--output}'=[Save output to FILE.]:output file:_files' \
|
||||
'(-d --download)'{-d,--download}'=[Do not print the response body to stdout.]' \
|
||||
'(-c --continue)'{-c,--continue}'[Resume an interrupted download.]' \
|
||||
'(--session-read-only)--session=[Create, or reuse and update a session.]:session name (or path)' \
|
||||
'(--session)--session-read-only=[Create or read a session without updating it form the request/response exchange.]:session name (or path)' \
|
||||
'(-a --auth)'{-a,--auth}'=[If only the username is provided (-a username)]:USER\:PASS' \
|
||||
'--auth-type=[The authentication mechanism to be used. Defaults to "basic".]:AUTH-TYPE:(basic digest)' \
|
||||
'--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)' \
|
||||
'--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' \
|
||||
'--allow-redirects[Set this flag if full redirects are allowed (e.g. re-POST-ing of data at new ``Location``)]' \
|
||||
'--timeout=[Float describes the timeout of the request (Use socket.setdefaulttimeout() as fallback).]:timeout (seconds)' \
|
||||
'--check-status[This flag instructs HTTPie to also check the HTTP status code and exit with an error if the status indicates one.]' \
|
||||
'--path-as-is[Bypass dot segment URL squashing]' \
|
||||
'(-I --ignore-stdin)'{-I,--ignore-stdin}'[Do not attempt to read stdin.]' \
|
||||
'(- *)--help[show help message.]' \
|
||||
"(- *)--version[show program's version number and exit.]" \
|
||||
'--traceback[Prints exception traceback should one occur.]' \
|
||||
'--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
|
@ -1,84 +0,0 @@
|
||||
#compdef ibus
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for ibus (https://github.com/ibus/ibus).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Tomo Kazahaya <https://github.com/tomonacci>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# The completion of "ibus emoji --lang=" depends on _language_codes from
|
||||
# https://github.com/zsh-users/zsh-completions.
|
||||
|
||||
local context state state_descr line
|
||||
typeset -A opt_args
|
||||
local curcontext=$curcontext
|
||||
|
||||
_arguments -C \
|
||||
":command:(($(ibus help|sed -ne 's/^ \(\S\+\) \+\(.*\)/"\1\\:\2"/p')))" \
|
||||
'*:: :->args' \
|
||||
&& return
|
||||
|
||||
case $state in
|
||||
args)
|
||||
case $line[1] in
|
||||
engine)
|
||||
_arguments \
|
||||
":engine:(($(ibus list-engine|sed -ne 's/:/\\\\:/g' -e 's/^ \(\S\+\) - \(.*\)$/"\1:\2"/p')))" \
|
||||
&& return
|
||||
;;
|
||||
read-cache)
|
||||
_arguments \
|
||||
'--system[show the content of the system registry cache]' \
|
||||
'--file=[custom registry cache to show]:registry cache:_files' \
|
||||
&& return
|
||||
;;
|
||||
write-cache)
|
||||
_arguments \
|
||||
'--system[save the system registry cache]' \
|
||||
'--file=[custom registry cache to save]:registry cache:_files' \
|
||||
&& return
|
||||
;;
|
||||
emoji)
|
||||
_arguments \
|
||||
'--font=[emoji font]:emoji font: ' \
|
||||
'--lang=[language of emoji annotations]:language:_language_codes ISO-639-1' \
|
||||
'--partial-match[match annotations with a partial string]' \
|
||||
&& return
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return 1
|
@ -1,65 +0,0 @@
|
||||
#compdef include-what-you-use
|
||||
|
||||
# Copyright 2018 CERN for the benefit of the LHCb Collaboration.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Developed by:
|
||||
#
|
||||
# CERN LBC group
|
||||
#
|
||||
# CERN
|
||||
#
|
||||
# http://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.
|
||||
|
||||
# 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:' \
|
||||
'--cwd=[specify the current working directory]:current working directory:_path_files -/' \
|
||||
'--howtodebug[print instructions on how to run iwyu under gdb]' \
|
||||
'--howtodebug=[print instructions on how to run iwyu under gdb if file matches argument]:file for debug run:_path_files' \
|
||||
'*'"--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:' \
|
||||
'--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:'
|
||||
}
|
||||
|
||||
_arguments "*-Xiwyu[include-what-you-use options]:include-what-you-use options:_iwyu_opts"
|
||||
# gcc will also provide --version and --help. Not ideal.
|
||||
_gcc
|
@ -1,146 +0,0 @@
|
||||
#compdef inxi
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script of inxi - a full featured CLI system information tool
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Oleksii Filonenko <brightone@protonmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local colors=($(seq 0 42))
|
||||
local verbosity_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'
|
||||
)
|
||||
local alt_downloaders=(
|
||||
'40:Perl'
|
||||
'41:Curl'
|
||||
'42:Fetch'
|
||||
'43:Wget'
|
||||
'44:Curl, Fetch, and Wget'
|
||||
)
|
||||
local partition_sort_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'
|
||||
)
|
||||
|
||||
_arguments -s \
|
||||
{-A,--audio}"[Show Audio/sound card(s) information]" \
|
||||
{-b,--basic}"[Show basic output, short form]" \
|
||||
{-B,--battery}"[Show system Battery information]" \
|
||||
{-c+,--color=}"[Set color scheme]:color:(${colors[*]})" \
|
||||
{-C,--cpu}"[Show full CPU output]" \
|
||||
{-d,--disk-full,--optical}"[Show hard + optical drive info]" \
|
||||
{-D,--disk}"[Show hard Disk info]" \
|
||||
{-f,--flags}"[Show all CPU flags used]" \
|
||||
{-F,--full}"[Show Full output]" \
|
||||
{-G,--graphics}"[Show Graphic card(s) information]" \
|
||||
"(- *)"{-h,--help}"[Show list of command-line options]" \
|
||||
{-i,--ip}"[Show WAN IP address and local interfaces]" \
|
||||
{-I,--info}"[Show Information: processes, uptime, etc.]" \
|
||||
{-l,--label}"[Show partition labels]" \
|
||||
{-m,--memory}"[Memory (RAM) data]" \
|
||||
{-M,--machine}"[Show Machine data]" \
|
||||
{-n,--network-advanced}"[Show Advanced Network card information]" \
|
||||
{-N,--network}"[Show Network card(s) information]" \
|
||||
{-o,--unmounted}"[Show unmounted partition information]" \
|
||||
{-p,--partitions-full}"[Show full Partition information]" \
|
||||
{-P,--partitions}"[Show basic Partition information]" \
|
||||
{-r,--repos}"[Show distro repository data]" \
|
||||
{-R,--raid}"[Show RAID data]" \
|
||||
"(- *)"--recommends"[Check inxi dependencies + recommends]" \
|
||||
{-s,--sensors}"[Show output from configured sensors]" \
|
||||
--slots"[Show PCI slots]" \
|
||||
{-S,--system}"[Show System information]" \
|
||||
{-t+,--processes=}"[Show processes]:processes:((c\:'CPU only' m\:'Memory only' cm\:'CPU+memory'))" \
|
||||
--usb"[Show USB data for attached Hubs and Devices]" \
|
||||
{-u,--uuid}"[Show partition UUIDs]" \
|
||||
"(- *)"{-U,--update}"[Auto-update inxi]" \
|
||||
"(- *)"{-V,--version}"[Show version of inxi]" \
|
||||
{-v+,--verbosity=}"[Script verbosity levels]:verbosity:->verbosity" \
|
||||
{-w,--weather}"[Adds weather line]" \
|
||||
{-W+,--weather-location=}"[Get weather/time for an alternate location]:weather location: " \
|
||||
--weather-unit="[Set weather unit]:weather unit:((m\:metric i\:imperial mi\:'metric (imperial)' im\:'imperial (metric)'))" \
|
||||
{-y+,--width=}"[Set width override]:columns (80 minimum): " \
|
||||
{-z,--filter}"[Adds security filters]" \
|
||||
{-Z,--filter-override}"[Absolute override for output filters]" \
|
||||
\*{-x,--extra}"[Extra data options]" \
|
||||
{-a,--admin}"[Admin extra data options]:admin option:->admin" \
|
||||
--alt"[Bypass a downloader option]:downloader:->alt" \
|
||||
--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)" \
|
||||
--host"[Turns on hostname in System line]" \
|
||||
--indent-min"[Overrides default indent minimum value]:integer: " \
|
||||
--limit"[Limit max IP addresses for -i]:limit (-1 removes the limit): " \
|
||||
--man"[Updates / install man page with -U]" \
|
||||
--no-host"[Turns off hostname in System line]" \
|
||||
--no-man"[Disables man page install with -U]" \
|
||||
--no-ssl"[Skip SSL certificate checks]" \
|
||||
--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:->partition_sort" \
|
||||
--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)" \
|
||||
--ftp"[Set alternate ftp upload location]:FTP URL: " \
|
||||
--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]"
|
||||
|
||||
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]"
|
||||
;;
|
||||
alt)
|
||||
_describe 'downloader' alt_downloaders
|
||||
;;
|
||||
output_file)
|
||||
_alternative \
|
||||
"outputs:output file:((print\:'Print to stdout'))" \
|
||||
"outputs:output file:_files"
|
||||
;;
|
||||
partition_sort)
|
||||
_describe 'sort order' partition_sort_orders
|
||||
;;
|
||||
verbosity)
|
||||
_describe 'script verbosity level' verbosity_levels
|
||||
;;
|
||||
esac
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-shell: zsh
|
||||
# End:
|
@ -1,49 +0,0 @@
|
||||
#compdef jmeter
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for JMeter (http://jakarta.apache.org/jmeter).
|
||||
#
|
||||
# Status: incomplete
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_arguments \
|
||||
'(- 1 *)'{-h,--help}'[print usage information and exit]' \
|
||||
'(- 1 *)'{-v,--version}'[print the version information and exit]' \
|
||||
{-p,--propfile}'[the jmeter property file to use]:properties file:_files -g "*.properties"' \
|
||||
'*'{-q,--addprop}'[additional property file(s)]:properties file:_files -g "*.properties"' \
|
||||
{-t,--testfile}'[the jmeter test plan file to run]:JMeter test plan file:_files -g "*.jmx"' \
|
||||
{-j,--jmeterlogfile}'[the jmeter log file]: :_files -g "*.log"' \
|
||||
{-l,--logfile}'[the file to log samples to]: :_files -g "*.jtl"' \
|
||||
{-n,--nongui}'[run JMeter in nongui mode]' \
|
||||
{-s,--server}'[run the JMeter server]' \
|
||||
{-H,--proxyHost}'[set a proxy server for JMeter to use]: :_hosts' \
|
||||
{-P,--proxyPort}'[set proxy server port for JMeter to use]:number' \
|
||||
{-u,--username}'[set username for proxy server that JMeter is to use]:username:_users' \
|
||||
{-a,--password}'[set password for proxy server that JMeter is to use]:password' \
|
||||
{-J-,--jmeterproperty}'[define additional JMeter properties]:argument=value' \
|
||||
{-G-,--globalproperty}'[define Global properties (sent to servers)]:argument=value' \
|
||||
{-D-,--systemproperty}'[define additional System properties]:argument=value' \
|
||||
{-S,--systemPropertyFile}'[a property file to be added as System properties]:properties file:_files -g "*.properties"' \
|
||||
{-L,--loglevel}'[define loglevel]:[category=]level' \
|
||||
{-r,--runremote}'[start remote servers (as defined by the jmeter property remote_hosts)]' \
|
||||
{-R,--remotestart}'[start these remote servers (overrides remote_hosts)]:remote servers list' \
|
||||
{-d,--homedir}'[the JMeter home directory to use]: :_files -/' \
|
||||
{-X,--remoteexit}'[exit the remote servers at end of test (non-GUI)]'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,42 +0,0 @@
|
||||
#compdef jmeter-plugins
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for jmeter-plugins command line tool 0.4.2
|
||||
# (http://code.google.com/p/jmeter-plugins).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_arguments \
|
||||
'(- 1 *)--help[show help options]' \
|
||||
'--generate-png[generate PNG file containing graph]:PNG file name:_files -g "*.png"' \
|
||||
'--generate-csv[generate CSV file containing graph data]:CSV file name:_files -g "*.csv"' \
|
||||
'--input-jtl[load data from specified JTL file]:JTL file:_files -g "*.jtl"' \
|
||||
'--plugin-type[type of graph to use for results generation]:class:((AggregateReport ThreadsStateOverTime BytesThroughputOverTime HitsPerSecond LatenciesOverTime PerfMon ResponseCodesPerSecond ResponseTimesDistribution ResponseTimesOverTime ResponseTimesPercentiles ThroughputOverTime ThroughputVsThreads TimesVsThreads TransactionsPerSecond))' \
|
||||
'--width[set graph width]:graph width (pixels)' \
|
||||
'--height[set graph height]::graph height (pixels)' \
|
||||
'--granulation[granulation time for samples]:time (ms)' \
|
||||
'--relative-times[use relative X axis times, no will set absolute times]: :((yes no))' \
|
||||
'--aggregate-rows[aggregate all rows into one]: :((yes no))' \
|
||||
'--paint-gradient[paint gradient background]: :((yes no))' \
|
||||
'--paint-zeroing[paint zeroing lines]: :((yes no))' \
|
||||
'--prevent-outliers[prevent outliers on distribution graph]: :((yes no))' \
|
||||
'--limit-rows[limit number of points in row]:number of points' \
|
||||
'--force-y[force Y axis limit]:limit' \
|
||||
'--hide-low-counts[hide points with sample count below limit]:limit'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,100 +0,0 @@
|
||||
#compdef jonas
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for JOnAS 5.2 (http://jonas.ow2.org).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext" ret=1
|
||||
|
||||
_arguments -C \
|
||||
'1:cmd:->cmds' \
|
||||
'*::arg:->args' \
|
||||
&& ret=0
|
||||
|
||||
case "$state" in
|
||||
(cmds)
|
||||
local commands; commands=(
|
||||
'version:show version information'
|
||||
'check:check that the JOnAS environment is correctly set'
|
||||
'start:start a server instance'
|
||||
'stop:stop a server instance'
|
||||
'admin:administrate a server instance'
|
||||
)
|
||||
_describe -t commands 'command' commands && ret=0
|
||||
;;
|
||||
(args)
|
||||
curcontext="${curcontext%:*:*}:jonas-cmd-$words[1]:"
|
||||
case $words[1] in
|
||||
(version|check)
|
||||
_message 'no more arguments' && ret=0
|
||||
;;
|
||||
(start)
|
||||
_arguments \
|
||||
'-standby[start a minimal JOnAS server with only mandatory services]' \
|
||||
'(-bg)-fg[start the server in foreground mode]' \
|
||||
'(-fg)-bg[start the server in background mode]' \
|
||||
'-win[start the server in a new window]' \
|
||||
'(-bg)-tui[start the Apache Felix TUI (force foreground mode)]' \
|
||||
'-gui[start the Apache Felix GUI]' \
|
||||
'-dev[start a JOnAS server by using bundles present in the default maven repository instead of bundles under $JONAS_ROOT/lib/bundles]' \
|
||||
'-clean[clean the Apache Felix cache before starting a JOnAS server]' \
|
||||
'-n[set the server name, must be unique in the domain (default: jonas)]:name' \
|
||||
'-target[start another server or cluster (group of servers) in the domain]:server' \
|
||||
'-Ddomain.name=[set the name of the management domain to which the server belongs]:domain' \
|
||||
&& ret=0
|
||||
;;
|
||||
(stop)
|
||||
_arguments \
|
||||
'-standby[stop all services except the mandatory ones]' \
|
||||
'-n[set the name of the server to stop (default: jonas)]:name' \
|
||||
'-target[stop another server or cluster (group of servers) in the domain]:server' \
|
||||
'-Ddomain.name=[set the name of the management domain to which the server belongs]:domain' \
|
||||
&& ret=0
|
||||
;;
|
||||
(admin)
|
||||
_arguments \
|
||||
'(- : *)-?[print the help message]' \
|
||||
'-win[administer the server in a new window]' \
|
||||
'-n[set the name of the server to administer (default: jonas)]:name' \
|
||||
'-username[set the username when authentication is required]: :_users' \
|
||||
'-password[set the password when authentication is required]:password' \
|
||||
'-registry[set the registry URL]: :_urls' \
|
||||
'-protocol[set the protocol name]:protocol:((jrmp\:JRE\ implementation\ of\ RMI\ on\ the\ JRMP\ protocol\ \(default\) iiop\:JacORB\ implementation\ of\ RMI\ over\ the\ IIOP\ protocol irmi\:Oracle\ JRE\ independent\ implementation\ of\ RMI))' \
|
||||
'-a[deploy an application from a given filepath on the current server, or on another target in the domain if the current server is a master]:Java application archive:_files -g "*.(j|w|r|e)ar"' \
|
||||
'-r[undeploy a previously deployed application from the current server or from the specified target if the current server is a master]:Java application archive:_files -g "*.(j|w|r|e)ar"' \
|
||||
'-gc[run the garbage collector on the current JOnAS server]' \
|
||||
'-passivate[passivate all entity bean instances]' \
|
||||
'-e[list the properties of the current JOnAS server]' \
|
||||
'-j[list the registered JNDI names, as seen by the current JOnAS server]' \
|
||||
'-l[list the beans currently loaded by the current JOnAS server]' \
|
||||
'-synch[synchronize the entity bean instances on the current JOnAS server]' \
|
||||
'-debug[set the logging level for the given topic to DEBUG]:topic' \
|
||||
'-tt[change the default timeout for transactions]:timeout (seconds)' \
|
||||
'-ping[wait until the JOnAS server is available]' \
|
||||
'-timeout[maximum time to wait when -ping is used]:timeout (seconds)' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,66 +0,0 @@
|
||||
#compdef jrnl
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for jrnl a simple journal application for your command line. (https://maebert.github.io/jrnl/).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Jindřich Pilař (https://github.com/JindrichPilar)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_jrnl() {
|
||||
|
||||
_arguments -C \
|
||||
'(- 1 *)'-h"[Show help and exit]" \
|
||||
'(- 1 *)'-v"[Prints version information and exits]" \
|
||||
'(- 1 *)'-ls"[Displays accessible journals]" \
|
||||
'(- 1 *)'-d"[Execute in debug mode]" \
|
||||
'(- 1 *)'--tags"[Returns a list of all tags and number of occurrences]" \
|
||||
"--short[Show only titles or line containing the search]" \
|
||||
"-from[View entries after this date]:date:" \
|
||||
"-until[View entries before this date]:date:" \
|
||||
"-to[View entries before this date]:date:" \
|
||||
"-on[View entries on this date]:date:" \
|
||||
"-and[Filter by tags using AND (default: OR)]" \
|
||||
"-starred[Show only starred entries]" \
|
||||
"-n[Shows the last n entries matching the filter. And '-3' have the same effect.]":number: \
|
||||
"--export[Export your journal. TYPE can be json, markdown text.]:format:(json markdown text)" \
|
||||
"-o[Optionally specifies output file when using --export If OUTPUT is a directory, exports each entry in individual file instead.]:output file:" \
|
||||
"--encrypt[Encrypts your existing journal with a new pass]" \
|
||||
"--decrypt[Decrypts your journal and stores it in plain text]" \
|
||||
"--edit[Opens your editor to edit the selected entries.]" \
|
||||
}
|
||||
|
||||
_jrnl
|
||||
|
@ -1,71 +0,0 @@
|
||||
#compdef kak
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for kak (https://github.com/mawww/kakoune)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Frank LENORMAND <https://github.com/lenormf>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_kak_sessions() {
|
||||
local -a session_ids expl
|
||||
session_ids=($(_call_program session_names kak -l))
|
||||
_description session-ids expl "session name"
|
||||
compadd "$expl[@]" -a session_ids
|
||||
}
|
||||
|
||||
_kak() {
|
||||
_arguments \
|
||||
'-n[do not source rc files on startup]' \
|
||||
'-l[list existing sessions]:session_id:_kak_sessions' \
|
||||
'-clear[clear dead sessions]' \
|
||||
'-ro[readonly mode]' \
|
||||
'(-help --help)'{-help,--help}'[display a help message and quit]' \
|
||||
'-d[run as a headless session (requires -s)]' \
|
||||
'-q[in filter mode, be quiet about errors applying keys]' \
|
||||
'-c[connect to given session]:session_id:_kak_sessions' \
|
||||
'-e[execute argument on client initialisation]:keys' \
|
||||
'-E[execute argument on server initialisation]:keys' \
|
||||
'-s[set session name]:session_id' \
|
||||
'-p[just send stdin as commands to the given session]:session_id:_kak_sessions' \
|
||||
'-f[act as a filter, executing given keys on given files]:keys' \
|
||||
'-i[backup the files on which a filter is applied using the given suffix]:suffix' \
|
||||
'-ui[set the type of user interface to use (ncurses, dummy, or json)]:ui_type:(ncurses dummy json)' \
|
||||
'*::files:_files'
|
||||
}
|
||||
|
||||
_kak "$@"
|
@ -1,86 +0,0 @@
|
||||
#compdef kitchen
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Test Kitchen (http://kitchen.ci/).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Peter Eisentraut (https://github.com/petere)
|
||||
# * Shohei YOSHIDA (https://github.com/syohex)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_kitchen() {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments '1: :->cmds'\
|
||||
'2: :->args'
|
||||
|
||||
case $state in
|
||||
cmds)
|
||||
_kitchen_commands
|
||||
;;
|
||||
args)
|
||||
case $line[1] in
|
||||
converge|create|destroy|diagnose|list|setup|test|verify)
|
||||
compadd 'all'
|
||||
_kitchen_instances
|
||||
;;
|
||||
login)
|
||||
_kitchen_instances
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_kitchen_commands() {
|
||||
local commands
|
||||
|
||||
commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) .*# \(.*\)$/\1:\2/p')}")
|
||||
_describe -t commands 'kitchen commands' commands
|
||||
}
|
||||
|
||||
_kitchen_instances() {
|
||||
if [[ $_kitchen_instances_cache_dir != $PWD ]]; then
|
||||
unset _kitchen_instances_cache
|
||||
fi
|
||||
if [[ ${+_kitchen_instances_cache} -eq 0 ]]; then
|
||||
_kitchen_instances_cache=(${(f)"$(_call_program instances $service list -b 2>/dev/null)"})
|
||||
_kitchen_instances_cache_dir=$PWD
|
||||
fi
|
||||
_wanted instances expl 'instance' compadd -a _kitchen_instances_cache
|
||||
}
|
||||
|
||||
_kitchen "$@"
|
@ -1,324 +0,0 @@
|
||||
#compdef knife
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2009-2015 Robby Russell and contributors (see
|
||||
# https://github.com/robbyrussell/oh-my-zsh/contributors)
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Chef's knife (http://www.opscode.com/chef).
|
||||
#
|
||||
# Source: https://github.com/ohmyzsh/ohmyzsh/blob/22fed4f/plugins/knife/_knife
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Frank Louwers (https://github.com/franklouwers)
|
||||
# * Mark Cornick (https://github.com/markcornick)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# You can override the path to knife.rb and your cookbooks by setting
|
||||
# KNIFE_CONF_PATH=/path/to/my/.chef/knife.rb
|
||||
# KNIFE_COOKBOOK_PATH=/path/to/my/chef/cookbooks
|
||||
# If you want your local cookbooks path to be calculated relative to where you are then
|
||||
# set the below option
|
||||
# KNIFE_RELATIVE_PATH=true
|
||||
# Read around where these are used for more detail.
|
||||
|
||||
# knife has a very special syntax, some example calls are:
|
||||
# knife status
|
||||
# knife cookbook list
|
||||
# knife role show ROLENAME
|
||||
# knife data bag show DATABAGNAME
|
||||
# knife role show ROLENAME --attribute ATTRIBUTENAME
|
||||
# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes
|
||||
|
||||
# The -Q switch in compadd allow for completions of things like "data bag" without having to go through two rounds of completion and avoids zsh inserting a \ for escaping spaces
|
||||
_knife() {
|
||||
# These flags should be available everywhere according to man knife
|
||||
local -a knife_general_flags; knife_general_flags=(--help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes)
|
||||
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
local -a cloudproviders; cloudproviders=(bluebox ec2 rackspace slicehost terremark)
|
||||
_arguments \
|
||||
'1: :->knifecmd' \
|
||||
'2: :->knifesubcmd' \
|
||||
'3: :->knifesubcmd2' \
|
||||
'4: :->knifesubcmd3' \
|
||||
'5: :->knifesubcmd4' \
|
||||
'6: :->knifesubcmd5'
|
||||
|
||||
case $state in
|
||||
knifecmd)
|
||||
compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment user index node recipe role search solo ssh status upload vault windows "$cloudproviders[@]"
|
||||
;;
|
||||
knifesubcmd)
|
||||
case $words[2] in
|
||||
bluebox|ec2|rackspace|slicehost|terremark)
|
||||
compadd "$@" server images
|
||||
;;
|
||||
client)
|
||||
compadd -Q "$@" "bulk delete" list create show delete edit reregister
|
||||
;;
|
||||
configure)
|
||||
compadd "$@" client
|
||||
;;
|
||||
cookbook)
|
||||
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
|
||||
;;
|
||||
diff)
|
||||
_arguments '*:file or directory:_files -g "*"'
|
||||
;;
|
||||
environment)
|
||||
compadd -Q "$@" list create delete edit show "from file"
|
||||
;;
|
||||
user)
|
||||
compadd -Q "$@" create delete edit list reregister show
|
||||
;;
|
||||
node)
|
||||
compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
|
||||
;;
|
||||
recipe)
|
||||
compadd "$@" list
|
||||
;;
|
||||
role)
|
||||
compadd -Q "$@" "bulk delete" create delete edit "from file" list show
|
||||
;;
|
||||
solo)
|
||||
compadd "$@" bootstrap clean cook init prepare
|
||||
;;
|
||||
upload)
|
||||
_arguments '*:file or directory:_files -g "*"'
|
||||
;;
|
||||
vault)
|
||||
compadd -Q "$@" create decrypt delete edit remove "rotate all keys" "rotate keys" show update
|
||||
;;
|
||||
windows)
|
||||
compadd "$@" bootstrap
|
||||
;;
|
||||
*)
|
||||
_arguments '2:Subsubcommands:($(_knife_options1))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
knifesubcmd2)
|
||||
case $words[3] in
|
||||
server)
|
||||
compadd "$@" list create delete
|
||||
;;
|
||||
images)
|
||||
compadd "$@" list
|
||||
;;
|
||||
site)
|
||||
compadd "$@" vendor show share search download list unshare
|
||||
;;
|
||||
show|delete|edit|update)
|
||||
_arguments '3:Subsubcommands:($(_knife_list_remote "$words[2]"))'
|
||||
;;
|
||||
upload|test)
|
||||
_arguments '3:Subsubcommands:($(_call_function - "_knife_list_local_$words[2]s") --all)'
|
||||
;;
|
||||
list)
|
||||
compadd -a "$@" knife_general_flags
|
||||
;;
|
||||
bag)
|
||||
compadd -Q "$@" show edit list "from file" create delete
|
||||
;;
|
||||
bootstrap|clean|cook|prepare)
|
||||
compadd "$@" nodes/*.json(N:t:r)
|
||||
;;
|
||||
init)
|
||||
compadd "$@" ./*(/N:t)
|
||||
;;
|
||||
*)
|
||||
_arguments '3:Subsubcommands:($(_knife_options2))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
knifesubcmd3)
|
||||
case "$words[3]" in
|
||||
show)
|
||||
case "$words[2]" in
|
||||
cookbook)
|
||||
versioncomp=1
|
||||
_arguments '4:Cookbookversions:($(_knife_cookbook_versions) latest)'
|
||||
;;
|
||||
node|client|role)
|
||||
compadd "$@" --attribute
|
||||
;;
|
||||
vault)
|
||||
_arguments '4:Keys:($(_knife_list_remote "$words[2]" "$words[4]"))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
update)
|
||||
case "$words[2]" in
|
||||
vault)
|
||||
_arguments '4:Keys:($(_knife_list_remote "$words[2]" "$words[4]"))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
case "$words[4]" in
|
||||
show|edit)
|
||||
_arguments '4:Subsubsubcommands:($(_knife_list_remote "$words[2]" "$words[3]"))'
|
||||
;;
|
||||
file)
|
||||
case "$words[2]" in
|
||||
environment)
|
||||
_arguments '*:files:_path_files -g "*.(rb|json)" -W "$(_knife_root)/environments"'
|
||||
;;
|
||||
node)
|
||||
_arguments '*:files:_path_files -g "*.(rb|json)" -W "$(_knife_root)/nodes"'
|
||||
;;
|
||||
role)
|
||||
_arguments '*:files:_path_files -g "*.(rb|json)" -W "$(_knife_root)/roles"'
|
||||
;;
|
||||
*)
|
||||
_arguments '*:Subsubcommands:($(_knife_options3))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
list)
|
||||
compadd -a "$@" knife_general_flags
|
||||
;;
|
||||
*)
|
||||
_arguments '*:Subsubcommands:($(_knife_options3))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
knifesubcmd4)
|
||||
if ((versioncomp > 0)); then
|
||||
compadd "$@" attributes definitions files libraries providers recipes resources templates
|
||||
else
|
||||
case "$words[5]" in
|
||||
file)
|
||||
_arguments '*:directory:_path_files -/ -W "$(_knife_root)/data_bags" -qS \ '
|
||||
;;
|
||||
*) _arguments '*:Subsubcommands:($(_knife_options2))' ;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
knifesubcmd5)
|
||||
case "$words[5]" in
|
||||
file)
|
||||
_arguments '*:files:_path_files -g "*.json" -W "$(_knife_root)/data_bags/$words[6]"'
|
||||
;;
|
||||
*)
|
||||
_arguments '*:Subsubcommands:($(_knife_options3))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Helper functions to provide the argument completion for several depths of commands
|
||||
_knife_options1() {
|
||||
local line
|
||||
for line in $(_call_program commands knife "$words[2]" --help | grep -v "^knife"); do
|
||||
echo $line | grep "\-\-"
|
||||
done
|
||||
}
|
||||
|
||||
_knife_options2() {
|
||||
local line
|
||||
for line in $(_call_program commands knife "$words[2]" "$words[3]" --help | grep -v "^knife"); do
|
||||
echo $line | grep "\-\-"
|
||||
done
|
||||
}
|
||||
|
||||
_knife_options3() {
|
||||
local line
|
||||
for line in $(_call_program commands knife "$words[2]" "$words[3]" "$words[4]" --help | grep -v "^knife"); do
|
||||
echo $line | grep "\-\-"
|
||||
done
|
||||
}
|
||||
|
||||
# get a list of objects of type x on the server
|
||||
_knife_list_remote() {
|
||||
case "$*" in
|
||||
role|client|node|cookbook|"cookbook site"|"data bag"|environment|user|vault)
|
||||
_call_program commands knife "$@" list --format json \
|
||||
| grep \" \
|
||||
| awk '{print $1}' \
|
||||
| awk -F"," '{print $1}' \
|
||||
| awk -F"\"" '{print $2}'
|
||||
;;
|
||||
"vault "*)
|
||||
_call_program commands knife vault show "$2" --format json \
|
||||
| grep \" \
|
||||
| awk '{print $1}' \
|
||||
| awk -F"," '{print $1}' \
|
||||
| awk -F"\"" '{print $2}'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
|
||||
_knife_list_local_cookbooks() {
|
||||
if [ $KNIFE_RELATIVE_PATH ]; then
|
||||
local cookbook_path="$(_knife_root)/cookbooks"
|
||||
else
|
||||
local knife_rb="${KNIFE_CONF_PATH:-${HOME}/.chef/knife.rb}"
|
||||
if [ -f ./.chef/knife.rb ]; then
|
||||
knife_rb="./.chef/knife.rb"
|
||||
fi
|
||||
local cookbook_path="${KNIFE_COOKBOOK_PATH:-$(grep -s cookbook_path "$knife_rb" | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' | cut -d '"' -f2)}"
|
||||
fi
|
||||
|
||||
local i
|
||||
for i in $cookbook_path; do
|
||||
ls $i
|
||||
done
|
||||
}
|
||||
|
||||
# This function extracts the available cookbook versions on the chef server
|
||||
_knife_cookbook_versions() {
|
||||
_call_program commands knife cookbook show "$words[4]" \
|
||||
| grep -v "$words[4]" \
|
||||
| grep -v -E '\]|\[|\{|\}' \
|
||||
| sed 's/ //g' \
|
||||
| sed 's/"//g'
|
||||
}
|
||||
|
||||
# Searches up from current directory to find the closest folder that has a .chef folder
|
||||
# Useful for the knife upload/from file commands
|
||||
_knife_root() {
|
||||
local directory="$PWD"
|
||||
while [ $directory != '/' ]; do
|
||||
test -e "$directory/.chef" && echo "$directory" && return
|
||||
directory="${directory:h}"
|
||||
done
|
||||
}
|
||||
|
||||
_knife "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,250 +0,0 @@
|
||||
#autoload
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completer for language codes.
|
||||
#
|
||||
# Usage: _language_codes ISO-639-1
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
(( $+functions[_language_codes_iso_639_1] )) ||
|
||||
_language_codes_iso_639_1() {
|
||||
local codes; codes=(
|
||||
'aa:Afar'
|
||||
'ab:Abkhazian'
|
||||
'af:Afrikaans'
|
||||
'ak:Akan'
|
||||
'sq:Albanian'
|
||||
'am:Amharic'
|
||||
'ar:Arabic'
|
||||
'an:Aragonese'
|
||||
'hy:Armenian'
|
||||
'as:Assamese'
|
||||
'av:Avaric'
|
||||
'ae:Avestan'
|
||||
'ay:Aymara'
|
||||
'az:Azerbaijani'
|
||||
'ba:Bashkir'
|
||||
'bm:Bambara'
|
||||
'eu:Basque'
|
||||
'be:Belarusian'
|
||||
'bn:Bengali'
|
||||
'bh:Bihari languages'
|
||||
'bi:Bislama'
|
||||
'bo:Tibetan'
|
||||
'bs:Bosnian'
|
||||
'br:Breton'
|
||||
'bg:Bulgarian'
|
||||
'my:Burmese'
|
||||
'ca:Catalan'
|
||||
'cs:Czech'
|
||||
'ch:Chamorro'
|
||||
'ce:Chechen'
|
||||
'zh:Chinese'
|
||||
'cu:Church Slavic'
|
||||
'cv:Chuvash'
|
||||
'kw:Cornish'
|
||||
'co:Corsican'
|
||||
'cr:Cree'
|
||||
'cy:Welsh'
|
||||
'cs:Czech'
|
||||
'da:Danish'
|
||||
'de:German'
|
||||
'dv:Divehi'
|
||||
'nl:Dutch'
|
||||
'dz:Dzongkha'
|
||||
'el:Greek, Modern (1453-)'
|
||||
'en:English'
|
||||
'eo:Esperanto'
|
||||
'et:Estonian'
|
||||
'eu:Basque'
|
||||
'ee:Ewe'
|
||||
'fo:Faroese'
|
||||
'fa:Persian'
|
||||
'fj:Fijian'
|
||||
'fi:Finnish'
|
||||
'fr:French'
|
||||
'fy:Western Frisian'
|
||||
'ff:Fulah'
|
||||
'ka:Georgian'
|
||||
'de:German'
|
||||
'gd:Gaelic'
|
||||
'ga:Irish'
|
||||
'gl:Galician'
|
||||
'gv:Manx'
|
||||
'gn:Guarani'
|
||||
'gu:Gujarati'
|
||||
'ht:Haitian'
|
||||
'ha:Hausa'
|
||||
'he:Hebrew'
|
||||
'hz:Herero'
|
||||
'hi:Hindi'
|
||||
'ho:Hiri Motu'
|
||||
'hr:Croatian'
|
||||
'hu:Hungarian'
|
||||
'hy:Armenian'
|
||||
'ig:Igbo'
|
||||
'is:Icelandic'
|
||||
'io:Ido'
|
||||
'ii:Sichuan Yi'
|
||||
'iu:Inuktitut'
|
||||
'ie:Interlingue'
|
||||
'ia:Interlingua (International Auxiliary Language Association)'
|
||||
'id:Indonesian'
|
||||
'ik:Inupiaq'
|
||||
'is:Icelandic'
|
||||
'it:Italian'
|
||||
'jv:Javanese'
|
||||
'ja:Japanese'
|
||||
'kl:Kalaallisut'
|
||||
'kn:Kannada'
|
||||
'ks:Kashmiri'
|
||||
'ka:Georgian'
|
||||
'kr:Kanuri'
|
||||
'kk:Kazakh'
|
||||
'km:Central Khmer'
|
||||
'ki:Kikuyu'
|
||||
'rw:Kinyarwanda'
|
||||
'ky:Kirghiz'
|
||||
'kv:Komi'
|
||||
'kg:Kongo'
|
||||
'ko:Korean'
|
||||
'kj:Kuanyama'
|
||||
'ku:Kurdish'
|
||||
'lo:Lao'
|
||||
'la:Latin'
|
||||
'lv:Latvian'
|
||||
'li:Limburgan'
|
||||
'ln:Lingala'
|
||||
'lt:Lithuanian'
|
||||
'lb:Luxembourgish'
|
||||
'lu:Luba-Katanga'
|
||||
'lg:Ganda'
|
||||
'mk:Macedonian'
|
||||
'mh:Marshallese'
|
||||
'ml:Malayalam'
|
||||
'mi:Maori'
|
||||
'mr:Marathi'
|
||||
'ms:Malay'
|
||||
'mk:Macedonian'
|
||||
'mg:Malagasy'
|
||||
'mt:Maltese'
|
||||
'mn:Mongolian'
|
||||
'mi:Maori'
|
||||
'ms:Malay'
|
||||
'my:Burmese'
|
||||
'na:Nauru'
|
||||
'nv:Navajo'
|
||||
'nr:Ndebele, South'
|
||||
'nd:Ndebele, North'
|
||||
'ng:Ndonga'
|
||||
'ne:Nepali'
|
||||
'nl:Dutch'
|
||||
'nn:Norwegian Nynorsk'
|
||||
'nb:Bokmål, Norwegian'
|
||||
'no:Norwegian'
|
||||
'ny:Chichewa'
|
||||
'oc:Occitan (post 1500)'
|
||||
'oj:Ojibwa'
|
||||
'or:Oriya'
|
||||
'om:Oromo'
|
||||
'os:Ossetian'
|
||||
'pa:Panjabi'
|
||||
'fa:Persian'
|
||||
'pi:Pali'
|
||||
'pl:Polish'
|
||||
'pt:Portuguese'
|
||||
'ps:Pushto'
|
||||
'qu:Quechua'
|
||||
'rm:Romansh'
|
||||
'ro:Romanian'
|
||||
'ro:Romanian'
|
||||
'rn:Rundi'
|
||||
'ru:Russian'
|
||||
'sg:Sango'
|
||||
'sa:Sanskrit'
|
||||
'si:Sinhala'
|
||||
'sk:Slovak'
|
||||
'sk:Slovak'
|
||||
'sl:Slovenian'
|
||||
'se:Northern Sami'
|
||||
'sm:Samoan'
|
||||
'sn:Shona'
|
||||
'sd:Sindhi'
|
||||
'so:Somali'
|
||||
'st:Sotho, Southern'
|
||||
'es:Spanish'
|
||||
'sq:Albanian'
|
||||
'sc:Sardinian'
|
||||
'sr:Serbian'
|
||||
'ss:Swati'
|
||||
'su:Sundanese'
|
||||
'sw:Swahili'
|
||||
'sv:Swedish'
|
||||
'ty:Tahitian'
|
||||
'ta:Tamil'
|
||||
'tt:Tatar'
|
||||
'te:Telugu'
|
||||
'tg:Tajik'
|
||||
'tl:Tagalog'
|
||||
'th:Thai'
|
||||
'bo:Tibetan'
|
||||
'ti:Tigrinya'
|
||||
'to:Tonga (Tonga Islands)'
|
||||
'tn:Tswana'
|
||||
'ts:Tsonga'
|
||||
'tk:Turkmen'
|
||||
'tr:Turkish'
|
||||
'tw:Twi'
|
||||
'ug:Uighur'
|
||||
'uk:Ukrainian'
|
||||
'ur:Urdu'
|
||||
'uz:Uzbek'
|
||||
've:Venda'
|
||||
'vi:Vietnamese'
|
||||
'vietnamien'
|
||||
'vo:Volapük'
|
||||
'cy:Welsh'
|
||||
'wa:Walloon'
|
||||
'wo:Wolof'
|
||||
'xh:Xhosa'
|
||||
'yi:Yiddish'
|
||||
'yo:Yoruba'
|
||||
'za:Zhuang'
|
||||
'zh:Chinese'
|
||||
'zu:Zulu'
|
||||
)
|
||||
_describe -t language-codes 'ISO 639-1 language code' codes "$@"
|
||||
}
|
||||
|
||||
_language_codes() {
|
||||
local command="$argv[$#]" ret=1
|
||||
|
||||
case $command in
|
||||
ISO-639-1)
|
||||
_language_codes_${${command//-/_}:l} "${@[1,-2]}" && ret=0
|
||||
;;
|
||||
*)
|
||||
_message "unknown command: $command"
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,124 +0,0 @@
|
||||
#compdef lilypond
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2021 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 lilypond (https://lilypond.org/)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Andre Kugland (https://github.com/kugland)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments -S -A "-*" \
|
||||
'(- 1 *)-d help[show help for scheme options]' \
|
||||
'(- 1 *)'{-h,--help}'[show usage information]' \
|
||||
'(- 1 *)'{-v,--version}'[show version number]' \
|
||||
'(- 1 *)'{-w,--warranty}'[show warranty and copyright]' \
|
||||
'(-f --formats)'{-f,--formats=}'[select format(s) to generate]:format(s) to generate:_sequence compadd - pdf svg png ps eps' \
|
||||
'--pdf[generate .pdf files]' \
|
||||
'--svg[generate .svg files]' \
|
||||
'--png[generate .png files]' \
|
||||
'--ps[generate .ps files]' \
|
||||
'(-E --eps)'{-E,--eps}'[generate .eps files]' \
|
||||
'(-O --pspdfopt)'{-O,--pspdfopt=}'[set .ps/.pdf optimization]:.ps/.pdf optimization:(size TeX TeX-GS)' \
|
||||
'*'{-d,--define-default=}'[set scheme option]:scheme option:->scheme_opt' \
|
||||
'(-e --evaluate)'{-e,--evaluate=}'[evaluate scheme code]:scheme code' \
|
||||
'(-H --header)'{-H,--header=}'[dump header field to file]:field' \
|
||||
'*'{-I,--include=}'[append directory to include search path]:directory:_files -/' \
|
||||
'(-i --init)'{-i,--init=}'[use file as init file]:file:_files -g "*.(#i)ly(-.)"' \
|
||||
'(-j --jail)'{-j,--jail=}'[chroot to jail, become user:group and cd into dir]:jail arg (user,group,jail,dir)' \
|
||||
'(-o --output)'{-o,--output=}'[set output base filename or folder]:output base filename or folder:_files' \
|
||||
'(-l --loglevel -s --silent -V --verbose)'{-l,--loglevel=}'[set level of the log]:log level [INFO]:(NONE ERROR WARNING BASIC PROGRESS INFO DEBUG)' \
|
||||
'(-l --loglevel -s --silent -V --verbose)'{-s,--silent}'[no progress, only error messages (same as --loglevel=ERROR)]' \
|
||||
'(-l --loglevel -s --silent -V --verbose)'{-V,--verbose}'[be verbose (same as --loglevel=DEBUG)]' \
|
||||
'*:input file:_files -g "*.(#i)ly(-.)"'
|
||||
|
||||
case $state in
|
||||
scheme_opt)
|
||||
_values 'scheme option' \
|
||||
'anti-alias-factor[set anti-alias factor]:anti-alias-factor (1-8)' \
|
||||
'aux-files[create .tex, .texi, .count files in the EPS backend]:aux-files:(\#t \#f)' \
|
||||
'backend[select backend]:backend:(eps null ps scm svg)' \
|
||||
'check-internal-types[check every property assignment for types]:check-internal-types:(\#t \#f)' \
|
||||
'clip-systems[generate cut-out snippets of a score]:clip-systems:(\#t \#f)' \
|
||||
'crop[match the size of the normal output to the typeset image]:crop:(\#t \#f)' \
|
||||
'debug-gc-assert-parsed-dead[ensure that all references to parsed objects are dead]:debug-gc-assert-parsed-dead:(\#t \#f)' \
|
||||
'debug-gc[dump memory debugging statistics]:debug-gc:(\#t \#f)' \
|
||||
'debug-lexer[debug the flex lexer]:debug-lexer:(\#t \#f)' \
|
||||
'debug-page-breaking-scoring[dump scores for many different page breaking configurations]:debug-page-breaking-scoring:(\#t \#f)' \
|
||||
'debug-parser[debug the bison parser]:debug-parser:(\#t \#f)' \
|
||||
'debug-property-callbacks[debug cyclic callback chains]:debug-property-callbacks:(\#t \#f)' \
|
||||
'debug-skylines[debug skylines]:debug-skylines:(\#t \#f)' \
|
||||
'delete-intermediate-files[delete unusable, intermediate PostScript files]:delete-intermediate-files:(\#t \#f)' \
|
||||
'dump-signatures[dump output signatures of each system]:dump-signatures:(\#t \#f)' \
|
||||
'embed-source-code[embed the source files inside the generated PDF document]:embed-source-code:(\#t \#f)' \
|
||||
'eps-box-padding[pad left edge of the output EPS bounding box by given amount]:eps-box-padding (mm)' \
|
||||
'font-export-dir[directory for exporting fonts as PostScript files]:font-export-dir:_files -/' \
|
||||
'font-ps-resdir[build a subset of PostScript resource directory for embedding fonts]:font-ps-resdir' \
|
||||
'gs-api[whether to use the Ghostscript API (read-only if not available)]:gs-api:(\#t \#f)' \
|
||||
'gs-load-fonts[load fonts via Ghostscript]:gs-load-fonts:(\#t \#f)' \
|
||||
'gs-load-lily-fonts[load only LilyPond fonts via Ghostscript]:gs-load-lily-fonts:(\#t \#f)' \
|
||||
'gs-never-embed-fonts[make Ghostscript embed only TrueType fonts and no other font format]:gs-never-embed-fonts:(\#t \#f)' \
|
||||
'gui[run LilyPond from a GUI and redirect stderr to a log file]:gui:(\#t \#f)' \
|
||||
'help[show this help]:help:(\#t \#f)' \
|
||||
'include-book-title-preview[include book titles in preview images]:include-book-title-preview:(\#t \#f)' \
|
||||
'include-eps-fonts[include fonts in separate-system EPS files]:include-eps-fonts:(\#t \#f)' \
|
||||
'include-settings[included file before the score is processed]:include-settings:_files -g "*.(#i)ly(-.)"' \
|
||||
'job-count[process in parallel, using the given number of jobs]:job-count' \
|
||||
'log-file[output log to file (.log will be appended)]:log-file' \
|
||||
'max-markup-depth[maximum depth for the markup tree]:max-markup-depth' \
|
||||
'midi-extension[set the default file extension for MIDI output]:midi-extension:(mid midi)' \
|
||||
'music-font-encodings[use font encodings and the PostScript "show" operator with music fonts]:music-font-encodings:(\#t \#f)' \
|
||||
'music-strings-to-paths[convert text strings to paths when glyphs belong to a music font]:music-strings-to-paths:(\#t \#f)' \
|
||||
'outline-bookmarks[use bookmarks in table of contents metadata]:outline-bookmarks:(\#t \#f)' \
|
||||
'paper-size[set default paper size]:paper-size:(\"a1\" \"a2\" \"a3\" \"a4\" \"a5\" \"a6\" \"b1\" \"b2\" \"b3\" \"b4\" \"b5\" \"b6\" \"c1\" \"c2\" \"c3\" \"c4\" \"c5\" \"c6\" \"f4\" \"government-legal\" \"government-letter\" \"imperial\" \"junior-legal\" \"ledger\" \"legal\" \"letter\" \"folio\" \"octavo\" \"quarto\" \"tabloid\")' \
|
||||
'pixmap-format[set GhostScript'\''s output format for pixel images]:pixmap-format:(fpng jpeg jpegcmyk jpeggray png16m pngalpha pnggray pngmonod)' \
|
||||
'png-height[image height for PNG output]:png-height (pixels)' \
|
||||
'png-width[image width for PNG output]:png-width (pixels)' \
|
||||
'point-and-click[add point & click links to PDF and SVG output]:point-and-click:(\#t \#f)' \
|
||||
'preview[create preview images also]:preview:(\#t \#f)' \
|
||||
'print-pages[print pages in the normal way]:print-pages:(\#t \#f)' \
|
||||
'profile-property-accesses[keep statistics of get_property() calls]:profile-property-accesses:(\#t \#f)' \
|
||||
'protected-scheme-parsing[continue when errors in inline Scheme are caught in the parser]:protected-scheme-parsing:(\#t \#f)' \
|
||||
'read-file-list[specify file which contains a list of input files]:read-file-list:(\#t \#f)' \
|
||||
'relative-includes[look for the included file relative to the current file]:relative-includes:(\#t \#f)' \
|
||||
'resolution[set resolution for generating PNG pixmaps to given value]:resolution (dpi)' \
|
||||
'safe[run in safer mode]:safe:(\#t \#f)' \
|
||||
'separate-log-files[use separate log files for each input]:separate-log-files:(\#t \#f)' \
|
||||
'show-available-fonts[list available font names]:show-available-fonts:(\#t \#f)' \
|
||||
'strict-infinity-checking[force a crash on encountering Inf and NaN floating point exceptions]:strict-infinity-checking:(\#t \#f)' \
|
||||
'strip-output-dir[don'\''t use directories from input files while constructing output file names]:strip-output-dir:(\#t \#f)' \
|
||||
'strokeadjust[set the PostScript '\''strokeadjust'\'' operator explicitly]:strokeadjust:(\#t \#f)' \
|
||||
'svg-woff[use woff font files in SVG backend]:svg-woff:(\#t \#f)' \
|
||||
'warning-as-error[change all warning and programming_error messages into errors]:warning-as-error:(\#t \#f)'
|
||||
;;
|
||||
esac
|
@ -1,74 +0,0 @@
|
||||
#compdef lunchy
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for lunchy (https://github.com/mperham/lunchy).
|
||||
#
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Blake Walters (https://github.com/markupboy)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local state line cmds ret=1
|
||||
|
||||
_arguments -C '1: :->cmds' '*: :->args'
|
||||
|
||||
case $state in
|
||||
cmds)
|
||||
local -a cmds
|
||||
cmds=(
|
||||
'ls:list available agents'
|
||||
'start:start an agent'
|
||||
'stop:stop an agent'
|
||||
'restart:restart an agent'
|
||||
'status:get the status of agent[s]'
|
||||
'install:install an agents plist file'
|
||||
'edit:edit an agent'
|
||||
)
|
||||
_describe -t commands 'lunchy command' cmds && ret=0
|
||||
;;
|
||||
args)
|
||||
case $line[1] in
|
||||
(install)
|
||||
;;
|
||||
(restart|stop)
|
||||
_values 'items' `lunchy status | awk '{print $3}' ` 2>/dev/null && ret=0
|
||||
;;
|
||||
*)
|
||||
_values 'items' `lunchy ls` 2>/dev/null && ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
@ -1,76 +0,0 @@
|
||||
#compdef mc
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2019 Sebastian Gniazdowski
|
||||
#
|
||||
# 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.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Sebastian Gniazdowski (https://github.com/psprint)
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
setopt localoptions warncreateglobal typesetsilent
|
||||
|
||||
local -a opts
|
||||
opts=(
|
||||
{-h,--help}'[show help on options]'
|
||||
--help-all'[show help on all options]'
|
||||
--help-terminal'[terminal options help]'
|
||||
--help-color'[color options help]'
|
||||
{-a,--stickchars}'[use stickchars to draw]'
|
||||
'(-c --color -b --nocolor)'{-b,--nocolor}'[requests to run in black and white]'
|
||||
'(-b --nocolor -c --color)'{-c,--color}'[request to run in color mode]'
|
||||
{-C,--colors=}'[specifies a color configuration]:arg:'
|
||||
--configure-options'[print configure options]'
|
||||
{-d,--nomouse}'[disable mouse support in text version]'
|
||||
{-d,--debuglevel=}'[save the debug level for SMB VFS]:debug level:(0 1 2 3 4 5 6 7 8 9 10)'
|
||||
{-e,--edit=}'[edit files]:file:_files'
|
||||
{-f,--datadir}'[print data directory]'
|
||||
{-F,--datadir-info}'[print extended info about used data directories]'
|
||||
{-g,--oldmouse}'[tries to use an old highlight mouse tracking]'
|
||||
{-k,--resetsoft}'[resets soft keys on HP terminals]'
|
||||
{-K,--keymap=}'[load definitions of key bindings from specified file]:file:_files'
|
||||
{-l,--ftplog=}'[log ftp dialog to specified file]:file:_files'
|
||||
--nokeymap'[dont load definitions of key bindings from file, use defaults]'
|
||||
{-P,--printwd=}'[print last working directory to specified file]:file:_files'
|
||||
{-s,--slow}'[to run on slow terminals]'
|
||||
{-S,--skin=}'[show mc with specified skin]:skin:'
|
||||
{-t,--termcap}'[tries to use termcap instead of terminfo]'
|
||||
'(-U --subshell -u --nosubshell)'{-u,--nosubshell}'[disables subshell support]'
|
||||
'(-u --nosubshell -U --subshell)'{-U,--subshell}'[enables subshell support (default)]'
|
||||
{-v,--view=}'[launches the file viewer on a file]:file:_files'
|
||||
{-V,--version}'[displays the current version]'
|
||||
{-x,--xterm}'[forces xterm features]'
|
||||
{-X,--no-x11}'[disable X11 support]'
|
||||
'*:pane directory:_directories'
|
||||
)
|
||||
|
||||
_arguments -s $opts
|
||||
|
||||
# Return value passes through
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,156 +0,0 @@
|
||||
#compdef middleman
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2013 Jozef Izso, MIT License
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for middleman (http://middlemanapp.com/)
|
||||
# Includes commands from middleman-blog and middleman-deploy extensions.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Jozef Izso (https://github.com/jozefizso)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local ret=1 state
|
||||
|
||||
local -a common_ops
|
||||
common_ops=(
|
||||
"--help[Display help]"
|
||||
)
|
||||
|
||||
typeset -A opt_args
|
||||
_arguments \
|
||||
':subcommand:->subcommand' \
|
||||
$common_ops \
|
||||
'*::options:->options' && ret=0
|
||||
|
||||
case $state in
|
||||
subcommand)
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
"article:Create a new blog article"
|
||||
"build:Builds the static site for deployment"
|
||||
"console:Start an interactive console in the context of your Middleman application"
|
||||
"deploy:Deploy a middleman built site over rsync, ftp, sftp, or git (e.g. gh-pages on github)."
|
||||
"extension:Create Middleman extension scaffold"
|
||||
"init:Create new project"
|
||||
"server:Start the preview server"
|
||||
"upgrade:Upgrade installed bundle"
|
||||
"version:Show version"
|
||||
)
|
||||
|
||||
_describe -t subcommands 'middleman subcommand' subcommands && ret=0
|
||||
;;
|
||||
|
||||
options)
|
||||
local -a args
|
||||
args=(
|
||||
$common_ops
|
||||
)
|
||||
|
||||
local -a help
|
||||
help=(
|
||||
"--help[Display help information]"
|
||||
)
|
||||
|
||||
case $words[1] in
|
||||
article)
|
||||
args=(
|
||||
{-d,--date}"[The date to create the post with (defaults to now)]:date"
|
||||
)
|
||||
;;
|
||||
|
||||
build)
|
||||
args=(
|
||||
"--clean[Remove orphaned files from build (Default: true)]"
|
||||
"--no-clean[Disable removing orphaned files from build]"
|
||||
{-g,--glob}"[Build a subset of the project]:glob"
|
||||
"--verbose[Print debug messages]"
|
||||
"--instrument[Print instrument messages]:instrument"
|
||||
"--profile[Generate profiling report for the build]"
|
||||
)
|
||||
;;
|
||||
|
||||
console)
|
||||
args=(
|
||||
{-e,--environment}"[The environment Middleman will run under (Default: development)]:environment"
|
||||
"--verbose[Print debug messages]"
|
||||
)
|
||||
;;
|
||||
|
||||
deploy)
|
||||
args=(
|
||||
{-b,--build-before}"[Run \`middleman build\` before the deploy step]"
|
||||
)
|
||||
;;
|
||||
|
||||
extension)
|
||||
args=(
|
||||
"--git[Default: true]"
|
||||
)
|
||||
;;
|
||||
|
||||
init)
|
||||
args=(
|
||||
{-T,--template}"[Use a project template: default, html5, mobile, smacss, empty. (Default: default)]:template"
|
||||
"--css-dir [The path to the css files]:css_dir"
|
||||
"--js-dir [The path to the javascript files]:js_dir"
|
||||
"--images-dir [The path to the image files]:images_dir"
|
||||
"--rack [Include a config.ru file]"
|
||||
"--skip-gemfile [Don't create a Gemfile]"
|
||||
"--skip-bundle [Don't run bundle install]"
|
||||
"--skip-git [Skip Git ignores and keeps]"
|
||||
)
|
||||
;;
|
||||
|
||||
server)
|
||||
args=(
|
||||
{-e,--environment}"[The environment Middleman will run under (Default: development)]:environment"
|
||||
{-h,--host}"[Bind to HOST address (Default: 0.0.0.0)]:host"
|
||||
{-p,--port}"[The port Middleman will listen on (Default: 4567)]:port"
|
||||
"--verbose [Print debug messages]"
|
||||
"--instrument [Print instrument messages]:instrument"
|
||||
"--disable-watcher [Disable the file change and delete watcher process]"
|
||||
"--profile [Generate profiling report for server startup]"
|
||||
"--reload-paths [Additional paths to auto-reload when files change]:reload_paths"
|
||||
"--force-polling [Force file watcher into polling mode]"
|
||||
)
|
||||
;;
|
||||
|
||||
upgrade)
|
||||
args=()
|
||||
;;
|
||||
|
||||
version)
|
||||
args=()
|
||||
;;
|
||||
esac
|
||||
|
||||
_arguments $args && ret=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
@ -1,68 +0,0 @@
|
||||
#compdef mina
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Mina (http://nadarei.co/mina/).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Kazuya Takeshima (https://github.com/mitukiii)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local curcontext="$curcontext" state line cmds ret=1
|
||||
|
||||
_arguments -C \
|
||||
{-h,--help}'[Show help]' \
|
||||
{-V,--version}'[Show program version]' \
|
||||
{-v,--verbose}'[Show commands as they happen]' \
|
||||
{-s,--simulate}'[Run in simulation mode]' \
|
||||
{-t,--trace}'[Show backtraces when errors occur]' \
|
||||
-f'[Use FILE as the deploy configuration]:file:_files' \
|
||||
'*: :->cmds' && ret=0
|
||||
|
||||
case $state in
|
||||
cmds)
|
||||
cmds=( ${(f)"$(_call_program commands mina -T 2> /dev/null | sed -e 's/:/\\:/g; s/\[/\\[/g; s/\]/\\]/g; s/mina \([^ ]*\) .*# /\1:/g')"} )
|
||||
_describe -t commands 'mina command' cmds && ret=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,236 +0,0 @@
|
||||
#compdef mix
|
||||
#autoload
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Elixir Mix
|
||||
#
|
||||
# Last updated: 18.04.2017
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Han Ngo (https://github.com/tieubao)
|
||||
# * Teja Sophista (https://github.com/tejanium)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'app.start:Starts all registered apps'
|
||||
'app.tree:Prints the application tree'
|
||||
'archive:Lists installed archives'
|
||||
'archive.build:Archives this project into a .ez file'
|
||||
'archive.install:Installs an archive locally'
|
||||
'archive.uninstall:Uninstalls archives'
|
||||
'clean:Deletes generated application files'
|
||||
'cmd:Executes the given command'
|
||||
'compile:Compiles source files'
|
||||
'deps:Lists dependencies and their status'
|
||||
"deps.clean:Deletes the given dependencies' files"
|
||||
'deps.compile:Compiles dependencies'
|
||||
'deps.get:Gets all out of date dependencies'
|
||||
'deps.tree:Prints the dependency tree'
|
||||
'deps.unlock:Unlocks the given dependencies'
|
||||
'deps.update:Updates the given dependencies'
|
||||
'do:Executes the tasks separated by comma'
|
||||
'ecto:Prints Ecto help information'
|
||||
'ecto.create:Creates the repository storage'
|
||||
'ecto.drop:Drops the repository storage'
|
||||
'ecto.dump:Dumps the repository database structure'
|
||||
'ecto.gen.migration:Generates a new migration for the repo'
|
||||
'ecto.gen.repo:Generates a new repository'
|
||||
'ecto.load:Loads previously dumped database structure'
|
||||
'ecto.migrate:Runs the repository migrations'
|
||||
'ecto.migrations:Displays the repository migration status'
|
||||
'ecto.rollback:Rolls back the repository migrations'
|
||||
'escript:Lists installed escripts'
|
||||
'escript.build:Builds an escript for the project'
|
||||
'escript.install:Installs an escript locally'
|
||||
'escript.uninstall:Uninstalls escripts'
|
||||
'gettext.extract:Extracts translations from source code'
|
||||
'gettext.merge:Merge template files into translation files'
|
||||
'help:Prints help information for tasks'
|
||||
'hex:Prints Hex help information'
|
||||
'hex.build:Builds a new package version locally'
|
||||
'hex.config:Reads, updates or deletes Hex config'
|
||||
'hex.docs:Fetch or open documentation of a package'
|
||||
'hex.info:Prints Hex information'
|
||||
'hex.key:Manages Hex API key'
|
||||
'hex.outdated:Shows outdated Hex deps for the current project'
|
||||
'hex.owner:Manages Hex package ownership'
|
||||
'hex.public_keys:Manages Hex public keys'
|
||||
'hex.publish:Publishes a new package version'
|
||||
'hex.retire:Retires a package version'
|
||||
'hex.search:Searches for package names'
|
||||
'hex.user:Registers or manages Hex user'
|
||||
'loadconfig:Loads and persists the given configuration'
|
||||
'local:Lists local tasks'
|
||||
'local.hex:Installs Hex locally'
|
||||
'local.phoenix:Updates Phoenix locally'
|
||||
'local.phx:Updates the Phoenix project generator locally'
|
||||
'local.public_keys:Manages public keys'
|
||||
'local.rebar:Installs Rebar locally'
|
||||
'new:Creates a new Elixir project'
|
||||
'phoenix.gen.html:Generates controller, model and views for an HTML based resource'
|
||||
'phoenix.server:Starts applications and their servers'
|
||||
'phx.digest:Digests and compresses static files'
|
||||
'phx.digest.clean:Removes old versions of static assets.'
|
||||
'phx.gen.channel:Generates a Phoenix channel'
|
||||
'phx.gen.context:Generates a context with functions around an Ecto schema'
|
||||
'phx.gen.html:Generates controller, views, and context for an HTML resource'
|
||||
'phx.gen.json:Generates controller, views, and context for a JSON resource'
|
||||
'phx.gen.presence:Generates a Presence tracker'
|
||||
'phx.gen.schema:Generates an Ecto schema and migration file'
|
||||
'phx.gen.secret:Generates a secret'
|
||||
'phx.new:Creates a new Phoenix application'
|
||||
'phx.new.ecto:Creates a new Ecto project within an umbrella project'
|
||||
'phx.new.web:Creates a new Phoenix web project within an umbrella project'
|
||||
'phx.routes:Prints all routes'
|
||||
'phx.server:Starts applications and their servers'
|
||||
'profile.fprof:Profiles the given file or expression with fprof'
|
||||
'run:Runs the given file or expression'
|
||||
"test:Runs a project's tests"
|
||||
'xref:Performs cross reference checks'
|
||||
'--help:Describe available tasks'
|
||||
'--version:Prints the Elixir version information'
|
||||
)
|
||||
|
||||
__task_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a tasks
|
||||
|
||||
tasks=(
|
||||
'app.start'
|
||||
'app.tree'
|
||||
'archive'
|
||||
'archive.build'
|
||||
'archive.install'
|
||||
'archive.uninstall'
|
||||
'clean'
|
||||
'cmd'
|
||||
'compile'
|
||||
'deps'
|
||||
'deps.clean'
|
||||
'deps.compile'
|
||||
'deps.get'
|
||||
'deps.tree'
|
||||
'deps.unlock'
|
||||
'deps.update'
|
||||
'do'
|
||||
'ecto'
|
||||
'ecto.create'
|
||||
'ecto.drop'
|
||||
'ecto.dump'
|
||||
'ecto.gen.migration'
|
||||
'ecto.gen.repo'
|
||||
'ecto.load'
|
||||
'ecto.migrate'
|
||||
'ecto.migrations'
|
||||
'ecto.rollback'
|
||||
'escript'
|
||||
'escript.build'
|
||||
'escript.install'
|
||||
'escript.uninstall'
|
||||
'gettext.extract'
|
||||
'gettext.merge'
|
||||
'format'
|
||||
'help'
|
||||
'hex'
|
||||
'hex.build'
|
||||
'hex.config'
|
||||
'hex.docs'
|
||||
'hex.info'
|
||||
'hex.key'
|
||||
'hex.outdated'
|
||||
'hex.owner'
|
||||
'hex.public_keys'
|
||||
'hex.publish'
|
||||
'hex.retire'
|
||||
'hex.search'
|
||||
'hex.user'
|
||||
'loadconfig'
|
||||
'local'
|
||||
'local.hex'
|
||||
'local.public_keys'
|
||||
'local.rebar'
|
||||
'new'
|
||||
'phoenix.gen.html'
|
||||
'phoenix.server'
|
||||
'phx.digest'
|
||||
'phx.digest.clean'
|
||||
'phx.gen.channel'
|
||||
'phx.gen.context'
|
||||
'phx.gen.html'
|
||||
'phx.gen.json'
|
||||
'phx.gen.presence'
|
||||
'phx.gen.schema'
|
||||
'phx.gen.secret'
|
||||
'phx.routes'
|
||||
'phx.server'
|
||||
'profile.fprof'
|
||||
'run'
|
||||
'test'
|
||||
'xref'
|
||||
)
|
||||
|
||||
_wanted tasks expl 'help' compadd $tasks
|
||||
}
|
||||
|
||||
local expl
|
||||
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
_describe -t commands "mix subcommand" _1st_arguments
|
||||
return
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(help)
|
||||
_arguments ':feature:__task_list'
|
||||
return
|
||||
;;
|
||||
(test|format|run)
|
||||
_arguments ':PATH:_files'
|
||||
return
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
@ -1,108 +0,0 @@
|
||||
#compdef mssh
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2020 Hyeon Kim
|
||||
#
|
||||
# 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
|
||||
# -----------
|
||||
# mssh is a Python client for accessing EC2 instances via AWS EC2 Instance
|
||||
# Connect.
|
||||
#
|
||||
# References:
|
||||
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-methods.html#ec2-instance-connect-connecting-ec2-cli
|
||||
# https://github.com/aws/aws-ec2-instance-connect-cli
|
||||
# https://pypi.org/project/ec2instanceconnectcli/
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Hyeon Kim (https://hyeon.me/)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# Do nothing if there's no AWS CLI
|
||||
if (( ! $+commands[aws] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# Define function only when it doesn't exist
|
||||
(( $+functions[_mssh_cache_policy] )) || _mssh_cache_policy() {
|
||||
# Cache invalidates after 30 seconds
|
||||
#
|
||||
# Reference:
|
||||
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#index-globbing_002c-qualifiers
|
||||
local -a oldp
|
||||
oldp=( "$1"(ms+30) )
|
||||
(( $#oldp ))
|
||||
}
|
||||
|
||||
# Unless user explicitly turned off caching, enable caching just for this context
|
||||
local existing_setting
|
||||
zstyle -s ":completion:${curcontext}:" use-cache existing_setting
|
||||
if [[ -z "${existing_setting}" ]]; then
|
||||
zstyle ":completion:${curcontext}:" use-cache on
|
||||
fi
|
||||
|
||||
# Update cache policy only when there was no existing policy
|
||||
local existing_policy
|
||||
zstyle -s ":completion:${curcontext}:" cache-policy existing_policy
|
||||
if [[ -z "${existing_policy}" ]]; then
|
||||
zstyle ":completion:${curcontext}:" cache-policy _mssh_cache_policy
|
||||
fi
|
||||
|
||||
local -a instances
|
||||
if _cache_invalid mssh_instances || ! _retrieve_cache mssh_instances; then
|
||||
# Cache is invalid or caching retrieval failed (usually due to disabled cache)
|
||||
|
||||
# Store the output of the AWS CLI separately
|
||||
#
|
||||
# Reference:
|
||||
# https://unix.stackexchange.com/a/430182
|
||||
local stderr
|
||||
local -i exit_code
|
||||
() {
|
||||
aws ec2 describe-instances \
|
||||
--query 'Reservations[].Instances[] | [?State.Name == `running`].join(`:`, [InstanceId, Tags[?Key == `Name`].Value | [0]])' \
|
||||
--output text \
|
||||
>${1} 2>${2}
|
||||
exit_code=${?}
|
||||
IFS=$'\n\t' instances=($(<${1}))
|
||||
stderr=$(<${2})
|
||||
} =(:) =(:)
|
||||
|
||||
if (( $exit_code == 0 )); then
|
||||
# AWS CLI successfully executed
|
||||
_store_cache mssh_instances instances
|
||||
else
|
||||
# AWS CLI failed, abort autocompletion
|
||||
_message -r "\
|
||||
Failed autocomplete due to following reason:
|
||||
${stderr}"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
_describe 'command' instances
|
||||
|
||||
# Reference:
|
||||
# http://zsh.sourceforge.net/Doc/Release/Completion-System.html
|
||||
# https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org
|
@ -1,86 +0,0 @@
|
||||
#compdef mussh
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for MUltihost SSH Wrapper (http://mussh.sourceforge.net/)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Mario Fernandez (https://github.com/sirech)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local curcontext="$curcontext" state line ret=1
|
||||
typeset -A opt_args
|
||||
|
||||
# TODO:
|
||||
# -i: admit more than one use
|
||||
# -d, -v, -t: control input
|
||||
# -m: Accept number (but also empty)
|
||||
# -h: Accept multiple hosts, also more than one use
|
||||
# -H: Accept multiple files, also more than one use
|
||||
|
||||
_arguments -C \
|
||||
'--help[display this help message]' \
|
||||
'-V[print version info and exit]' \
|
||||
'-d[Verbose debug]:level (from 0 to 2)' \
|
||||
'-v[SSH debug level]:level (from 0 to 3)' \
|
||||
'-m[Run concurrently]' \
|
||||
'(-b -B)-b[Print each hosts output in a block without mingling with other hosts output]' \
|
||||
'(-b -B)-B[Allow hosts output to mingle. (default)]' \
|
||||
'(-a -A)-a[Force loading ssh-agent]' \
|
||||
'(-a -A)-A[Do NOT load ssh-agent]' \
|
||||
'(-u -U)-u[Unique. Eliminate duplicate hosts. (default)]' \
|
||||
'(-u -U)-U[Do NOT make host list unique]' \
|
||||
'-P[Do NOT fall back to passwords on any host. This will skip hosts where keys fail]' \
|
||||
'-i[Load an identity file. May be used more than once]:identity' \
|
||||
'-o[Args to pass to ssh with -o option]:ssh-args' \
|
||||
'(-l -L)-l[Use _login_ when no other is specified with the hostname]:login' \
|
||||
'(-l -L)-L[Force use of _login_ on all hosts]:login' \
|
||||
'-s[Path to shell on remote host]:shell' \
|
||||
'-t[Timeout setting for each session]:timeout' \
|
||||
'-p[Host to use as proxy]:[user@]host' \
|
||||
'-po[Args to pass to ssh on proxy with -o option]:ssh-args' \
|
||||
'(-h -H)-h[Add a host to list of hosts]:[user@]host' \
|
||||
'(-h -H)-H[Add contents of file to list of hosts]:host file:_files' \
|
||||
'(-c -C)-c[Add a command or quoted list of commands to list of commands to be executed on each host]:command' \
|
||||
'(-c -C)-C[Add file contents to list of commands to be executed on each host]:commands file:_files' \
|
||||
'(-q)-q[No output unless necessary]' && ret=0
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,613 +0,0 @@
|
||||
#compdef mvn mvnDebug
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Maven (http://maven.apache.org).
|
||||
#
|
||||
# Status: See FIXME and TODO tags.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Notes
|
||||
# -----
|
||||
#
|
||||
# * By default advanced phases are displayed only if you start typing them. To have
|
||||
# them always displayed:
|
||||
#
|
||||
# zstyle ':completion:*:mvn:*' show-all-phases true
|
||||
#
|
||||
# * By default full form plugins (groupId:artifactId[:version]) are only shown if you
|
||||
# start typing them. To have them always displayed:
|
||||
#
|
||||
# zstyle ':completion:*:mvn:*' show-full-form-plugins true
|
||||
#
|
||||
# * By default only the plugins for which the completion has already been
|
||||
# called ("mvn plugin:<TAB>") are shown. To define your own list of plugins:
|
||||
#
|
||||
# maven_plugins=(jboss tomcat gwt android)
|
||||
# zstyle ':completion:*:mvn:*' plugins $maven_plugins
|
||||
#
|
||||
# * To have a better presentation of completions:
|
||||
#
|
||||
# zstyle ':completion:*:*:mvn:*:matches' group 'yes'
|
||||
# zstyle ':completion:*:*:mvn:*:options' description 'yes'
|
||||
# zstyle ':completion:*:*:mvn:*:options' auto-description '%d'
|
||||
# zstyle ':completion:*:*:mvn:*:descriptions' format $'\e[1m -- %d --\e[22m'
|
||||
# zstyle ':completion:*:*:mvn:*:messages' format $'\e[1m -- %d --\e[22m'
|
||||
# zstyle ':completion:*:*:mvn:*:warnings' format $'\e[1m -- No matches found --\e[22m'
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_mvn() {
|
||||
typeset -A opt_args
|
||||
local context state line
|
||||
|
||||
local curcontext="$curcontext" maven_version excl_opts
|
||||
|
||||
excl_opts=(-h --help -v --version -ep --encrypt-password -emp --encrypt-master-password)
|
||||
|
||||
_pick_variant -r maven_version maven3='Maven 3' maven2='Maven 2' unknown --version
|
||||
if [[ $maven_version == 'maven3' ]]; then
|
||||
opts=(
|
||||
"($excl_opts -T --threads)"{-T,--threads}'[thread count, for instance 2.0C where C is core multiplied]:thread count:_mvn_thread_counts'
|
||||
"($excl_opts -t --toolchains)"{-t,--toolchains}'[alternate path for the user toolchains file]:toolchains file:_mvn_toolchains_files'
|
||||
"($excl_opts -l --log-file)"{-l,--log-file}'[log file to where all build output will go]:log file:_mvn_log_files'
|
||||
)
|
||||
elif [[ $maven_version == 'maven2' ]]; then
|
||||
opts=(
|
||||
"($excl_opts -cpu --check-plugin-updates -up --update-plugins -npu --no-plugin-updates -o --offline)"{-cpu,--check-plugin-updates,-up,--update-plugins}'[force upToDate check for any relevant registered plugins]'
|
||||
"($excl_opts -npr --no-plugin-registry)"{-npr,--no-plugin-registry}'[don'\''t use plugin-registry.xml for plugin versions]'
|
||||
"($excl_opts -npu --no-plugin-updates -cpu --check-plugin-updates -up --update-plugins)"{-npu,--no-plugin-updates}'[suppress upToDate check for any relevant registered plugins]'
|
||||
"($excl_opts -r --reactor)"{-r,--reactor}'[dynamically build reactor from subdirectories]:reactor:_mvn_reactors'
|
||||
)
|
||||
fi
|
||||
|
||||
[[ -n ${(M)words:#"-pl"} || -n ${(M)words:#"--projects"} ]] && opts+=(
|
||||
"($excl_opts -am --also-make)"{-am,--also-make}'[if project list is specified, also build projects required by the list]'
|
||||
"($excl_opts -amd --also-make-dependents)"{-amd,--also-make-dependents}'[if project list is specified, also build projects that depend on projects on the list]'
|
||||
)
|
||||
|
||||
_arguments -C \
|
||||
"(- : *)"{-h,--help}'[display help information]' \
|
||||
"(- : *)"{-v,--version}'[display version information]' \
|
||||
"(- : *)"{-emp,--encrypt-master-password}'[encrypt master security password]:master password:_mvn_passwords' \
|
||||
"(- : *)"{-ep,--encrypt-password}'[encrypt server password]:password:_mvn_passwords' \
|
||||
"($excl_opts -B --batch-mode)"{-B,--batch-mode}'[run in non-interactive (batch) mode]' \
|
||||
"($excl_opts -V --show-version)"{-V,--show-version}'[display version information without stopping build]' \
|
||||
"($excl_opts -q --quiet -X --debug)"{-q,--quiet}'[quiet output, only show errors]' \
|
||||
"($excl_opts -X --debug -q --quiet)"{-X,--debug}'[produce execution debug output]' \
|
||||
"($excl_opts -N --non-recursive)"{-N,--non-recursive}'[do not recurse into sub-projects]' \
|
||||
"($excl_opts -C --strict-checksums -c --lax-checksums)"{-C,--strict-checksums}'[fail the build if checksums don'\''t match]' \
|
||||
"($excl_opts -c --lax-checksums -C --strict-checksums)"{-c,--lax-checksums}'[warn if checksums don'\''t match]' \
|
||||
"($excl_opts -e --errors)"{-e,--errors}'[produce execution error messages]' \
|
||||
"($excl_opts -f --file)"{-f,--file}'[force the use of an alternate POM file]:POM file:_mvn_pom_files' \
|
||||
"($excl_opts -s --settings)"{-s,--settings}'[alternate path for the user settings file]:settings file:_mvn_settings_files' \
|
||||
"($excl_opts -gs --global-settings)"{-gs,--global-settings}'[alternate path for the global settings file]:global settings file:_mvn_settings_files' \
|
||||
"($excl_opts -fae --fail-at-end -ff --fail-fast -fn --fail-never)"{-fae,--fail-at-end}'[only fail the build afterwards, allow all non-impacted builds to continue]' \
|
||||
"($excl_opts -ff --fail-fast -fae --fail-at-end -fn --fail-never)"{-ff,--fail-fast}'[stop at first failure in reactorized builds]' \
|
||||
"($excl_opts -fn --fail-never -fae --fail-at-end -ff --fail-fast)"{-fn,--fail-never}'[never fail the build, regardless of project result]' \
|
||||
"($excl_opts)*"{-P,--activate-profiles}'[comma-delimited list of profiles to activate]:profile:_mvn_profiles -s ,' \
|
||||
"($excl_opts -pl --projects)"{-pl,--projects}'[build specified reactor projects instead of all projects]:project list:_mvn_projects -s ,' \
|
||||
"($excl_opts -rf --resume-from)"{-rf,--resume-from}'[resume reactor from specified project]:project:_mvn_projects' \
|
||||
"($excl_opts -o --offline -U --update-snapshots -cpu --check-plugin-updates -up --update-plugins)"{-o,--offline}'[work offline]' \
|
||||
"($excl_opts -U --update-snapshots -nsu --no-snapshot-updates -o --offline)"{-U,--update-snapshots}'[force a check for updated releases and snapshots on remote repositories]' \
|
||||
"($excl_opts -nsu --no-snapshot-updates -U --update-snapshots -o --offline)"{-nsu,--no-snapshot-updates}'[Suppress SNAPSHOT updates]' \
|
||||
"*"{-D-,--define}'[define a system property]:property:_mvn_properties' \
|
||||
"${opts[@]}" \
|
||||
"($excl_opts)*: :_mvn_args"
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_args] )) ||
|
||||
_mvn_args() {
|
||||
_alternative \
|
||||
'phases:phase:_mvn_phases' \
|
||||
'plugin-colon-goals:plugin colon goal:_mvn_plugin_colon_goals'
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_phases] )) ||
|
||||
_mvn_phases() {
|
||||
local phases
|
||||
phases=(
|
||||
'clean:remove all files generated by the previous build'
|
||||
'compile:compile the source code of the project'
|
||||
'test:run tests using a suitable unit testing framework'
|
||||
'package:take the compiled code and package it in its distributable format, such as a JAR'
|
||||
'integration-test:process and deploy the package if necessary into an environment where integration tests can be run'
|
||||
'verify:run any checks to verify the package is valid and meets quality criteria'
|
||||
'install:install the package into the local repository, for use as a dependency in other projects locally'
|
||||
'deploy:done in an integration or release environment, copies the final package to the remote repository'
|
||||
'site:generates the projects site documentation'
|
||||
'site-deploy:deploys the generated site documentation to the specified web server'
|
||||
)
|
||||
if [[ $#PREFIX -gt 0 ]] || zstyle -t ":completion:${curcontext}:" show-all-phases; then
|
||||
phases+=(
|
||||
'pre-clean:executes processes needed prior to the actual project cleaning'
|
||||
'post-clean:executes processes needed to finalize the project cleaning'
|
||||
'validate:validate the project is correct and all necessary information is available'
|
||||
'initialize:initialize build state, e.g. set properties or create directories'
|
||||
'generate-sources:generate any source code for inclusion in compilation'
|
||||
'process-sources:process the source code, for example to filter any values'
|
||||
'generate-resources:generate resources for inclusion in the package'
|
||||
'process-resources:copy and process the resources into the destination directory, ready for packaging'
|
||||
'process-classes:post-process the generated files from compilation'
|
||||
'generate-test-sources:generate any test source code for inclusion in compilation'
|
||||
'process-test-sources:process the test source code, for example to filter any values'
|
||||
'generate-test-resources:create resources for testing'
|
||||
'process-test-resources:copy and process the resources into the test destination directory'
|
||||
'test-compile:compile the test source code into the test destination directory'
|
||||
'process-test-classes:post-process the generated files from test compilation'
|
||||
'prepare-package:perform any operations necessary to prepare a package before the actual packaging'
|
||||
'pre-integration-test:perform actions required before integration tests are executed'
|
||||
'post-integration-test:perform actions required after integration tests have been executed'
|
||||
'pre-site:executes processes needed prior to the actual project site generation.'
|
||||
'post-site:executes processes needed to finalize the site generation, and to prepare for site deployment'
|
||||
)
|
||||
fi
|
||||
_describe -t 'phases' "phase" phases
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_plugins] )) ||
|
||||
_mvn_plugins() {
|
||||
local ret=1
|
||||
if [[ $words[CURRENT] == *.* ]] || zstyle -t ":completion:${curcontext}:" show-full-form-plugins; then
|
||||
_wanted full-form-plugins expl 'full form plugin' _mvn_full_form_plugins && ret=0
|
||||
else
|
||||
_wanted plugin-prefixes expl 'plugin prefix' _mvn_plugin_prefixes && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_plugin_colon_goals] )) ||
|
||||
_mvn_plugin_colon_goals() {
|
||||
local ret=1
|
||||
if [[ $words[CURRENT] == *.* ]] || zstyle -t ":completion:${curcontext}:" show-full-form-plugins; then
|
||||
_wanted full-form-plugin-colon-goals expl 'full form plugin colon goal' _mvn_full_form_plugin_colon_goals && ret=0
|
||||
else
|
||||
_wanted plugin-prefix-colon-goals expl 'plugin prefix colon goal' _mvn_plugin_prefix_colon_goals && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_plugin_prefix_colon_goals] )) ||
|
||||
_mvn_plugin_prefix_colon_goals() {
|
||||
local ret=1
|
||||
if compset -P '*:'; then
|
||||
local plugin="${IPREFIX%:}"
|
||||
_wanted goals expl "${plugin} plugin goal" _mvn_plugin_goals $plugin && ret=0
|
||||
else
|
||||
_wanted plugin-prefixes expl 'plugin prefix' _mvn_plugin_prefixes -qS: && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_plugin_prefixes] )) ||
|
||||
_mvn_plugin_prefixes() {
|
||||
local plugins
|
||||
zstyle -a ":completion:${curcontext}:" plugins plugins
|
||||
[[ $#plugins -eq 0 ]] && plugins=($(__mvn_get_plugin_prefix $(__mvn_get_cache_dir)/mvn/plugins/*(:t)))
|
||||
_describe -t plugin-prefixes 'plugin prefix' plugins $@
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_full_form_plugin_colon_goals] )) ||
|
||||
_mvn_full_form_plugin_colon_goals() {
|
||||
local ret=1
|
||||
# FIXME Duplicates _mvn_full_form_plugins
|
||||
if compset -P 1 '*:'; then
|
||||
local groupId="${${IPREFIX%:}##*:}"
|
||||
if compset -P 1 '*:'; then
|
||||
local artifactId="${${IPREFIX%:}##*:}"
|
||||
if compset -P 1 '*:'; then
|
||||
local version="${${IPREFIX%:}##*:}"
|
||||
_wanted goals expl "${artifactId}:${version} goal" _mvn_plugin_goals "${groupId}:${artifactId}:${version}" && ret=0
|
||||
else
|
||||
_alternative \
|
||||
"versions:${artifactId} version:_mvn_artifact_versions -qS: ${groupId}:${artifactId}" \
|
||||
"goals:${artifactId} goal:_mvn_plugin_goals ${groupId}:${artifactId}" \
|
||||
&& ret=0
|
||||
fi
|
||||
else
|
||||
_wanted artifactIds expl "${groupId} artifactId" _mvn_groupId_artifactIds -qS: $groupId && ret=0
|
||||
fi
|
||||
else
|
||||
_wanted groupIds expl "groupId" _mvn_groupIds -qS: && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_full_form_plugins] )) ||
|
||||
_mvn_full_form_plugins() {
|
||||
local ret=1 chunk="${PREFIX%%:*}"
|
||||
if compset -P 1 '*:'; then
|
||||
local groupId="$chunk"
|
||||
chunk="${PREFIX%%:*}"
|
||||
if compset -P 1 '*:'; then
|
||||
_wanted versions expl "${current} version" _mvn_artifact_versions $@ "${groupId}:${chunk}" && ret=0
|
||||
else
|
||||
_wanted artifactIds expl "${groupId} artifactId" _mvn_groupId_artifactIds -qS: "${groupId}" && ret=0
|
||||
fi
|
||||
else
|
||||
_wanted groupIds expl "groupId" _mvn_groupIds -qS: && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_groupIds] )) ||
|
||||
_mvn_groupIds() {
|
||||
local repository_location=$(__mvn_get_repository_location) update_policy ret=1
|
||||
|
||||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_groupIds_caching_policy
|
||||
|
||||
if [[ -d $repository_location ]]; then
|
||||
unset _groupIds
|
||||
if ( [[ ${+_groupIds} -eq 0 ]] || _cache_invalid "mvn/repositories/${repository_location}/groupIds" ) && ! _retrieve_cache "mvn/repositories/${repository_location}/groupIds"; then
|
||||
_groupIds=($repository_location/**/)
|
||||
_groupIds=(${${${(u)_groupIds:h:h}#"$repository_location/"}//\//.})
|
||||
[[ $#_groupIds -gt 0 ]] && _store_cache "mvn/repositories/${repository_location}/groupIds" _groupIds
|
||||
fi
|
||||
|
||||
[[ $#_groupIds -gt 0 ]] && _multi_parts $@ . _groupIds && ret=0
|
||||
fi
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_groupId_artifactIds] )) ||
|
||||
_mvn_groupId_artifactIds() {
|
||||
local groupId_repository_location="${$(__mvn_get_repository_location)}/${${@[-1]}//\.//}" ret=1
|
||||
|
||||
if [[ -d $groupId_repository_location ]]; then
|
||||
local artifactIds; artifactIds=($groupId_repository_location/*/*/*.pom(:h:h:t))
|
||||
_describe -t artifactIds "artifactId" artifactIds $@[0,-2] && ret=0
|
||||
fi
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_artifact_versions] )) ||
|
||||
_mvn_artifact_versions() {
|
||||
local artifact_repository_location="${$(__mvn_get_repository_location)}/${${@[-1]}//[\.:]//}" ret=1
|
||||
|
||||
if [[ -d $artifact_repository_location ]]; then
|
||||
local versions; versions=($artifact_repository_location/*/*.pom(:h:t))
|
||||
_describe -t versions "version" versions $@[0,-2]
|
||||
fi
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_plugin_goals] )) ||
|
||||
_mvn_plugin_goals() {
|
||||
local ret=1 plugin="$@[-1]" update_policy
|
||||
|
||||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_goals_caching_policy
|
||||
|
||||
unset _goals
|
||||
if ( [[ ${+_goals} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin}" ) && ! _retrieve_cache "mvn/plugins/${plugin}"; then
|
||||
setopt localoptions extendedglob
|
||||
_goals=(${(s:,,,:)${${${(f)${${${(f)${${${${(F)${(S)${(f)"$(_call_program goals $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=$plugin)"}//#$(__mvn_get_plugin_prefix $plugin):/,,,}}:#*BUILD FAILURE*}#*This plugin has*goals#:}%For more information, run \'mvn help:describe*}}//:/\\:}}}// ##/ }// Description\\: /:}})
|
||||
[[ $#_goals -gt 0 ]] && _store_cache "mvn/plugins/${plugin}" _goals
|
||||
fi
|
||||
|
||||
[[ $#_goals -gt 0 ]] && _describe -t "goals" "${plugin} goal" _goals $@[0,-2] && ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_profiles] )) ||
|
||||
_mvn_profiles() {
|
||||
|
||||
# FIXME Use "mvn help:all-profiles" output instead of parsing settings and pom files...
|
||||
# Blocked on http://jira.codehaus.org/browse/MPH-82 and http://jira.codehaus.org/browse/MPH-83
|
||||
local profs update_policy settings_file=$(__mvn_get_settings_file) parent_pom_file=$(__mvn_get_parent_pom_file) cache_name profiles_section ret=1
|
||||
|
||||
# TODO Should be split into _mvn_profiles/mvn_profiles_lists
|
||||
|
||||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_profiles_caching_policy
|
||||
|
||||
profs=()
|
||||
|
||||
# Resolve profiles from settings.xml
|
||||
if [[ -f $settings_file ]]; then
|
||||
unset _profiles
|
||||
cache_name="mvn/profiles${settings_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10
|
||||
if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then
|
||||
_profiles=()
|
||||
profiles_section="${(M)${(f)$(<$settings_file)}:#*<profiles>*}"
|
||||
if [[ -n "$profiles_section" ]]; then
|
||||
for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*<profile>}%</profile>*}//<repositories>*<\/repositories>}//<pluginRepositories>*<\/pluginRepositories>}//<build>*<\/build>}//<\/id>*<id>/,,,}##*<id>}%%</id>*}}; do
|
||||
[[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in settings file"']')
|
||||
done
|
||||
fi
|
||||
[[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
|
||||
fi
|
||||
profs+=($_profiles)
|
||||
fi
|
||||
|
||||
# Resolve project profiles
|
||||
if [[ -f $parent_pom_file ]]; then
|
||||
unset _profiles
|
||||
cache_name="mvn/profiles${parent_pom_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10
|
||||
if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then
|
||||
_profiles=()
|
||||
setopt localoptions extendedglob
|
||||
for file in ${parent_pom_file:h}/**/pom.xml~*target\/*; do # FIXME project.build.directory is not always target/
|
||||
profiles_section="${(M)${(f)$(<$file)}:#*<profiles>*}"
|
||||
if [[ -n "$profiles_section" ]]; then
|
||||
for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*<profile>}%</profile>*}//<repositories>*<\/repositories>}//<pluginRepositories>*<\/pluginRepositories>}//<build>*<\/build>}//<\/id>*<id>/,,,}##*<id>}%%</id>*}}; do
|
||||
[[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in ${file#${parent_pom_file:h}\/}"']')
|
||||
done
|
||||
fi
|
||||
done
|
||||
[[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
|
||||
fi
|
||||
profs+=($_profiles)
|
||||
fi
|
||||
|
||||
compset -P '-'; compset -P '+'; compset -P '!' # FIXME Only works for the first profile
|
||||
|
||||
[[ $#profs -gt 0 ]] && _values $@ 'profile' "${profs[@]}" && ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_projects] )) ||
|
||||
_mvn_projects() {
|
||||
# TODO Projects can also be given in the form [groupId:]artifactId.
|
||||
# TODO Should be split into _mvn_projects/mvn_projects_lists
|
||||
local pom_file=$(__mvn_get_parent_pom_file) ret=1
|
||||
|
||||
if [[ -f $pom_file ]]; then
|
||||
setopt localoptions extendedglob
|
||||
local projects; projects=(${pom_file:h}/*/**/pom.xml~*target\/*) # FIXME project.build.directory is not always target/
|
||||
projects=(${${projects#.\/}:h})
|
||||
[[ $#projects -gt 0 ]] && _values "$@" 'project' "${projects[@]}" && ret=0
|
||||
fi
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_properties] )) ||
|
||||
_mvn_properties() {
|
||||
local ret=1
|
||||
if compset -P '*='; then
|
||||
_wanted property-values expl 'property value' _mvn_property_values ${${IPREFIX%=}#-D} && ret=0
|
||||
else
|
||||
_wanted property-names expl 'property name' _mvn_property_names -qS= && ret=0
|
||||
fi
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_property_names] )) ||
|
||||
_mvn_property_names() {
|
||||
# FIXME "-qS=" should be inherited from _mvn_properties
|
||||
local alternatives; alternatives=(
|
||||
"common-property-names:common property name:_mvn_common_property_names -qS="
|
||||
)
|
||||
for plugin_colon_goal in ${(M)words:#[^-]*:*}; do
|
||||
alternatives+=("plugin-property-names:plugin property name:_mvn_plugin_goal_property_names -qS= ${plugin_colon_goal}")
|
||||
done
|
||||
_alternative "${alternatives[@]}"
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_common_property_names] )) ||
|
||||
_mvn_common_property_names() {
|
||||
local properties; properties=(
|
||||
'skipTests:skip tests execution'
|
||||
'maven.test.skip:skip tests compilation and execution'
|
||||
'gpg.passphrase:gpg passphrase'
|
||||
'tycho.mode:enable maven mode for Tycho projects to disable p2 resolution'
|
||||
)
|
||||
_describe -t 'common-property-names' 'common property name' properties $@
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_plugin_goal_property_names] )) ||
|
||||
_mvn_plugin_goal_property_names() {
|
||||
local plugin_colon_goal="$@[-1]" update_policy ret=1
|
||||
|
||||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_properties_caching_policy
|
||||
|
||||
unset _properties
|
||||
if ( [[ ${+_properties} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin_colon_goal}" ) && ! _retrieve_cache "mvn/plugins/${plugin_colon_goal}"; then
|
||||
# FIXME Does not work for:
|
||||
# android:apk (new line before expression)
|
||||
# ear:ear (unknown cause)
|
||||
_properties=(${(M)${(ps:,,,:)${${${${(pj: :)${${${(f)${"$(_call_program properties $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=${plugin_colon_goal%:*} -Dgoal=${plugin_colon_goal##*:} -Ddetail)"#*Available parameters:}%%\[INFO\]*}//# [a-z]*/,,,}##*Expression: \$\{}}//\}[[:space:]]##/:}//[[:space:]]##/ }//[[:space:]]#,,,[[:space:]]#/,,,}}:#[a-zA-Z]##:*})
|
||||
[[ $#_properties -gt 0 ]] && _store_cache "mvn/plugins/${plugin_colon_goal}" _properties
|
||||
fi
|
||||
|
||||
[[ $#_properties -gt 0 ]] && _describe -t "${plugin_colon_goal//:/-}-property-names" "${plugin_colon_goal} property name" _properties $@[0,-2] && ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_property_values] )) ||
|
||||
_mvn_property_values() {
|
||||
local ret=1
|
||||
setopt localoptions extendedglob
|
||||
case $@[-1] in
|
||||
((#i)*pomFile*) _wanted pom-files expl 'POM file' _mvn_pom_files && ret=0;;
|
||||
((#i)*file*) _wanted files expl 'file' _files && ret=0;;
|
||||
((#i)*groupId*) _wanted groupIds expl 'groupId' _mvn_groupIds && ret=0;;
|
||||
((#i)*artifactId*) _wanted artifactIds expl 'artifactId' _mvn_groupId_artifactIds ${${(M)${(ps.:.)opt_args[(K)-D]}:#groupId=*}#groupId=} && ret=0;;
|
||||
((#i)*version*) _wanted versions expl 'version' _mvn_artifact_versions ${${(M)${(ps.:.)opt_args[(K)-D]}:#groupId=*}#groupId=}:${${(M)${(ps.:.)opt_args[(K)-D]}:#artifactId=*}#artifactId=} && ret=0;;
|
||||
((#i)*repositoryId*) _message -e repositoryIds 'repositoryId' && ret=0;; # TODO Not implemented
|
||||
((#i)*classifier*) _message -e classifiers 'classifier' && ret=0;;
|
||||
((#i)*scope*) _wanted scopes expl 'scope' _mvn_scopes && ret=0;;
|
||||
((#i)*url*) _wanted urls expl 'url' _urls && ret=0;; # TODO Use _alternative and add repository urls from settings + projects
|
||||
((#i)*(password|passphrase)*) _wanted passwords expl password _mvn_passwords && ret=0;;
|
||||
((#i)*(createChecksum|generatePom|maven.test.skip)*) _wanted booleans expl 'boolean' _mvn_booleans && ret=0;;
|
||||
((#i)*user*) _wanted users expl 'user' _users && ret=0;; # TODO Use _alternative and add repository usernames from settings + projects
|
||||
((#i)*plugin*) _wanted plugin expl 'plugin' _mvn_plugins && ret=0;;
|
||||
((#i)*tycho.mode*) _wanted tychomodes expl 'tychomode' _mvn_tycho_modes && ret=0;;
|
||||
(*) _default && ret=0;;
|
||||
esac
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_scopes] )) ||
|
||||
_mvn_scopes() {
|
||||
local scopes; scopes=(
|
||||
'compile:default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.'
|
||||
'provided:much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.'
|
||||
'runtime:indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath.'
|
||||
'test:indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.'
|
||||
'system:similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.'
|
||||
'import:only used on a dependency of type pom in the <dependencyManagement> section. It indicates that the specified POM should be replaced with the dependencies in that POM'\''s <dependencyManagement> section. Since they are replaced, dependencies with a scope of import do not actually participate in limiting the transitivity of a dependency.'
|
||||
)
|
||||
_describe -t scopes 'scope' scopes
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_thread_counts] )) ||
|
||||
_mvn_thread_counts() {
|
||||
local thread_counts; thread_counts=(
|
||||
'1:build with 1 thread' '1C:build with 1 thread per CPU core'
|
||||
'2:build with 2 threads' '2C:build with 2 threads per CPU core'
|
||||
'3:build with 3 threads' '3C:build with 3 threads per CPU core'
|
||||
'4:build with 4 threads' '4C:build with 4 threads per CPU core'
|
||||
'5:build with 5 threads' '5C:build with 5 threads per CPU core'
|
||||
'6:build with 6 threads' '6C:build with 6 threads per CPU core'
|
||||
'7:build with 7 threads' '7C:build with 7 threads per CPU core'
|
||||
'8:build with 8 threads' '8C:build with 8 threads per CPU core'
|
||||
)
|
||||
_describe -t thread-counts 'thread count' thread_counts
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_reactors] )) ||
|
||||
_mvn_reactors() {
|
||||
_message -e reactors 'reactor' # FIXME No idea what kind of value the "--reactor" option is supposed to take
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_passwords] )) ||
|
||||
_mvn_passwords() {
|
||||
_message -e passwords 'password'
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_pom_files] )) ||
|
||||
_mvn_pom_files() {
|
||||
_files -g '*pom*\.xml*'
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_toolchains_files] )) ||
|
||||
_mvn_toolchains_files() {
|
||||
_files -g '*toolchains*\.xml*'
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_settings_files] )) ||
|
||||
_mvn_settings_files() {
|
||||
_files -g '*settings*\.xml*'
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_log_files] )) ||
|
||||
_mvn_log_files() {
|
||||
_files
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_booleans] )) ||
|
||||
_mvn_booleans() {
|
||||
local booleans; booleans=(
|
||||
'true:"true" boolean value'
|
||||
'false:"false" boolean value'
|
||||
)
|
||||
_describe -t booleans 'boolean' booleans
|
||||
}
|
||||
|
||||
|
||||
(( $+functions[_mvn_tycho_modes] )) ||
|
||||
_mvn_tycho_modes() {
|
||||
local tychomodes; tychomodes=(
|
||||
'maven:maven mode, Tycho will not do any p2 dependency resolution'
|
||||
)
|
||||
_describe -t tychomodes 'boolean' tychomodes
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Helper functions
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
__mvn_get_pom_file() {
|
||||
print ${~opt_args[-f]:-${opt_args[--file]:-pom.xml}}
|
||||
}
|
||||
|
||||
__mvn_get_parent_pom_file() {
|
||||
local pom_file=$(__mvn_get_pom_file)
|
||||
while [[ -f ${pom_file:a:h:h}/pom.xml ]]; do
|
||||
pom_file=${pom_file:a:h:h}/pom.xml;
|
||||
done
|
||||
print $pom_file
|
||||
}
|
||||
|
||||
__mvn_get_settings_file() {
|
||||
print ${~opt_args[-s]:-${opt_args[--settings]:-$HOME/.m2/settings.xml}}
|
||||
}
|
||||
|
||||
__mvn_get_repository_location() {
|
||||
print ${${${${(M)"$(<$(__mvn_get_settings_file))":#*<localRepository>*}:-$HOME/.m2/repository}##*<localRepository>}%%<\/localRepository>*}
|
||||
}
|
||||
|
||||
__mvn_get_plugin_prefix() {
|
||||
print ${${${${@#*.*:}%%:*}%-plugin}/-#maven-#}
|
||||
}
|
||||
|
||||
__mvn_get_cache_dir() {
|
||||
local cache_dir
|
||||
zstyle -s ":completion:${curcontext}:" cache-path cache_dir
|
||||
print ${cache_dir:-${ZDOTDIR:-$HOME}/.zcompcache}
|
||||
}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Caching policies
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
(( $+functions[_mvn_goals_caching_policy] )) ||
|
||||
_mvn_goals_caching_policy() {
|
||||
# Rebuild if cache is older than one month.
|
||||
local -a oldp
|
||||
oldp=( "$1"(NmM+1) )
|
||||
(( $#oldp ))
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_properties_caching_policy] )) ||
|
||||
_mvn_properties_caching_policy() {
|
||||
_mvn_goals_caching_policy
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_groupIds_caching_policy] )) ||
|
||||
_mvn_groupIds_caching_policy() {
|
||||
_mvn_goals_caching_policy
|
||||
}
|
||||
|
||||
(( $+functions[_mvn_profiles_caching_policy] )) ||
|
||||
_mvn_profiles_caching_policy() {
|
||||
# Rebuild if cached file more recent than cache.
|
||||
local cached_file="${1#$(__mvn_get_cache_dir)}"
|
||||
[[ -f $cached_file && $cached_file -nt "$1" ]] && return 0
|
||||
|
||||
# Rebuild if cache is older than one week.
|
||||
local -a oldp
|
||||
oldp=( "$1"(Nmw+1) )
|
||||
(( $#oldp )) && return 0
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
_mvn "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,73 +0,0 @@
|
||||
#compdef nano
|
||||
|
||||
local curcontext="$curcontext" state line
|
||||
local -i ret=1
|
||||
|
||||
_arguments -s -S -C \
|
||||
'(-)'{-A,--smarthome}'[enable smart home key]' \
|
||||
'(-B --backup)'{-B,--backup}'[save backups of existing files]' \
|
||||
'(-C --backupdir)'{-C+,--backupdir=}'[specify directory for saving unique backup files]:directory:_directories' \
|
||||
'(-D --boldtext)'{-D,--boldtext}'[use bold instead of reverse video text]' \
|
||||
'(-E --tabstospaces)'{-E,--tabstospaces}'[convert typed tabs to spaces]' \
|
||||
'(-F --multibuffer)'{-F,--multibuffer}'[read a file into a new buffer by default]' \
|
||||
'(-G --locking)'{-G,--locking}'[use vim-style lock files]' \
|
||||
'(-H --historylog)'{-H,--historylog}'[log & read search replace string history]' \
|
||||
'(-I --ignorercfiles)'{-I,--ignorercfiles}"[don't look at nanorc files]" \
|
||||
'(-J --guidestripe)'{-J+,--guidestripe=}'[show a guide bar at specified column]:number' \
|
||||
'(-K --rawsequences)'{-K,--rawsequences}'[fix numeric keypad key confusion problem]' \
|
||||
'(-L --nonewlines)'{-L,--nonewlines}"[don't add an automatic newline]" \
|
||||
'(-M --trimblanks)'{-M,--trimblanks}'[trim trailing spaces when hard-wrapping]' \
|
||||
'(-N --noconvert -u --unix)'{-N,--noconvert}"[don't convert files from DOS/Mac format]" \
|
||||
'(-O --bookstyle)'{-O,--bookstyle}'[leading whitespace means new paragraph]' \
|
||||
'(-P --positionlog)'{-P,--positionlog}'[log & read location of cursor position]' \
|
||||
'(-Q --quotestr)'{-Q+,--quotestr=}'[specify regular expression to match quoted parts of lines]:regex [^([ \t]*([!#%\:;>|}]|//))+]' \
|
||||
'(-R --restricted)'{-R,--restricted}'[restricted mode]' \
|
||||
'(-S --softwrap)'{-S,--softwrap}'[display overly long lines on multiple rows]' \
|
||||
'(-T --tabsize)'{-T+,--tabsize=}'[set width of a tab]:columns [8]' \
|
||||
'(-U --quickblank -c --constantshow -_ --minibar)'{-U,--quickblank}'[do quick statusbar blanking]' \
|
||||
'(- *)'{-V,--version}'[print version information and exit]' \
|
||||
'(-W --wordbounds -X --wordchars)'{-W,--wordbounds}'[detect word boundaries more accurately]' \
|
||||
'(-X --wordchars -W --wordbounds)'{-X+,--wordchars=}'[specify which other characters are word parts]:string' \
|
||||
'(-Y --syntax=)'{-Y+,--syntax=}'[syntax definition to use for coloring]:value' \
|
||||
'(-Z --zap)'{-Z,--zap}'[let backspace and delete erase a marked region]' \
|
||||
'(-a --atblanks)'{-a,--atblanks}'[when soft-wrapping, do it at whitespace]' \
|
||||
'(-b --breaklonglines -w --nowrap)'{-b,--breaklonglines}'[automatically hard-wrap overlong lines]' \
|
||||
'(-c --constantshow -U --quickblank)'{-c,--constantshow}'[show cursor position constantly]' \
|
||||
'(-d --rebinddelete)'{-d,--rebinddelete}'[fix Backspace/Delete confusion problem]' \
|
||||
'(-e --emptyline)'{-e,--emptyline}'[keep the line below the title bar empty]' \
|
||||
'(-f --rcfile)'{-f,--rcfile=}'[Use only specified file for configuring nano]:file:_files' \
|
||||
'(-g --showcursor)'{-g,--showcursor}'[show cursor in file browser & help text]' \
|
||||
'(- *)'{-h,--help}'[show help text and exit]' \
|
||||
'(-i --autoindent)'{-i,--autoindent}'[automatically indent new lines]' \
|
||||
'(-j --jumpyscrolling)'{-j,--jumpyscrolling}'[scroll by half-screen, not by line]' \
|
||||
'(-k --cutfromcursor)'{-k,--cutfromcursor}'[cut from cursor to end of line]' \
|
||||
'(-l --linenumbers)'{-l,--linenumbers}'[show line numbers in front of the text]' \
|
||||
'(-m --mouse)'{-m,--mouse}'[enable the use of the mouse]' \
|
||||
'(-n --noread)'{-n,--noread}"[don't read the file (only write it)]" \
|
||||
'(-o --operatingdir)'{-o+,--operatingdir=}'[set operating directory]:directory:_directories' \
|
||||
'(-p --preserve)'{-p,--preserve}'[preserve XON (^Q) and XOFF (^S) keys]' \
|
||||
'(-q --indicator)'{-q,--indicator}'[show a position+portion indicator]' \
|
||||
'(-r --fill)'{-r+,--fill=}'[set width for hard-wrap and justification]:width [-8]' \
|
||||
'(-s --speller)'{-s+,--speller=}'[enable alternate speller]:program:_command_names -e' \
|
||||
'(-t --tempfile)'{-t,--tempfile}'[auto save on exit, do not prompt]' \
|
||||
'(-u --unix -N --noconvert)'{-u,--unix}'[save a file by default in Unix format]' \
|
||||
'(-v --view)'{-v,--view}'[view mode (read-only)]' \
|
||||
'(-w --nowrap -b --breaklonglines)'{-w,--nowrap}"[don't hard-wrap long lines default]" \
|
||||
'(-x --nohelp)'{-x,--nohelp}"[don't show the two help lines]" \
|
||||
'(-y --afterends)'{-y,--afterends}'[make Ctrl+Right stop at word ends]' \
|
||||
'(-z --suspend)'{-z,--suspend}'[enable suspension]' \
|
||||
'(-% --stateflags)'{-%,--stateflags}'[show some states in the title bar]' \
|
||||
'(-_ --minibar -U --quickblank)'{-_,--minibar}'[suppress the title bar and show information at the bottom of the screen]' \
|
||||
'(-! --magic)'{-\!,--magic}'[try libmagic to determine applicable syntax]' \
|
||||
'(-t -q)*: :->args' && ret=0
|
||||
|
||||
if [[ -n $state ]]; then
|
||||
case $PREFIX in
|
||||
+) _message -e lines "start at a given line" ;;
|
||||
+[crCR]#[/?]) _message -e 'search string' ;;
|
||||
+<->,) _message -e 'column number' ;;
|
||||
*) _files && ret=0 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
return ret
|
@ -1,162 +0,0 @@
|
||||
#compdef nanoc
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2020 OKURA Masafumi, MIT License
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for nanoc (https://nanoc.ws/)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * OKURA Masafumi (https://okuramasafumi.com)
|
||||
#
|
||||
# This works is heavily inspired by the middleman completion by
|
||||
# Jozef Izso (https://github.com/jozefizso)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local ret=1 state
|
||||
|
||||
local -a common_ops
|
||||
common_ops=(
|
||||
{-C,--no-color}"[disable color]"
|
||||
{-V,--verbose}"[make output more detailed]"
|
||||
{-d,--debug}"[enable debugging]"
|
||||
{-e,--env=}"[set environment]"
|
||||
{-h,--help}"[show the help message and quit]"
|
||||
{-l,--color}"[enable color]"
|
||||
{-v,--version}"[show version information and quit]"
|
||||
{-w,--warn}"[enable warnings]"
|
||||
)
|
||||
|
||||
typeset -A opt_args
|
||||
_arguments \
|
||||
':subcommand:->subcommand' \
|
||||
$common_ops \
|
||||
'*::options:->options' && ret=0
|
||||
|
||||
case $state in
|
||||
subcommand)
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
"check:run issue checks"
|
||||
"compile:compile items of this site"
|
||||
"create-site:create a site"
|
||||
"deploy:deploy the compiled site"
|
||||
"help:show help"
|
||||
"prune:remove files not managed by Nanoc from the output directory"
|
||||
"shell:open a shell on the Nanoc environment"
|
||||
"show-data:show data in this site"
|
||||
"show-plugins:show all available plugins"
|
||||
"show-rules:describe the rules for each item"
|
||||
"view:start the web server that serves static files"
|
||||
)
|
||||
|
||||
_describe -t subcommands 'nanoc subcommand' subcommands && ret=0
|
||||
;;
|
||||
|
||||
options)
|
||||
local -a args
|
||||
args=(
|
||||
$common_ops
|
||||
)
|
||||
|
||||
local -a help
|
||||
help=(
|
||||
"--help[Display help information]"
|
||||
)
|
||||
|
||||
case $words[1] in
|
||||
check)
|
||||
args=(
|
||||
{-L,--list}"[list all checks]"
|
||||
{-a,--all}"[run all checks]"
|
||||
)
|
||||
;;
|
||||
|
||||
compile)
|
||||
args=(
|
||||
"--diff[generate diff]"
|
||||
)
|
||||
;;
|
||||
|
||||
create-site)
|
||||
args=(
|
||||
"--force[force creation of new site]"
|
||||
)
|
||||
;;
|
||||
|
||||
deploy)
|
||||
args=(
|
||||
{-C,--no-check}"[do not run the issue checks marked for deployment]"
|
||||
{-D,--list-deployers}"[list available deployers]"
|
||||
{-L,--list}"[list available locations to deploy to]"
|
||||
{-n,--dry-run}"[show what would be deployed]"
|
||||
{-t,--target=}"[specify the location to deploy to (default:\`default\`)]"
|
||||
)
|
||||
;;
|
||||
|
||||
prune)
|
||||
args=(
|
||||
{-n,--dry-run}"[print files to be deleted instead of actually deleting them]"
|
||||
{-y,--yes}"[confirm deletion]"
|
||||
)
|
||||
;;
|
||||
|
||||
shell)
|
||||
args=(
|
||||
{-p,--preprocess}"[run preprocessor]"
|
||||
)
|
||||
;;
|
||||
|
||||
show-data)
|
||||
args=(
|
||||
)
|
||||
;;
|
||||
|
||||
show-plugins)
|
||||
args=(
|
||||
)
|
||||
;;
|
||||
|
||||
show-rules)
|
||||
args=(
|
||||
)
|
||||
;;
|
||||
|
||||
view)
|
||||
args=(
|
||||
{-H,--handler=}"[specify the handler to use(webrick/mongrel/...)]"
|
||||
{-L,--live-reload}"[reload on changes]"
|
||||
{-o,--host=}"[specify the host to listen on(default: 127.0.0.1)]"
|
||||
{-p,--port=}"[specify the port to listen on(default: 3000)]"
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
_arguments $args && ret=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
@ -1,500 +0,0 @@
|
||||
#compdef nft
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for nft 0.9.0 (https://www.netfilter.org/projects/nftables/index.html).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Markus Richter ( https://github.com/mqus , <mqus@disroot.org>)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
_nft(){
|
||||
local -a rules states prev args families options descriptors
|
||||
local state="start" line nextstate cmd_obj cmd_subcmd cmd_fam cmd_tab cmd_chain #curcontext="$curcontext"
|
||||
|
||||
options=(
|
||||
'(-)'{-h,--help}'[show help]' \
|
||||
'(-)'{-v,--version}'[print version information]' \
|
||||
"(-i --interactive)"{-i,--interactive}'[read input from interactive CLI]: :->end' \
|
||||
"(-f --file)"{-f,--file}'[read input from <filename>]:nftables rule file:_files' \
|
||||
'(-c --check -n --numeric -N)'{-c,--check}"[check command's validity without actually applying the changes]" \
|
||||
'(-j --json)'{-j,--json}'[format output in json]' \
|
||||
'(-c --check -N)*'{-n,--numeric}'[can be specified up to 3 times, Shows 1:network addresses(default behaviour), 2:internet services (port numbers) and 3:protocols, user IDs, and group IDs numerically]' \
|
||||
'(-s --stateless)'{-s,--stateless}'[omit stateful information of ruleset]' \
|
||||
'(-N -n --numeric -c --check)'-N'[translate IP addresses to names]' \
|
||||
'(-a --handle)'{-a,--handle}'[output rule handle]' \
|
||||
'(-e --echo)'{-e,--echo}'[echo what has been added, inserted or replaced]' \
|
||||
{-I,--includepath}'[add specified directory to the paths searched for include files]:include directory [/usr/share]:include directory:_directories'
|
||||
)
|
||||
|
||||
# start a state machine. The state is modified by _arguments if the
|
||||
# current argument (descriptors) cannot be completed. Each state has to define is successive state and the
|
||||
# 'descriptors' for _arguments, which essentially tells _arguments how to complete
|
||||
local _i=0
|
||||
while true;do
|
||||
(( _i+=1 ))
|
||||
#Guard for endless loops
|
||||
[[ $_i -gt 100 ]] && return 1
|
||||
|
||||
descriptors=()
|
||||
nextstate="end"
|
||||
case $state in
|
||||
(start)
|
||||
##if line is empty (at the start) or ends with semicolon, autocomplete subcommands,
|
||||
# else if we are after a space,complete a semicolon (end the current nft command) and start anew
|
||||
if [[ $line[1] = "" || $line[1] =~ ';$' ]] ; then
|
||||
descriptors=( ":: :_nft_subcommands" )
|
||||
nextstate="category"
|
||||
else
|
||||
if [[ $words =~ ' $' ]]; then
|
||||
descriptors=(':: :(\;)')
|
||||
else
|
||||
descriptors=(':argument: ')
|
||||
fi
|
||||
nextstate="start"
|
||||
fi
|
||||
;;
|
||||
(category)
|
||||
case $line[1] in
|
||||
(add | list | flush | delete | create | rename | insert | replace | reset)
|
||||
descriptors=( ":: :_nft_${line[1]}" )
|
||||
nextstate=$line[1]
|
||||
;;
|
||||
(monitor)
|
||||
descriptors=( ":: : _nft_mon_filter" )
|
||||
nextstate="mon1"
|
||||
;;
|
||||
(export)
|
||||
descriptors=( ":: :(ruleset)" ":: :_nft_out_format" )
|
||||
nextstate="preend"
|
||||
;;
|
||||
(describe)
|
||||
descriptors=( ":expression: ")
|
||||
nextstate="start" #x restart
|
||||
;;
|
||||
(*)
|
||||
return 1;
|
||||
;;
|
||||
esac
|
||||
|
||||
#descriptors=( "(ruleset)" )
|
||||
#nextstate="end"
|
||||
;;
|
||||
(mon1)
|
||||
case $line[1] in
|
||||
(new | destroy)
|
||||
# descriptors=( ":: :_nft_mon_keywords" ":: :_nft_out_format")
|
||||
descriptors=( ":: : _nft_mon_keywords")
|
||||
nextstate="mon1"
|
||||
;;
|
||||
(tables | chains | sets | rules | elements | ruleset)
|
||||
descriptors=( ":: : _nft_out_format")
|
||||
nextstate="preend"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
#all completions for create and insert match with the completions of add
|
||||
(create | insert)
|
||||
state="add"
|
||||
;|
|
||||
#all completions for reset and flush match with the completions of list
|
||||
(reset | flush)
|
||||
state="list"
|
||||
;|
|
||||
#(add(^table)/create(^table)/delete/flush(^ruleset)/insert/list(^ruleset)/rename/replace)[family]table
|
||||
(reset | delete | insert | rename | replace | add | create | flush | list)
|
||||
if [[ $state = "add" && $line[1] = "table" ]]; then
|
||||
descriptors=( ":: :_nft_families" ":table name:")
|
||||
nextstate="start" #x restart
|
||||
elif [[ $state = "list" && ( $line[1] = "ruleset" || $line[1] = "tables" ) ]]; then
|
||||
descriptors=( ":: :_nft_families")
|
||||
nextstate="start" #x restart
|
||||
elif [[ $state = "delete" && $line[1] = "table" ]]; then
|
||||
descriptors=(": : _nft_table all-handle")
|
||||
nextstate="tcomplete-delete-table"
|
||||
else
|
||||
cmd_obj=$line[1]
|
||||
cmd_subcmd=$state
|
||||
descriptors=(": : _nft_table all")
|
||||
nextstate="tcomplete"
|
||||
fi
|
||||
;;
|
||||
(tcomplete-delete-table)
|
||||
# if only a family was completed, complete the table name.
|
||||
case $line[1] in
|
||||
(arp | bridge | inet | ip | ip6 | netdev)
|
||||
descriptors=(": : _nft_table ${line[1]}-handle")
|
||||
cmd_fam=$line[1]
|
||||
;;
|
||||
# if 'handle' was completed, complete the handle number.
|
||||
(handle)
|
||||
descriptors=(": : _nft_table_handle_all " )
|
||||
;;
|
||||
# else, complete nothing and go to the next state. default family is 'ip'
|
||||
(*)
|
||||
descriptors=()
|
||||
cmd_fam="ip"
|
||||
;;
|
||||
esac
|
||||
nextstate="delete-table"
|
||||
;;
|
||||
(tcomplete)
|
||||
# if only a family was completed, complete the table name.
|
||||
case $line[1] in
|
||||
(arp | bridge | inet | ip | ip6 | netdev)
|
||||
descriptors=(": : _nft_table ${line[1]}")
|
||||
cmd_fam=$line[1]
|
||||
;;
|
||||
# else, complete nothing and go to the next state. default family is 'ip'
|
||||
(*)
|
||||
descriptors=()
|
||||
cmd_fam="ip"
|
||||
;;
|
||||
esac
|
||||
nextstate="$cmd_subcmd-$cmd_obj"
|
||||
;;
|
||||
(list-table)
|
||||
descriptors=(":: :(\;)")
|
||||
nextstate="start"
|
||||
;;
|
||||
(delete-table)
|
||||
#if family AND handle were input, complete handle number for given family.
|
||||
if [[ $line[1] == "handle" ]]; then
|
||||
descriptors=(":table handle: _nft_table_handle $cmd_fam" )
|
||||
else
|
||||
descriptors=()
|
||||
fi
|
||||
nextstate="start"
|
||||
;;
|
||||
(delete-chain | delete-set | delete-quota | delete-counter | delete-ct\\ helper)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab $cmd_obj true")
|
||||
nextstate="delete-obj-handle"
|
||||
;;
|
||||
(delete-obj-handle)
|
||||
if [[ $line[1] == "handle" ]]; then
|
||||
descriptors=(": : _nft_object_handle $cmd_fam $cmd_tab $cmd_obj")
|
||||
else
|
||||
descriptors=(": :(\;)")
|
||||
fi
|
||||
nextstate="start"
|
||||
;;
|
||||
(add-chain)
|
||||
descriptors=(":chain name:")
|
||||
nextstate="start"
|
||||
;;
|
||||
(rename-chain)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
|
||||
nextstate="add-chain"
|
||||
;;
|
||||
(replace-rule | delete-rule)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
|
||||
nextstate="repdel-rule"
|
||||
;;
|
||||
(repdel-rule)
|
||||
cmd_chain=$line[1]
|
||||
descriptors=(": :(handle)" ": : _nft_rule_handle $cmd_fam $cmd_tab ${line[1]}")
|
||||
if [[ $cmd_subcmd = "replace" ]];then
|
||||
nextstate="rule-stmt"
|
||||
else
|
||||
nextstate="start"
|
||||
fi
|
||||
;;
|
||||
(add-rule)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
|
||||
nextstate="add-rule-2"
|
||||
;;
|
||||
(add-rule-2)
|
||||
cmd_chain=$line[1]
|
||||
descriptors=(": :(handle index position)")
|
||||
nextstate="add-rule-3"
|
||||
;;
|
||||
(add-rule-3)
|
||||
case $line[1] in
|
||||
(index | position)
|
||||
descriptors=(":${line[1]}:")
|
||||
;;
|
||||
(handle)
|
||||
descriptors=(": : _nft_rule_handle $cmd_fam $cmd_tab $cmd_chain")
|
||||
;;
|
||||
(*)
|
||||
descriptors=()
|
||||
;;
|
||||
esac
|
||||
nextstate="rule-stmt"
|
||||
;;
|
||||
(rule-stmt)
|
||||
#TODO
|
||||
# _nft_rule $cmd_fam $cmd_tab $cmd_chain\
|
||||
# && return 0;
|
||||
descriptors=":expression: "
|
||||
nextstate="start"
|
||||
;;
|
||||
(list-set | list-map | delete-map | list-chain | list-flowtable | delete-flowtable | list-ct\\ helper | list-counter | list-quota | list-meter)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab $cmd_obj false")
|
||||
nextstate="start"
|
||||
;;
|
||||
#TODO:
|
||||
#(add-element | delete-element)
|
||||
#(add-set | add-map)
|
||||
#(add-flowtable)
|
||||
#("add-ct\ helper")
|
||||
#(add-counter)
|
||||
#(add-quota)
|
||||
|
||||
(*)
|
||||
return 1;
|
||||
;;
|
||||
esac
|
||||
_arguments -C -s \
|
||||
"${options[@]}" \
|
||||
"${descriptors[@]}" \
|
||||
"*:: :->$nextstate" \
|
||||
&& return 0;
|
||||
|
||||
done
|
||||
} # end _nft
|
||||
|
||||
_nft_subcommands(){
|
||||
local commands=(
|
||||
'add:add a table, chain, rule, set, map, or object'
|
||||
'list:list a ruleset, table, chain, set, map, or object'
|
||||
'flush:flush (delete everything from) a ruleset, table, chain, set, or map'
|
||||
'export:print the ruleset in a machine readable format (json or xml)'
|
||||
'delete:delete a table, chain, rule, set, element, map, or object'
|
||||
'create:similar to add but returns an error for existing chain'
|
||||
'rename:rename the specified chain'
|
||||
'insert:similar to the add command, but the rule is prepended to the beginning of the chain or before the rule at the given position'
|
||||
'replace:similar to the add command, but replaces the specified rule'
|
||||
'reset:list-and-reset stateful object'
|
||||
'monitor:listen to Netlink events'
|
||||
'describe:show information about the type of an expression and its data type'
|
||||
)
|
||||
_describe -t commands 'nft subcommand' commands "$@"
|
||||
}
|
||||
_nft_mon_filter(){
|
||||
local monitor_filters=(
|
||||
'new:show only events of created objects'
|
||||
'destroy:show only events of deleted objects'
|
||||
)
|
||||
_describe -t monitor_filters 'nft monitor' monitor_filters -J monitor_filters "$@"
|
||||
_nft_mon_keywords
|
||||
}
|
||||
|
||||
_nft_mon_keywords(){
|
||||
local monitor_keywords=(
|
||||
'tables:show table events'
|
||||
'chains:show chain events'
|
||||
'sets:show set events'
|
||||
'rules:show rule events'
|
||||
'elements:show only events of element objects'
|
||||
'ruleset:show ruleset events, such as table, chain, rule, set, counters and quotas'
|
||||
)
|
||||
_describe -t monitor_keywords 'nft monitor' monitor_keywords -J monitor_keywords "$@"
|
||||
_nft_out_format
|
||||
}
|
||||
|
||||
_nft_out_format(){
|
||||
local monitor_format=(
|
||||
'json:format output to JSON'
|
||||
'xml:format output to XML'
|
||||
)
|
||||
_describe -t monitor_format "output format" monitor_format -J monitor_format "$@"
|
||||
}
|
||||
|
||||
_nft_add(){
|
||||
local commands=(
|
||||
'table:add a new table'
|
||||
'flowtable:add a new flowtable'
|
||||
'chain:add a chain to a table'
|
||||
'rule:add a rule to an existing chain'
|
||||
'set:add a set to a table'
|
||||
'map:add a map to a table'
|
||||
'element:add one or multiple element(s) to a set or map'
|
||||
'ct\ helper:add a ct helper to a table'
|
||||
'counter:add a named counter to a table'
|
||||
'quota:add a named quota helper to a table'
|
||||
)
|
||||
_describe -t commands 'nft add' commands "$@"
|
||||
}
|
||||
|
||||
_nft_create(){
|
||||
local commands=(
|
||||
"table:add a table, but return an error if it already exists"
|
||||
"chain:add a chain to a table, but return an error if it already exists"
|
||||
"flowtable:add a flowtable, but return an error if it already exists"
|
||||
)
|
||||
_describe -t commands 'nft create' commands "$@"
|
||||
}
|
||||
|
||||
_nft_delete(){
|
||||
local commands=(
|
||||
"table:delete the specified table"
|
||||
"chain:delete the specified chain, chain must be empty and mustn't be used as jump target"
|
||||
"rule:delete the specified rule, rule must be referable to by a handle"
|
||||
"set:delete the specified set"
|
||||
"map:delete the specified map"
|
||||
"element:delete element(s) from the specified set/map"
|
||||
"flowtable:delete the specified flowtable"
|
||||
"ct\ helper:delete the specified ct helper"
|
||||
"counter:delete the specified counter"
|
||||
"quota:delete the specified quota"
|
||||
)
|
||||
_describe -t commands 'nft delete' commands "$@"
|
||||
}
|
||||
|
||||
_nft_flush(){
|
||||
local commands=(
|
||||
"ruleset:clear the whole ruleset, including removing all tables and containing objects"
|
||||
"table:flush all chains and rules of the specified table"
|
||||
"chain:flush all rules of the specified chain"
|
||||
"set:remove all elements from the specified set"
|
||||
"map:remove all elements from the specified map"
|
||||
)
|
||||
_describe -t commands 'nft flush' commands "$@"
|
||||
}
|
||||
|
||||
_nft_insert(){
|
||||
local commands=(
|
||||
"rule:prepend a rule to the beginning of the chain or before the rule with the given handle"
|
||||
)
|
||||
_describe -t commands 'nft insert' commands "$@"
|
||||
}
|
||||
|
||||
_nft_list(){
|
||||
local commands=(
|
||||
"ruleset:print the ruleset in human-readable format"
|
||||
"tables:list all tables (undocumented)"
|
||||
"table:list all chains and rules of the specified table"
|
||||
"chain:list all rules of the specified chain"
|
||||
"set:display the elements in the specified set"
|
||||
"map:display the elements in the specified map"
|
||||
"flowtable:list all flowtables"
|
||||
"ct\ helper:display stateful information the ct helper holds"
|
||||
"counter:display stateful information the counter holds"
|
||||
"quota:display stateful information the quota holds"
|
||||
)
|
||||
_describe -t commands 'nft list' commands "$@"
|
||||
}
|
||||
|
||||
_nft_rename(){
|
||||
local commands=(
|
||||
"chain:replace a chain"
|
||||
)
|
||||
_describe -t commands 'nft rename' commands "$@"
|
||||
}
|
||||
|
||||
_nft_replace(){
|
||||
local commands=(
|
||||
"rule:replace a rule"
|
||||
)
|
||||
_describe -t commands 'nft replace' commands "$@"
|
||||
}
|
||||
|
||||
_nft_reset(){
|
||||
local commands=(
|
||||
'ct\ helper:reset and list a ct helper to a table'
|
||||
'counter:reset and list a counter from a table'
|
||||
'quota:reset and list a quota object a table'
|
||||
)
|
||||
_describe -t commands 'nft reset' commands "$@"
|
||||
}
|
||||
_nft_families(){
|
||||
local families=(
|
||||
"ip:IPv4 address family"
|
||||
"ip6:IPv6 address family"
|
||||
"inet:internet (IPv4+IPv6) address family"
|
||||
"arp:ARP address family, handling IPv4 ARP packets"
|
||||
"bridge:Bridge address family, handling packets which traverse a bridge device"
|
||||
"netdev:Netdev address family, handling packets from ingress"
|
||||
)
|
||||
_describe -t families 'nft families' families "$@"
|
||||
}
|
||||
|
||||
_nft_table(){
|
||||
# complete the names of tables and the families of existing tables
|
||||
#$1 can be: all all-handle <family> <family>-handle
|
||||
local tables=()
|
||||
if [[ "$1" =~ "^all" ]]; then
|
||||
local families=( ${(f)"$(_call_program -p tables nft list tables 2>/dev/null \
|
||||
| cut -d\ -f2 )"} )
|
||||
# ip is the default family, search also for table names there
|
||||
1="${1/all/ip}"
|
||||
_describe -t families "family" families -J "family"
|
||||
fi
|
||||
if [[ "$1" =~ "-handle$" ]]; then
|
||||
tables=("handle:adress the table by handle")
|
||||
#remove -handle from $1 to be able to complete table names
|
||||
1="${1/-handle/}"
|
||||
_describe -t tables "table" tables -V "handle"
|
||||
fi
|
||||
case $1 in
|
||||
(arp | bridge | inet | ip | ip6 | netdev)
|
||||
tables=( ${(f)"$(_call_program -p tables nft list ruleset -a 2>/dev/null \
|
||||
| grep '^table '"$1" | sed 's/table // ;s/{ # handle // ;s/\(\S*\) \(\S*\) \(\S*\)/\2:type \1, handle \3/' )"} )
|
||||
_describe -t tables "table" tables -V "table-name"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_nft_table_handle(){
|
||||
# complete the handles of tables with the specified family (with the table name in the description)
|
||||
#$1:protocol family
|
||||
local tables=( ${(f)"$(_call_program -p tables nft list ruleset -a 2>/dev/null \
|
||||
| grep '^table '"$1" | sed 's/table // ;s/{ # handle // ;s/\(\S*\) \(\S*\) \(\S*\)/\3:\2(type \1)/' )"} )
|
||||
echo $1 > /tmp/znfttab
|
||||
_describe -t tables "table handle" tables
|
||||
}
|
||||
|
||||
_nft_table_handle_all(){
|
||||
# complete the handles of tables of all families (with the table name in the description)
|
||||
local tables=( ${(f)"$(_call_program -p tables nft list ruleset -a 2>/dev/null \
|
||||
| grep '^table' | sed 's/table // ;s/{ # handle // ;s/\(\S*\) \(\S*\) \(\S*\)/\3:\2(type \1)/' )"} )
|
||||
_describe -t tables "table handle" tables
|
||||
}
|
||||
|
||||
_nft_object(){
|
||||
# complete the names of objects contained directly in a table (with the handle number in the description)
|
||||
#$1:protocol family
|
||||
#$2:table
|
||||
#$3:object type (chain/set/map/flowtable/ct helper/counter/quota/meter)
|
||||
#$4:include 'handle'?
|
||||
local objects=( ${(f)"$(_call_program -p objects nft list table $1 $2 -a 2>/dev/null\
|
||||
| grep ""\\s\*$3"" | sed 's/\s*'"$3"' // ;s/ { # \(.*\)/:(\1)/' )"} )
|
||||
if $4 ;then
|
||||
objects+=( "handle:adress $3 by handle")
|
||||
fi
|
||||
_describe -t objects "$3" objects
|
||||
}
|
||||
|
||||
_nft_object_handle(){
|
||||
# complete handles of objects contained directly in a table (with the name in the description)
|
||||
#$1:protocol family
|
||||
#$2:table
|
||||
#$3:object type (chain/set/ct helper/counter/quota)
|
||||
local handles=( ${(f)"$(_call_program -p handles nft list table $1 $2 -a 2>/dev/null\
|
||||
| grep ""\\s\*$3"" | sed 's/\s*'"$3"' // ;s/ { # handle// ;s/\(\S*\) \(\S*\)/\2:\1/' )"} )
|
||||
_describe -t handles "$3-handle" handles
|
||||
}
|
||||
|
||||
_nft_rule_handle(){
|
||||
# complete the handles of rules (and put the rule into the description)
|
||||
#$1:protocol family
|
||||
#$2:table
|
||||
#$3:chain name
|
||||
local rules=( ${(f)"$(_call_program -p nft-rule-handle nft list chain $1 $2 $3 -a 2>/dev/null \
|
||||
|grep -v '^\s*\(table\|chain\|type\|\}\)'|sed 's/^\s*\(.*\) # handle \(\S*\)$/\2:\1/' )"} )
|
||||
# don't sort those entries alphabetically, so they get shown in the order they are executed in nftables
|
||||
_describe -t rules "rule" rules -V "rules"
|
||||
}
|
||||
|
||||
#currently, only the `nft` command is covered by this script.
|
||||
_nft "$@"
|
@ -1,180 +0,0 @@
|
||||
#compdef node
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Node.js v10.4.1 (https://nodejs.org)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Mario Fernandez (https://github.com/sirech)
|
||||
# * Nicholas Penree (https://github.com/drudge)
|
||||
# * Masafumi Koba (https://github.com/ybiquitous)
|
||||
# * Shohei YOSHIDA (https://github.com/syohex)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_node_files() {
|
||||
for (( i = 2; i < CURRENT; i++)); do
|
||||
if [[ ${words[i]} == "--prof-process" ]]; then
|
||||
_files -g "*.log"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
_files -g "*.(js|mjs)"
|
||||
}
|
||||
|
||||
_node_args() {
|
||||
if (( CURRENT == 2 )); then
|
||||
_alternative "_node_files" "_values 'command' 'inspect[enable inspector for debugging]'"
|
||||
return
|
||||
fi
|
||||
|
||||
_node_files
|
||||
}
|
||||
|
||||
local curcontext="$curcontext" state line ret=1
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
'-[script read from stdin (default; interactive mode if a tty)]' \
|
||||
'--[indicate the end of node options]' \
|
||||
'--abort-on-uncaught-exception[aborting instead of exiting causes a core file to be generated for analysis]' \
|
||||
'--completion-bash[print source-able bash completion script]' \
|
||||
'--cpu-prof[Start the V8 CPU profiler on start up]' \
|
||||
'--cpu-prof-dir=[directory where the V8 profiles generated by --cpu-prof]: :_files -/' \
|
||||
'--cpu-prof-name=[file name of the V8 profile generated with --cpu-prof]: :_files' \
|
||||
'--cpu-prof-interval=[sampling interval in microseconds for the V8 CPU profiler]:number' \
|
||||
'--disable-proto=[disable Object.prototype.__proto__]:mode:(delete throw)' \
|
||||
'--disallow-code-generation-from-strings[disallow eval and friends]' \
|
||||
'--dns-result-order=[set default value of verbatim in dns.lookup]: :(ipv4first verbatim)' \
|
||||
'--enable-fips[enable FIPS crypto at startup]' \
|
||||
'--enable-source-maps[source map support]' \
|
||||
'--es-module-specifier-resolution=[extension resolution algorithm for es modules]:resolution algorithm:(explicit none)' \
|
||||
'--experimental-global-webcrypto[expose experimental Web Crypto API on the global scope]' \
|
||||
'--experimental-import-meta-resolve[experimental ES Module import.meta.resolve() support]' \
|
||||
'(--loader --experimental-loader)'{--loader,--experimental-loader}'=[Specify the module of a custom ECMAScript Module loader]: :_files' \
|
||||
'--experimental-network-imports[experimental https support for the ES Module loader]' \
|
||||
'--experimental-policy=[security policy file]: :_files' \
|
||||
'--experimental-vm-modules[experimental ES Module support in vm module]' \
|
||||
'--experimental-wasi-unstable-preview1[experimental WASI support]' \
|
||||
'--experimental-wasm-modules[experimental ES module support for webassembly modules]' \
|
||||
'--force-context-aware[disable loading non-context-aware addons]' \
|
||||
'--force-fips[force FIPS crypto]' \
|
||||
'--frozen-intrinsics[experimental frozen intrinsics support]' \
|
||||
'--heap-prof[Start the V8 heap profiler on start up]' \
|
||||
'--heap-prof-dir=[Directory where the V8 profiles generated by --heap-prof]: :_files -/' \
|
||||
'--heap-prof-interval=[sampling interval in bytes for the V8 heap profile]: :number' \
|
||||
'--heap-prof-name=[file name of the V8 heap profile generated]: :_files' \
|
||||
'--heapsnapshot-signal=[Generate heap snapshot on specified signal]:signals:_signals -s' \
|
||||
'--huge-max-old-generation-size[increase default maximum heap size with 16GB or more]' \
|
||||
'--icu-data-dir=[set ICU data load path to dir (overrides NODE_ICU_DATA) note: linked-in ICU data is present]: :_directories' \
|
||||
'--input-type=[set module type for string input]:module type :(commonjs module)' \
|
||||
'--insecure-http-parser[Use an insecure HTTP parser that accepts invalid HTTP headers]' \
|
||||
'--inspect-brk=-[activate inspector on host:port and break at start of user script]:[host\:]port' \
|
||||
'(--debug-port --inspect-port)'{--debug-port,--inspect-port}'=[set host:port for inspector]:[host\:]port' \
|
||||
'--inspect=-[activate inspector on host:port (default: 127.0.0.1:9229)]:[host\:]port' \
|
||||
'--inspect-publish-uid=[comma separated list of destinations for inspector uid]' \
|
||||
'--interpreted-frames-native-stack[help system profilers to translate JavaScript interpreted frames]' \
|
||||
'--jitless[Disable runtime allocation of executable memory]' \
|
||||
'--max-http-header-size=[set the maximum size of HTTP headers]: :number' \
|
||||
'--napi-modules[load N-API modules (no-op - option kept for compatibility)]' \
|
||||
'--no-addons[disable loading native addons]' \
|
||||
'--no-deprecation[silence deprecation warnings]' \
|
||||
'--no-experimental-fetch[disable experimental Fetch API]' \
|
||||
'--no-experimental-repl-await[disable experimental await keyword support in REPL]' \
|
||||
'--no-force-async-hooks-checks[disable checks for async_hooks]' \
|
||||
'--no-global-search-paths[disable global module search paths]' \
|
||||
'--no-warnings[silence all process warnings]' \
|
||||
'--node-memory-debug[run with extra debug checks for memory leaks in Node.js itself]' \
|
||||
'--openssl-config=[load OpenSSL configuration from the specified file (overrides OPENSSL_CONF)]:file:_files' \
|
||||
'--pending-deprecation[emit pending deprecation warnings]' \
|
||||
'--policy-integrity=[ensure the security policy contents match the specified integrity]' \
|
||||
'--preserve-symlinks[preserve symbolic links when resolving]' \
|
||||
'--preserve-symlinks-main[preserve symbolic links when resolving the main module]' \
|
||||
'--prof[generate V8 profiler output]' \
|
||||
'--prof-process[process V8 profiler output generated using --prof]' \
|
||||
'--redirect-warnings=[write warnings to file instead of stderr]: :_files' \
|
||||
'--report-compact[output compact single-line JSON]' \
|
||||
'--report-directory=[custom report path]: :_files -/' \
|
||||
'--report-filename=[custom report file name]: :_files' \
|
||||
'--report-on-fatalerror[generate diagnostic report on fatal (internal) errors]' \
|
||||
'--report-on-signal=[generate diagnostic report upon receiving signals]' \
|
||||
'--report-signal=[causes diagnostic report to be produced on provided signal]:signals:_signals -s' \
|
||||
'--report-uncaught-exception[generate diagnostic report on uncaught exceptions]' \
|
||||
'--secure-heap=[total size of the OpenSSL secure heap]: :number' \
|
||||
'--secure-heap-min=[minimum allocation size from the OpenSSL secure heap]' \
|
||||
'--throw-deprecation[throw an exception on deprecations]' \
|
||||
'--title=[the process title to use on startup]:process title' \
|
||||
'--tls-cipher-list=[use an alternative default TLS cipher list]:cipher list string' \
|
||||
'--tls-keylog=[log TLS decryption keys to named file for traffic analysis]: :_files' \
|
||||
'(--tls-max-v1.3)--tls-max-v1.2[set default TLS maximum to TLSv1.2]' \
|
||||
'(--tls-max-v1.2)--tls-max-v1.3[set default TLS maximum to TLSv1.3]' \
|
||||
'(--tls-min-v1.1 --tls-min-v1.2 --tls-min-v1.3)--tls-min-v1.0[set default TLS minimum to TLSv1.0]' \
|
||||
'(--tls-min-v1.0 --tls-min-v1.2 --tls-min-v1.3)--tls-min-v1.1[set default TLS minimum to TLSv1.1]' \
|
||||
'(--tls-min-v1.0 --tls-min-v1.1 --tls-min-v1.3)--tls-min-v1.2[set default TLS minimum to TLSv1.2]' \
|
||||
'(--tls-max-v1.2 --tls-min-v1.0 --tls-min-v1.1 --tls-min-v1.2)--tls-min-v1.3[set default TLS minimum to TLSv1.3]' \
|
||||
'--trace-atomics-wait[trace Atomics.wait operations]' \
|
||||
'--trace-deprecation[show stack traces on deprecations]' \
|
||||
'--trace-event-categories[comma separated list of trace event categories to record]: :{_values -s , categories node node.async_hooks node.bootstrap node.perf node.perf.usertiming node.perf.timerify node.fs.sync node.vm.script v8}' \
|
||||
'--trace-event-file-pattern[Template string specifying the filepath for the trace-events data, it supports ${rotation} and ${pid} log-rotation id. %2$u is the pid.]:template string' \
|
||||
'--trace-exit[show stack trace when an environment exits]' \
|
||||
'--trace-sigint[prints a stack trace on SIGINT]' \
|
||||
'--trace-sync-io[show stack trace when use of sync IO is detected after the first tick]' \
|
||||
'--trace-tls[prints TLS packet trace information to stderr]' \
|
||||
'--trace-uncaught[show stack traces for the throw behind uncaught exceptions]' \
|
||||
'--trace-warnings[show stack traces on process warnings]' \
|
||||
'--track-heap-objects[track heap object allocations for heap snapshots]' \
|
||||
'--unhandled-rejections=[define unhandled rejections behavior]:rejection behavior:(strict warn none)' \
|
||||
'--use-bundled-ca[use bundled CA store (default)]' \
|
||||
'--use-largepages=[re-map the Node.js static code to large memory pages at startup]:mode:(off on silent)' \
|
||||
"--use-openssl-ca[use OpenSSL's default CA store]" \
|
||||
'(- 1 *)--v8-options[print v8 command line options]' \
|
||||
"--v8-pool-size=[set v8's thread pool size]:number" \
|
||||
'--zero-fill-buffers[automatically zero-fill all newly allocated Buffer and SlowBuffer instances]' \
|
||||
{-c,--check}'[syntax check script without executing]' \
|
||||
'(- 1 *)'{-e,--eval}'[evaluate script]:inline JavaScript' \
|
||||
'(- 1 *)'{-h,--help}'[print node command line options]' \
|
||||
{-i,--interactive}'[always enter the REPL even if stdin does not appear to be a terminal]' \
|
||||
'(- 1 *)'{-p,--print}'[evaluate script and print result]:inline JavaScript' \
|
||||
'*'{-r,--require}'[module to preload (option can be repeated)]: :_node_files' \
|
||||
'(- 1 *)'{-v,--version}'[print Node.js version]' \
|
||||
'*: :_node_args' && ret=0
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,110 +0,0 @@
|
||||
#compdef nvm
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for nvm (https://github.com/creationix/nvm).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Changwoo Park (https://github.com/pismute)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local curcontext="$curcontext" state line ret=1
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'help:Show this message'
|
||||
'install:Download and install a <version>'
|
||||
'uninstall:Uninstall a <version>'
|
||||
'use:Modify PATH to use <version>'
|
||||
'run:Run <version> with <args> as arguments'
|
||||
'ls:List installed [versions]'
|
||||
'ls-remote:List remote versions available for install'
|
||||
'deactivate:Undo effects of NVM on current shell'
|
||||
'alias:Set an alias named <name> pointing to <version>. Show all aliases beginning with [<pattern>].'
|
||||
'unalias:Deletes the alias named <name>'
|
||||
'copy-packages:Install global NPM packages contained in <version> to current version'
|
||||
'clear-cache:Clear cache'
|
||||
'version:Show current node version'
|
||||
)
|
||||
|
||||
_arguments -C \
|
||||
'1: :->cmds' \
|
||||
'*: :->args' && ret=0
|
||||
|
||||
__nvm_aliases(){
|
||||
local aliases
|
||||
aliases=""
|
||||
if [ -d $NVM_DIR/alias ]; then
|
||||
aliases="`cd $NVM_DIR/alias && ls`"
|
||||
fi
|
||||
echo "${aliases}"
|
||||
}
|
||||
|
||||
__nvm_versions(){
|
||||
echo "$(nvm_ls) $(__nvm_aliases)"
|
||||
}
|
||||
|
||||
case $state in
|
||||
cmds)
|
||||
_describe -t commands 'nvm command' _1st_arguments && ret=0
|
||||
;;
|
||||
|
||||
args)
|
||||
case $words[2] in
|
||||
(use|run|ls|list|install|uninstall|copy-packages)
|
||||
|
||||
_values 'version' $(__nvm_versions) && ret=0
|
||||
;;
|
||||
|
||||
(alias|unalias)
|
||||
|
||||
_values 'aliases' $(__nvm_aliases) && ret=0
|
||||
;;
|
||||
|
||||
*)
|
||||
(( ret )) && _message 'no more arguments'
|
||||
;;
|
||||
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
File diff suppressed because it is too large
Load Diff
@ -1,246 +0,0 @@
|
||||
#compdef openvpn3
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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 openvpn 3 (https://github.com/openvpn/openvpn3) (https://openvpn.net/openvpn-client-for-linux/).
|
||||
# version: 13_beta-1 (Jul 1 2021)
|
||||
# openvpn 3/Linux git:makepkg:2031975261858750 (openvpn3)
|
||||
# openvpn core 3.git:HEAD:ce0c9963 linux x86_64 64-bit
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Author
|
||||
# -------
|
||||
#
|
||||
# * undg (https://github.com/undg)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local sessions_configs_names=$(openvpn3 sessions-list | grep 'Config name:' | awk '{print $3}' | xargs)
|
||||
local sessions_paths=$(openvpn3 sessions-list | grep 'Path:' | awk '{print $2}' | xargs)
|
||||
local sessions_interfaces=$(openvpn3 sessions-list | grep 'Device:' | awk '{print $4}' | xargs)
|
||||
local sessions_users=$(openvpn3 sessions-list | grep 'Owner:' | awk '{print $2}' | xargs)
|
||||
local sessions_names=$(openvpn3 sessions-list | grep 'Session name:' | awk '{print $2}' | xargs)
|
||||
local configs_names=$(openvpn3 configs-list | awk 'count&&!--count; /\/net\/openvpn\//{count=2}' | awk '{print $1}' | xargs)
|
||||
local configs_paths=$(openvpn3 configs-list | grep '/net/openvpn/v3/configuration/' | xargs)
|
||||
|
||||
_openvpn3_config-acl(){
|
||||
_arguments \
|
||||
{-s,--show}"[Show the current access control lists]" \
|
||||
{-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \
|
||||
{-S,--seal}"[Make the configuration profile permanently read-only]" \
|
||||
{-R,--revoke}"[<UID | username> Revoke this user access from this configuration profile]" \
|
||||
{-G,--grant}"[<UID | username> Grant this user access to this configuration profile]" \
|
||||
"--public-access[<true|false> Set/unset the public access flag]" \
|
||||
"--lock-down[<true|false> Set/unset the lock-down flag.Will disable config retrieval for users]: :(true false)" \
|
||||
"--config-path[OBJ-PATH Alias for --path]: :($configs_paths)" \
|
||||
}
|
||||
|
||||
_openvpn3_config-import(){
|
||||
_arguments \
|
||||
{-p,--persistent}"[Make the configuration profile persistent through service restarts]" \
|
||||
{-n,--name}"[NAME Provide a different name for the configuration (default: CFG-FILE)]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CFG-FILE Configuration file to import]: :_files" \
|
||||
}
|
||||
|
||||
_openvpn3_config-manage(){
|
||||
_arguments \
|
||||
{-s,--show}"[Show current configuration options]" \
|
||||
{-r,--rename}"[NEW-CONFIG-NAME Renames the configuration]" \
|
||||
{-o,--path}"[CONFIG-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \
|
||||
"--unset-override[<name> Removes the <name> override]" \
|
||||
"--tls-version-min[<tls_1_0|tls_1_1|tls_1_2|tls_1_3> Sets the minimal TLS version for the control channel]: :(tls_1_0 tls_1_1 tls_1_2 tls_1_3)" \
|
||||
"--tls-cert-profile[<legacy preferred suiteb> Sets the control channel tls profile]: :(legacy preferred suiteb)" \
|
||||
"--server-override[<value> Replace the remote, connecting to this server instead the server specified in the configuration]" \
|
||||
"--proxy-username[<value> HTTP Proxy username to authenticate as]" \
|
||||
"--proxy-port[<value> HTTP Proxy port to connect on]" \
|
||||
"--proxy-password[<value> HTTP Proxy password to use for authentication]" \
|
||||
"--proxy-host[<value> HTTP Proxy to connect via, overrides configuration file http-proxy]" \
|
||||
"--proxy-auth-cleartext[<true|false> Adds the boolean override proxy-auth-cleartext]: :(true false)" \
|
||||
"--proto-override[<tcp|udp> Overrides the protocol being used]: :(tcp upd)" \
|
||||
"--port-override[<value> Replace the remote port, connecting to this port instead of the configuration value]" \
|
||||
"--persist-tun[<true|false> Adds the boolean override persist-tun]: :(true false)" \
|
||||
"--ipv6[<yes|no|default> Sets the IPv6 policy of the client]: :(yes no default)" \
|
||||
"--force-cipher-aes-cbc[<true|false> Adds the boolean override force-cipher-aes-cbc]: :(true false)" \
|
||||
"--dns-sync-lookup[<true|false> Adds the boolean override dns-sync-lookup]: :(true false)" \
|
||||
"--dns-setup-disabled[<true|false> Adds the boolean override dns-setup-disabled]: :(true false)" \
|
||||
"--dns-fallback-google[<true|false> Adds the boolean override dns-fallback-google]: :(true false)" \
|
||||
"--config-path[CONFIG-PATH Alias for --path]: :($configs_paths)" \
|
||||
"--auth-fail-retry[<true|false> Adds the boolean override auth-fail-retry]: :(true false)" \
|
||||
"--allow-compression[<no asym yes> Set compression mode]: :(no asym yes)" \
|
||||
}
|
||||
|
||||
_openvpn3_config-remove(){
|
||||
_arguments \
|
||||
{-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \
|
||||
"--force[Force the deletion process without asking for confirmation]" \
|
||||
"--config-path[OBJ-PATH Alias for --path]: :($configs_paths)" \
|
||||
}
|
||||
|
||||
_openvpn3_config-show(){
|
||||
_arguments \
|
||||
{-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
|
||||
{-j,--json}"[Dump the configuration in JSON format]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \
|
||||
"--config-path[OBJ-PATH Alias for --path]: :($configs_paths)" \
|
||||
}
|
||||
|
||||
_openvpn3_configs-list(){
|
||||
_arguments \
|
||||
{-h,--help}"[This help screen]" \
|
||||
}
|
||||
|
||||
_openvpn3_help(){
|
||||
_arguments \
|
||||
{-h,--help}"[This help screen]" \
|
||||
}
|
||||
|
||||
_openvpn3_log(){
|
||||
_arguments \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --session-path, where configuration profile name is used instead]: :($sessions_configs_names $configs_names)" \
|
||||
{-I,--interface}"[INTERFACE Alternative to --session-path, where tun interface name is used instead]: :($sessions_interfaces)" \
|
||||
"--session-path[SESSION-PATH Receive log events for a specific session]: :($sessions_paths)" \
|
||||
"--log-level[LOG-LEVEL Set the log verbosity level of messages to be shown (default: 4)]" \
|
||||
"--config-events[Receive log events issued by the configuration manager]" \
|
||||
}
|
||||
|
||||
_openvpn3__session-acl(){
|
||||
_arguments \
|
||||
{-s,--show}"[Show the current access control lists]" \
|
||||
{-o,--path}"[SESSION-PATH Path to the session in the session manager]: :($sessions_paths)" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($sessions_configs_names)" \
|
||||
{-R,--revoke}"[<UID | username> Revoke this user access from this session]" \
|
||||
{-I,--interface}"[INTERFACE Alternative to --path, where tun interface name is used instead]: :($sessions_interfaces)" \
|
||||
{-G,--grant}"[<UID | username> Grant this user access to this session]" \
|
||||
"--session-path[SESSION-PATH Alias for --path]: :($sessions_paths)" \
|
||||
"--public-access[<true|false> Set/unset the public access flag]: :(true false)" \
|
||||
"--allow-log-access[<true|false> Can users granted access also access the session log?]: :(true false)" \
|
||||
}
|
||||
|
||||
_openvpn3_session-manage(){
|
||||
_arguments \
|
||||
{-o,--path}"[SESSION-PATH Path to the session in the session manager]: :($sessions_paths)" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($sessions_configs_names)" \
|
||||
{-R,--resume}"[Resumes a paused VPN session]" \
|
||||
{-P,--pause}"[Pauses the VPN session]" \
|
||||
{-I,--interface}"[INTERFACE Alternative to --path, where tun interface name is used instead]: :($sessions_interfaces)" \
|
||||
{-D,--disconnect}"[Disconnects a VPN session]" \
|
||||
"--session-path[SESSION-PATH Alias for --path]: :($sessions_paths)" \
|
||||
"--restart[Disconnect and reconnect a running VPN session]" \
|
||||
"--cleanup[Clean up stale sessions]" \
|
||||
}
|
||||
|
||||
_openvpn3_session-start(){
|
||||
_arguments \
|
||||
{-p,--config-path}"[CONFIG-PATH Configuration path to an already imported configuration]: :($configs_paths)" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-FILE Configuration file to start directly]: :_files" \
|
||||
"--persist-tun[Enforces persistent tun/seamless tunnel (requires --config)]" \
|
||||
}
|
||||
|
||||
_openvpn3_session-stats(){
|
||||
_arguments \
|
||||
{-o,--path}"[SESSION-PATH Path to the configuration in the configuration manager]: :($sessions_paths)" \
|
||||
{-j,--json}"[Dump the configuration in JSON format]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($sessions_configs_names)" \
|
||||
{-I,--interface}"[INTERFACE Alternative to --path, where tun interface name is used instead]: :($sessions_interfaces)" \
|
||||
"--session-path[SESSION-PATH Alias for --path]: :($sessions_paths)" \
|
||||
}
|
||||
|
||||
_openvpn3_sessions-list(){
|
||||
_arguments \
|
||||
{-h,--help}"[This help screen]" \
|
||||
}
|
||||
|
||||
_openvpn3_shell-completion(){
|
||||
_arguments \
|
||||
{-h,--help}"[This help screen]" \
|
||||
"--list-commands[List all available commands]" \
|
||||
"--list-options[COMMAND List all available options for a specific command]: :($(openvpn3 shell-completion --list-commands))" \
|
||||
"--arg-helper[OPTION Used together with --list-options, lists value hint to an option]"
|
||||
}
|
||||
|
||||
_openvpn3_version(){
|
||||
_arguments \
|
||||
{-h,--help}"[This help screen]" \
|
||||
}
|
||||
|
||||
|
||||
_openvpn3_command(){
|
||||
local -a _openvpn3_cmds
|
||||
_openvpn3_cmds=(
|
||||
"config-acl: Manage access control lists for configurations" \
|
||||
"config-import: Import configuration profiles" \
|
||||
"config-manage: Manage configuration properties" \
|
||||
"config-remove: Remove an available configuration profile" \
|
||||
"config-show: Show/dump a configuration profile" \
|
||||
"configs-list: List all available configuration profiles" \
|
||||
"help: This help screen" \
|
||||
"log: Receive log events as they occur" \
|
||||
"session-acl: Manage access control lists for sessions" \
|
||||
"session-manage: Manage VPN sessions" \
|
||||
"session-start: Start a new VPN session" \
|
||||
"session-stats: Show session statistics" \
|
||||
"sessions-list: List available VPN sessions" \
|
||||
"shell-completion: Helper function to provide shell completion data" \
|
||||
"version: Show program version information" \
|
||||
)
|
||||
|
||||
if ((CURRENT == 1)); then
|
||||
_describe -t commands 'openvpn3 commands' _openvpn3_cmds
|
||||
else
|
||||
local curcontext="$curcontext"
|
||||
cmd="${${_openvpn3_cmds[(r)$words[1]:*]%%:*}}"
|
||||
if (($#cmd)); then
|
||||
if (( $+functions[_openvpn3_$cmd] )); then
|
||||
_openvpn3_$cmd
|
||||
else
|
||||
_message "no options for $cmd"
|
||||
fi
|
||||
else
|
||||
_message "no more options"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
_arguments \
|
||||
{-h,--help}"[that This help screen]" \
|
||||
"*::openvpn3 commands:_openvpn3_command" \
|
||||
|
@ -1,75 +0,0 @@
|
||||
#compdef optirun
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for the optirun command from bumblebee
|
||||
# (https://github.com/Bumblebee-Project/Bumblebee).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Christophe-Marie Duquesne <chm.duquesne@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
local -a arguments
|
||||
|
||||
arguments=(
|
||||
'--version[output version information]'
|
||||
'(-h --help)'{-h,--help}'[show help]'
|
||||
'(-c --vgl-compress)'{-c,--vgl-compress}'[image transport method]:method:(proxy jpeg rgb xb yuv)'
|
||||
'--failsafe[run a program even if the nvidia card is unavailable]:boolean:(true false)'
|
||||
'--no-failsafe[do not run a program if the nvidia card is unavailable]'
|
||||
'--vgl-options[options to be passed to vglrun (example: +tr)]'
|
||||
'(-q --quiet --silent)'{-q,--quiet,--silent}'[suppress all logging messages]'
|
||||
'(-v --verbose)'{-v,--verbose}'[increase the verbosity level of log messages]'
|
||||
'--debug[set the verbosity level to the maximum]'
|
||||
'(-b --bridge)'{-b,--bridge}'[specify bridge library to use: VirtualGL, Primus or auto]:method:(auto primus virtualgl none)'
|
||||
'(-d --display)'{-d,--display}'[the X display number to use]'
|
||||
'(-C --config)'{-C,--config}'[retrieve settings for Bumblebee from FILE]:file:_files'
|
||||
'(-l --ldpath)'{-l,--ldpath}'[PATH the libraries like libGL.so are searched in]:file:_files'
|
||||
'--primus-ldpath[a colon-separated list of paths which are searched for the primus libGL.so.1]:file:_files'
|
||||
'(-s --socket)'{-s,--socket}'[use FILE for communication with the daemon]:file:_files'
|
||||
'--no-xorg[do not start secondary X server (implies -b none)]'
|
||||
'*::arguments: _normal'
|
||||
)
|
||||
|
||||
_arguments $arguments
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,113 +0,0 @@
|
||||
#compdef opusenc opusdec opusinfo
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2021 Github zsh-users - http://github.com/zsh-users
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for opus-tools (https://opus-codec.org/)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Andre Kugland (https://github.com/kugland)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
case $service in
|
||||
opusenc)
|
||||
_arguments -S \
|
||||
'1:input file:_files -g "*.(#i)(wav|flac|ogg|aif(|f))(-.)"' \
|
||||
'2:output file:_files -g "*.(#i)opus(-.)"' \
|
||||
'(- 1 *)'{-h,--help}'[show usage information]' \
|
||||
'(- 1 *)'{-V,--version}'[show version information]' \
|
||||
'(- 1 *)--help-picture[show help on attaching album art]' \
|
||||
'--quiet[enable quiet mode]' \
|
||||
'--bitrate[set target bitrate per channel]:target bitrate per channel (kbps) (6-256)' \
|
||||
'--comp[set encoding complexity]:encoding complexity (1-10) [10]:(1 2 3 4 5 6 7 8 9 10)' \
|
||||
'--cvbr[use constrained variable bitrate encoding]' \
|
||||
'--downmix-mono[downmix to mono]' \
|
||||
'--downmix-stereo[downmix to stereo (if >2 channels)]' \
|
||||
'--expect-loss[set expected packet loss]:expected packet loss (percent) (0-100) [0]' \
|
||||
'--framesize[set maximum frame size]:maximum frame size (milliseconds) [20]:(2.5 5 10 20 40 60)' \
|
||||
'--hard-cbr[use hard constant bitrate encoding]' \
|
||||
'--max-delay[set maximum container delay]:maximum container delay (milliseconds) (0-1000) [1000]' \
|
||||
'--music[tune low bitrates for music (override automatic detection)]' \
|
||||
'--no-phase-inv[disable use of phase inversion for intensity stereo]' \
|
||||
'--speech[tune low bitrates for speech (override automatic detection)]' \
|
||||
'--vbr[use variable bitrate encoding (default)]' \
|
||||
'--album[set album or collection]:album or collection' \
|
||||
'--date[set date of track]:date of track (YYYY, YYYY-MM, or YYYY-MM-DD):_dates -f "%F"' \
|
||||
'--discard-comments[discard metadata when transcoding]' \
|
||||
'--discard-pictures[discard pictures when transcoding]' \
|
||||
'--padding[reserve extra bytes for metadata]:padding size (bytes) [512]' \
|
||||
'--title[set track title]:track title' \
|
||||
'--tracknumber[set track number]:track number' \
|
||||
'*--artist[add artist or author]:artist or author' \
|
||||
'*--comment[add an extra comment]:comment (tag=val)' \
|
||||
'*--genre[add genre]:genre' \
|
||||
'*--picture[attach album art]:album art:_files -g "*.(#i)(jp(|e)g|png|gif)(-.)"' \
|
||||
'--ignorelength[ignore the data length in RIFF wav headers]' \
|
||||
'--raw-bits[set bits per sample for raw input]:bits per sample [16]:(8 16 24)' \
|
||||
'--raw-chan[set number of channels for raw input]:number of channels (1-255) [2]' \
|
||||
'--raw-endianness[set endianness for raw input]:endianness:(("0"\:"big endian" "1"\:"little endian"))' \
|
||||
'--raw-rate[set sampling rate for raw input]:sample rate (Hz) (100-768000) [48000]' \
|
||||
'--raw[interpret input as raw PCM data without headers]' \
|
||||
'--serial[force use of a specific stream serial number]:stream serial number' \
|
||||
'--save-range[save check values for every frame to a file]:output for check values:_files' \
|
||||
'--set-ctl-int[pass encoder control]:encoder control'
|
||||
;;
|
||||
opusdec)
|
||||
_arguments -S \
|
||||
'1:input file:_files -g "*.(#i)opus(-.)"' \
|
||||
'2::output file:_files -g "*.(#i)wav(-.)"' \
|
||||
'(- 1 *)'{-h,--help}'[show usage information]' \
|
||||
'(- 1 *)'{-V,--version}'[show version information]' \
|
||||
'(- 1 *)--help-picture[show help on attaching album art]' \
|
||||
'--quiet[enable quiet mode]' \
|
||||
'--rate[force decoding at given sample rate]:sample rate (Hz) (8000-192000)' \
|
||||
'--force-stereo[force decoding to stereo]' \
|
||||
'--gain[adjust output volume]:gain (dB) (negative is quieter)' \
|
||||
'--no-dither[do not dither 16-bit output]' \
|
||||
'--float[output 32-bit floating-point samples]' \
|
||||
'--force-wav[force RIFF wav header on output]' \
|
||||
'--packet-loss[simulate random packet loss]:packet loss probability (percent) (0-100)' \
|
||||
'--save-range[save check values for every frame to a file]:output for check values:_files'
|
||||
;;
|
||||
opusinfo)
|
||||
_arguments -s -S \
|
||||
'(- 1 *)-h[show usage information]' \
|
||||
'(- 1 *)-V[show version information]' \
|
||||
'*-q[make the output quieter]' \
|
||||
'*-v[make the output more verbose]' \
|
||||
'*:opus file:_files -g "*.(#i)opus(-.)"'
|
||||
;;
|
||||
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
|
@ -1,95 +0,0 @@
|
||||
#compdef patool
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for patool (https://github.com/wummel/patool).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Sergei Eremenko (https://github.com/SmartFinn)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local state line ret=1
|
||||
|
||||
_arguments -C \
|
||||
'(-h --help)'{-h,--help}'[show help message and exit]' \
|
||||
'(--non-interactive)'--non-interactive'[do not query for user input]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[verbose operation]' \
|
||||
'1:cmd:->cmds' \
|
||||
'*:arg:->args' && ret=0
|
||||
|
||||
case $state in
|
||||
(cmds)
|
||||
local -a cmds
|
||||
|
||||
cmds=(
|
||||
'create:create an archive from given files'
|
||||
'diff:show differences between two archives'
|
||||
'extract:extract files from given archives'
|
||||
'formats:show all supported archive formats'
|
||||
'list:list files in archives'
|
||||
'repack:repackage archive to a different format'
|
||||
'recompress:recompress an archive to smaller size'
|
||||
'search:search in archive contents for given pattern'
|
||||
'test:test the given archives'
|
||||
)
|
||||
|
||||
_describe -t commands 'patool commands' cmds && ret=0
|
||||
;;
|
||||
(args)
|
||||
case $line[1] in
|
||||
(extract)
|
||||
_arguments \
|
||||
'--outdir[extract to the given output directory]:select directory:_files -/' \
|
||||
'*:files:_files' && ret=0
|
||||
;;
|
||||
(formats)
|
||||
_message 'no more arguments' && ret=0
|
||||
;;
|
||||
(search)
|
||||
_arguments \
|
||||
'2:search pattern:' \
|
||||
'*:files:_files' && ret=0
|
||||
;;
|
||||
(*)
|
||||
_arguments \
|
||||
'*:files:_files' && ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
File diff suppressed because it is too large
Load Diff
@ -1,36 +0,0 @@
|
||||
#compdef periscope
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Periscope (http://code.google.com/p/periscope).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_arguments \
|
||||
'(- : *)'{-h,--help}'[show help message and exit]' \
|
||||
'(- : *)--version[show version number and exit]' \
|
||||
'*'{-l,--language}'[wanted language]: :_language_codes ISO-639-1' \
|
||||
'(-f --force)'{-f,--force}'[replace existing subtitle file]' \
|
||||
'(-q --query)'{-q,--query}'[query to send to the subtitles website]:queries' \
|
||||
'--list-plugins[list all plugins supported by periscope]' \
|
||||
'--list-active-plugins[list all plugins used to search subtitles]' \
|
||||
'--cache-folder[cache/config directory to use]: :_files -/' \
|
||||
'--quiet[run in quiet mode (only show warn and error messages)]' \
|
||||
'--debug[set the logging level to debug]' \
|
||||
'*: :_files'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,590 +0,0 @@
|
||||
#compdef psql pg_dump pg_dumpall pg_restore createdb dropdb vacuumdb createuser dropuser initdb
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users, Dominic Mitchell, Johann 'Myrkraverk' Oskarsson, Daniel Serodio, J Smith
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for PostgreSQL utils (http://postgresql.org).
|
||||
#
|
||||
# Source: http://www.zsh.org/mla/users/2004/msg01006.html
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Dominic Mitchell <dom+zsh@happygiraffe.net>
|
||||
#
|
||||
# * Johann 'Myrkraverk' Oskarsson <johann@2ndquadrant.com>
|
||||
#
|
||||
# * Daniel Serodio <dserodio@gmail.com> pg_dumpall completion
|
||||
#
|
||||
# * J Smith <dark.panda@gmail.com> various completion additions
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_pgsql_get_identity () {
|
||||
_pgsql_user=${(v)opt_args[(i)-U|--username]}
|
||||
_pgsql_port=${(v)opt_args[(i)-p|--port]}
|
||||
_pgsql_host=${(v)opt_args[(i)-h|--host]}
|
||||
|
||||
_pgsql_params=(
|
||||
${_pgsql_user:+"--username=$_pgsql_user"}
|
||||
${_pgsql_port:+"--port=$_pgsql_port"}
|
||||
${_pgsql_host:+"--host=$_pgsql_host"}
|
||||
)
|
||||
}
|
||||
|
||||
# Postgres Allows specifying the path to the directory containing the
|
||||
# socket as well as a hostname.
|
||||
_pgsql_host_or_dir() {
|
||||
_alternative \
|
||||
'hosts:host:_hosts' \
|
||||
'directories:directory:_directories'
|
||||
}
|
||||
|
||||
# This creates a port completion list based on socket files on the
|
||||
# local computer. Be default, Postgres puts them in /tmp/ but Debian
|
||||
# changed that to /var/run/postgresql/ in their packages.
|
||||
_pgsql_ports() {
|
||||
compadd "$@" - /tmp/.s.PGSQL.<->(N:e) /var/run/postgresql/.s.PGSQL.<->(N:e)
|
||||
}
|
||||
|
||||
_pgsql_users () {
|
||||
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
|
||||
local _pgsql_user_sql
|
||||
_pgsql_get_identity
|
||||
|
||||
# We use _pgsql_port and _pgsql_host directly here instead of
|
||||
# _pgsql_params so as to not pick up a partially completed
|
||||
# username.
|
||||
_pgsql_params=(
|
||||
${_pgsql_port:+"--port=$_pgsql_port"}
|
||||
${_pgsql_host:+"--host=$_pgsql_host"}
|
||||
)
|
||||
|
||||
_pgsql_user_sql='select r.rolname from pg_catalog.pg_roles r where r.rolcanlogin = true'
|
||||
|
||||
compadd "$@" - $( psql $_pgsql_params[@] -XAqt -c $_pgsql_user_sql template1 2>/dev/null )
|
||||
|
||||
}
|
||||
|
||||
_pgsql_tables () {
|
||||
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
|
||||
_pgsql_get_identity
|
||||
|
||||
# Need to pull out the database name from the existing arguments.
|
||||
# This is going to vary between commands. Thankfully, it's only
|
||||
# used by pg_dump, which always has the dbname in arg1. If it's
|
||||
# not present it defaults to ${PGDATABASE:-$LOGNAME}, which
|
||||
# matches (I think) the PostgreSQL behaviour.
|
||||
|
||||
local db
|
||||
db=${line[1]:-${PGDATABASE:-$LOGNAME}}
|
||||
|
||||
## Instead of parsing the output of the psql \ commands, we look
|
||||
## up the tables ourselves. The following query has been tested
|
||||
## with Postgres 8.2 - 9.2.
|
||||
|
||||
local _pgsql_table_sql
|
||||
_pgsql_table_sql="select n.nspname || '.' || c.relname \
|
||||
from pg_catalog.pg_class c \
|
||||
left join pg_catalog.pg_namespace n on n.oid = c.relnamespace \
|
||||
where c.relkind in ('r', '') \
|
||||
and n.nspname <> 'pg_catalog' \
|
||||
and n.nspname <> 'information_schema' \
|
||||
and n.nspname !~ '^pg_toast' \
|
||||
and pg_catalog.pg_table_is_visible( c.oid ) \
|
||||
order by 1"
|
||||
|
||||
compadd "$@" - \
|
||||
$( psql $_pgsql_params[@] -AXqt -c $_pgsql_table_sql $db 2>/dev/null )
|
||||
}
|
||||
|
||||
_pgsql_schemas () {
|
||||
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
|
||||
_pgsql_get_identity
|
||||
|
||||
local db
|
||||
db=${line[1]:-${PGDATABASE:-$LOGNAME}}
|
||||
|
||||
local _pgsql_schema_sql="select n.nspname \
|
||||
from pg_catalog.pg_namespace n \
|
||||
where n.nspname !~ '^pg_' \
|
||||
and n.nspname <> 'information_schema' \
|
||||
order by 1;"
|
||||
|
||||
compadd "$@" - \
|
||||
$( psql $_pgsql_params[@] -AXqt -c $_pgsql_schema_sql $db 2>/dev/null )
|
||||
}
|
||||
|
||||
_pgsql_databases () {
|
||||
local _pgsql_user _pgsql_port _pgsql_host _pgsql_params
|
||||
_pgsql_get_identity
|
||||
|
||||
local _pgsql_services _pgsql_service_files
|
||||
_pgsql_service_files=(~/.pg_service.conf)
|
||||
(( $+commands[pg_config] )) && _pgsql_service_files+=$(pg_config --sysconfdir)/pg_service.conf
|
||||
|
||||
_pgsql_services=$( grep -h '^\[.*\]' $_pgsql_service_files 2>/dev/null \
|
||||
| sed -e 's/^\[/service=/' -e 's/\].*$//' )
|
||||
|
||||
local _pgsql_db_sql
|
||||
_pgsql_db_sql="select d.datname from pg_catalog.pg_database d \
|
||||
where d.datname <> 'template0'"
|
||||
|
||||
compadd "$@" - \
|
||||
${(f)_pgsql_services} \
|
||||
$( psql $_pgsql_params[@] -AXtq -c $_pgsql_db_sql template1 2>/dev/null )
|
||||
}
|
||||
|
||||
_pgsql_encodings () {
|
||||
local _pgsql_user
|
||||
_pgsql_get_identity
|
||||
|
||||
local _pgsql_db_sql
|
||||
_pgsql_db_sql="select pg_encoding_to_char(i) from generate_series(0,100) i;"
|
||||
|
||||
compadd "$@" - $( psql $_pgsql_params[@] -AXtq -c $_pgsql_db_sql template1 )
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
## The actual completion code for the commands
|
||||
##
|
||||
|
||||
_psql () {
|
||||
local curcontext="$curcontext" state line expl
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s "-*" \
|
||||
"$_pgsql_common_opts[@]" \
|
||||
{-c+,--command=}':execute SQL command:' \
|
||||
{-d+,--dbname=}':database to connect to:_pgsql_databases' \
|
||||
{-f+,--file=}':SQL file to read:_files' \
|
||||
{-l,--list}'[list databases]' \
|
||||
{-v+,--set=,--variable=}':set SQL variable:' \
|
||||
{-V,--version}'[output version information, then exit]' \
|
||||
{-X,--no-psqlrc}'[don'\''t read ~/.psqlrc]' \
|
||||
{-1,--single-transaction}'[restore as a single transaction]' \
|
||||
{-\?,--help=}':display help:' \
|
||||
\
|
||||
{-a,--echo-all}'[print commands read]' \
|
||||
{-b,--echo-errors}'[echo failed commands]' \
|
||||
{-e,--echo-queries}'[display queries submitted]' \
|
||||
{-E,--echo-hidden}'[display hidden queries]' \
|
||||
{-L,--log-file=}'[send session log to file]' \
|
||||
{-n,--no-readline}'[disable enhanced command line editing (readline)]' \
|
||||
{-o+,--output=}':query output:_files' \
|
||||
{-q,--quiet}'[non verbose mode]' \
|
||||
{-s,--single-step}'[prompt before each query]' \
|
||||
{-S,--single-line}'[newline sends query]' \
|
||||
\
|
||||
{-A,--no-align}'[unaligned output mode]' \
|
||||
--csv'[CSV (Comma-Separated Values) table output mode]' \
|
||||
{-F+,--field-separator=}':field separator char:' \
|
||||
{-H,--html}'[HTML output]' \
|
||||
{-P+,--pset=}':set psql variable:' \
|
||||
{-R+,--record-separator=}':record separator char:' \
|
||||
{-t,--tuples-only}'[don'\''t display header/footer]' \
|
||||
{-T+,--table-attr=}':HTML table options:' \
|
||||
{-x,--expanded}'[one column per line]' \
|
||||
{-z,--field-separator-zero}'[set field separator for unaligned output to zero byte]' \
|
||||
{-0,--record-separator-zero}'[set record separator for unaligned output to zero byte]' \
|
||||
-u'[prompt for username/password]' \
|
||||
':PostgreSQL database:_pgsql_databases' \
|
||||
':PostgreSQL user:_pgsql_users'
|
||||
}
|
||||
|
||||
_pg_dump () {
|
||||
local curcontext="$curcontext" state line expl
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s \
|
||||
"$_pgsql_common_opts[@]" \
|
||||
{-f+,--file=}':output file:_files' \
|
||||
{-F+,--format=}':output format:_values "format" "p[plain text]" "t[tar]" "c[custom]"' \
|
||||
{-j,--jobs=}'[use this many parallel jobs to dump]' \
|
||||
{-v,--verbose}'[verbose mode]' \
|
||||
{-V,--version}'[output version information, then exit]' \
|
||||
{-Z+,--compress=}':compression level:_values "level" 9 8 7 6 5 4 3 2 1 0' \
|
||||
--lock-wait-timeout='[fail after waiting TIMEOUT for a table lock]' \
|
||||
--no-sync'[do not wait for changes to be written safely to disk]' \
|
||||
{-\?,--help}'[display help]' \
|
||||
\
|
||||
{-a,--data-only}'[dump only data]' \
|
||||
{-b,--blobs}'[dump blobs as well]' \
|
||||
{-B,--no-blobs}'[exclude large objects in dump]' \
|
||||
{-c,--clean}'[include clean cmds in dump]' \
|
||||
{-C,--create}'[include createdb cmds in dump]' \
|
||||
{-e+,--extension=}'[dump the specified extension(s) only]' \
|
||||
{-E+,--encoding=}':database encoding:_pgsql_encodings' \
|
||||
{-n+,--schema=}':schema to dump:_pgsql_schemas' \
|
||||
{-N+,--exclude-schema=}':schema to NOT dump:_pgsql_schemas' \
|
||||
{-O,--no-owner}'[don'\''t recreate as same owner]' \
|
||||
{-s,--schema-only}'[no data, only schema]' \
|
||||
{-S+,--superuser=}':superuser name:_pgsql_users' \
|
||||
{-t+,--table=}':table to dump:_pgsql_tables' \
|
||||
{-T+,--exclude-table=}':table to NOT dump:_pgsql_tables' \
|
||||
{-x,--no-{acl,privileges}}'[don'\''t dump ACLs]' \
|
||||
--binary-upgrade'[for use by upgrade utilities only]' \
|
||||
{-D,--{attribute,column}-inserts}'[use INSERT (cols) not COPY]' \
|
||||
--disable-dollar-quoting'[disable dollar quoting, use SQL standard quoting]' \
|
||||
--disable-triggers'[disable triggers during data-only restore]' \
|
||||
--enable-row-security'[enable row security (dump only content user has access to)]' \
|
||||
--exclude-table-data='[do NOT dump data for the named table(s)]' \
|
||||
--if-exists'[use IF EXISTS when dropping objects]' \
|
||||
--include-foreign-data='[include data of foreign servers]' \
|
||||
--inserts'[dump data as INSERT commands, rather than COPY]' \
|
||||
--load-via-partition-root'[load partitions via the root table]' \
|
||||
--no-comments'[do not dump comments]' \
|
||||
--no-publications'[do not dump publications]' \
|
||||
--no-security-labels'[do not dump security label assignments]' \
|
||||
--no-subscriptions'[do not dump subscriptions]' \
|
||||
--no-synchronized-snapshots'[do not use synchronized snapshots in parallel jobs]' \
|
||||
--no-tablespaces'[do not dump tablespace assignments]' \
|
||||
--no-toast-compression'[do not dump TOAST compression methods]' \
|
||||
--no-unlogged-table-data'[do not dump unlogged table data]' \
|
||||
--on-conflict-do-nothing'[add ON CONFLICT DO NOTHING to INSERT commands]' \
|
||||
--quote-all-identifiers'[quote all identifiers, even if not key words]' \
|
||||
--rows-per-insert=['number of rows per INSERT'] \
|
||||
--section=':dump named section:_values "section" pre-data data post-data' \
|
||||
--serializable-deferrable'[wait until the dump can run without anomalies]' \
|
||||
--snapshot='[use given snapshot for the dump]' \
|
||||
--strict-names'[require table and/or schema include patterns to match at least one entity each]' \
|
||||
--use-set-session-authorization'[use SET SESSION AUTHORIZATION commands instead of ALTER OWNER]' \
|
||||
\
|
||||
{-i,--ignore-version}'[ignore version mismatch]' \
|
||||
{-o,--oids}'[dump objects identifiers for every table]' \
|
||||
{-R,--no-reconnect}'[don'\''t output connect]' \
|
||||
-X+':option:_values "option" use-set-session-authorization disable-triggers' \
|
||||
':PostgreSQL database:_pgsql_databases'
|
||||
}
|
||||
|
||||
_pg_restore () {
|
||||
local curcontext="$curcontext" state line expl
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s \
|
||||
"$_pgsql_common_opts[@]" \
|
||||
{-d+,--dbname=}':database to connect to:_pgsql_databases' \
|
||||
{-f+,--file=}':output file:_files' \
|
||||
{-F+,--format=}':output format:_values "format" "p[plain text]" "t[tar]" "c[custom]"' \
|
||||
{-l,--list}'[list databases]' \
|
||||
{-v,--verbose}'[verbose mode]' \
|
||||
{-V,--version}'[output version information, then exit]' \
|
||||
{-\?,--help}'[display help]' \
|
||||
\
|
||||
{-a,--data-only}'[dump only data]' \
|
||||
{-c,--clean}'[include clean (drop) cmds before recreating]' \
|
||||
{-C,--create}'[include createdb cmds in dump]' \
|
||||
{-e,--exit-on-error}'[exit on error, default is to continue]' \
|
||||
{-I,--index=}':index name:' \
|
||||
{-j,--jobs=}':use this many parallel jobs to restore:' \
|
||||
{-L,--use-list=}':use table of contents from this file for selecting/ordering output:' \
|
||||
{-n,--schema=}':restore only objects in this schema:' \
|
||||
{-O,--no-owner}'[skip restoration of object ownership]' \
|
||||
{-P,--function=}':restore named function:' \
|
||||
{-s,--schema-only}'[restore only the schema, no data]' \
|
||||
{-S,--superuser=}':superuser user name to use for disabling triggers:' \
|
||||
{-t,--table=}':restore named table:' \
|
||||
{-T,--trigger=}':restore named trigger:' \
|
||||
{-x,--no-privileges}'[skip restoration of access privileges (grant/revoke)]' \
|
||||
{-1,--single-transaction}'[restore as a single transaction]' \
|
||||
--disable-triggers'[disable triggers during data-only restore]' \
|
||||
--enable-row-security'[enable row security]' \
|
||||
--if-exists'[use IF EXISTS when dropping objects]' \
|
||||
--no-comments'[do not restore comments]' \
|
||||
--no-data-for-failed-tables'[do not restore data of tables that could not be created]' \
|
||||
--no-publications'[do not restore publications]' \
|
||||
--no-security-labels'[do not restore security labels]' \
|
||||
--no-subscriptions'[do not restore subscriptions]' \
|
||||
--no-tablespaces'[do not restore tablespace assignments]' \
|
||||
--section=':dump named section:_values "section" pre-data data post-data' \
|
||||
--strict-names'[require table and/or schema include patterns to match at least one entity each]' \
|
||||
--use-set-session-authorization'[use SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownership]' \
|
||||
\
|
||||
{-b,--blobs}'[include large objects in dump]' \
|
||||
{-B,--no-blobs}'[exclude large objects in dump]' \
|
||||
\
|
||||
"1: :_files"
|
||||
}
|
||||
|
||||
_pg_dumpall () {
|
||||
local curcontext="$curcontext" state line expl
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s \
|
||||
"$_pgsql_common_opts[@]" \
|
||||
{-f+,--file=}':output file:_files' \
|
||||
{-v,--verbose}'[verbose mode]' \
|
||||
{-V,--version}'[output version information, then exit]' \
|
||||
--lock-wait-timeout='[fail after waiting TIMEOUT for a table lock]' \
|
||||
{-\?,--help}'[display help]' \
|
||||
\
|
||||
{-a,--data-only}'[dump only data]' \
|
||||
{-c,--clean}'[include clean (drop) cmds before recreating]' \
|
||||
{-E,--encoding=}'[dump the data in encoding]' \
|
||||
{-g,--globals-only}'[dump only global objects, no databases]' \
|
||||
{-O,--no-owner}'[don'\''t recreate as same owner]' \
|
||||
{-r,--roles-only}'[no databases or tablespaces, only roles]' \
|
||||
{-s,--schema-only}'[no data, only schema]' \
|
||||
{-S+,--superuser=}':superuser name:_pgsql_users' \
|
||||
{-t,--tablespaces-only}'[no databases or roles, only tablespaces]' \
|
||||
{-x,--no-privileges}'[don'\''t dump ACLs]' \
|
||||
--binary-upgrade'[for use by upgrade utilities only]' \
|
||||
--column-inserts'[use INSERT with column names not COPY]' \
|
||||
--disable-dollar-quoting'[disable dollar quoting, use SQL standard quoting]' \
|
||||
--disable-triggers'[disable triggers during data-only restore]' \
|
||||
--exclude-database=':exclude databases:_pgsql_databases' \
|
||||
--extra-float-digits='[override default setting for extra_float_digits]' \
|
||||
--if-exists'[use IF EXISTS when dropping objects]' \
|
||||
--inserts'[use INSERT not COPY]' \
|
||||
--load-via-partition-root'[pload partitions via the root table]' \
|
||||
--no-comments'[do not dump comments]' \
|
||||
--no-publications'[do not dump publications]' \
|
||||
--no-role-passwords'[do not dump passwords for roles]' \
|
||||
--no-security-labels'[do not dump security label assignments]' \
|
||||
--no-subscriptions'[do not dump subscriptions]' \
|
||||
--no-sync'[do not wait for changes to be written safely to disk]' \
|
||||
--no-tablespaces'[do not dump tablespace assignments]' \
|
||||
--no-toast-compression'[do not dump TOAST compression methods]' \
|
||||
--no-unlogged-table-data'[do not dump unlogged table data]' \
|
||||
--on-conflict-do-nothing'[add ON CONFLICT DO NOTHING to INSERT commands]' \
|
||||
--quote-all-identifiers'[quote all identifiers, even if not key words]' \
|
||||
--rows-per-insert='[number of rows per INSERT]' \
|
||||
--use-set-session-authorization'[use SET SESSION AUTHORIZATION cmds instead of ALTER OWNER]' \
|
||||
{-o,--oids}'[dump objects identifiers for every table]' \
|
||||
}
|
||||
|
||||
_createdb () {
|
||||
local curcontext="$curcontext" state line expl
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s \
|
||||
"$_pgsql_common_opts[@]" \
|
||||
{-D+,--tablespace=}'[default tablespace for the database]' \
|
||||
{-e,--echo}'[display SQL queries]' \
|
||||
{-E+,--encoding=}':database encoding:_pgsql_encodings' \
|
||||
{-l+,--locale=}'[locale settings for the database]' \
|
||||
--lc-collate='[LC_COLLATE setting for the database]' \
|
||||
--lc-ctype='[LC_CTYPE setting for the database]' \
|
||||
{-O+,--owner=}':database user to own the new database:_pgsql_users' \
|
||||
{-T+,--template=}':database template:_pgsql_databases' \
|
||||
'--version[output version information, then exit]' \
|
||||
{-\?,--help}'[display help]' \
|
||||
\
|
||||
--maintenance-db=':alternate maintenance database:_pgsql_databases' \
|
||||
{-q,--quiet}'[non verbose mode]' \
|
||||
--location=':database location (unsupported since PostgrSQL 8.0):_directories' \
|
||||
':PostgreSQL database:' \
|
||||
':comment:'
|
||||
}
|
||||
|
||||
_dropdb () {
|
||||
local curcontext="$curcontext" state line expl
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s \
|
||||
"$_pgsql_common_opts[@]" \
|
||||
{-e,--echo}'[display SQL queries]' \
|
||||
{-f,--force}'[try to terminate other connections before dropping]' \
|
||||
{-i,--interactive}'[confirm before drop]' \
|
||||
{-V,--version}'[output version information, then exit]' \
|
||||
--if-exists'[don'\''t treport error if database does'\''t exist]' \
|
||||
--maintenance-db=':alternate maintenance database:_pgsql_databases' \
|
||||
{-q,--quiet}'[non verbose mode]' \
|
||||
':PostgreSQL database:_pgsql_databases'
|
||||
}
|
||||
|
||||
_vacuumdb () {
|
||||
local curcontext="$curcontext" state line expl
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s \
|
||||
"$_pgsql_common_opts[@]" \
|
||||
{-a,--all}'[vacuum all databases]' \
|
||||
{-d+,--dbname=}':database to connect to:_pgsql_databases' \
|
||||
--disable-page-skipping'[disable all page-skipping behavior]' \
|
||||
{-e,--echo}'[show the commands being sent to the server]' \
|
||||
{-f,--full}'[do full vacuuming]' \
|
||||
{-F,--freeze}'[freeze row transaction information]' \
|
||||
--force-index-cleanup'[always remove index entries that point to dead tuples]' \
|
||||
{-j,--jobs=}'[use this many concurrent connections to vacuum]' \
|
||||
'--min-mxid-age=[minimum multixact ID age of tables to vacuum]' \
|
||||
'--min-xid-age=[minimum transaction ID age of tables to vacuum]' \
|
||||
--no-index-cleanup'[don'\''t remove index entries that point to dead tuples]' \
|
||||
--no-process-toast'[skip the TOAST table associated with the table to vacuum]' \
|
||||
--no-truncate'[don'\''t truncate empty pages at the end of the table]' \
|
||||
{-P+,--parallel=}'[use this many background workers for vacuum, if available]' \
|
||||
{-q,--quiet}'[do not write any messages]' \
|
||||
'--skip-locked[skip relations that cannot be immediately locked]' \
|
||||
{-t+,--table=}':table to dump:_pgsql_tables' \
|
||||
{-v,--verbose}'[write a lot of output]' \
|
||||
{-V,--version}'[output version information, then exit]' \
|
||||
{-z,--analyze}'[update optimizer hints]' \
|
||||
{-Z,--analyze-only}'[only update optimizer statistics; no vacuum]' \
|
||||
--analyze-in-stages'[only update optimizer statistics, in multiple stages for faster results; no vacuum]' \
|
||||
{-\?,--help}'[display help]' \
|
||||
--maintenance-db='[alternate maintenance database]' \
|
||||
'1:PostgreSQL database:_pgsql_databases'
|
||||
}
|
||||
|
||||
_createuser () {
|
||||
local curcontext="$curcontext" state line expl
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s \
|
||||
"$_pgsql_common_opts[@]" \
|
||||
{-c,--connection-limit=}'[connection limit for role (default: no limit)]' \
|
||||
{-d,--createdb}'[role can create new databases]' \
|
||||
{-D,--no-createdb}'[role cannot create databases]' \
|
||||
{-e,--echo}'[display SQL queries]' \
|
||||
{-g,--role=}'[new role will be a member of this role]' \
|
||||
{-i,--inherit}'[role inherits privileges of roles it is a member of (default)]' \
|
||||
{-I,--no-inherit}'[role does not inherit privileges]' \
|
||||
{-l,--login}'[role can login (default)]' \
|
||||
{-L,--no-login}'[role cannot login]' \
|
||||
{-P,--pwprompt}'[assign a password to new role]' \
|
||||
{-r,--createrole}'[role can create new roles]' \
|
||||
{-R,--no-createrole}'[role cannot create roles]' \
|
||||
{-s,--superuser}'[role will be superuser]' \
|
||||
{-S,--no-superuser}'[role will not be superuser]' \
|
||||
--interactive'[prompt for missing role name and attributes rather than using defaults]' \
|
||||
--replication'[role can initiate replication]' \
|
||||
--no-replication'[role cannot initiate replication]' \
|
||||
{-E,--encrypted}'[encrypt stored password]' \
|
||||
{-N,--unencrypted}'[do not encrypt stored password]' \
|
||||
{-\?,--help}'[display help]'
|
||||
}
|
||||
|
||||
_dropuser () {
|
||||
local curcontext="$curcontext" state line expl
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s \
|
||||
"$_pgsql_common_opts[@]" \
|
||||
{-e,--echo}'[display SQL queries]' \
|
||||
{-q,--quiet}'[non verbose mode]' \
|
||||
{-i,--interactive}'[prompt before deleting anything, and prompt for role name if not specified]' \
|
||||
{-V,--version}'[output version information, then exit]' \
|
||||
--if-exists'[don'\''t report error if user doesn'\''t exist]' \
|
||||
':PostgreSQL user:_pgsql_users'
|
||||
}
|
||||
|
||||
_initdb () {
|
||||
local curcontext="$curcontext" state line expl
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s \
|
||||
{--auth=,-A+}':default authentication method for local connections:_values "auth methods" $_pgsql_auth_methods[@]' \
|
||||
--auth-host=':default authentication method for local TCP/IP connections:_values "auth methods" $_pgsql_auth_methods[@]' \
|
||||
--auth-local=':default authentication method for local-socket connections:_values "auth methods" $_pgsql_auth_methods[@]' \
|
||||
{-D+,--pgdata=}':location for this database cluster:_files' \
|
||||
{-E+,--encoding=}':set default encoding for new databases:_pgsql_encodings' \
|
||||
{-g,--allow-group-access}'[allow group readexecute on data directory]' \
|
||||
{-k,--data-checksums}':use data page checksums:' \
|
||||
--locale=':set default locale for new databases:' \
|
||||
--lc-collate=':set the default locale for collate:' \
|
||||
--lc-ctype=':set the default locale for ctype:' \
|
||||
--lc-messages=':set the default locale for messages:' \
|
||||
--lc-monetary=':set the default locale for monetary:' \
|
||||
--lc-numeric=':set the default locale for numeric:' \
|
||||
--lc-time=':set the default local for time:' \
|
||||
--no-locale'[equivalent to --locale=C]' \
|
||||
--pwfile=':read password for the new superuser from file:_files' \
|
||||
{-T+,--text-search-config=}'[default text search configuration]' \
|
||||
{-U+,--username=NAME}':database superuser name:' \
|
||||
{-W,--pwprompt}'[prompt for a password for the new superuser]' \
|
||||
{-X+,--waldir=}':location for the write-ahead log directory:_files' \
|
||||
--xlogdir=':location for the transaction log directory (unsupported since PostgreSQL 10):_files' \
|
||||
--wal-segsize='[size of WAL segments, in megabytes]' \
|
||||
{-d,--debug}'[generate lots of debugging output]' \
|
||||
--discard-caches'[set debug_discard_caches=1]' \
|
||||
-L+':where to find the input files:_files' \
|
||||
{-n,--no-clean}'[do not clean up after errors]' \
|
||||
{-N,--no-sync}':do not wait for changes to be written safely to disk:' \
|
||||
--instructions'[do not print instructions for next steps]' \
|
||||
{-s,--show}'[show internal settings]' \
|
||||
{-S,--sync-only}'[only sync data directory]' \
|
||||
{-V,--version}'[output version information, then exit]' \
|
||||
{-\?,--help}'[display help]' \
|
||||
':location for this database cluster:_files'
|
||||
}
|
||||
|
||||
_pgsql_utils () {
|
||||
local _pgsql_common_opts _pgsql_auth_methods
|
||||
|
||||
_pgsql_common_opts=(
|
||||
{-\?,--help}'[display help]'
|
||||
{-h+,--host=}':database host:_pgsql_host_or_dir'
|
||||
{-p+,--port=}':database port number:_pgsql_ports'
|
||||
{-U+,--username=}':connect as user:_pgsql_users'
|
||||
{-W,--password}'[prompt for password]'
|
||||
{-w,--no-password}'[never prompt for password]'
|
||||
--role='[do SET ROLE before restore]'
|
||||
)
|
||||
|
||||
_pgsql_auth_methods=(
|
||||
trust
|
||||
reject
|
||||
md5
|
||||
password
|
||||
gss
|
||||
sspi
|
||||
krb5
|
||||
ident
|
||||
peer
|
||||
ldap
|
||||
radius
|
||||
cert
|
||||
pam
|
||||
)
|
||||
|
||||
case "$service" in
|
||||
psql) _psql "$@" ;;
|
||||
pg_dump) _pg_dump "$@" ;;
|
||||
pg_dumpall) _pg_dumpall "$@" ;;
|
||||
pg_restore) _pg_restore "$@" ;;
|
||||
createdb) _createdb "$@" ;;
|
||||
dropdb) _dropdb "$@" ;;
|
||||
vacuumdb) _vacuumdb "$@" ;;
|
||||
createuser) _createuser "$@" ;;
|
||||
dropuser) _dropuser "$@" ;;
|
||||
initdb) _initdb "$@" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
_pgsql_utils "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,94 +0,0 @@
|
||||
#compdef phing
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) Igor M. Timoshenko <igor.timoshenko@i.ua>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is furnished
|
||||
# to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Phing (http://phing.info).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Igor Timoshenko <igor.timoshenko@i.ua>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_phing() {
|
||||
local context curcontext="$curcontext" state line ret=1
|
||||
integer NORMARG
|
||||
typeset -A opt_args
|
||||
|
||||
# Follow http://phing.info/docs/stable/webhelp/sec.commandlineargs.html for more information
|
||||
_arguments \
|
||||
'(-h -help)'{-h,-help}'[display the help screen]' \
|
||||
'(-v -version)'{-v,-version}'[print version information and exit]' \
|
||||
'(-l -list)'{-l,-list}'[list all available targets in buildfile (excluding targets that have their hidden attribute set to true)]' \
|
||||
'(-q -quiet)'{-q,-quiet}'[quiet operation, no output at all]' \
|
||||
'-verbose[verbose, give some more output]' \
|
||||
'-debug[output debug information]' \
|
||||
'-logfile [use given file for log]:file:_files' \
|
||||
'-D[set the property to the specified value to be used in the buildfile]' \
|
||||
'-find []:file:_files' \
|
||||
'-buildfile [specify an alternate buildfile name. Default is build.xml]:file:_files' \
|
||||
'-logger [specify an alternate logger. Default is phing.listener.DefaultLogger. Other options include phing.listener.NoBannerLogger, phing.listener.AnsiColorLogger, phing.listener.XmlLogger, phing.listener.TargetLogger and phing.listener.HtmlColorLogger]' \
|
||||
'-propertyfile [load properties from the specified file]:file:_files' \
|
||||
'(-v --version)'{-v,--version}'[show version]' \
|
||||
'1: :->targets' \
|
||||
'*:: :->args' \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
targets)
|
||||
local buildfile; buildfile=build.xml
|
||||
if [[ ! -f $buildfile ]]
|
||||
then
|
||||
ret=0
|
||||
else
|
||||
local targets; targets=($(sed -nE "/<target /s/.*name=[\"'](\w+)[\"'].*/\1/p" $buildfile))
|
||||
_describe -t 'targets' 'target' targets && ret=0
|
||||
fi
|
||||
;;
|
||||
args)
|
||||
if [[ CURRENT -eq NORMARG && ${+opt_args[--match]} -eq 0 ]]
|
||||
then
|
||||
# If the current argument is the first non-option argument
|
||||
# and --match isn't present then a pattern is expected
|
||||
_message -e patterns 'pattern' && ret=0
|
||||
else
|
||||
_files
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
_phing "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
@ -1,100 +0,0 @@
|
||||
#compdef pixz
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for pixz a parallel, indexing version of xz. (https://github.com/vasi/pixz).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Jindřich Pilař (https://github.com/JindrichPilar)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local -a files index
|
||||
files=()
|
||||
index=()
|
||||
|
||||
_pixz_compressed_files() {
|
||||
files=("${(f)$(ls -l | grep '.tpxz$\|.xz$' | rev | cut -d' ' -f1 | rev)}")
|
||||
}
|
||||
|
||||
_pixz_load_file_index() {
|
||||
index=("${(f)$(pixz -l $1)}")
|
||||
}
|
||||
|
||||
_pixz() {
|
||||
|
||||
_arguments -C \
|
||||
'(- 1 *)'-h"[Show help and exit]" \
|
||||
'(- 1 *)'-l"[List tarball contents very fast]:file:->xzfiles" \
|
||||
'(- 1 *)'-x"[Extract one file very fast]:filepath:->filepath" \
|
||||
'(- 1 *)'-d"[Decompress]:file:->xzfiles" \
|
||||
"-i[Input]:file:->files" \
|
||||
"-o[Output]:output:->outputxz" \
|
||||
"-p[Use a maximum of NUM CPU-intensive threads]:cpu:->cpus" \
|
||||
"-t[Don't assume input is in tar format]" \
|
||||
"-k[Keep original input (do not remove it)]" \
|
||||
"-e[Use "extreme" compression, which is much slower]" \
|
||||
"-f[Set the size of each compression block, relative to the LZMA dictionary size (default is 2.0)]:num" \
|
||||
"-q[Set the number of blocks to allocate for the compression queue (default is 1.3 * cores + 2)]:num" \
|
||||
'1:inputfile:->files' \
|
||||
'2:outputfile' \
|
||||
'*: : :->args' \
|
||||
|
||||
case "$state" in
|
||||
(cmds)
|
||||
_describe -t commands 'commands' commands
|
||||
;;
|
||||
(xzfiles)
|
||||
_pixz_compressed_files
|
||||
_describe -t files 'files' files
|
||||
;;
|
||||
(files)
|
||||
_files
|
||||
;;
|
||||
(cpus)
|
||||
local num_cpus cores
|
||||
num_cpus=$(nproc)
|
||||
cores=()
|
||||
for i in {1..$num_cpus}; do
|
||||
cores+=($i)
|
||||
done
|
||||
_describe -t cores 'cores' cores
|
||||
;;
|
||||
(filepath)
|
||||
;;
|
||||
(*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_pixz
|
||||
|
@ -1,137 +0,0 @@
|
||||
#compdef pkcon
|
||||
# ------------------------------------------------------------------------------
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for pkcon (http://www.packagekit.org).
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local -a options
|
||||
options=(
|
||||
'--version[Show the program version and exit]'
|
||||
'--filter[Set the filter, e.g. installed]'
|
||||
"--root[Set the install root, e.g. '/' or '/mnt/ltsp']"
|
||||
'(-n --nowait)'{-n,--nowait}'[Exit without waiting for actions to complete]'
|
||||
'(-y --noninteractive)'{-g,--noninteractive}'[Install the packages without asking for confirmation]'
|
||||
'--background[Run the command using idle network bandwidth and also using less power]'
|
||||
'(-p --plain)'{-p,--plain}'[Print to screen a machine readable output, rather than using animated widgets]'
|
||||
'(-c --cache-age)'{-c,--cache-age}"[The maximum metadata cache age. Use -1 for 'never'.]"
|
||||
'(-h --help)'{-h,--help}'[Show help options.]'
|
||||
'(-v --verbose)'{-v,--verbose}'[Show debugging information for all files]'
|
||||
)
|
||||
|
||||
local -a actions
|
||||
actions=(
|
||||
'accept-eula'
|
||||
'get-roles'
|
||||
'get-distro-upgrades'
|
||||
'get-categories'
|
||||
'get-actions'
|
||||
'get-groups'
|
||||
'get-filters'
|
||||
'get-transactions'
|
||||
'get-time'
|
||||
'search'
|
||||
'install'
|
||||
'install-local'
|
||||
'download'
|
||||
'remove'
|
||||
'update'
|
||||
'refresh'
|
||||
'resolve'
|
||||
'get-updates'
|
||||
'get-depends'
|
||||
'get-requires'
|
||||
'get-details'
|
||||
'get-files'
|
||||
'get-update-detail'
|
||||
'get-packages'
|
||||
'repo-list'
|
||||
'repo-enable'
|
||||
'repo-disable'
|
||||
'repo-set-data'
|
||||
'what-provides'
|
||||
'upgrade-system'
|
||||
)
|
||||
|
||||
local context state line expl cmd
|
||||
local -A opt_args
|
||||
|
||||
integer i=2
|
||||
while (( i < $#words )); do
|
||||
case "$words[$i]" in
|
||||
-*)
|
||||
# skip option
|
||||
(( i++ ))
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -z "$cmd" ]]; then
|
||||
cmd="$words[$i]"
|
||||
words[$i]=()
|
||||
(( CURRENT-- ))
|
||||
fi
|
||||
(( i++ ))
|
||||
done
|
||||
|
||||
if [[ -z "$cmd" ]]
|
||||
then
|
||||
_arguments -s -w : $options \
|
||||
":action:($actions)"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$cmd" in
|
||||
search)
|
||||
_arguments : $options \
|
||||
':type:(name details group file)' \
|
||||
':data: :'
|
||||
;;
|
||||
refresh)
|
||||
_arguments -s -w : $options \
|
||||
'--force'
|
||||
;;
|
||||
*)
|
||||
_arguments -s -w : $options
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user