update prezto

This commit is contained in:
2018-11-18 23:37:19 +04:00
parent a17ecf9f57
commit 2808949f26
352 changed files with 15169 additions and 25328 deletions

View File

@@ -6,6 +6,19 @@ the [zsh-completions][1] project.
This module must be loaded **after** the *utility* module.
Options
-------
- `COMPLETE_IN_WORD` complete from both ends of a word.
- `ALWAYS_TO_END` move cursor to the end of a completed word.
- `PATH_DIRS` perform path search even on command names with slashes.
- `AUTO_MENU` show completion menu on a successive tab press.
- `AUTO_LIST` automatically list choices on ambiguous completion.
- `AUTO_PARAM_SLASH` if completed parameter is a directory, add a trailing slash.
- `EXTENDED_GLOB` needed for file modification glob modifiers with compinit.
- `MENU_COMPLETE` do not autoselect the first completion entry.
- `FLOW_CONTROL` disable start/stop characters in shell editor.
Settings
--------

View File

@@ -0,0 +1,39 @@
# 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/_ack)).
* Any reasonable open source licence 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`.

View File

@@ -6,11 +6,6 @@ zsh-completions ![GitHub release](https://img.shields.io/github/release/zsh-user
*This projects aims at gathering/developing new completion scripts that are not available in Zsh yet. The scripts may be contributed to the Zsh project when stable enough.*
## Status
See [issues](https://github.com/zsh-users/zsh-completions/issues) for details on each completion definition.
## Usage
### Using packages
@@ -20,11 +15,14 @@ See [issues](https://github.com/zsh-users/zsh-completions/issues) for details on
| Debian / Ubuntu | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
| Fedora / CentOS / RHEL / Scientific Linux | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
| OpenSUSE / SLE | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
| Arch Linux | [zsh-completions](https://www.archlinux.org/packages/zsh-completions), [zsh-completions-git](https://aur.archlinux.org/packages/zsh-completions-git) |
| Gentoo | [app-shells/zsh-completions](http://packages.gentoo.org/package/app-shells/zsh-completions) |
| NixOS | [zsh-completions](https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/zsh-completions/default.nix) |
| Void Linux | [zsh-completions](https://github.com/voidlinux/void-packages/tree/master/srcpkgs/zsh-completions) |
| Mac OS | [homebrew](https://github.com/Homebrew/homebrew-core/blob/master/Formula/zsh-completions.rb) |
| 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) |
| Mac OS | [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](ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/zsh-completions/README.html) |
### Using zsh frameworks
@@ -59,18 +57,9 @@ Add `antigen bundle zsh-users/zsh-completions` to your `~/.zshrc`.
### Contributing
Contributions are welcome, just make sure you follow the guidelines:
* Completions are not accepted when already available in zsh.
* Completions are not accepted when already available in their original project.
* Please do not just copy/paste someone else completion, ask before.
* Completions only partially implemented are not accepted.
* Please add a header containing authors, status and origin of the script and license header if you do not wish to use the Zsh license (example [here](src/_ack)).
* Please try to follow [Zsh completion style guide](https://github.com/zsh-users/zsh/blob/master/Etc/completion-style-guide).
* Please send one separate pull request per file.
* Send a pull request or ask for committer access.
Contributions are welcome, see [CONTRIBUTING](https://github.com/zsh-users/zsh-completions/blob/master/CONTRIBUTING.md).
## License
Completions use the Zsh license, unless explicitely mentionned in the file header.
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.

View File

@@ -38,30 +38,24 @@
#
# ------------------------------------------------------------------------------
_afew() {
_arguments -C \
'(- 1 *)'-h"[Show help and exit]" \
"(-c --classify -l --learn= -t --tag -u --update -U --update-reference -m --move-mails)"{-w,--watch}"[Continuously monitor the mailbox for new messages matching the given query]" \
"(-c --classify -l --learn= -u --update -U --update-reference -m --move-mails -w --watch)"{-t,--tag}"[Run the tag filters]" \
"(-c --classify -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-l,--learn=}"[Train category with the messages matching query]" \
"(-c --classify -l --learn= -t --tag -U --update-reference -m --move-mails -w --watch)"{-u,--update}"[Update the categories (requires no query)]" \
"(-c --classify -l --learn= -t --tag -u --update -m --move-mails -w --watch)"{-U,--update-reference}"[Update the reference category (takes quite some time) (requires no query)]" \
"(-l --learn= -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-c,--classify}"[Classify each message matching the iven query]" \
"(-c --classify -l --learn= -t --tag -u --update -U --update-reference -w --watch)"{-m,--move-mails}"[Move mail files between maildir folders]" \
"(-n --all)"{-a,--all}"[Operate on all email]" \
"(-a --new)"{-n,--new}"[Operate on all new email]" \
{-C,--notmuch-config=}"[Path to notmuch configuration file]:files:_files" \
{-e,--enable-filters=}"[Flter classes to use]:filters" \
{-d,--dry-run}"[Dont change the DB]" \
{-R,--reference-set-size=}"[Size of the reference set (default: 1000)]:size:" \
{-T,--reference-set-timeframe-days=}"[Do not use emails older than DAYS days (default: 30)]:days:" \
{--verbose,-v}"[Be more verbose]" \
'*:Query:' \
}
_afew
_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

View File

@@ -40,7 +40,7 @@
# ------------------------------------------------------------------------------
#
# Needs either ANSIBLE_HOSTS or /etc/ansible/hosts on linux
# (or /usr/local/etc/ansible/hosts on OSX)
# (or /usr/local/etc/ansible/hosts on macOS)
#
# Note 1: the following gist (https://gist.github.com/15ed54a438a36d67fd99.git)
# has some files to help improve the hostfile shell parsing
@@ -416,8 +416,8 @@ _modules=(
'os_user:Manage OpenStack Identity Users'
'os_user_group:Associate OpenStack Identity users and groups'
'os_volume:Create/Delete Cinder Volumes'
'osx_defaults:osx_defaults allows users to read, write, and delete Mac OS X user defaults from Ansible'
'osx_say:Makes an OSX computer to speak.'
'osx_defaults:osx_defaults allows users to read, write, and delete macOS user defaults from Ansible'
'osx_say:Makes a macOS computer speak.'
'ovirt:oVirt/RHEV platform management'
'package:Generic OS package manager'
'pacman:Manage packages with *pacman*'
@@ -643,7 +643,7 @@ _ansible ()
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C -W \
_arguments -s -C -W \
'1:pattern:->pattern'\
"(-a --args)"{-a,--args}"[ARGS module arguments]:arguments:(ARG)"\
'--ask-become-pass[ask for privilege escalation password]'\
@@ -658,14 +658,14 @@ _ansible ()
"(-C --check)"{-C,--check}"[don't make any changes]"\
"(-c --connection)"{-c,--connection}"[CONNECTION connection type to use (default=smart)]:connection type:(smart ssh local chroot)"\
"(-D --diff)"{-D,--diff}"[show differences when changing (small) files and templates]"\
"(-e --extra-vars)"{-e,--extra-vars}"[set additional variables as key=value or YAML/JSON]"\
"*"{-e,--extra-vars}"[set additional variables as key=value or YAML/JSON]"\
"(-f --forks)"{-f,--forks}"[FORKS number of parallel processes to use (default=5)]:forks:(5)"\
"(-h --help)"{-h,--help}"[help message]"\
"(-i --inventory-file)"{-i,--inventory-file}"[INVENTORY specify inventory host file]:inventory file:_files"\
"*"{-i,--inventory,--inventory-file}"[INVENTORY specify inventory host file]:inventory file:_files"\
"(-l --limit)"{-l,--limit}"[SUBSET further limit selected hosts to an additional pattern]:subset pattern:->pattern"\
'--list-hosts[outputs a list of matching hosts. Does not execute anything else]'\
"(-m --module-name)"{-m,--module-name}"[MODULE_NAME module name (default=command)]:module name:->module"\
"(-M --module-path)"{-M,--module-path}"[MODULE_PATH specify path to module library (default=None)]:module path:_files -/"\
"*"{-M,--module-path}"[MODULE_PATH specify path to module library (default=None)]:module path:_files -/"\
'--new-vault-password-file[new vault password file for rekey]:new vault password file:_files'\
"(-o --one-line)"{-o,--one-line}"[condense output]"\
'--output[output file name for encrypt or decrypt; use - for stdout]:output file:_files'\
@@ -683,8 +683,8 @@ _ansible ()
"(-T --timeout)"{-T,--timeout}"[TIMEOUT override the SSH timeout (s) (default=10)]:ssh timeout:(10)"\
"(-t --tree)"{-t,--tree}"[OUTPUT_DIRECTORY log output to this directory]:output directory:_files -/"\
"(-u --user)"{-u,--user}"[REMOTE_USER connect as this user (default=${USER})]:connect as user:(${USER})"\
"--vault-password-file[VAULT_PASSWORD_FILE vault password file]:vault password file:_files"\
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]"\
"*--vault-password-file[VAULT_PASSWORD_FILE vault password file]:vault password file:_files"\
"*"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]"\
"--version[show program's version number and exit]"\
case $state in

View File

@@ -84,7 +84,7 @@ _ansible-galaxy ()
_arguments \
"(-h --help)"{-h,--help}"[help message]" \
"(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \
"(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
"*"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \
"(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \
"--version[show program's version number and exit]" \

View File

@@ -40,7 +40,7 @@
# ------------------------------------------------------------------------------
#
# Needs either ANSIBLE_HOSTS or /etc/ansible/hosts on linux
# (or /usr/local/etc/ansible/hosts on OSX)
# (or /usr/local/etc/ansible/hosts on macOS)
#
# Note 1: the following gist (https://gist.github.com/15ed54a438a36d67fd99.git)
# has some files to help improve the hostfile shell parsing
@@ -126,8 +126,8 @@ _ansible-playbook ()
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C -W \
"1:playbook yml file:_files -g '*.yml|*.yaml'"\
_arguments -s -C -W \
"*:playbook yml file:_files -g '*.yml|*.yaml'"\
'--ask-become-pass[ask for privilege escalation password]'\
"(-k --ask-pass)"{-k,--ask-pass}"[ask for connection password]"\
'--ask-su-pass[ask for su password (deprecated, use become)]'\
@@ -139,23 +139,23 @@ _ansible-playbook ()
"(-C --check)"{-C,--check}"[don't make any changes]"\
"(-c --connection)"{-c,--connection}"[CONNECTION connection type to use (default=smart)]:connection type:(smart ssh local chroot)"\
"(-D --diff)"{-D,--diff}"[when changing (small files and templates, show the diff in those. Works great with --check)]"\
"(-e --extra-vars)"{-e,--extra-vars}"[EXTRA_VARS set additional variables as key=value or YAML/JSON]:extra vars:(EXTRA_VARS)"\
"*"{-e,--extra-vars}"[EXTRA_VARS set additional variables as key=value or YAML/JSON]:extra vars:(EXTRA_VARS)"\
'--flush-cache[clear the fact cache]'\
'--force-handlers[run handlers even if a task fails]'\
"(-f --forks)"{-f,--forks}"[FORKS number of parallel processes to use (default=5)]:forks:(5)"\
"(-h --help)"{-h,--help}"[help message]"\
"(-i --inventory-file)"{-i,--inventory-file}"[INVENTORY specify inventory host file]:inventory file:_files"\
"*"{-i,--inventory,--inventory-file}"[INVENTORY specify inventory host file]:inventory file:_files"\
"(-l --limit)"{-l,--limit}"[SUBSET further limit selected hosts to an additional pattern]:subset pattern:->pattern"\
'--list-hosts[outputs a list of matching hosts. Does not execute anything else]'\
'--list-tags[list all available tags]'\
'--list-tasks[list all tasks that would be executed]'\
"(-M --module-path)"{-M,--module-path}"[MODULE_PATH specify path to module library (default=None)]:module path:_files -/"\
"*"{-M,--module-path}"[MODULE_PATH specify path to module library (default=None)]:module path:_files -/"\
'--new-vault-password-file[new vault password file for rekey]:new vault password file:_files'\
'--output[output file name for encrypt or decrypt; use - for stdout]:output file:_files'\
'--private-key[PRIVATE_KEY_FILE use this file to authenticate the connection]:private key file:_files'\
'--scp-extra-args[specify extra arguments to pass to scp only]'\
'--sftp-extra-args[specify extra arguments to pass to sftp only]'\
"--skip-tags[SKIP_TAGS only run plays and tasks whose tags do not match these values]:skip tags:(SKIP_TAGS)"\
"*--skip-tags[SKIP_TAGS only run plays and tasks whose tags do not match these values]:skip tags:(SKIP_TAGS)"\
'--ssh-common-args[specify common arguments to pass to sftp/scp/ssh]'\
'--ssh-extra-args[specify extra arguments to pass to ssh only]'\
"--start-at-task[START_AT start the playbook at the task matching this name]:name:(TASK_NAME)"\
@@ -165,11 +165,11 @@ _ansible-playbook ()
"(-s --sudo)"{-s,--sudo}"[run operations with sudo (nopasswd) (deprecated, use become)]"\
"(-U --sudo-user)"{-U,--sudo-user}"[SUDO_USER desired sudo user (default=root) (deprecated, use become)]:su user:(root)"\
'--syntax-check[perform a syntax check on the playbook, but do not execute it]'\
"(-t --tags)"{-t,--tags}"[TAGS only run plays and tasks gagged with these values]:task tags:(TAGS)"\
"*"{-t,--tags}"[TAGS only run plays and tasks gagged with these values]:task tags:(TAGS)"\
"(-T --timeout)"{-T,--timeout}"[TIMEOUT override the SSH timeout (s) (default=10)]:ssh timeout:(10)"\
"(-u --user)"{-u,--user}"[REMOTE_USER connect as this user (default=${USER})]:connect as user:(${USER})"\
"--vault-password-file[VAULT_PASSWORD_FILE vault password file]:vault password file:_files"\
"(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]"\
"*--vault-password-file[VAULT_PASSWORD_FILE vault password file]:vault password file:_files"\
"*"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]"\
"--version[show program's version number and exit]"\
case $state in

View File

@@ -39,9 +39,9 @@
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line _packages _opts ret=1
local curcontext="$curcontext" state line _opts ret=1
_arguments -C -A "-v" -A "--version" \
_arguments -C \
'(- 1 *)'{-v,--version}'[display version information]' \
'1: :->cmds' \
'*:: :->args' && ret=0
@@ -49,35 +49,34 @@ _arguments -C -A "-v" -A "--version" \
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]"
"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[Makes various commands more forceful]' \
'(--json)--json[Output consumable JSON]' \
'(--log-level)--log-level[What level of logs to report]' \
'(--offline)--offline[Do not hit the network]' \
'(--quiet)--quiet[Only output important information]' \
'(--silent)--silent[Do not output anything, besides errors]' \
'(--verbose)--verbose[Makes output more verbose]' \
'(--allow-root)--allow-root[Allows running commands as root]' \
'(--version)--version[Output Bower version]' \
'(--no-color)--no-color[Disable colors]'
ret=0
'(--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
@@ -98,54 +97,46 @@ case $state in
'update' \
'uninstall' \
'unregister' \
'version'
ret=0
'version' && ret=0
;;
(home|info|init|link|lookup|prune|register|search|unregister)
_arguments \
'(--help)--help[Show help message]'
ret=0
'(--help)--help[show help message]' && ret=0
;;
install)
_arguments \
'(--force-latest)--force-latest[Force latest version on conflict]' \
'(--help)--help[Show help message]' \
'(--production)--production[Do not install project devDependencies]' \
'(--save)--save[Save installed packages into the project''s bower.json dependencies]' \
'(--save-dev)--save-dev[Save installed packages into the project''s bower.json devDependencies]'
ret=0
'(--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
'(--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
'(--help)--help[show help message]' \
'(-t --token)'{-t,--token}'[Pass GitHub auth token (will not prompt for username/password)]' && ret=0
;;
uninstall)
_arguments \
'(--help)--help[Show help message]' \
'(--save)--save[Save installed packages into th projects''s bower.json dependencies]' \
'(--save-dev)--save-dev[Save installed packages into th projects''s bower.json devDependencies]'
ret=0
'(--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[Do not install project devDependencies]'
ret=0
'(--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
'(--message)--message[custom git commit and tag message]' && ret=0
;;
exec)
_normal && ret=0
@@ -154,7 +145,7 @@ case $state in
_opts=( $(bower help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
_opts+=( $(bower help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
if [[ $_opts != "" ]]; then
_values 'options' $_opts && ret=0
_values 'option' $_opts && ret=0
fi
;;
esac

View File

@@ -28,7 +28,7 @@
# Description
# -----------
#
# Completion script for the OSX 'caffeinate' tool (man 8 caffeinate).
# Completion script for the macOS 'caffeinate' tool (man 8 caffeinate).
#
# -------------------------------------------------------------------------
# Authors

View File

@@ -0,0 +1,325 @@
#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 invokation: '
;;
*CCACHE_PREFIX_CPP*)
_alternative ':prefixes for preprocessor invokation: '
;;
*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 originial 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 originial 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 invokation'
'prefix_command_cpp:prefixes for preprocessor invokation'
'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 invokation: '
;;
*=prefix_command_cpp=)
_alternative ':prefixes for preprocessor invokation: '
;;
*=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 --print-config)'{-p,--print-config}'[print 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

View File

@@ -0,0 +1,211 @@
#compdef chromium
# Copyright 2018 CERN for the benefit of the LHCb Collaboration
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of CERN nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
_arguments \
"--user-data-dir=[Specify the directory that user data is kept in]:directory:_path_files -/" \
"--app=[Runs URL in app mode]:url:_urls" \
"--incognito[Open in incognito mode]" \
"--new-window[open in new window]" \
"(--no-proxy-server --proxy-auto-detect --proxy-pac-url --password-store)--proxy-server=[specify proxy server]:[<proxy-scheme>\://]<proxy-host>[\:<proxy-port>]:_chromium_proxyurls" \
"--no-proxy-server[Disables the proxy server]" \
"--proxy-auto-detect[Autodetect proxy configuration]" \
"--proxy-pac-url=[Specify proxy autoconfiguration URL]:proxy autoconfiguration url:_urls" \
"--password-store=[Set the password store to use]:password store: _wanted arguments expl 'wallet store' compadd -- basic gnome kwallet" \
"--version[print version]" \
"*:: :{ _alternative _urls _files }"
# excerpt from the chromium help message:
#
# Specify the HTTP/SOCKS4/SOCKS5 proxy server to use for requests. This overrides any environment variables or settings picked via the options dialog. An individual proxy server is specified
# using the format:
#
#
#
# Where <proxy-scheme> is the protocol of the proxy server, and is one of:
#
# "http", "socks", "socks4", "socks5".
#
# If the <proxy-scheme> is omitted, it defaults to "http". Also note that "socks" is equivalent to "socks5".
#
# Examples:
#
# --proxy-server="foopy:99"
# Use the HTTP proxy "foopy:99" to load all URLs.
#
# --proxy-server="socks://foobar:1080"
# Use the SOCKS v5 proxy "foobar:1080" to load all URLs.
#
# --proxy-server="socks4://foobar:1080"
# Use the SOCKS v4 proxy "foobar:1080" to load all URLs.
#
# --proxy-server="socks5://foobar:66"
# Use the SOCKS v5 proxy "foobar:66" to load all URLs.
#
# It is also possible to specify a separate proxy server for different URL types, by prefixing the proxy server specifier with a URL specifier:
#
# Example:
#
# --proxy-server="https=proxy1:80;http=socks4://baz:1080"
# Load https://* URLs using the HTTP proxy "proxy1:80". And load http://*
# URLs using the SOCKS v4 proxy "baz:1080".
#
_chromium_proxyurls () {
#TODO: semicolon separated urls not yet implemented
# mostly copied from _urls
local ipre scheme host user uhosts ret=1 expl match glob suf
local localhttp
zstyle -a ":completion:${curcontext}:urls" local localhttp
local localhttp_servername="$localhttp[1]"
local localhttp_documentroot="$localhttp[2]"
local localhttp_userdir="$localhttp[3]"
zstyle -a ":completion:${curcontext}:urls" urls urls
if [[ $#urls -gt 1 || ( $#urls -eq 1 && ! -d $urls[1] ) ]]
then
[[ $#urls -eq 1 && -f $urls[1] ]] && urls=($(< $urls[1]))
_wanted urls expl 'URL' compadd "$@" -a urls && return 0
urls=()
fi
urls="$urls[1]"
glob=(-g '*(^/)')
zparseopts -D -K -E 'g:=glob'
ipre="$IPREFIX"
if ! compset -P '(#b)([-+.a-z0-9]#):'
then
_tags -C argument prefixes
while _tags
do
while _next_label prefixes expl 'URL prefix' -S '' "$@"
do
compset -S '[^:/]*' && compstate[to_end]=''
compadd "$expl[@]" http:// socks:// socks4:// socks5:// && ret=0
done
(( ret )) || return 0
done
return 1
fi
scheme="$match[1]"
case "$scheme" in
(http(|s)|socks(|4|5)) if ! compset -P //
then
_wanted -C "$scheme" prefixes expl 'end of prefix' compadd -S '' "$@" //
return
fi ;;
(file) [[ -prefix //(127.0.0.1|localhost)/ ]] && compset -P '//(127.0.0.1|localhost)'
[[ -prefix /// ]] && compset -P //
if ! compset -P //
then
_tags -C file files
while _tags
do
while _next_label files expl 'local file'
do
if [[ -prefix / ]]
then
_path_files "$expl[@]" -S '' "${glob[@]}" && ret=0
_path_files "$expl[@]" -S/ -r '/' -/ && ret=0
elif [[ -z "$PREFIX" ]]
then
compadd -S '/' -r '/' "$expl[@]" "$@" - "${PWD%/}" && ret=0
fi
done
(( ret )) || return 0
done
return 1
fi ;;
esac
if ! compset -P '(#b)([^:/]#)([:/])'
then
uhosts=($urls/$scheme/$PREFIX*$SUFFIX(/:t))
_tags hosts
while _tags
do
while _next_label hosts expl host
do
compset -S '[:/]*' || suf="/"
(( $#uhosts )) || _hosts -S "$suf" -r '/:' "$expl[@]" && ret=0
[[ "$scheme" = http ]] && uhosts=($uhosts $localhttp_servername)
compadd -S "$suf" -r '/:' "$expl[@]" -a uhosts && ret=0
done
(( ret )) || return 0
done
return 1
fi
host="$match[1]"
[[ $match[2] = ':' ]] && ! compset -P '<->/' && _message -e ports 'port number' && return 0
_tags remote-files files || return 1
if [[ "$localhttp_servername" = "$host" ]]
then
if compset -P \~
then
if ! compset -P '(#b)([^/]#)/'
then
_users -S/ "$@"
return
fi
user="$match[1]"
while _tags
do
while _next_label files expl 'local file'
do
_path_files "$expl[@]" "$@" -W ~$user/$localhttp_userdir "${glob[@]}" && ret=0
_path_files -S/ -r '/' "$expl[@]" -W ~$user/$localhttp_userdir-/ && ret=0
done
(( ret )) || return 0
done
else
while _tags
do
while _next_label files expl 'local file'
do
_path_files "$expl[@]" "$@" -W $localhttp_documentroot "${glob[@]}" && ret=0
_path_files -S/ -r '/' "$expl[@]" -W $localhttp_documentroot -/ && ret=0
done
(( ret )) || return 0
done
fi
else
while _tags
do
(( $#urls )) && while _next_label files expl 'local file'
do
_path_files "$expl[@]" "$@" -W $urls/$scheme/$host "${glob[@]}" && ret=0
_path_files -S/ -r '/' "$expl[@]" -W $urls/$scheme/$host -/ && ret=0
done
[[ $scheme = (scp|sftp) ]] && _requested remote-files && _remote_files -h $host -- ssh && ret=0
(( ret )) || return 0
done
fi
return $ret
}

View File

@@ -1,6 +1,6 @@
#compdef cmake
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
# 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
@@ -35,7 +35,7 @@
# -------
#
# * Scott M. Kroll <skroll@gmail.com> (initial version)
# * Paul Seyfert <pseyfert@mathphys.fsk.uni-heidelberg.de> (handling of --build)
# * Paul Seyfert <pseyfert.mathphys@gmail.com> (handling of --build and updates)
#
# -------------------------------------------------------------------------
# Notes
@@ -78,9 +78,15 @@ local cmake_build_options;cmake_build_options=(
# ------------------------
# _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]
@@ -116,6 +122,10 @@ _cmake_targets() {
_describe 'build targets' targets
}
_cmake_suggest_builddirs() {
_alternative ':current directory:(.)' 'directory::_directories' && return 0
}
_cmake_on_build() {
local build_extras;build_extras=(
'--[Native build tool options]'
@@ -130,14 +140,14 @@ _cmake_on_build() {
(( i++ ))
done
inbuild=false
nativemode=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
nativemode=true
dashdashposition=$i
fi
done
# check if build mode has been left
@@ -149,18 +159,16 @@ _cmake_on_build() {
if [[ $words[(($i - 1))] == --config ]] ; then continue ; fi
outofbuild=true
done
if [ "$nativemode" = true ] ; then
_cmake_generator_options $words[(($buildat + 1))] && return 0
if (( $dashdashposition > 0 )) ; then
_cmake_generator_options $words[(($buildat + 1))] $dashdashposition && return 0
fi
if [ "$inbuild" = false ] ; then
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 [ $difference -eq 1 ] ; then
# directly after --build comes the build directory
_alternative ':current directory:(.)' 'directory::_directories' && return 0
elif [[ $words[(($CURRENT - 1))] == --target ]] ; then
# after --build <dir> --target, suggest targets
_cmake_targets $words[(($buildat + 1))] && return 0
@@ -291,6 +299,9 @@ _cmake_define_lang_property_names() {
"CMAKE_${cmake_lang}_FLAGS_RELEASE:${cmake_lang_desc} compiler flags for all Relase build"
"CMAKE_${cmake_lang}_FLAGS_MINSIZREL:${cmake_lang_desc} compiler flags for all MinSizRel build"
"CMAKE_${cmake_lang}_FLAGS_RELWITHDEBINFO:${cmake_lang_desc} compiler flags for all RelWithDebInfo build"
"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
@@ -302,12 +313,15 @@ _cmake_define_lang_property_names() {
(( $+functions[_cmake_define_common_property_names] )) ||
_cmake_define_common_property_names() {
local properties; properties=(
'CMAKE_MODULE_PATH:Search path for cmake modules'
'CMAKE_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'
)
_describe -t 'common-property-names' 'common property name' properties $@
@@ -322,12 +336,18 @@ _cmake_define_property_values() {
setopt localoptions extendedglob
case $@[-1] in
(CMAKE_BUILD_TYPE) _wanted build-types expl 'build type' _cmake_build_types && ret=0;;
(CMAKE_CXX_STANDARD) _wanted cxx-standards expl 'cxx standard' _cmake_cxx_standars && ret=0;;
(CMAKE_C_STANDARD) _wanted c-standards expl 'c standard' _cmake_c_standars && 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_INSTALL_PREFIX) _files -/ && ret=0;;
(CMAKE_EXPORT_COMPILE_COMMANDS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
(CMAKE_*_COMPILER) _wanted compilers expl 'compiler' _cmake_compilers && ret=0;;
(CMAKE_*_FLAGS(|_?*)) _message -e compiler-flags 'compiler flags' && ret=0;;
(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
@@ -348,6 +368,33 @@ _cmake_build_types() {
_values 'build type' ${build_types[@]}
}
# -------------------
# _cmake_c_standars
# -------------------
(( $+functions[_cmake_c_standars] )) ||
_cmake_c_standars() {
local c_standards; c_standards=(
'90'
'99'
'11'
)
_values 'c standard' ${c_standards[@]}
}
# -------------------
# _cmake_cxx_standars
# -------------------
(( $+functions[_cmake_cxx_standars] )) ||
_cmake_cxx_standars() {
local cxx_standards; cxx_standards=(
'98'
'11'
'14'
'17'
)
_values 'cxx standard' ${cxx_standards[@]}
}
# -----------------
# _cmake_generators
# -----------------
@@ -405,7 +452,7 @@ _cmake_command() {
}
local cmake_suggest_build;cmake_suggest_build=(
'--build[build]'
'--build[build]:build dir:_cmake_suggest_builddirs'
)
if [ $CURRENT -eq 2 ] ; then

View File

@@ -0,0 +1,626 @@
#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_conanfile_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 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_conanfile'
}
(( $+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_directory_or_package_references] )) ||
_conan_conanfile_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

View File

@@ -0,0 +1,53 @@
#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 "$@"

View File

@@ -0,0 +1,442 @@
#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
;;
(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
;;
(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
;;
esac
;;
esac
return ret
}
(( $+functions[root_commands] )) ||
_root_commands() {
local commands;
commands=(
"analyze:Analyze the project's Dart code."
'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.'
'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.')
_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 "$@"

View File

@@ -92,15 +92,15 @@ _ghc_compiler ()
'-c[Stop after generating object files]' \
'-eventlog[Enable runtime event tracing]' \
'-debug[Use the debugging runtime]' \
"-dylib-install-name[On Darwin/OS X only, set the install name]" \
"-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/OS X/iOS only, add dir to the list of directories searched for frameworks]' \
'-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/OS X/iOS only, generate a standalone static 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)]' \

View File

@@ -40,24 +40,36 @@
_glances() {
_arguments \
"-b[Display network rate in Byte per second]" \
"-B[Bind server to the given IP or host NAME]:host:_hosts" \
"-c[Connect to a Glances server]:host:_hosts" \
"-C[Path to the configuration file]:configuration path:_files -/" \
"-d[Disable disk I/O module]" \
"-e[Enable the sensors module (Linux-only)]" \
"-f[Set the output folder (HTML) or file (CSV)]:output path:_files -/" \
"-h[Display the syntax and exit]" \
"-m[Disable mount module]" \
"-n[Disable network module]" \
"-o[Define additional output (available: HTML or CSV)]:output type:(HTML CSV)" \
"-p[Define the client or server TCP port (default: 61209)]:port:_ports" \
"-P[Client/server password]:password:" \
"-s[Run Glances in server mode]" \
"-t[Set the refresh time in seconds (default: 3)]:seconds:" \
"-v[Display the version and exit]" \
"-z[Do not use the bold color attribute]" \
_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 "$@"
_glances "$@"

View File

@@ -1,554 +0,0 @@
#compdef go
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
# Copyright (c) 2013-2015 Robby Russell and contributors (see
# https://github.com/robbyrussell/oh-my-zsh/contributors)
# Copyright (c) 2010-2014 Go authors
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for go 1.5 (http://golang.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mikkel Oscar Lyderik <mikkeloscar@gmail.com>
# * oh-my-zsh authors:
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/golang/golang.plugin.zsh
# * Go authors
#
# ------------------------------------------------------------------------------
typeset -A opt_args
_go() {
local -a commands build_flags
commands=(
'build:compile packages and dependencies'
'clean:remove object files'
'doc:show documentation for package or symbol'
'env:print Go environment information'
'fix:run go tool fix on packages'
'fmt:run gofmt on package sources'
'generate:generate Go files by processing source'
'get:download and install packages and dependencies'
'install:compile and install packages and dependencies'
'list:list packages'
'run:compile and run Go program'
'test:test packages'
'tool:run specified go tool'
'version:print Go version'
'vet:run go tool vet on packages'
'help:get more information about a command'
)
_arguments \
"1: :{_describe 'command' commands}" \
'*:: :->args'
case $state in
args)
build_flags=(
'-a[force rebuilding of packages that are already up-to-date]'
'-n[print the commands but do not run them]'
'-p[number of builds that can be run in parallel]:number'
'-race[enable data race detection]'
'-v[print the names of packages as they are compiled]'
'-work[print temporary work directory and keep it]'
'-x[print the commands]'
'-asmflags[arguments for each go tool asm invocation]:flags'
'-buildmode[build mode to use]:mode'
'-compiler[name of compiler to use]:name'
'-gccgoflags[arguments for gccgo]:args'
'-gcflags[arguments for each go tool compile invocation]:args'
'-installsuffix[suffix to add to package directory]:suffix'
'-ldflags[arguments to pass on each go tool link invocation.]:flags'
'-linkshared[link against shared libraries]'
'-pkgdir[install and load all packages from dir]:dir'
'-tags[list of build tags to consider satisfied]:tags'
'-toolexec[program to use to invoke toolchain programs]:args'
)
__go_packages() {
local gopaths
declare -a gopaths
gopaths=("${(s/:/)$(go env GOPATH)}")
gopaths+=("$(go env GOROOT)")
for p in $gopaths; do
_path_files -W "$p/src" -/
done
}
case $words[1] in
build)
_arguments \
'-o[force build to write to named output file]:file:_files' \
'-i[installs the packages that are dependencies of the target]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
clean)
_arguments \
'-i[remove corresponding installed archive or binary]' \
'-r[apply clean recursively on all dependencies]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
doc)
_arguments \
'-c[respect case when matching symbols]' \
'-cmd[treat a command (package main) like a regular package]' \
'-u[show docs for unexported and exported symbols and methods]'
;;
fix)
_arguments '*:importpaths:__go_packages'
;;
fmt)
_arguments \
'-n[prints commands that would be executed]' \
'-x[prints commands as they are executed]' \
'*:importpaths:__go_packages'
;;
generate)
_arguments \
'-run=[specifies a regular expression to select directives]:regex' \
'-x[print the commands]' \
'-n[print the commands but do not run them]' \
'-v[print the names of packages as they are compiled]' \
"*:args:{ _alternative ':importpaths:__go_packages' _files }"
;;
get)
_arguments \
'-d[instructs get to stop after downloading the packages]' \
'-f[force get -u not to verify that each package has been checked from vcs]' \
'-fix[run the fix tool on the downloaded packages]' \
'-insecure[permit fetching/resolving custom domains]' \
'-t[also download the packages required to build tests]' \
'-u[use the network to update the named packages]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
install)
_arguments ${build_flags[@]} \
'*:importpaths:__go_packages'
;;
list)
_arguments \
'-e[changes the handling of erroneous packages]' \
'-f[specifies an alternate format for the list]:format' \
'-json[causes package data to be printed in JSON format]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
run)
_arguments \
${build_flags[@]} \
'-exec[invoke the binary using xprog]:xporg' \
'*:file:_files -g "*.go(-.)"'
;;
test)
_arguments \
"-c[compile but don't run test]" \
'-i[install dependencies of the test]' \
'-bench[run benchmarks matching the regular expression]:regexp' \
'-benchmem[print memory allocation statistics for benchmarks]' \
'-benchtime[run benchmarks for t rime]:t' \
'-blockprofile[write a goroutine blocking profile to the specified file]:block' \
'-blockprofilerate[control goroutine blocking profiles]:n' \
'-count[run each test and benchmark n times]:n' \
'-cover[enable coverage analysis]' \
'-covermode[set the mode for coverage analysis]:mode:(set count atomic)' \
'-coverpkg[apply coverage analysis in each test of listed packages]:list' \
'-coverprofile[write a coverage profile to file]:cover' \
'-cpu[specify a list of GOMAXPROCS values]:cpus' \
'-cpuprofile[write a CPU profile to the specified file]:profile' \
'-memprofile[write a memory profile to file]:mem' \
'-memprofilerate[enable more precise memory profiles]:n' \
'-outputdir[place output files from profiling in output dir]:dir' \
'-parallel[allow parallel execution of test functions]:n' \
'-run[run tests and examples matching the regular expression]:regexp' \
'-short[tell long-running tests to shorten their run time]' \
'-timeout[timeout long running tests]:t' \
'-trace[write an execution trace to the specified file]:trace' \
'-v[verbose output]' \
${build_flags[@]} \
'-exec[run test binary using xprog]:xprog' \
'-o[compile test binary to named file]:file:_files' \
'*:importpaths:__go_packages'
;;
tool)
local -a tools
tools=($(go tool))
_arguments \
'-n[print command that would be executed]' \
"1: :{_describe 'tool' tools}" \
'*:: :->args'
case $state in
args)
case $words[1] in
addr2line)
_files
;;
asm)
_arguments \
'-D[predefined symbol with optional simple value]:value' \
'-I[include directory]:value' \
'-S[print assembly and machine code]' \
'-debug[dump instructions as they are parsed]' \
'-dynlink[support references to Go symbols]' \
'-o[output file]:string' \
'-shared[generate code that can be linked into a shared lib]' \
'-trimpath[remove prefix from recorded source file paths]:string'
;;
callgraph)
local -a algos graphs
algos=(
'static:static calls only'
'cha:Class Hierarchy Analysis'
'rta:Rapid Type Analysis'
'pta:inclusion-based Points-To Analysis'
)
graphs=(
'digraph:output in digraph format'
'graphviz:output in AT&T GraphViz (.dot) format'
)
_arguments \
'-algo=[call-graph construction algorithm]:algos:{ _describe "algos" algos }' \
"-test[include the package's tests in the analysis]" \
'-format=[format in which each call graph edge is displayed]:graphs:{ _describe "graphs" graphs }'
;;
cgo)
_arguments \
'-debug-define[print relevant #defines]' \
'-debug-gcc[print gcc invocations]' \
'-dynimport[if non-empty, print dynamic import data]:string' \
'-dynlinker[record dynamic linker information]' \
'-dynout[write -dynimport output to file]:file' \
'-dynpackage[set Go package for -dynimport output]:string' \
'-exportheader[where to write export header]:string' \
'-gccgo[generate files for use with gccgo]' \
'-gccgopkgpath[-fgo-pkgpath option used with gccgo]:string' \
'-gccgoprefix[-fgo-prefix option used with gccgo]:string' \
'-godefs[write Go definitions for C file to stdout]' \
'-import_runtime_cgo[import runtime/cgo in generated code]' \
'-import_syscall[import syscall in generated code]' \
'-importpath[import path of package being built]:path' \
'-objdir[object directory]:dir'
;;
compile)
_arguments \
'-%[debug non-static initializers]' \
'-+[compiling runtime]' \
"-A[for bootstrapping, allow 'any' type]" \
'-B[disable bounds checking]' \
'-D[set relative path for local imports]:path' \
'-E[debug symbol export]' \
'-I[add directory to import search path]:directory' \
'-K[debug missing line numbers]' \
'-L[use full (long) path in error messages]' \
'-M[debug move generation]' \
'-N[disable optimizations]' \
'-P[debug peephole optimizer]' \
'-R[debug register optimizer]' \
'-S[print assembly listing]' \
'-V[print compiler version]' \
'-W[debug parse tree after type checking]' \
'-asmhdr[write assembly header to file]:file' \
'-buildid[record id as the build id in the export metadata]:id' \
'-complete[compiling complete package (no C or assembly)]' \
'-cpuprofile[write cpu profile to file]:file' \
'-d[print debug information about items in list]:list' \
'-dynlink[support references to Go symbols]' \
'-e[no limit on number of errors reported]' \
'-f[debug stack frames]' \
'-g[debug code generation]' \
'-h[halt on error]' \
'-i[debug line number stack]' \
'-importmap[add definition of the form source=actual to import map]:definition' \
'-installsuffix[set pkg directory suffix]:suffix' \
'-j[debug runtime-initialized variables]' \
'-l[disable inlining]' \
'-largemodel[generate code that assumes a large memory model]' \
'-live[debug liveness analysis]' \
'-m[print optimization decisions]' \
'-memprofile[write memory profile to file]:file' \
'-memprofilerate[set runtime.MemProfileRate to rate]:rate' \
'-nolocalimports[reject local (relative) imports]' \
'-o[write output to file]:file' \
'-p[set expected package import path]:path' \
'-pack[write package file instead of object file]' \
'-r[debug generated wrappers]' \
'-race[enable race detector]' \
'-s[warn about composite literals that can be simplified]' \
'-shared[generate code that can be linked into a shared library]' \
'-trimpath[remove prefix from recorded source file paths]:prefix' \
'-u[reject unsafe code]' \
'-v[increase debug verbosity]' \
'-w[debug type checking]' \
'-wb[enable write barrier (default 1)]' \
'-x[debug lexer]' \
'-y[debug declarations in canned imports (with -d)]' \
'*:file:_files -g "*.go(-.)"'
;;
cover)
if (( CURRENT == 2 )); then
_arguments \
'-func=[output coverage profile information for each function]:string' \
'-html=[generate HTML representation of coverage profile]:file:_files' \
'-mode=[coverage mode]:mode:(set count atomic)'
return
fi
_arguments \
'-o[file for output]:file' \
'-var=[name of coverage variable to generate]:var' \
'*:file:_files -g "*.go(-.)"'
;;
doc)
_arguments \
'-c[respect case when matching symbols]' \
'-cmd[treat a command (package main) like a regular package]' \
'-u[show docs for unexported and exported symbols and methods]' \
;;
fix)
_arguments \
'-diff[display diffs instead of rewriting files]' \
'-force[force fixes to run even if the code looks updated]:string' \
'-r[restrict the rewrites]:string' \
'*:files:_files'
;;
link)
_arguments \
'-B[add an ELF NT_GNU_BUILD_ID note when using ELF]:note' \
'-C[check Go calls to C code]' \
'-D[set data segment address (default -1)]:address' \
'-E[set entry symbol name]:entry' \
'-H[set header type]:type' \
'-I[use linker as ELF dynamic linker]:linker' \
'-L[add specified directory to library path]:directory' \
'-R[set address rounding quantum (default -1)]:quantum' \
'-T[set text segment address (default -1)]:address' \
'-V[print version and exit]' \
'-W[disassemble input]' \
'-X[add string value definition]:definition' \
'-a[disassemble output]' \
'-buildid[record id as Go toolchain build id]:id' \
'-buildmode[set build mode]:mode' \
'-c[dump call graph]' \
'-cpuprofile[write cpu profile to file]:file' \
'-d[disable dynamic executable]' \
'-extld[use linker when linking in external mode]:linker' \
'-extldflags[pass flags to external linker]:flags' \
'-f[ignore version mismatch]' \
'-g[disable go package data checks]' \
'-h[halt on error]' \
'-installsuffix[set package directory suffix]:suffix' \
'-k[set field tracking symbol]:symbol' \
'-linkmode[set link mode]:mode:(internal external auto)' \
'-linkshared[link against installed Go shared libraries]' \
'-memprofile[write memory profile to file]:file' \
'-memprofilerate[set runtime.MemProfileRate to rate]:rate' \
'-n[dump symbol table]' \
'-o[write output to file]:file' \
'-r[set the ELF dynamic linker search path to dir1:dir2:...]:path' \
'-race[enable race detector]' \
'-s[disable symbol table]' \
'-shared[generate shared object (implies -linkmode external)]' \
'-tmpdir[use directory for temporary files]:directory' \
'-u[reject unsafe packages]' \
'-v[print link trace]' \
'-w[disable DWARF generation]' \
'*:files:_files'
;;
objdump)
_arguments \
'-s[only dump symbols matching this regexp]:regexp' \
'*:files:_files'
;;
pack)
_arguments '1:ops:(c p r t x)' '::verbose:(v)' ':files:_files'
;;
pprof)
_arguments \
'-callgrind[outputs a graph in callgrind format]' \
'-disasm=[output annotated assembly]:p' \
'-dot[outputs a graph in DOT format]' \
'-eog[visualize graph through eog]' \
'-evince[visualize graph through evince]' \
'-gif[outputs a graph image in GIF format]' \
'-gv[visualize graph through gv]' \
'-list=[output annotated source for functions matching regexp]:p' \
'-pdf[outputs a graph in PDF format]' \
'-peek=[output callers/callees of functions matching regexp]:p' \
'-png[outputs a graph image in PNG format]' \
'-proto[outputs the profile in compressed protobuf format]' \
'-ps[outputs a graph in PS format]' \
'-raw[outputs a text representation of the raw profile]' \
'-svg[outputs a graph in SVG format]' \
'-tags[outputs all tags in the profile]' \
'-text[outputs top entries in text form]' \
'-top[outputs top entries in text form]' \
'-tree[outputs a text rendering of call graph]' \
'-web[visualize graph through web browser]' \
'-weblist=[output annotated source in HTML]:p' \
'-output=[generate output on file f (stdout by default)]:f' \
'-functions[report at function level (default)]' \
'-files[report at source file level]' \
'-lines[report at source line level]' \
'-addresses[report at address level]' \
'-base[show delta from this profile]:profile' \
'-drop_negative[ignore negative differences]' \
'-cum[sort by cumulative data]' \
'-seconds=[length of time for dynamic profiles]:n' \
'-nodecount=[max number of nodes to show]:n' \
'-nodefraction=[hide nodes below <f>*total]:f' \
'-edgefraction=[hide edges below <f>*total]:f' \
'-sample_index[index of sample value to display]' \
'-mean[average sample value over first value]' \
'-inuse_space[display in-use memory size]' \
'-inuse_objects[display in-use object counts]' \
'-alloc_space[display allocated memory size]' \
'-alloc_objects[display allocated object counts]' \
'-total_delay[display total delay at each region]' \
'-contentions[display number of delays at each region]' \
'-mean_delay[display mean delay at each region]' \
'-runtime[show runtime call frames in memory profiles]' \
'-focus=[restricts to paths going through a node matching regexp]:r' \
'-ignore=[skips paths going through any nodes matching regexp]:r' \
'-tagfocus=[restrict to samples tagged with key:value matching regexp]:r' \
'-tagignore=[discard samples tagged with key:value matching regexp]' \
'-call_tree[generate a context-sensitive call tree]' \
'-unit=[convert all samples to unit u for display]:u' \
'-divide_by=[scale all samples by dividing them by f]:f' \
'-buildid=[override build id for main binary in profile]:id' \
'-tools=[search path for object-level tools]:path' \
'-help[help message]' \
'*:files:_files'
;;
trace)
_arguments \
'-http=[HTTP service address]:addr' \
'*:files:_files'
;;
vet)
_arguments \
'-all[check everything]' \
'-asmdecl[check assembly against Go declarations]' \
'-assign[check for useless assignments]' \
'-atomic[check for common mistaken usages of the sync/atomic]' \
'-bool[check for mistakes involving boolean operators]' \
'-buildtags[check that +build tags are valid]' \
'-composites[check that composite literals used field-keyed elements]' \
'-compositewhitelist[use composite white list]' \
'-copylocks[check that locks are not passed by value]' \
'-methods[check that canonically named methods are canonically defined]' \
'-nilfunc[check for comparisons between functions and nil]' \
'-printf[check printf-like invocations]' \
'-printfuncs[print function names to check]:string' \
'-rangeloops[check that range loop variables are used correctly]' \
'-shadow[check for shadowed variables]' \
'-shadowstrict[whether to be strict about shadowing]' \
'-shift[check for useless shifts]' \
'-structtags[check that struct field tags have canonical format]' \
'-tags[list of build tags to apply when parsing]:list' \
'-test[for testing only: sets -all and -shadow]' \
'-unreachable[check for unreachable code]' \
'-unsafeptr[check for misuse of unsafe.Pointer]' \
'-unusedfuncs[list of functions whose results must be used]:string' \
'-unusedresult[check for unused result of calls to functions in -unusedfuncs]' \
'-unusedstringmethods[list of methods whose results must be used]:string' \
'-v[verbose]' \
'*:files:_files'
;;
yacc)
_arguments \
'-o[output]:output' \
'-v[parsetable]:parsetable' \
'*:files:_files'
;;
esac
;;
esac
;;
vet)
_arguments \
'-n[print commands that would be executed]' \
'-x[prints commands as they are executed]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
help)
local -a topics
topics=(
'c:calling between Go and C'
'buildmode:description of build modes'
'filetype:file types'
'gopath:GOPATH environment variable'
'environment:environment variables'
'importpath:import path syntax'
'packages:description of package lists'
'testflag:description of testing flags'
'testfunc:description of testing functions'
)
_arguments "1: :{_describe 'command' commands -- topics}"
;;
esac
;;
esac
}
_go

View File

@@ -0,0 +1,646 @@
#compdef go
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
# Copyright (c) 2013-2015 Robby Russell and contributors (see
# https://github.com/robbyrussell/oh-my-zsh/contributors)
# Copyright (c) 2010-2014 Go authors
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for go 1.11 (http://golang.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mikkel Oscar Lyderik Larsen <mikkeloscar@gmail.com>
# * oh-my-zsh authors:
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/golang/golang.plugin.zsh
# * Go authors
#
# ------------------------------------------------------------------------------
typeset -A opt_args
__go_buildmodes() {
local -a buildmodes
buildmodes=(
'archive[non-main packages into .a files]'
'c-archive[main package, plus all packages it imports, into a C archive file]'
'c-shared[main package, plus all packages it imports, into a C shared library]'
'default[main packages are built into executables and listed non-main packages are built into .a files]'
'shared[non-main packages into a single shared library that will be used when building with the -linkshared option]'
'exe[main packages into executables]'
'pie[main packages and everything they import into position independent executables (PIE)]'
'plugin[main packages, plus all packages that they import, into a Go plugin]'
)
_values 'mode' $buildmodes
}
local -a commands build_flags
commands=(
'bug:start a bug report'
'build:compile packages and dependencies'
'clean:remove object files and cached files'
'doc:show documentation for package or symbol'
'env:print Go environment information'
'fix:update packages to use new APIs'
'fmt:gofmt (reformat) package sources'
'generate:generate Go files by processing source'
'get:download and install packages and dependencies'
'install:compile and install packages and dependencies'
'list:list packages or modules'
'mod:module maintenance'
'run:compile and run Go program'
'test:test packages'
'tool:run specified go tool'
'version :print Go version'
'vet:report likely mistakes in packages'
'help:get more information about a command'
)
_arguments \
"1: :{_describe 'command' commands}" \
'*:: :->args'
case $state in
args)
build_flags=(
'-a[force rebuilding of packages that are already up-to-date]'
'-n[print the commands but do not run them]'
'-p[number of builds that can be run in parallel]:number'
'-race[enable data race detection]'
'-v[print the names of packages as they are compiled]'
'-work[print temporary work directory and keep it]'
'-x[print the commands]'
'-asmflags[arguments for each go tool asm invocation]:flags'
'-buildmode[build mode to use]:mode:__go_buildmodes'
'-compiler[name of compiler to use]:name'
'-gccgoflags[arguments for gccgo]:args'
'-gcflags[arguments for each go tool compile invocation]:args'
'-installsuffix[suffix to add to package directory]:suffix'
'-ldflags[arguments to pass on each go tool link invocation.]:flags'
'-linkshared[link against shared libraries]'
'-pkgdir[install and load all packages from dir]:dir'
'-tags[list of build tags to consider satisfied]:tags'
'-toolexec[program to use to invoke toolchain programs]:args'
)
__go_packages() {
local gopaths
declare -a gopaths
gopaths=("${(s/:/)$(go env GOPATH)}")
gopaths+=("$(go env GOROOT)")
for p in $gopaths; do
_path_files -W "$p/src" -/
done
}
case $words[1] in
build)
_arguments \
'-o[force build to write to named output file]:file:_files' \
'-i[installs the packages that are dependencies of the target]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
clean)
_arguments \
'-i[remove corresponding installed archive or binary]' \
'-r[apply clean recursively on all dependencies]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
doc)
_arguments \
'-c[respect case when matching symbols]' \
'-cmd[treat a command (package main) like a regular package]' \
'-u[show docs for unexported and exported symbols and methods]'
;;
fix)
_arguments '*:importpaths:__go_packages'
;;
fmt)
_arguments \
'-n[prints commands that would be executed]' \
'-x[prints commands as they are executed]' \
'*:importpaths:__go_packages'
;;
generate)
_arguments \
'-run=[specifies a regular expression to select directives]:regex' \
'-x[print the commands]' \
'-n[print the commands but do not run them]' \
'-v[print the names of packages as they are compiled]' \
"*:args:{ _alternative ':importpaths:__go_packages' _files }"
;;
get)
_arguments \
'-d[instructs get to stop after downloading the packages]' \
'-f[force get -u not to verify that each package has been checked from vcs]' \
'-fix[run the fix tool on the downloaded packages]' \
'-insecure[permit fetching/resolving custom domains]' \
'-t[also download the packages required to build tests]' \
'-u[use the network to update the named packages]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
install)
_arguments ${build_flags[@]} \
'*:importpaths:__go_packages'
;;
list)
_arguments \
'-e[changes the handling of erroneous packages]' \
'-f[specifies an alternate format for the list]:format' \
'-json[causes package data to be printed in JSON format]' \
'-compiled[set CompiledGoFiles to the Go source files presented to the compiler]' \
'-deps[iterate over named packages and their dependencies]' \
'-m[list modules instead of packages]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
mod)
local -a mod_commands
mod_commands=(
'download:download modules to local cache'
'edit:edit go.mod from tools or scripts'
'graph:print module requirement graph'
'init:initialize new module in current directory'
'tidy:add missing and remove unused modules'
'vendor:make vendored copy of dependencies'
'verify:verify dependencies have expected content'
'why:explain why packages or modules are needed'
'help:get more information about a command'
)
_arguments \
"1: :{_describe 'command' mod_commands}" \
'*:: :->args'
case $state in
args)
case $words[1] in
download)
_arguments \
'-json[print a sequance of JSON objects to standard output]'
;;
edit)
_arguments \
'-fmt[reformats the go.mod file without making other changes]' \
"-module[change the module's path]" \
'*-require=[add a requirement on the given module path and version]:require' \
'*-droprequire=[drop a requirement on the given module path and version]:droprequire' \
'*-exclude=[add an exclusion for the given module path and version]:exclude' \
'*-dropexclude=[drop an exclusion for the given module path and version]:dropexclude' \
'*-replace=[add a replacement of the given module path and version]:replace' \
'*-dropreplace=[drop a replacement of the given module path and version]:dropreplace' \
'-json[prints the final go.mod file in JSON format]' \
'-print[prints the final go.mod in its text format]' \
':go.mod:_path_files -g "go.mod"'
;;
graph)
;;
init)
# Use go packages as module name suggestion
_arguments \
'*:module:__go_packages'
;;
tidy)
_arguments \
'-v[print information about removed modules to standard error]'
;;
vendor)
_arguments \
'-v[print the names of vendored modules and packages to standard error]'
;;
verify)
;;
why)
_arguments \
'-m[treats the arguments as a list of modules]' \
'-vendor[exclude tests of dependencies]' \
'*:module:__go_packages'
;;
esac
;;
esac
;;
run)
_arguments \
${build_flags[@]} \
'-exec[invoke the binary using xprog]:xporg' \
'*:file:_files -g "*.go(-.)"'
;;
test)
_arguments \
"-c[compile but don't run test]" \
'-i[install dependencies of the test]' \
'-bench[run benchmarks matching the regular expression]:regexp' \
'-benchmem[print memory allocation statistics for benchmarks]' \
'-benchtime[run benchmarks for t rime]:t' \
'-blockprofile[write a goroutine blocking profile to the specified file]:block' \
'-blockprofilerate[control goroutine blocking profiles]:n' \
'-count[run each test and benchmark n times]:n' \
'-cover[enable coverage analysis]' \
'-covermode[set the mode for coverage analysis]:mode:(set count atomic)' \
'-coverpkg[apply coverage analysis in each test of listed packages]:list' \
'-coverprofile[write a coverage profile to file]:cover' \
'-cpu[specify a list of GOMAXPROCS values]:cpus' \
'-cpuprofile[write a CPU profile to the specified file]:profile' \
'-memprofile[write a memory profile to file]:mem' \
'-memprofilerate[enable more precise memory profiles]:n' \
'-outputdir[place output files from profiling in output dir]:dir' \
'-parallel[allow parallel execution of test functions]:n' \
'-run[run tests and examples matching the regular expression]:regexp' \
'-short[tell long-running tests to shorten their run time]' \
'-timeout[timeout long running tests]:t' \
'-trace[write an execution trace to the specified file]:trace' \
'-v[verbose output]' \
${build_flags[@]} \
'-exec[run test binary using xprog]:xprog' \
'-o[compile test binary to named file]:file:_files' \
'*:importpaths:__go_packages'
;;
tool)
local -a tools
tools=($(go tool))
_arguments \
'-n[print command that would be executed]' \
"1: :{_describe 'tool' tools}" \
'*:: :->args'
case $state in
args)
case $words[1] in
addr2line)
_files
;;
asm)
_arguments \
'-D[predefined symbol with optional simple value]:value' \
'-I[include directory]:value' \
'-S[print assembly and machine code]' \
'-debug[dump instructions as they are parsed]' \
'-dynlink[support references to Go symbols]' \
'-o[output file]:string' \
'-shared[generate code that can be linked into a shared lib]' \
'-trimpath[remove prefix from recorded source file paths]:string'
;;
callgraph)
local -a algos graphs
algos=(
'static:static calls only'
'cha:Class Hierarchy Analysis'
'rta:Rapid Type Analysis'
'pta:inclusion-based Points-To Analysis'
)
graphs=(
'digraph:output in digraph format'
'graphviz:output in AT&T GraphViz (.dot) format'
)
_arguments \
'-algo=[call-graph construction algorithm]:algos:{ _describe "algos" algos }' \
"-test[include the package's tests in the analysis]" \
'-format=[format in which each call graph edge is displayed]:graphs:{ _describe "graphs" graphs }'
;;
cgo)
_arguments \
'-debug-define[print relevant #defines]' \
'-debug-gcc[print gcc invocations]' \
'-dynimport[if non-empty, print dynamic import data]:string' \
'-dynlinker[record dynamic linker information]' \
'-dynout[write -dynimport output to file]:file' \
'-dynpackage[set Go package for -dynimport output]:string' \
'-exportheader[where to write export header]:string' \
'-gccgo[generate files for use with gccgo]' \
'-gccgopkgpath[-fgo-pkgpath option used with gccgo]:string' \
'-gccgoprefix[-fgo-prefix option used with gccgo]:string' \
'-godefs[write Go definitions for C file to stdout]' \
'-import_runtime_cgo[import runtime/cgo in generated code]' \
'-import_syscall[import syscall in generated code]' \
'-importpath[import path of package being built]:path' \
'-objdir[object directory]:dir'
;;
compile)
_arguments \
'-%[debug non-static initializers]' \
'-+[compiling runtime]' \
"-A[for bootstrapping, allow 'any' type]" \
'-B[disable bounds checking]' \
'-D[set relative path for local imports]:path' \
'-E[debug symbol export]' \
'-I[add directory to import search path]:directory' \
'-K[debug missing line numbers]' \
'-L[use full (long) path in error messages]' \
'-M[debug move generation]' \
'-N[disable optimizations]' \
'-P[debug peephole optimizer]' \
'-R[debug register optimizer]' \
'-S[print assembly listing]' \
'-V[print compiler version]' \
'-W[debug parse tree after type checking]' \
'-asmhdr[write assembly header to file]:file' \
'-buildid[record id as the build id in the export metadata]:id' \
'-complete[compiling complete package (no C or assembly)]' \
'-cpuprofile[write cpu profile to file]:file' \
'-d[print debug information about items in list]:list' \
'-dynlink[support references to Go symbols]' \
'-e[no limit on number of errors reported]' \
'-f[debug stack frames]' \
'-g[debug code generation]' \
'-h[halt on error]' \
'-i[debug line number stack]' \
'-importmap[add definition of the form source=actual to import map]:definition' \
'-installsuffix[set pkg directory suffix]:suffix' \
'-j[debug runtime-initialized variables]' \
'-l[disable inlining]' \
'-largemodel[generate code that assumes a large memory model]' \
'-live[debug liveness analysis]' \
'-m[print optimization decisions]' \
'-memprofile[write memory profile to file]:file' \
'-memprofilerate[set runtime.MemProfileRate to rate]:rate' \
'-nolocalimports[reject local (relative) imports]' \
'-o[write output to file]:file' \
'-p[set expected package import path]:path' \
'-pack[write package file instead of object file]' \
'-r[debug generated wrappers]' \
'-race[enable race detector]' \
'-s[warn about composite literals that can be simplified]' \
'-shared[generate code that can be linked into a shared library]' \
'-trimpath[remove prefix from recorded source file paths]:prefix' \
'-u[reject unsafe code]' \
'-v[increase debug verbosity]' \
'-w[debug type checking]' \
'-wb[enable write barrier (default 1)]' \
'-x[debug lexer]' \
'-y[debug declarations in canned imports (with -d)]' \
'*:file:_files -g "*.go(-.)"'
;;
cover)
if (( CURRENT == 2 )); then
_arguments \
'-func=[output coverage profile information for each function]:string' \
'-html=[generate HTML representation of coverage profile]:file:_files' \
'-mode=[coverage mode]:mode:(set count atomic)'
return
fi
_arguments \
'-o[file for output]:file' \
'-var=[name of coverage variable to generate]:var' \
'*:file:_files -g "*.go(-.)"'
;;
doc)
_arguments \
'-c[respect case when matching symbols]' \
'-cmd[treat a command (package main) like a regular package]' \
'-u[show docs for unexported and exported symbols and methods]' \
;;
fix)
_arguments \
'-diff[display diffs instead of rewriting files]' \
'-force[force fixes to run even if the code looks updated]:string' \
'-r[restrict the rewrites]:string' \
'*:files:_files'
;;
link)
_arguments \
'-B[add an ELF NT_GNU_BUILD_ID note when using ELF]:note' \
'-C[check Go calls to C code]' \
'-D[set data segment address (default -1)]:address' \
'-E[set entry symbol name]:entry' \
'-H[set header type]:type' \
'-I[use linker as ELF dynamic linker]:linker' \
'-L[add specified directory to library path]:directory' \
'-R[set address rounding quantum (default -1)]:quantum' \
'-T[set text segment address (default -1)]:address' \
'-V[print version and exit]' \
'-W[disassemble input]' \
'-X[add string value definition]:definition' \
'-a[disassemble output]' \
'-buildid[record id as Go toolchain build id]:id' \
'-buildmode[set build mode]:mode' \
'-c[dump call graph]' \
'-cpuprofile[write cpu profile to file]:file' \
'-d[disable dynamic executable]' \
'-extld[use linker when linking in external mode]:linker' \
'-extldflags[pass flags to external linker]:flags' \
'-f[ignore version mismatch]' \
'-g[disable go package data checks]' \
'-h[halt on error]' \
'-installsuffix[set package directory suffix]:suffix' \
'-k[set field tracking symbol]:symbol' \
'-linkmode[set link mode]:mode:(internal external auto)' \
'-linkshared[link against installed Go shared libraries]' \
'-memprofile[write memory profile to file]:file' \
'-memprofilerate[set runtime.MemProfileRate to rate]:rate' \
'-n[dump symbol table]' \
'-o[write output to file]:file' \
'-r[set the ELF dynamic linker search path to dir1:dir2:...]:path' \
'-race[enable race detector]' \
'-s[disable symbol table]' \
'-shared[generate shared object (implies -linkmode external)]' \
'-tmpdir[use directory for temporary files]:directory' \
'-u[reject unsafe packages]' \
'-v[print link trace]' \
'-w[disable DWARF generation]' \
'*:files:_files'
;;
objdump)
_arguments \
'-s[only dump symbols matching this regexp]:regexp' \
'*:files:_files'
;;
pack)
_arguments '1:ops:(c p r t x)' '::verbose:(v)' ':files:_files'
;;
pprof)
_arguments \
'-callgrind[outputs a graph in callgrind format]' \
'-disasm=[output annotated assembly]:p' \
'-dot[outputs a graph in DOT format]' \
'-eog[visualize graph through eog]' \
'-evince[visualize graph through evince]' \
'-gif[outputs a graph image in GIF format]' \
'-gv[visualize graph through gv]' \
'-list=[output annotated source for functions matching regexp]:p' \
'-pdf[outputs a graph in PDF format]' \
'-peek=[output callers/callees of functions matching regexp]:p' \
'-png[outputs a graph image in PNG format]' \
'-proto[outputs the profile in compressed protobuf format]' \
'-ps[outputs a graph in PS format]' \
'-raw[outputs a text representation of the raw profile]' \
'-svg[outputs a graph in SVG format]' \
'-tags[outputs all tags in the profile]' \
'-text[outputs top entries in text form]' \
'-top[outputs top entries in text form]' \
'-tree[outputs a text rendering of call graph]' \
'-web[visualize graph through web browser]' \
'-weblist=[output annotated source in HTML]:p' \
'-output=[generate output on file f (stdout by default)]:f' \
'-functions[report at function level (default)]' \
'-files[report at source file level]' \
'-lines[report at source line level]' \
'-addresses[report at address level]' \
'-base[show delta from this profile]:profile' \
'-drop_negative[ignore negative differences]' \
'-cum[sort by cumulative data]' \
'-seconds=[length of time for dynamic profiles]:n' \
'-nodecount=[max number of nodes to show]:n' \
'-nodefraction=[hide nodes below <f>*total]:f' \
'-edgefraction=[hide edges below <f>*total]:f' \
'-sample_index[index of sample value to display]' \
'-mean[average sample value over first value]' \
'-inuse_space[display in-use memory size]' \
'-inuse_objects[display in-use object counts]' \
'-alloc_space[display allocated memory size]' \
'-alloc_objects[display allocated object counts]' \
'-total_delay[display total delay at each region]' \
'-contentions[display number of delays at each region]' \
'-mean_delay[display mean delay at each region]' \
'-runtime[show runtime call frames in memory profiles]' \
'-focus=[restricts to paths going through a node matching regexp]:r' \
'-ignore=[skips paths going through any nodes matching regexp]:r' \
'-tagfocus=[restrict to samples tagged with key:value matching regexp]:r' \
'-tagignore=[discard samples tagged with key:value matching regexp]' \
'-call_tree[generate a context-sensitive call tree]' \
'-unit=[convert all samples to unit u for display]:u' \
'-divide_by=[scale all samples by dividing them by f]:f' \
'-buildid=[override build id for main binary in profile]:id' \
'-tools=[search path for object-level tools]:path' \
'-help[help message]' \
'*:files:_files'
;;
trace)
_arguments \
'-http=[HTTP service address]:addr' \
'*:files:_files'
;;
vet)
_arguments \
'-all[check everything]' \
'-asmdecl[check assembly against Go declarations]' \
'-assign[check for useless assignments]' \
'-atomic[check for common mistaken usages of the sync/atomic]' \
'-bool[check for mistakes involving boolean operators]' \
'-buildtags[check that +build tags are valid]' \
'-composites[check that composite literals used field-keyed elements]' \
'-compositewhitelist[use composite white list]' \
'-copylocks[check that locks are not passed by value]' \
'-methods[check that canonically named methods are canonically defined]' \
'-nilfunc[check for comparisons between functions and nil]' \
'-printf[check printf-like invocations]' \
'-printfuncs[print function names to check]:string' \
'-rangeloops[check that range loop variables are used correctly]' \
'-shadow[check for shadowed variables]' \
'-shadowstrict[whether to be strict about shadowing]' \
'-shift[check for useless shifts]' \
'-structtags[check that struct field tags have canonical format]' \
'-tags[list of build tags to apply when parsing]:list' \
'-test[for testing only: sets -all and -shadow]' \
'-unreachable[check for unreachable code]' \
'-unsafeptr[check for misuse of unsafe.Pointer]' \
'-unusedfuncs[list of functions whose results must be used]:string' \
'-unusedresult[check for unused result of calls to functions in -unusedfuncs]' \
'-unusedstringmethods[list of methods whose results must be used]:string' \
'-v[verbose]' \
'*:files:_files'
;;
yacc)
_arguments \
'-o[output]:output' \
'-v[parsetable]:parsetable' \
'*:files:_files'
;;
esac
;;
esac
;;
vet)
_arguments \
'-n[print commands that would be executed]' \
'-x[prints commands as they are executed]' \
${build_flags[@]} \
'*:importpaths:__go_packages'
;;
help)
local -a topics
topics=(
'buildmode:build modes'
'c:calling between Go and C'
'cache:build and test caching'
'environment:environment variables'
'filetype:file types'
'go.mod:the go.mod file'
'gopath:GOPATH environment variable'
'gopath-get:legacy GOPATH go get'
'goproxy:module proxy protocol'
'importpath:import path syntax'
'modules:modules, module versions, and more'
'module-get:module-aware go get'
'packages:package lists and patterns'
'testflag:testing flags'
'testfunc:testing functions'
)
_arguments "1: :{_describe 'command' commands -- topics}"
;;
esac
;;
esac

View File

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

View File

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

View File

@@ -42,8 +42,10 @@
# ------------------------------------------------------------------------------
_kak_sessions() {
session_ids=($(_call_program session_ids kak -l))
_values "${session_ids[@]}"
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() {

View File

@@ -1,6 +1,6 @@
#compdef node
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# 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
@@ -28,7 +28,7 @@
# Description
# -----------
#
# Completion script for Node.js v0.8.4 (http://nodejs.org)
# Completion script for Node.js v10.4.1 (https://nodejs.org)
#
# ------------------------------------------------------------------------------
# Authors
@@ -36,24 +36,64 @@
#
# * Mario Fernandez (https://github.com/sirech)
# * Nicholas Penree (https://github.com/drudge)
# * Masafumi Koba (https://github.com/ybiquitous)
#
# ------------------------------------------------------------------------------
_node_files() {
_files -g "*.(js|mjs)"
}
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments -C \
'(- 1 *)--help[print options help]' \
'(- 1 *)'{-v,--version}'[print node version]' \
'(--no-deprecation)--no-deprecation[silence deprecation warnings]' \
'(--trace-deprecation)--trace-deprecation[show stack traces on deprecations]' \
'-[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]' \
'--experimental-modules[experimental ES Module support and caching modules]' \
'--experimental-repl-await[experimental await keyword support in REPL]' \
'--experimental-vm-modules[experimental ES Module support in vm module]' \
'--icu-data-dir=[set ICU data load path to dir (overrides NODE_ICU_DATA) note: linked-in ICU data is present]: :_directories' \
'--inspect-brk=-[activate inspector on host:port and break at start of user script]:[host\:]port' \
'--inspect-port=[set host:port for inspector]:[host\:]port' \
'--inspect=-[activate inspector on host:port (default: 127.0.0.1:9229)]:[host\:]port' \
'--napi-modules[load N-API modules (no-op - option kept for compatibility)]' \
'--no-deprecation[silence deprecation warnings]' \
'--no-force-async-hooks-checks[disable checks for async_hooks]' \
'--no-warnings[silence all process warnings]' \
'--openssl-config=[load OpenSSL configuration from the specified file (overrides OPENSSL_CONF)]:file:_files' \
'--pending-deprecation[emit pending deprecation warnings]' \
'--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' \
'--throw-deprecation[throw an exception on deprecations]' \
'--tls-cipher-list=[use an alternative default TLS cipher list]:cipher list string' \
'--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-events-enabled[track trace events]' \
'--trace-sync-io[show stack trace when use of sync IO is detected after the first tick]' \
'--trace-warnings[show stack traces on process warnings]' \
'--track-heap-objects[track heap object allocations for heap snapshots]' \
'--use-bundled-ca[use bundled CA store (default)]' \
"--use-openssl-ca[use OpenSSL's default CA store]" \
'(- 1 *)--v8-options[print v8 command line options]' \
'(--max-stack-size)--max-stack-size=[set max v8 stack size (bytes)]' \
'(-e --eval)'{-e,--eval}'[evaluate script]:Inline Script' \
'(-i --interactive)'{-i,--interactive}'[always enter the REPL even if stdin does not appear to be a terminal]' \
'(-p --print)'{-p,--print}'[print result of --eval]' \
'(--vars)--vars[print various compiled-in variables]' \
'*:JS Script:_files -g "*.js"' && ret=0
"--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_files' && ret=0
_values 'commands' \
'inspect[enable inspector for debugging]' && ret=0
return ret

View File

@@ -1,58 +0,0 @@
#compdef paste
#
# ------------------------------------------------------------------------------
# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for paste (from util-linux 2.27.1->)
# (https://git.kernel.org/cgit/utils/util-linux/util-linux.git/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ole Jørgen Brønner <olejorgenb@yahoo.no>
#
# ------------------------------------------------------------------------------
#
# Note: paste has upstream bash completion
# Note: Credit to https://github.com/RobSis/zsh-completion-generator which was
# used to generate most of the script.
local arguments
arguments=(
'*'{-d,--delimiters}'[reuse characters from LIST instead of TABs]:delimiters'
'(-s --serial)'{-s,--serial}'[paste one file at a time instead of in parallel]'
'(-z --zero-terminated)'{-z,--zero-terminated}'[line delimiter is NUL, not newline]'
'--help[display this help and exit]'
'--version[output version information and exit]'
'*:filename:_files'
)
_arguments -s $arguments

View File

@@ -303,7 +303,8 @@ _pg_restore () {
--no-security-labels'[do not restore security labels]' \
--no-tablespaces'[do not restore tablespace assignments]' \
--section=':dump named section:_values "section" pre-data data post-data' \
--use-set-session-authorization'[use SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownership]'
--use-set-session-authorization'[use SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownership]' \
"1: :_files"
}
_pg_dumpall () {

View File

@@ -119,7 +119,7 @@ _port() {
)
pseudo_common=(all current active inactive actinact installed uninstalled outdated
obsolete requested unrequested leaves)
obsolete requested unrequested leaves rleaves)
pseudo_advanced=('variants:' 'variant:' 'description:' 'depends:'
'depends_lib:' 'depends_run:' 'depends_build:' 'depends_fetch:' 'depends_extract:'
@@ -127,6 +127,7 @@ _port() {
'maintainers:' 'maintainer:' 'categories:' 'category:' 'version:' 'revision:' 'license:')
select_options=(
'--summary:Display sumamry of selected options'
'--list:List available versions for the group'
'--set:Select the given version for the group'
'--show:Show which version is currently selected for the group (default if none given)'
@@ -157,7 +158,7 @@ _port() {
'-F[Read and process the file of commands specified by the argument.]' \
'-p[Despite any errors encountered, proceed to process multiple ports and commands.]' \
'-y[Perform a dry run.]' \
'-t[Enable trace mode debug facilities on platforms that support it (Mac OS X).]' \
'-t[Enable trace mode debug facilities on platforms that support it (macOS).]' \
"1:Port actions:(($actions))" \
'::Per-action arguments:_port_dispatch' \
&& return 0

View File

@@ -1,119 +0,0 @@
#compdef rclone
# ------------------------------------------------------------------------------
# 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 rclone (http://rclone.org/).
#
# ------------------------------------------------------------------------------
# Author(s)
# -------
#
# * Rajat Roy <i3wm.debian@gmail.com>
#
# ------------------------------------------------------------------------------
_rclone() {
local state
_arguments \
'1: :->subcommand' \
'--bwlimit' \
'--checkers' \
'(-c --checksum)'{-c,--checksum}'[check the file hash and size to determine if files are equal]' \
'--config' \
'--contimeout' \
'--dedupe-mode' \
'(-n --dry-run)'{-n,--dry-run}'[Do a trial run with no permanent changes]' \
'--ignore-existing' \
'--ignore-size' \
'(-I --ignore-times)'{-I,--ignore-times}'[unconditionally upload all files regardless of the state of files on the destination]' \
'--log-file' \
'--low-level-retries' \
'--max-depth' \
'--modify-window' \
'--no-gzip-encoding' \
'--no-update-modtime' \
'(-q --quiet)'{-q,--quiet}'[as little output as possible]' \
'--retries' \
'--size-only' \
'--stats' \
'--delete-' \
'--timeout' \
'--transfers' \
'(-u --update)'{-u,--update}'[skip any files which exist on the destination and have a modified time that is newer than the source file]' \
'(-v --verbose)'{-v,--verbose}'[tells you about every file it considers and transfers]' \
'--delete-excluded' \
'--filter' \
'--filter-from' \
'-exclude' \
'--exclude-from' \
'--include' \
'--include-from' \
'--files-from' \
'--min-size' \
'--max-size' \
'--min-age' \
'--max-age' \
'--dump-filters' \
'*:files:_files'
case $state in
subcommand)
_arguments '1: :(
config
copy
sync
move
delete
purge
mkdir
rmdir
check
ls
lsd
lsl
md5sum
sha1sum
size
version
cleanup
dedupe
authorize
cat
genautocomplete
gendocs
listremotes
mount
--help)'
;;
esac
}
_rclone "$@"

View File

@@ -48,6 +48,9 @@ _rspec() {
'*'{-O,--options}'[Specify the path to a custom options file]:PATH:_files' \
--order'[Run examples by the specified order type]: :->order' \
--seed'[Equivalent of --order rand:SEED]: :_guard "[[\:digit\:]]#" "SEED"' \
--bisect'[Repeatedly runs the suite in order to isolate the failures to the smallest reproducible case]' \
--only-failures'[Filter to just the examples that failed the last time they ran]' \
'(-n --next-failure)'{-n,--next-failure}'[Apply `--only-failures` and abort after one failure (equivalent to `--only-failures --fail-fast --order defined`)]' \
--fail-fast'[Abort the run on first failure]' \
--no-fail-fast'[Do not abort the run on first failure]' \
--failure-exit-code'[Override the exit code used when there are failing specs]: :_guard "[[\:digit\:]]#" "CODE"' \
@@ -58,8 +61,10 @@ _rspec() {
'(-o --out)'{-o,--out}'[Write output to a file instead of $stdout]:FILE:_files' \
--deprecation-out'[Write deprecation warnings to a file instead of $stderr]:FILE:_files' \
'(-b --backtrace)'{-b,--backtrace}'[Enable full backtrace]' \
'(-c --color)'{-c,--color}'[Enable color in the output]' \
--force-color'[Force the output to be in color, even if the output is not a TTY]' \
--no-color'[Force the output to not be in color, even if the output is a TTY]' \
'(-p --profile)'{-p,--profile}'[Enable profiling of examples and list the slowest examples (default: 10)]: :_guard "[[\:digit\:]]#" "COUNT"' \
--no-profile'[Disable profiling of examples]' \
'(-w --warnings)'{-w,--warnings}'[Enable ruby warnings]' \
'(-P --pattern)'{-P,--pattern}'[Load files matching pattern (default: "spec/**/*_spec.rb")]:PATTERN:' \
--exclude-pattern'[Load files except those matching pattern]:PATTERN:' \

View File

@@ -1,81 +0,0 @@
#compdef scl
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Software Collections (https://www.softwarecollections.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
_scl() {
local context curcontext="$curcontext" state line
typeset -A opt_args
local ret=1
_arguments -C \
'1: :_scl_cmds' \
"(- : *)"{-h,--help}'[display help information]' \
"(- : *)"{-l,--list}'[list installed Software Collections or packages that belong to them]:installed collection:_scl_installed_collections' \
'*::arg:->args' \
&& ret=0
case $state in
(args)
curcontext="${curcontext%:*:*}:scl-cmd-$words[1]:"
case $line[1] in
(register)
_arguments '1:Software Collection path:_files -/' && ret=0
;;
(deregister)
_arguments -C \
'1:: :_scl_installed_collections' \
'--force[force suppression of the collection]' \
&& ret=0
;;
(enable)
_arguments -C \
'1:: :_scl_installed_collections' \
'2:command: _command_names -e' \
&& ret=0
;;
*)
_call_function ret _scl_cmd_$words[1] && ret=0
(( ret )) && _message 'no more arguments'
;;
esac
;;
esac
}
(( $+functions[_scl_cmds] )) ||
_scl_cmds() {
local commands; commands=(
'register:register a Software Collection'
'deregister:deregister a Software Collection'
'enable:enable a Software Collection'
)
_describe -t commands 'scl command' commands "$@"
}
(( $+functions[_scl_installed_collections] )) ||
_scl_installed_collections() {
local installed_collections; installed_collections=($(_call_program installed_collections $service --list))
_describe -t collections 'Software Collection' installed_collections "$@"
}
_scl "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -0,0 +1,72 @@
#compdef scons
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for SCons 2.5.1 (http://scons.org/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Oliver Kiddle <okiddle@yahoo.co.uk>
#
# ------------------------------------------------------------------------------
_arguments -s -S \
'(-c --clean --remove)-'{c,-clean,-remove}'[remove specified targets and dependencies]' \
'(-C --directory)-'{C,-directory=}'[change to specified directory first]:directory:_directories' \
'--cache-debug=[print CacheDir debug info to file]:file:_files' \
'(--cache-disable --no-cache)--'{cache-disable,no-cache}"[don't retrieve built targets from cache]" \
'(--cache-force --cache-populate)--'{cache-force,cache-populate}'[copy already-built targets into cache]' \
"--cache-readonly[don't update CacheDir with built targets]" \
'--cache-show[print build actions for files from cache]' \
'--config=[set Configure mode]:mode:(auto force cache)' \
'(-u --up --search-up -U)-D[search up for SConstruct; build default targets]' \
'--debug=[print debugging information]:type:(
count duplicate explain findlibs includes memoizer memory objects pdb prepare presub stacktrace time)' \
'--diskcheck=[enable specific on-disk checks]:check:(all none match rcs sccs)' \
'--duplicate=[set preferred file duplication methods]:file duplication methods:(
hard-soft-copy soft-hard-copy hard-copy soft-copy copy)' \
'(-f --file --makefile --sconstruct)-'{f,-file=,-makefile=,-sconstruct=}'[specify SConstruct file]:file:_files' \
'(-)-'{h,-help}'[display defined usage information]' \
'(-)-'{H,-help-options}'[display usage information]' \
'(-i -ignore-errors)-'{i,-ignore-errors}'[ignore errors from build actions]' \
\*{-I,--include-dir=}'[add directory to search Python modules]:directories:_directories' \
'(--implicit-deps-changed --implicit-deps-unchanged)--implicit-cache[cache scanned dependencies]' \
'(--implicit-cache --implicit-deps-changed)--implicit-deps-changed[rescan dependencies]' \
'(--implicit-cache --implicit-deps-unchanged)--implicit-deps-unchanged[ignore changes to scanned dependencies]' \
'--interactive[start interactive mode]' \
'(-j --jobs)-'{j,jobs=}'[specify no of jobs to run in parallel]' \
'(-k --keep-going)-'{k,-keep-going}'[continue after an error]' \
'--max-drift=[set the maximum clock drift]:drift (seconds)' \
'--md5-chunksize=[set chunksize for MD5 signature computation]:size (kB)' \
'(-n --just-print --dry-run --recon)-'{n,-just-print,-dry-run,-recon}"[print commands but don't run them]" \
"--no-site-dir[don't use the usual site_scons directory]" \
'--profile=[profile scons]:output file:_files' \
'(-q --question)-'{q,question}'[query whether up-to-date]' \
'-Q[suppress progress messages]' \
'--random[build dependencies in random order]' \
'(-s --silent --quiet)-'{s,-silent,-quiet}"[don't print commands]" \
'--site-dir=[specify site_scons directory]:directory:_directories' \
'--stack-size[set stacksize of threads]:size (kB)' \
'--taskmastertrace=[trace node evaluation to file]:file' \
'--tree=[print dependency tree]:format:(all derived prune status)' \
'(-u --up --search-up -D -U)-'{u,-up,-search-up}'[search up for SConstruct; build current directory]' \
'(-u --up --search-up -D)-U[search up for SConstruct; build Default targets]' \
'(-)-'{v,-version}'[print version information]' \
\*{--warn=,--warning=}'[enable or disable warnings]:type:(
all cache-write-error corrupt-sconsign dependency deprecated
deprecated-copy deprecated-source-signatures deprecated-target-signatures
duplicate-environment fortran-cxx-mix link misleading-keywords
missing-sconscript no-md5-module no-metaclass-support no-object-count
no-parallel-support python-version reserved-variable stack-size no-all
no-cache-write-error no-corrupt-sconsign no-dependency no-deprecated
no-deprecated-copy no-deprecated-source-signatures
no-deprecated-target-signatures no-duplicate-environment
no-fortran-cxx-mix no-link no-misleading-keywords no-missing-sconscript
no-no-md5-module no-no-metaclass-support no-no-object-count
no-no-parallel-support no-python-version no-reserved-variable
no-stack-size)' \
\*{-Y,--repository}'[search specified repository for files]:repository:_files' \
'*:target:_default' # Doesn't seem to be a simple way to get a list of targets

View File

@@ -0,0 +1,935 @@
#compdef sfdx
# DESCRIPTION: Zsh completion script for the Salesforce CLI
# AUTHOR: Wade Wegner (@WadeWegner)
# REPO: https://github.com/wadewegner/salesforce-cli-zsh-completion
# LICENSE: https://github.com/wadewegner/salesforce-cli-zsh-completion/blob/master/LICENSE
local -a _1st_arguments
_1st_arguments=(
"force\:alias\:list":"list username aliases for the Salesforce CLI"
"force\:alias\:set":"set username aliases for the Salesforce CLI"
"force\:apex\:class\:create":"create an Apex class"
"force\:apex\:execute":"execute anonymous Apex code"
"force\:apex\:log\:get":"fetch a debug log"
"force\:apex\:log\:list":"list debug logs"
"force\:apex\:test\:report":"display test results"
"force\:apex\:test\:run":"invoke Apex tests"
"force\:apex\:trigger\:create":"create an Apex trigger"
"force\:auth\:jwt\:grant":"authorize an org using the JWT flow"
"force\:auth\:sfdxurl\:store":"authorize an org using an SFDX auth URL"
"force\:auth\:web\:login":"authorize an org using the web login flow"
"force\:config\:get":"get config var values for given names"
"force\:config\:list":"list config vars for the Salesforce CLI"
"force\:config\:set":"set config vars for the Salesforce CLI"
"force\:data\:bulk\:delete":"bulk delete records from a csv file"
"force\:data\:bulk\:status":"view the status of a bulk data load job or batch"
"force\:data\:bulk\:upsert":"bulk upsert records from a CSV file"
"force\:data\:record\:create":"create a record"
"force\:data\:record\:delete":"delete a record"
"force\:data\:record\:get":"view a record"
"force\:data\:record\:update":"update a record"
"force\:data\:soql\:query":"execute a SOQL query"
"force\:data\:tree\:export":"export data from an org into sObject tree format for force:data:tree:import consumption"
"force\:data\:tree\:import":"import data into an org using SObject Tree Save API"
"force\:doc\:commands\:display":"display help for force commands"
"force\:doc\:commands\:list":"list the force commands"
"force\:lightning\:app\:create":"create a Lightning app"
"force\:lightning\:component\:create":"create a Lightning component"
"force\:lightning\:event\:create":"create a Lightning event"
"force\:lightning\:interface\:create":"create a Lightning interface"
"force\:lightning\:lint":"analyse (lint) Lightning component code"
"force\:lightning\:test\:create":"create a Lightning test"
"force\:lightning\:test\:install":"install Lightning Testing Service unmanaged package in your org"
"force\:lightning\:test\:run":"invoke Lightning component tests"
"force\:limits\:api\:display":"display current orgs limits"
"force\:mdapi\:convert":"convert Metadata API source into the Salesforce DX source format"
"force\:mdapi\:deploy":"deploy metadata to an org using Metadata API"
"force\:mdapi\:deploy\:report":"check the status of a metadata deployment"
"force\:mdapi\:retrieve":"retrieve metadata from an org using Metadata API"
"force\:mdapi\:retrieve\:report":"check the status of a metadata retrieval"
"force\:org\:create":"create a scratch org"
"force\:org\:delete":"mark a scratch org for deletion"
"force\:org\:display":"get org description"
"force\:org\:list":"list all orgs youve created or authenticated to"
"force\:org\:open":"open an org in your browser"
"force\:org\:shape\:create":"create a snapshot of org edition, features, and licenses"
"force\:org\:shape\:delete":"delete all org shapes for a target org"
"force\:org\:shape\:list":"list all org shapes youve created"
"force\:package1\:version\:create":"create a first-generation package version in the release org"
"force\:package1\:version\:create\:get":"retrieve the status of a package version creation request"
"force\:package1\:version\:display":"display details about a first-generation package version"
"force\:package1\:version\:list":"list package versions for the specified first-generation package or for the org"
"force\:package2\:create":"create a second-generation package"
"force\:package2\:list":"list all second-generation packages in the Dev Hub org"
"force\:package2\:update":"update a second-generation package"
"force\:package2\:version\:create":"create a second-generation package version"
"force\:package2\:version\:create\:get":"retrieve a package version creation request"
"force\:package2\:version\:create\:list":"list package version creation requests"
"force\:package2\:version\:get":"retrieve a package version in the Dev Hub org"
"force\:package2\:version\:list":"list all package versions in the Dev Hub org"
"force\:package2\:version\:update":"update a second-generation package version"
"force\:package\:install":"install a package in the target org"
"force\:package\:install\:get":"retrieve the status of a package installation request"
"force\:package\:installed\:list":"list the orgs installed packages"
"force\:package\:uninstall":"uninstall a second-generation package from the target org"
"force\:package\:uninstall\:get":"retrieve status of package uninstall request"
"force\:project\:create":"create a new SFDX project"
"force\:project\:upgrade":"update project config files to the latest format"
"force\:schema\:sobject\:describe":"describe an object"
"force\:schema\:sobject\:list":"list all objects of a specified category"
"force\:source\:convert":"convert Salesforce DX source into the Metadata API source format"
"force\:source\:open":"edit a Lightning Page with Lightning App Builder"
"force\:source\:pull":"pull source from the scratch org to the project"
"force\:source\:push":"push source to an org from the project"
"force\:source\:status":"list local changes and/or changes in a scratch org"
"force\:user\:create":"create a user for a scratch org"
"force\:user\:display":"displays information about a user of a scratch org"
"force\:user\:list":"lists all users of a scratch org"
"force\:user\:password\:generate":"generate a password for scratch org users"
"force\:user\:permset\:assign":"assign a permission set to one or more users of an org"
"force\:visualforce\:component\:create":"create a Visualforce component"
"force\:visualforce\:page\:create":"create a Visualforce page"
)
_arguments '*:: :->command'
if (( CURRENT == 1 )); then
_describe -t commands "sfdx command" _1st_arguments
return
fi
local -a _command_args
case "$words[1]" in
force:limits:api:display)
_command_args=(
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:lightning:app:create)
_command_args=(
'(-n|--appname)'{-n,--appname}'[name of the generated Lightning app]' \
'(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningApp*)]' \
'(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \
'(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \
'(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \
'(--json)--json[JSON output]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:data:bulk:delete)
_command_args=(
'(-s|--sobjecttype)'{-s,--sobjecttype}'[the sObject type of the records youre deleting]' \
'(-f|--csvfile)'{-f,--csvfile}'[the path to the CSV file containing the ids of the records to delete]:file:_files' \
'(-w|--wait)'{-w,--wait}'[the number of minutes to wait for the command to complete before displaying the results]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:data:bulk:status)
_command_args=(
'(-i|--jobid)'{-i,--jobid}'[the ID of the job you want to view or of the job whose batch you want to view]' \
'(-b|--batchid)'{-b,--batchid}'[the ID of the batch whose status you want to view]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:data:bulk:upsert)
_command_args=(
'(-s|--sobjecttype)'{-s,--sobjecttype}'[the sObject type of the records you want to upsert]' \
'(-f|--csvfile)'{-f,--csvfile}'[the path to the CSV file that defines the records to upsert]:file:_files' \
'(-i|--externalid)'{-i,--externalid}'[the column name of the external ID; if not provided, an arbitrary ID is used]' \
'(-w|--wait)'{-w,--wait}'[the number of minutes to wait for the command to complete before displaying the results]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:apex:class:create)
_command_args=(
'(-n|--classname)'{-n,--classname}'[name of the generated Apex class]' \
'(-t|--template)'{-t,--template}'[template to use for file creation (DefaultApexClass*,ApexException,ApexUnitTest,InboundEmailService)]' \
'(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \
'(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \
'(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \
'(--json)--json[JSON output]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:doc:commands:display)
_command_args=(
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:doc:commands:list)
_command_args=(
'(-u|--usage)'{-u,--usage}'[list only docopts usage strings]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:visualforce:component:create)
_command_args=(
'(-t|--template)'{-t,--template}'[template to use for file creation (DefaultVFComponent*)]' \
'(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \
'(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \
'(-n|--componentname)'{-n,--componentname}'[name of the generated Visualforce component]' \
'(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \
'(-l|--label)'{-l,--label}'[Visualforce component label]' \
'(--json)--json[JSON output]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:lightning:component:create)
_command_args=(
'(-n|--componentname)'{-n,--componentname}'[name of the generated Lightning component]' \
'(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningCmp*)]' \
'(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \
'(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \
'(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \
'(--json)--json[JSON output]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:mdapi:convert)
_command_args=(
'(-r|--rootdir)'{-r,--rootdir}'[the root directory containing the Metadata API source]:file:_files' \
'(-d|--outputdir)'{-d,--outputdir}'[the output directory to store the sfdx source]:file:_files' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:source:convert)
_command_args=(
'(-r|--rootdir)'{-r,--rootdir}'[the source directory for the source to be converted]:file:_files' \
'(-d|--outputdir)'{-d,--outputdir}'[the output directory to export the Metadata API source to]:file:_files' \
'(-n|--packagename)'{-n,--packagename}'[the name of the package to associate with the Metadata API source]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:org:create)
_command_args=(
'(-f|--definitionfile)'{-f,--definitionfile}'[path to a scratch org definition file]:file:_files' \
'(-j|--definitionjson)'{-j,--definitionjson}'[scratch org definition in json format ]' \
'(-n|--nonamespace)'{-n,--nonamespace}'[creates the scratch org with no namespace]' \
'(-c|--noancestors)'{-c,--noancestors}'[do not include second-generation package ancestors in the scratch org]' \
'(-i|--clientid)'{-i,--clientid}'[connected app consumer key]' \
'(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the created org as the default username]' \
'(-a|--setalias)'{-a,--setalias}'[set an alias for for the created scratch org]' \
'(-e|--env)'{-e,--env}'[environment where the scratch org is created: \[sandbox*,virtual,prototype\] (sandbox*,virtual,prototype)]' \
'(-w|--wait)'{-w,--wait}'[the streaming client socket timeout (in minutes) (default:6, min:2)]' \
'(-d|--durationdays)'{-d,--durationdays}'[duration of the scratch org (in days) (default:7, min:1, max:30)]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package2:create)
_command_args=(
'(-n|--name)'{-n,--name}'[package name]' \
'(-o|--containeroptions)'{-o,--containeroptions}'[\[*Managed | Unlocked | Locked\] container options for the package (Managed=DeveloperManagedSubscriberManaged, Unlocked=DeveloperControlledSubscriberEditable, Locked=DeveloperControlledSubscriberLocked)]' \
'(-d|--description)'{-d,--description}'[package description]' \
'(-e|--nonamespace)'{-e,--nonamespace}'[creates the package with no namespace; available only for developer-controlled packages.]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:user:create)
_command_args=(
'(-f|--definitionfile)'{-f,--definitionfile}'[file path to a user definition]:file:_files' \
'(-a|--setalias)'{-a,--setalias}'[set an alias for the created username to reference within the CLI]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:project:create)
_command_args=(
'(-n|--projectname)'{-n,--projectname}'[name of the generated project]' \
'(-t|--template)'{-t,--template}'[template to use for file creation (Defaultsfdx-project.json*)]' \
'(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \
'(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \
'(-l|--loginurl)'{-l,--loginurl}'[Salesforce instance login URL (https://login.salesforce.com*)]' \
'(-x|--sourceapiversion)'{-x,--sourceapiversion}'[source API version number (41.0*)]' \
'(-s|--namespace)'{-s,--namespace}'[project associated namespace]' \
'(-p|--defaultpackagedir)'{-p,--defaultpackagedir}'[default package directory name (force-app*)]:file:_files' \
'(--json)--json[JSON output]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:org:delete)
_command_args=(
'(-p|--noprompt)'{-p,--noprompt}'[no prompt to confirm deletion]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:mdapi:deploy)
_command_args=(
'(-c|--checkonly)'{-c,--checkonly}'[validate deploy but dont save to the org (default:false)]' \
'(-d|--deploydir)'{-d,--deploydir}'[root of directory tree of files to deploy]:file:_files' \
'(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 0)]' \
'(-i|--jobid)'{-i,--jobid}'[WARNING: The flag "jobid" has been deprecated and will be removed in v41.01.0 or later. Instead, use "sfdx force:mdapi:deploy:report -i <jobId>".]' \
'(-l|--testlevel)'{-l,--testlevel}'[deployment testing level (NoTestRun,RunSpecifiedTests,RunLocalTests,RunAllTestsInOrg)]' \
'(-r|--runtests)'{-r,--runtests}'[tests to run if --testlevel RunSpecifiedTests]' \
'(-e|--rollbackonerror)'{-e,--rollbackonerror}'[WARNING: The flag "rollbackonerror" has been deprecated and will be removed in v41.01.0 or later. Instead, use "ignoreerrors".]' \
'(-o|--ignoreerrors)'{-o,--ignoreerrors}'[ignore any errors and do not roll back deployment (default:false)]' \
'(-g|--ignorewarnings)'{-g,--ignorewarnings}'[whether a warning will allow a deployment to complete successfully (default:false)]' \
'(-f|--zipfile)'{-f,--zipfile}'[path to .zip file of metadata to deploy]:file:_files' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[verbose output of deploy results]' \
)
;;
force:mdapi:deploy:report)
_command_args=(
'(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 0)]' \
'(-i|--jobid)'{-i,--jobid}'[job ID of the deployment you want to check]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[verbose output of deploy results]' \
)
;;
force:org:display)
_command_args=(
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[emit additional command output to stdout]' \
)
;;
force:user:display)
_command_args=(
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:lightning:event:create)
_command_args=(
'(-n|--eventname)'{-n,--eventname}'[name of the generated Lightning event]' \
'(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningEvt*)]' \
'(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \
'(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \
'(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \
'(--json)--json[JSON output]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:apex:execute)
_command_args=(
'(-f|--apexcodefile)'{-f,--apexcodefile}'[path to a local file containing Apex code]:file:_files' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:config:get)
_command_args=(
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[emit additional command output to stdout]' \
)
;;
force:package:install)
_command_args=(
'(-i|--id)'{-i,--id}'[ID of the package version to install (starts with 04t)]' \
'(-w|--wait)'{-w,--wait}'[number of minutes to wait for installation status]' \
'(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (default: null)]' \
'(-p|--publishwait)'{-p,--publishwait}'[number of minutes to wait for subscriber package version ID to become available in the target org]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package:install:get)
_command_args=(
'(-i|--requestid)'{-i,--requestid}'[ID of the package install request you want to check]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package:installed:list)
_command_args=(
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:lightning:interface:create)
_command_args=(
'(-n|--interfacename)'{-n,--interfacename}'[name of the generated Lightning interface]' \
'(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningIntf*)]' \
'(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \
'(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \
'(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \
'(--json)--json[JSON output]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:auth:jwt:grant)
_command_args=(
'(-u|--username)'{-u,--username}'[authentication username]' \
'(-f|--jwtkeyfile)'{-f,--jwtkeyfile}'[path to a file containing the private key]:file:_files' \
'(-i|--clientid)'{-i,--clientid}'[OAuth client ID (sometimes called the consumer key)]' \
'(-r|--instanceurl)'{-r,--instanceurl}'[the login URL of the instance the org lives on]' \
'(-d|--setdefaultdevhubusername)'{-d,--setdefaultdevhubusername}'[set the authenticated org as the default dev hub org for scratch org creation]' \
'(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the authenticated org as the default username that all commands run against]' \
'(-a|--setalias)'{-a,--setalias}'[set an alias for the authenticated org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:lightning:lint)
_command_args=(
'(-i|--ignore)'{-i,--ignore}'[pattern used to ignore some folders]' \
'(--files)--files[pattern used to include specific files]:file:_files' \
'(-j|--json)'{-j,--json}'[format output as JSON]' \
'(--config)--config[path to a custom ESLint configuration file]:file:_files' \
'(--verbose)--verbose[report warnings in addition to errors]' \
'(--exit)--exit[exit with error code 1 if there are lint issues]' \
)
;;
force:alias:list)
_command_args=(
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:config:list)
_command_args=(
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:org:list)
_command_args=(
'(--all)--all[include expired, deleted, and unknown-status scratch orgs]' \
'(--clean)--clean[remove all local org authorizations for non-active orgs]' \
'(-p|--noprompt)'{-p,--noprompt}'[do not prompt for confirmation]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[list more information about each org]' \
)
;;
force:package2:list)
_command_args=(
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:user:list)
_command_args=(
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:apex:log:get)
_command_args=(
'(-i|--logid)'{-i,--logid}'[ID of the log to display]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:apex:log:list)
_command_args=(
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:org:open)
_command_args=(
'(-p|--path)'{-p,--path}'[navigation URL path]:file:_files' \
'(-r|--urlonly)'{-r,--urlonly}'[display navigation URL, but dont launch browser]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:source:open)
_command_args=(
'(-f|--sourcefile)'{-f,--sourcefile}'[file to edit]:file:_files' \
'(-r|--urlonly)'{-r,--urlonly}'[generate a navigation URL; dont launch the editor]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:visualforce:page:create)
_command_args=(
'(-t|--template)'{-t,--template}'[template to use for file creation (DefaultVFPage*)]' \
'(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \
'(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \
'(-n|--pagename)'{-n,--pagename}'[name of the generated Visualforce page]' \
'(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \
'(-l|--label)'{-l,--label}'[Visualforce page label]' \
'(--json)--json[JSON output]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:user:password:generate)
_command_args=(
'(-o|--onbehalfof)'{-o,--onbehalfof}'[comma-separated list of usernames for which to generate passwords]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:user:permset:assign)
_command_args=(
'(-n|--permsetname)'{-n,--permsetname}'[the name of the permission set to assign]' \
'(-o|--onbehalfof)'{-o,--onbehalfof}'[comma-separated list of usernames or aliases to assign the permission set to]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:source:pull)
_command_args=(
'(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 33) (default:33, min:1)]' \
'(-f|--forceoverwrite)'{-f,--forceoverwrite}'[ignore conflict warnings and overwrite changes to the project]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:source:push)
_command_args=(
'(-f|--forceoverwrite)'{-f,--forceoverwrite}'[ignore conflict warnings and overwrite changes to scratch org]' \
'(-g|--ignorewarnings)'{-g,--ignorewarnings}'[deploy changes even if warnings are generated]' \
'(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 33) (default:33, min:1)]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:data:record:create)
_command_args=(
'(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record youre creating]' \
'(-v|--values)'{-v,--values}'[the <fieldName>=<value> pairs youre creating]' \
'(-t|--usetoolingapi)'{-t,--usetoolingapi}'[create the record with tooling api]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:data:record:delete)
_command_args=(
'(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record youre deleting]' \
'(-i|--sobjectid)'{-i,--sobjectid}'[the ID of the record youre deleting]' \
'(-w|--where)'{-w,--where}'[a list of <fieldName>=<value> pairs to search for]' \
'(-t|--usetoolingapi)'{-t,--usetoolingapi}'[delete the record with Tooling API]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:data:record:get)
_command_args=(
'(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record youre retrieving]' \
'(-i|--sobjectid)'{-i,--sobjectid}'[the ID of the record youre retrieving]' \
'(-w|--where)'{-w,--where}'[a list of <fieldName>=<value> pairs to search for]' \
'(-t|--usetoolingapi)'{-t,--usetoolingapi}'[retrieve the record with Tooling API]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:data:record:update)
_command_args=(
'(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record youre updating]' \
'(-i|--sobjectid)'{-i,--sobjectid}'[the ID of the record youre updating]' \
'(-w|--where)'{-w,--where}'[a list of <fieldName>=<value> pairs to search for]' \
'(-v|--values)'{-v,--values}'[the <fieldName>=<value> pairs youre updating]' \
'(-t|--usetoolingapi)'{-t,--usetoolingapi}'[update the record with Tooling API]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:mdapi:retrieve)
_command_args=(
'(-a|--apiversion)'{-a,--apiversion}'[target API version for the retrieve (default 41.0)]' \
'(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: -1 (no limit))]' \
'(-r|--retrievetargetdir)'{-r,--retrievetargetdir}'[directory root for the retrieved files]:file:_files' \
'(-k|--unpackaged)'{-k,--unpackaged}'[file path of manifest of components to retrieve]:file:_files' \
'(-d|--sourcedir)'{-d,--sourcedir}'[source dir to use instead of default manifest sfdx-project.xml]' \
'(-p|--packagenames)'{-p,--packagenames}'[a comma-separated list of packages to retrieve]' \
'(-s|--singlepackage)'{-s,--singlepackage}'[a single-package retrieve (default: false)]' \
'(-i|--jobid)'{-i,--jobid}'[WARNING: The flag "jobid" has been deprecated and will be removed in v41.01.0 or later. Instead, use "sfdx force:mdapi:retrieve:report -i <jobId> -r <targetDir>".]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[verbose output of retrieve result]' \
)
;;
force:mdapi:retrieve:report)
_command_args=(
'(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: -1 (no limit))]' \
'(-r|--retrievetargetdir)'{-r,--retrievetargetdir}'[directory root for the retrieved files]:file:_files' \
'(-i|--jobid)'{-i,--jobid}'[job ID of the retrieve you want to check]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[verbose output of retrieve result]' \
)
;;
force:alias:set)
_command_args=(
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:config:set)
_command_args=(
'(-g|--global)'{-g,--global}'[set config var globally (to be used from any directory)]:file:_files' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:auth:sfdxurl:store)
_command_args=(
'(-f|--sfdxurlfile)'{-f,--sfdxurlfile}'[path to a file containing the sfdx url]:file:_files' \
'(-d|--setdefaultdevhubusername)'{-d,--setdefaultdevhubusername}'[set the authenticated org as the default dev hub org for scratch org creation]' \
'(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the authenticated org as the default username that all commands run against]' \
'(-a|--setalias)'{-a,--setalias}'[set an alias for the authenticated org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:org:shape:create)
_command_args=(
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:org:shape:delete)
_command_args=(
'(-p|--noprompt)'{-p,--noprompt}'[do not prompt for confirmation]' \
'(-u|--targetusername)'{-u,--targetusername}'[username for the target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:org:shape:list)
_command_args=(
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[list more information about each org shape]' \
)
;;
force:schema:sobject:describe)
_command_args=(
'(-s|--sobjecttype)'{-s,--sobjecttype}'[the API name of the object to describe]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:schema:sobject:list)
_command_args=(
'(-c|--sobjecttypecategory)'{-c,--sobjecttypecategory}'[the type of objects to list (all|custom|standard)]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:data:soql:query)
_command_args=(
'(-q|--query)'{-q,--query}'[SOQL query to execute]' \
'(-t|--usetoolingapi)'{-t,--usetoolingapi}'[execute query with Tooling API]' \
'(-r|--resultformat)'{-r,--resultformat}'[query result format emitted to stdout; --json flag overrides this parameter (human*,csv,json)]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:source:status)
_command_args=(
'(-a|--all)'{-a,--all}'[list all the changes that have been made]' \
'(-l|--local)'{-l,--local}'[list the changes that have been made locally]' \
'(-r|--remote)'{-r,--remote}'[list the changes that have been made in the scratch org]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:lightning:test:create)
_command_args=(
'(-n|--testname)'{-n,--testname}'[name of the generated Lightning test]' \
'(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningTest*)]' \
'(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \
'(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \
'(--json)--json[JSON output]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:lightning:test:install)
_command_args=(
'(-w|--wait)'{-w,--wait}'[number of minutes to wait for installation status (default:2)]' \
'(-r|--releaseversion)'{-r,--releaseversion}'[release version of Lightning Testing Service (default:latest)]' \
'(-t|--packagetype)'{-t,--packagetype}'[type of unmanaged package. 'full' option contains both jasmine and mocha, plus examples (full*,jasmine,mocha)]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:apex:test:report)
_command_args=(
'(-i|--testrunid)'{-i,--testrunid}'[ID of test run]' \
'(-c|--codecoverage)'{-c,--codecoverage}'[retrieve code coverage results]' \
'(-d|--outputdir)'{-d,--outputdir}'[directory to store test run files]:file:_files' \
'(-r|--resultformat)'{-r,--resultformat}'[test result format emitted to stdout; --json flag overrides this parameter (human*,tap,junit,json)]' \
'(-w|--wait)'{-w,--wait}'[the streaming client socket timeout (in minutes) (default:6, min:2)]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[display Apex test processing details]' \
)
;;
force:apex:test:run)
_command_args=(
'(-n|--classnames)'{-n,--classnames}'[comma-separated list of Apex test class names to execute]' \
'(-s|--suitenames)'{-s,--suitenames}'[comma-separated list of Apex test suite names to execute]' \
'(-c|--codecoverage)'{-c,--codecoverage}'[retrieve code coverage results]' \
'(-d|--outputdir)'{-d,--outputdir}'[directory to store test run files]:file:_files' \
'(-l|--testlevel)'{-l,--testlevel}'[testlevel enum value (RunLocalTests,RunAllTestsInOrg,RunSpecifiedTests)]' \
'(-r|--resultformat)'{-r,--resultformat}'[test result format emitted to stdout; --json flag overrides this parameter (human*,tap,junit,json)]' \
'(-w|--wait)'{-w,--wait}'[the streaming client socket timeout (in minutes) (default:6, min:2)]' \
'(--precompilewait)--precompilewait[how long to wait (in minutes) for Apex pre-compilation (default:3, min:3)]' \
'(-y|--synchronous)'{-y,--synchronous}'[run tests from a single class synchronously]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[display Apex test processing details]' \
)
;;
force:lightning:test:run)
_command_args=(
'(-a|--appname)'{-a,--appname}'[name of your Lightning test application]' \
'(-d|--outputdir)'{-d,--outputdir}'[directory path to store test run artifacts: for example, log files and test results]:file:_files' \
'(-r|--resultformat)'{-r,--resultformat}'[test result format emitted to stdout; --json flag overrides this parameter (human*,tap,junit,json)]' \
'(-f|--configfile)'{-f,--configfile}'[path to config file for the test]:file:_files' \
'(-o|--leavebrowseropen)'{-o,--leavebrowseropen}'[leave browser open]' \
'(-t|--timeout)'{-t,--timeout}'[time (ms) to wait for results element in dom (default:60000)]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:data:tree:export)
_command_args=(
'(-q|--query)'{-q,--query}'[soql query, or filepath of file containing a soql query, to retrieve records]:file:_files' \
'(-p|--plan)'{-p,--plan}'[generate mulitple sobject tree files and a plan definition file for aggregated import]' \
'(-x|--prefix)'{-x,--prefix}'[prefix of generated files]' \
'(-d|--outputdir)'{-d,--outputdir}'[directory to store files]:file:_files' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:data:tree:import)
_command_args=(
'(-f|--sobjecttreefiles)'{-f,--sobjecttreefiles}'[comma-delimited, ordered paths of json files containing collection of record trees to insert]:file:_files' \
'(-p|--plan)'{-p,--plan}'[path to plan to insert multiple data files that have master-detail relationships]:file:_files' \
'(-c|--contenttype)'{-c,--contenttype}'[if data file extension is not .json, provide content type (applies to all files)]' \
'(--confighelp)--confighelp[display schema information for the --plan configuration file to stdout; if you use this option, all other options except --json are ignored]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:apex:trigger:create)
_command_args=(
'(-n|--triggername)'{-n,--triggername}'[name of the generated Apex trigger]' \
'(-t|--template)'{-t,--template}'[template to use for file creation (ApexTrigger*)]' \
'(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \
'(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \
'(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \
'(-s|--sobject)'{-s,--sobject}'[sObject to create a trigger on (SOBJECT*)]' \
'(-e|--triggerevents)'{-e,--triggerevents}'[events that fire the trigger (before insert*,before upsert,before delete,after insert,after upsert,after delete,after undelete)]' \
'(--json)--json[JSON output]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package:uninstall)
_command_args=(
'(-i|--id)'{-i,--id}'[ID of the package to uninstall (starts with 04t)]' \
'(-w|--wait)'{-w,--wait}'[number of minutes to wait for uninstall status]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package:uninstall:get)
_command_args=(
'(-i|--requestid)'{-i,--requestid}'[ID of the package uninstall request you want to check]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package2:update)
_command_args=(
'(-i|--package2id)'{-i,--package2id}'[id of the package (starts with 0Ho)]' \
'(-n|--name)'{-n,--name}'[package name]' \
'(-d|--description)'{-d,--description}'[package description]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:project:upgrade)
_command_args=(
'(-f|--forceupgrade)'{-f,--forceupgrade}'[run all upgrades even if project has already been upgraded]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package1:version:create)
_command_args=(
'(-i|--packageid)'{-i,--packageid}'[ID of the metadata package (starts with 033) of which youre creating a new version]' \
'(-n|--name)'{-n,--name}'[package version name]' \
'(-d|--description)'{-d,--description}'[package version description]' \
'(-v|--version)'{-v,--version}'[package version in major.minor format, for example, 3.2]' \
'(-m|--managedreleased)'{-m,--managedreleased}'[create a managed package version]' \
'(-r|--releasenotesurl)'{-r,--releasenotesurl}'[release notes URL]' \
'(-p|--postinstallurl)'{-p,--postinstallurl}'[post install URL]' \
'(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (default: null)]' \
'(-w|--wait)'{-w,--wait}'[minutes to wait for the package version to be created (default: 2 minutes)]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package2:version:create)
_command_args=(
'(-i|--package2id)'{-i,--package2id}'[ID of the parent package (starts with 0Ho)]' \
'(-d|--directory)'{-d,--directory}'[path to directory that contains the contents of the package version]:file:_files' \
'(-b|--branch)'{-b,--branch}'[the package versions branch]' \
'(-t|--tag)'{-t,--tag}'[the package versions tag]' \
'(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (default: null)]' \
'(-p|--preserve)'{-p,--preserve}'[temp files are preserved that would otherwise be deleted]' \
'(-j|--validateschema)'{-j,--validateschema}'[sfdx-project.json is validated against JSON schema]' \
'(-w|--wait)'{-w,--wait}'[minutes to wait for the package version to be created (default:0)]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package1:version:create:get)
_command_args=(
'(-i|--requestid)'{-i,--requestid}'[PackageUploadRequest ID]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package2:version:create:get)
_command_args=(
'(-i|--package2createrequestid)'{-i,--package2createrequestid}'[package2 version creation request ID (starts with 08c)]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package2:version:create:list)
_command_args=(
'(-c|--createdlastdays)'{-c,--createdlastdays}'[created in the last specified number of days (starting at 00:00:00 of first day to now; 0 for today)]' \
'(-s|--status)'{-s,--status}'[filter the list by version creation request status (Queued,InProgress,Success,Error)]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package1:version:display)
_command_args=(
'(-i|--packageversionid)'{-i,--packageversionid}'[metadata package version ID (starts with 04t)]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package2:version:get)
_command_args=(
'(-i|--package2versionid)'{-i,--package2versionid}'[the package version ID (starts wtih 05i)]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package1:version:list)
_command_args=(
'(-i|--packageid)'{-i,--packageid}'[metadata package ID (starts with 033)]' \
'(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:package2:version:list)
_command_args=(
'(-c|--createdlastdays)'{-c,--createdlastdays}'[created in the last specified number of days (starting at 00:00:00 of first day to now; 0 for today)]' \
'(-m|--modifiedlastdays)'{-m,--modifiedlastdays}'[list items modified in the specified last number of days (starting at 00:00:00 of first day to now; 0 for today)]' \
'(-i|--package2ids)'{-i,--package2ids}'[filter results on specified comma-delimited package2 ids (start with 0Ho)]' \
'(-r|--released)'{-r,--released}'[display released versions only]' \
'(-o|--orderby)'{-o,--orderby}'[order by the specified package2 version fields]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--concise)--concise[display limited package2 version details]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
'(--verbose)--verbose[display extended package2 versions detail]' \
)
;;
force:package2:version:update)
_command_args=(
'(-i|--package2versionid)'{-i,--package2versionid}'[the package version ID (starts wtih 05i)]' \
'(-n|--name)'{-n,--name}'[the package version name]' \
'(-d|--description)'{-d,--description}'[the package version description]' \
'(-b|--branch)'{-b,--branch}'[the package version branch]' \
'(-t|--tag)'{-t,--tag}'[the package version tag]' \
'(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (default: null)]' \
'(-s|--setasreleased)'{-s,--setasreleased}'[set the package version as released (cant be undone)]' \
'(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
force:auth:web:login)
_command_args=(
'(-i|--clientid)'{-i,--clientid}'[OAuth client ID (sometimes called the consumer key)]' \
'(-r|--instanceurl)'{-r,--instanceurl}'[the login URL of the instance the org lives on]' \
'(-d|--setdefaultdevhubusername)'{-d,--setdefaultdevhubusername}'[set the authenticated org as the default dev hub org for scratch org creation]' \
'(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the authenticated org as the default username that all commands run against]' \
'(-a|--setalias)'{-a,--setalias}'[set an alias for the authenticated org]' \
'(--disablemasking)--disablemasking[disable masking of user input (for use with problematic terminals)]' \
'(--json)--json[format output as json]' \
'(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \
)
;;
esac
_arguments \
$_command_args \
&& return 0

View File

@@ -1,34 +0,0 @@
#compdef ssh-copy-id
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for ssh-copy-id.
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
# FIXME This completes "user@host" and not "[user@]host" ("user@" is optional),
# should be merged in _ssh.
_arguments -A "-*" \
'-i+[use identity file]:SSH identity file:_files' \
'-n+[do a dry-run]' \
'-h+[print usage summary]' \
'-p+[specify custom port]' \
'-o+[additional ssh option]' \
'1: :_user_at_host'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -40,54 +40,56 @@
_stack () {
_arguments \
--version'[Show version]' \
--help'[Show this help text]' \
'--docker*''[Run "stack --docker-help" for details]' \
--verbosity'[Verbosity: silent, error, warn, info, debug]' \
{-v,--verbose}'[Enable verbose mode: verbosity level "debug"]' \
--system-ghc'[Enable using the system installed GHC (on the PATH) if available and a matching version]' \
--no-system-ghc'[Disable using the system installed GHC (on the PATH) if available and a matching version]' \
--install-ghc'[Enable downloading and installing GHC if necessary (can be done manually with stack setup)]' \
--no-install-ghc'[Disable downloading and installing GHC if necessary (can be done manually with stack setup)]' \
--arch'[System architecture, e.g. i386, x86_64]' \
--os'[Operating system, e.g. linux, windows]' \
{-j,--jobs}'[Number of concurrent jobs to run]' \
--extra-include-dirs'[Extra directories to check for C header files]' \
--extra-lib-dirs'[Extra directories to check for libraries]' \
--skip-ghc-check'[Enable skipping the GHC version and architecture check]' \
--no-skip-ghc-check'[Disable skipping the GHC version and architecture check]' \
--skip-msys'[Enable skipping the local MSYS installation (Windows only)]' \
--no-skip-msys'[Disable skipping the local MSYS installation (Windows only)]' \
--resolver'[Override resolver in project file]' \
--no-terminal'[Override terminal detection in the case of running in a false terminal]' \
--stack-yaml'[Override project stack.yaml file (overrides any STACK_YAML environment variable)]' \
--version'[display version information]' \
--help'[display usage information]' \
'--docker*''[run "stack --docker-help" for details]' \
--verbosity'[verbosity: silent, error, warn, info, debug]' \
{-v,--verbose}'[enable verbose mode: verbosity level "debug"]' \
--system-ghc'[enable using the system installed GHC (on the PATH) if available and a matching version]' \
--no-system-ghc'[disable using the system installed GHC (on the PATH) if available and a matching version]' \
--install-ghc'[enable downloading and installing GHC if necessary (can be done manually with stack setup)]' \
--no-install-ghc'[disable downloading and installing GHC if necessary (can be done manually with stack setup)]' \
--arch'[system architecture, e.g. i386, x86_64]' \
--os'[operating system, e.g. linux, windows]' \
{-j,--jobs}'[number of concurrent jobs to run]' \
--extra-include-dirs'[extra directories to check for C header files]' \
--extra-lib-dirs'[extra directories to check for libraries]' \
--skip-ghc-check'[enable skipping the GHC version and architecture check]' \
--no-skip-ghc-check'[disable skipping the GHC version and architecture check]' \
--skip-msys'[enable skipping the local MSYS installation (Windows only)]' \
--no-skip-msys'[disable skipping the local MSYS installation (Windows only)]' \
--resolver'[override resolver in project file]' \
--no-terminal'[override terminal detection in the case of running in a false terminal]' \
--stack-yaml'[override project stack.yaml file (overrides any STACK_YAML environment variable)]' \
'*: :__stack_modes'
}
__stack_modes () {
_values \
'subcommand' \
'build[Build the project(s) in this directory/configuration]' \
'install[Build executables and install to a user path]' \
'test[Build and test the project(s) in this directory/configuration]' \
'bench[Build and benchmark the project(s) in this directory/configuration]' \
'haddock[Generate haddocks for the project(s) in this directory/configuration]' \
'new[Create a brand new project]' \
'init[Initialize a stack project based on one or more cabal packages]' \
'solver[Use a dependency solver to try and determine missing extra-deps]' \
'setup[Get the appropriate ghc for your project]' \
'path[Print out handy path information]' \
'unpack[Unpack one or more packages locally]' \
'update[Update the package index]' \
'upgrade[Upgrade to the latest stack (experimental)]' \
'upload[Upload a package to Hackage]' \
'dot[Visualize your projects dependency graph using Graphviz dot]' \
'exec[Execute a command]' \
'ghc[Run ghc]' \
'ghci[Run ghci in the context of project(s)]' \
'ide[Run ide-backend-client with the correct arguments]' \
'runghc[Run runghc]' \
'clean[Clean the local packages]' \
'docker[Subcommands specific to Docker use]'
'build[build the project(s) in this directory/configuration]' \
'install[build executables and install to a user path]' \
'test[build and test the project(s) in this directory/configuration]' \
'bench[build and benchmark the project(s) in this directory/configuration]' \
'haddock[generate haddocks for the project(s) in this directory/configuration]' \
'new[create a brand new project]' \
'init[initialize a stack project based on one or more cabal packages]' \
'solver[use a dependency solver to try and determine missing extra-deps]' \
'setup[get the appropriate ghc for your project]' \
'path[print out handy path information]' \
'unpack[unpack one or more packages locally]' \
'update[update the package index]' \
'upgrade[upgrade to the latest stack (experimental)]' \
'upload[upload a package to Hackage]' \
'dot[visualize your projects dependency graph using Graphviz dot]' \
'exec[execute a command]' \
'ghc[run ghc]' \
'ghci[run ghci in the context of project(s)]' \
'ide[run ide-backend-client with the correct arguments]' \
'runghc[run runghc]' \
'clean[clean the local packages]' \
'docker[subcommands specific to Docker use]'
}
_stack "$@"

View File

@@ -39,22 +39,17 @@
# ------------------------------------------------------------------------------
_subl() {
integer ret=1
local I="-h --help -v --version"
local -a args
args+=(
"(- *)"{-h,--help}'[Show help and exit]'
"(- *)"{-v,--version}'[Show version and exit]'
"($I)--project[Load the given project]:project:"
"($I)--command[Run the given command]:command:"
"($I -n --new-window)"{-n,--new-window}'[Open a new window]'
"($I -a --add)"{-a,--add}'[Add folders to the current window]'
"($I -w --wait)"{-w,--wait}'[Wait for the files to be closed before returning]'
"($I -b --background)"{-b,--background}'[Do not activate the application]'
)
_arguments $args[@] '*:file:_files' && ret=0
return ret
}
local I="-h --help -v --version"
local -a args
args+=(
"(- *)"{-h,--help}'[display usage information]'
"(- *)"{-v,--version}'[display version information]'
"($I)--project[load the given project]:project"
"($I)--command[run the given command]:command"
"($I -n --new-window)"{-n,--new-window}'[open a new window]'
"($I -a --add)"{-a,--add}'[add folders to the current window]'
"($I -w --wait)"{-w,--wait}'[wait for the files to be closed before returning]'
"($I -b --background)"{-b,--background}"[don't activate the application]"
)
_arguments "$args[@]" '*:file:_files'
_subl

View File

@@ -0,0 +1,64 @@
#compdef tarsnap
# ------------------------------------------------------------------------------
# Copyright (c) 2014-2017 Daniel Teunis - https://github.com/danteu
#
# 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 tarsnap 1.0.39 (http://tarsnap.com).
#
# ------------------------------------------------------------------------------
# Author
# -------
#
# * Daniel Teunis <daniel@teunis.cc>
#
# ------------------------------------------------------------------------------
_arguments \
'(- 1 *)--help[prints tarsnap help]' \
'(- 1 *)--version[prints tarsnap version number]' \
'(- 1 *)--verify-config[checks configuration files for syntactic errors]' \
'--fsck[performs integrity checks on the stored archives]' \
'--fsck-prune[performs integrity checks and prunes broken data]' \
'--list-archives[prints names of stored archives]' \
'--nuke[deletes all stored archives]' \
'--print-stats[prints archive statistics]' \
'--recover[recovers partial archive]' \
'-c[creates archive]' \
'-d[deletes specified archive]' \
'-r[prints content of specified archive]' \
'-t[lists archive content]' \
'-x[extracts specified archive]' \
'--lowmem[reduces memory usage by not caching small files]' \
'--quiet[silences some warnings]' \
'--keyfile[specifies keyfile]:keyfile:->file' \
'--cachedir[specifies cache directory]:cachedir:->directory' \
'-f[specifies archive name]:archivename:->file'
case "$state" in
file)
_files
;;
directory)
_path_files -/
;;
esac

View File

@@ -0,0 +1,133 @@
#compdef tmuxp
# ------------------------------------------------------------------------------
# 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 tmuxp (https://tmuxp.git-pull.com/en/latest/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Bez Hermoso <bezalelhermoso@gmail.com>
#
# ------------------------------------------------------------------------------
_tmuxp() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
":command:->command" \
"*::options:->options" \
"--log_level:log level:(DEBUG INFO WARNING ERROR CRITICAL)" \
"--help[display usage information]"
case $state in
(command)
local -a subcommands
subcommands=(
'convert:Convert a tmuxp config between JSON and YAML.'
'freeze:Snapshot a session into a config.'
'import:Import a teamocil/tmuxinator config.'
'load:Load tmuxp workspaces.'
)
_describe -t commands 'commands' subcommands
;;
(options)
case $line[1] in
(load)
__tmuxp_load
;;
(import)
__tmuxp_import
;;
(freeze)
local sessions="$(__tmux_sessions)"
_arguments -C \
"1::session name:compadd $sessions"
;;
(convert)
_arguments -C \
'1:: :_files -g "*.(json|yaml|yml)"'
;;
esac
esac
}
__tmuxp_load() {
local state line
typeset -A opt_args
_arguments -C \
'*:sessions:->sessions' \
'--yes:yes' \
'-d[Load the session without attaching it]' \
'-2[Force tmux to assume the terminal supports 256 colors]' \
'-8[Like -2, but indicates that the terminal supports 88 colors]'
# Cant get the options to be recognized when there are sessions that has
# a dash.
case $state in
(sessions)
local s
_alternative \
'sessions-user:user session:compadd -F line - ~/.tmuxp/*.(json|yml|yaml)(:r:t)' \
'sessions-other:session in current directory:_path_files -g "**/*.(json|yaml|yml)(-.)"'
;;
esac
}
__tmuxp_import() {
local state line
typeset -A opt_args
_arguments -C \
'1::program:(tmuxinator teamocil)' \
'2::project:->project'
case $state in
(project)
if [[ $line[1] == 'tmuxinator' ]]
then
_wanted tmuxinator-projects exp 'tmuxinator projects' compadd $(tmuxinator completions start)
fi
;;
esac
}
__tmux_sessions () {
local tmux_sessions
tmux_sessions=($(_call_program tmux_sessions 'tmux ls -F "#{session_name}"'))
echo $tmux_sessions
}
_tmuxp "$@"

View File

@@ -0,0 +1,61 @@
#compdef tox
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for tox (https://tox.readthedocs.io).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
(( $+functions[_tox_envs_list] )) ||
_tox_envs_list() {
local envs; envs=($(_call_program envs $service --listenvs-all))
if [ ${#envs} -gt 0 ]; then
_values -s , 'tox environments' "${envs[@]}"
else
_message 'tox environments (none found)'
fi
}
_arguments \
'(- 1 *)--version[show version and exit]' \
'(- 1 *)'{-h,--help}'[show help options]' \
'(- 1 *)'{--hi,--help-ini}'[show help about ini-names]' \
'*-v[increase verbosity of reporting output]' \
'*-q[progressively silence reporting output]' \
'(- 1 *)--showconfig[show configuration information for all environments]' \
'(- 1 *)'{-l,--listenvs}'[show list of test environments]' \
'(- 1 *)'{-a,--listenvs-all}'[show list of all defined environments]' \
'-c[config file name or directory with "tox.ini" file]:config path:_files -g "*.ini"' \
'-e[work against specified environments]: :_tox_envs_list' \
'--notest[skip invoking test commands]' \
'--sdistonly[only perform the sdist packaging activity]' \
'--parallel--safe-build[ensure two tox builds can run in parallel]' \
'--installpkg[ensure two tox builds can run in parallel]:package path:_files -/' \
'--develop[install package in the venv using "setup.py develop"]' \
'(-i --index-url)'{-i,--index-url}'[set indexserver url]:index server URL:_urls' \
'--pre[install pre-releases and development versions of dependencies]' \
'(-r --recreate)'{-r,--recreate}'[force recreation of virtual environments]' \
'--result-json[write a json file with detailed information about all commands and results involved]:JSON file path:_files -g "*.json"' \
'--hashseed[set PYTHONHASHSEED to SEED before running commands]:seed' \
'*--force-dep[forces a certain version of one of the dependencies when configuring the virtual environment]:pip requirement' \
'--sitepackages[override sitepackages setting to True in all envs]' \
'--alwayscopy[override alwayscopy setting to True in all envs]' \
'--skip-missing-interpreters[do not fail tests for missing interpreters]: :(config true false)' \
'--workdir[tox working directory]: :_files -/' \
'*: :_guard "^-*" command positional substitution arguments'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@@ -39,16 +39,10 @@
# ------------------------------------------------------------------------------
_trash-list() {
_arguments -C \
'--version[Show programs version number and exit]' \
{-h,--help}'[Show help message and exit]' \
'*: :' \
}
_trash-list
_arguments \
'--version[show programs version number and exit]' \
{-h,--help}'[show help message and exit]' \
'*: :'
# Local Variables:
# mode: Shell-Script

View File

@@ -39,21 +39,15 @@
# ------------------------------------------------------------------------------
_trash-put() {
_arguments -C \
'--version[Show programs version number and exit]' \
{-h,--help}'[Show help message and exit]' \
{-d,--directory}'[Remove empty directories - ignored (for GNU rm compabilty)]' \
{-f,--force}'[Ignore nonexistent arguments and never prompt - ignored (for GNU rm compabilty)]' \
{-i,--interactive}'[Prompt before every removal - ignored (for GNU rm compabilty)]' \
{-r,-R,--recursive}'[Remove directories and their content recursively - ignored (for GNU rm compabilty)]' \
{-v,--verbose}'[Explain what is being done]' \
'*: :_files' \
}
_trash-put
_arguments -C \
'--version[display version information]' \
{-h,--help}'[display usage information]' \
{-d,--directory}'[remove empty directories - ignored (for GNU rm compatibility)]' \
{-f,--force}'[ignore nonexistent arguments and never prompt - ignored (for GNU rm compatibility)]' \
{-i,--interactive}'[prompt before every removal - ignored (for GNU rm compabilty)]' \
{-r,-R,--recursive}'[remove directories and their content recursively - ignored (for GNU rm compatibility)]' \
{-v,--verbose}'[explain what is being done]' \
'*: :_files'
# Local Variables:
# mode: Shell-Script

View File

@@ -56,7 +56,7 @@ _paths() {
_path_list+=$_path
done
_describe 'paths' _path_list
_describe 'path' _path_list
}
_filesystems() {
@@ -68,96 +68,97 @@ _filesystems() {
'xenix' 'xfs' 'xiafs'
)
_describe 'file system types' _fs_types
_describe 'file system type' _fs_types
}
_udisksctl() {
typeset -A opt_args
local curcontext="$curcontext" state line
local curcontext="$curcontext" state line ret=1
_arguments -C \
'1:udisksctl commands:->cmds' \
'*:: :->cmd_args' \
'*:: :->cmd_args' && ret=0
case $state in
cmds)
local commands; commands=(
'help: Show help'
'info: Show info about an object'
'dump: Show info about all object'
'status: Shows high-level status'
'monitor: Monitor changes to objects'
'mount: Mount a filesystem'
'unmount: Unmount a filesystem'
'unlock: Unlock an encrypted device'
'lock: Lock an encrypted device'
'loop-setup: Set-up a loop device'
'loop-delete: Delete a loop device'
'power-off: Safely power off a drive'
'smart-simulate: Set SMART data for a drive'
'help:show help'
'info:show info about an object'
'dump:show info about all object'
'status:shows high-level status'
'monitor:monitor changes to objects'
'mount:mount a filesystem'
'unmount:unmount a filesystem'
'unlock:unlock an encrypted device'
'lock:lock an encrypted device'
'loop-setup:set-up a loop device'
'loop-delete:delete a loop device'
'power-off:safely power off a drive'
'smart-simulate:set SMART data for a drive'
)
_describe -t commands 'udisksctl commands' commands
_describe -t commands 'udisksctl command' commands && ret=0
;;
cmd_args)
case $words[1] in
info)
_arguments \
{-p,--object-path}'[Object to get information about]:object path:_paths' \
{-b,--block-device}'[Block device to get information about]:block device:_paths' \
{-d,--drive}'[Drive to get information about]:drives:_paths' \
{-p,--object-path}'[specify object to get information about]:object path:_paths' \
{-b,--block-device}'[specify block device to get information about]:block device:_paths' \
{-d,--drive}'[specify drive to get information about]:drive:_paths' && ret=0
;;
mount)
_arguments \
{-p,--object-path}'[Object to mount]:object path:_paths' \
{-b,--block-device}'[Block device to mount]:block device:_paths' \
{-t,--filesystem-type}'[Filesystem type to use]:fs type:_filesystems' \
{-o,--options}'[Mount options]' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \
{-p,--object-path}'[specify object to mount]:object path:_paths' \
{-b,--block-device}'[specify block device to mount]:block device:_paths' \
{-t,--filesystem-type}'[specify filesystem type to use]:fs type:_filesystems' \
{-o,--options}'[mount options]' \
"(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;;
unmount)
_arguments \
{-p,--object-path}'[Object to unmount]:object path:_paths' \
{-b,--block-device}'[Block device to unmount]:block device:_paths' \
{-f,--force}'[Force/lazy unmount]' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \
{-p,--object-path}'[object to unmount]:object path:_paths' \
{-b,--block-device}'[block device to unmount]:block device:_paths' \
{-f,--force}'[force/lazy unmount]' \
"(--no-user-interaction)--no-user-interaction[don't auhenticate the user if needed]" && ret=0
;;
unlock|lock)
_arguments \
{-p,--object-path}'[Object to lock/unlock]:object path:_paths' \
{-b,--block-device}'[Block device to lock/unlock]:block device:_paths' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \
{-p,--object-path}'[object to lock/unlock]:object path:_paths' \
{-b,--block-device}'[block device to lock/unlock]:block device:_paths' \
"(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;;
loop-setup)
_arguments \
{-f,--file}'[File to set-up a loop device for]:files:_files' \
{-r,--read-only}'[Setup read-only device]' \
{-o,--offset}'[Start at <num> bytes into file]:offset in bytes:' \
{-s,--size}'[Limit size to <num> bytes]:limit in bytes:' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \
{-f,--file}'[specify file to set-up a loop device for]:files:_files' \
{-r,--read-only}'[setup read-only device]' \
{-o,--offset}'[start at specified offset into file]:offset (bytes)' \
{-s,--size}'[limit size]:limit (bytes)' \
"(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;;
loop-delete)
_arguments \
{-p,--object-path}'[Object for loop device to delete]:object path:_paths' \
{-b,--block-device}'[Loop device to delete]:block device:_paths' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \
{-p,--object-path}'[object for loop device to delete]:object path:_paths' \
{-b,--block-device}'[loop device to delete]:block device:_paths' \
"(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;;
power-off)
_arguments \
{-p,--object-path}'[Object path for ATA device]:object path:_paths' \
{-b,--block-device}'[Device file for ATA devic]:block device:_paths' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \
{-p,--object-path}'[object path for ATA device]:object path:_paths' \
{-b,--block-device}'[device file for ATA devic]:block device:_paths' \
"(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;;
smart-simulate)
_arguments \
{-f,--file}'[File with libatasmart blob]:files:_files' \
{-p,--object-path}'[Object to get information about]:object path:_paths' \
{-b,--block-device}'[Block device to get information about]:block device:_paths' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \
{-f,--file}'[file with libatasmart blob]:files:_files' \
{-p,--object-path}'[object to get information about]:object path:_paths' \
{-b,--block-device}'[block device to get information about]:block device:_paths' \
"(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;;
esac
;;
esac
return ret
}
_udisksctl "$@"

View File

@@ -41,7 +41,7 @@
_ufw_logging() {
local main additional second
local params additional second
second=$words[2]
if [ ! -z $second ]; then
@@ -60,8 +60,8 @@ _ufw_logging() {
"full"
)
_describe -t params 'On/Off' params
_describe -t additional 'Level' additional
_describe -t params 'on/off' params
_describe -t additional 'level' additional
}
@@ -85,35 +85,34 @@ _ufw_delete() {
}
_ufw() {
local -a commands
local curcontext="$curcontext" ret=1
local -a state line commands
commands=(
"enable:Enables the firewall"
"disable:Disables the firewall"
"default:Set default policy"
"logging:Set logging to LEVEL"
"allow:Add allow rule"
"deny:Add deny rule"
"reject:Add reject rule"
"limit:Add limit rule"
"delete:Delete RULE"
"insert:Insert RULE at NUM"
"route:Add route RULE"
"reload:Reload firewall"
"reset:Reset firewall"
"status:Show firewall status"
"show:Show firewall report"
"version:Display version information"
"enable:enable the firewall"
"disable:disable the firewall"
"default:set default policy"
"logging:set logging level"
"allow:add allow rule"
"deny:add deny rule"
"reject:add reject rule"
"limit:add limit rule"
"delete:delete rule"
"insert:insert rule at position"
"route:add route rule"
"reload:reload firewall"
"reset:reset firewall"
"status:show firewall status"
"show:show firewall report"
"version:display version information"
)
_arguments -C -s -S -n \
'(- 1 *)'--version"[Show program\'s version number and exit]: :->full" \
'(- 1 *)'{-h,--help}'[Show help message and exit]: :->full' \
'(- 1 *)'--dry-run"[Don\'t modify anything, just show the changes]: :->cmds" \
'(- 1 *)'--version"[display version information]: :->full" \
'(- 1 *)'{-h,--help}'[display usage information]: :->full' \
'(- 1 *)'--dry-run"[don't modify anything, just show the changes]: :->cmds" \
'1:cmd:->cmds' \
'*:: :->args' \
'*:: :->args' && ret=0
case "$state" in
(cmds)
@@ -124,19 +123,21 @@ _ufw() {
cmd=$words[1]
case "$cmd" in
(logging)
_ufw_logging
_ufw_logging && ret=0
;;
(delete)
_ufw_delete
_ufw_delete && ret=0
;;
(*)
return
_default && ret=0
;;
esac
;;
(*)
;;
esac
return ret
}
_ufw

View File

@@ -1,278 +0,0 @@
#compdef virsh
# ------------------------------------------------------------------------------
# Redistribution and use in source and 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 LibVirt's Shell (virsh) (http://libvirt.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Jan-Philipp Litza <janphilipp@litza.de>
# * Vadim A. Misbakh-Soloviov <mva@mva.name>
#
# ------------------------------------------------------------------------------
local -a args reply
function _virsh-domains() {
local -a out
out=( ${${${${(f)"$(virsh list "$@")"}:#(---| Id)*}## #[0-9-]## ##}%% *} )
_describe -t domains "${${1#--}:-running} domains" out
return $?
}
local -a expand_files
expand_files=(/$'[^\0]##\0'/ ':file:file name:_files')
local -a expand_dirs
expand_dirs=(/$'[^\0]##\0'/ ":dir:dir name:_files -/")
local -a expand_domains
expand_domains=(
/$'[^\0]##\0'/
":domains:domains:{_virsh-domains --all}"
)
local -a expand_domains_running
expand_domains_running=(
/$'[^\0]##\0'/
":domains:running domains:{_virsh-domains}"
)
local -a expand_domains_inactive
expand_domains_inactive=(
/$'[^\0]##\0'/
":domains:inactive domains:{_virsh-domains --inactive}"
)
local -a expand_kilobytes
expand_kilobytes=(
/'\d+'/
":kilobytes:kilobytes:"
)
local -a expand_count
expand_count=(
/'\d+'/
":count:count:"
)
local -a subcmd_help
subcmd_help=(
/$'[^\0]##\0'/
":command:virsh command:"
)
local -a subcmd_list
_regex_words \
list-options 'list options' \
'--all:list all domains, not only active' \
'--inactive:list only inactive domains'
subcmd_list=("$reply[@]")
local -a subcmd_freecell
subcmd_freecell=(
/'\d*'/
":numa-cell:NUMA cell:"
)
local -a subcmd_autostart
_regex_words \
autostart-options 'autostart options' \
'--disable:disables autostart instead of enabling'
subcmd_autostart=("(" "$reply[@]" "|" ")" $expand_domains)
local -a subcmd_create
_regex_words \
create-options 'create options' \
'--console:attach to the console after creation' \
'--paused:pause domain after creation (if supported by driver)'
subcmd_create=("(" "$reply[@]" "|" ")" $expand_files)
local -a subcmd_dumpxml
_regex_words \
dumpxml-options 'dumpxml options' \
'--inactive:use the config for next reboot instead of current' \
'--security-info:include security sensitive information' \
'--update-cpu:update CPU requirements according to host CPU'
subcmd_dumpxml=("(" "$reply[@]" "|" ")" $expand_domains)
local -a subcmd_start
_regex_words \
start-options 'start options' \
'--console:attach to console after start' \
'--paused: pause after start (if supported by driver)'
subcmd_start=("(" "$reply[@]" "|" ")" $expand_domains_inactive)
args=( /$'[^\0]#\0'/ )
_regex_words \
commands "virsh command" \
'help:print help:$subcmd_help' \
'attach-device:attach device from an XML file:$expand_domains $expand_files' \
'attach-disk:attach disk device' \
'attach-interface:attach network interface' \
'autostart:autostart a domain:$subcmd_autostart' \
'capabilities:capabilities:' \
'cd:change the current directory:$expand_dirs' \
'connect:(re)connect to hypervisor' \
'console:connect to the guest console:$expand_domains_running' \
'cpu-baseline:compute baseline CPU:$expand_files' \
'cpu-compare:compare host CPU with a CPU described by an XML file:$expand_files' \
'create:create a domain from an XML file:$subcmd_create' \
'start:start a (previously defined) inactive domain:$subcmd_start' \
'destroy:destroy a domain:$expand_domains_running' \
'detach-device:detach device from an XML file:$expand_domains $expand_files' \
'detach-disk:detach disk device' \
'detach-interface:detach network interface' \
'define:define (but don'"\'"'t start) a domain from an XML file:$expand_files' \
'domid:convert a domain name or UUID to domain id:$expand_domains' \
'domuuid:convert a domain name or id to domain UUID:$expand_domains' \
'dominfo:domain information:$expand_domains' \
'domjobinfo:domain job information:$expand_domains' \
'domjobabort:abort active domain job:$expand_domains' \
'domname:convert a domain id or UUID to domain name:$expand_domains' \
'domstate:domain state:$expand_domains' \
'domblkstat:get device block stats for a domain' \
'domifstat:get network interface stats for a domain' \
'dommemstat:get memory statistics for a domain:$expand_domains_running' \
'domblkinfo:domain block device size information' \
'domxml-from-native:Convert native config to domain XML' \
'domxml-to-native:Convert domain XML to native config' \
'dumpxml:domain information in XML:$subcmd_dumpxml' \
'edit:edit XML configuration for a domain:$expand_domains' \
'find-storage-pool-sources:discover potential storage pool sources' \
'find-storage-pool-sources-as:find potential storage pool sources' \
'freecell:NUMA free memory:$subcmd_freecell' \
'hostname:print the hypervisor hostname:' \
'list:list domains:$subcmd_list' \
'migrate:migrate domain to another host' \
'migrate-setmaxdowntime:set maximum tolerable downtime' \
'net-autostart:autostart a network' \
'net-create:create a network from an XML file:$expand_files' \
'net-define:define (but don'"\'"'t start) a network from an XML file:$expand_files' \
'net-destroy:destroy a network' \
'net-dumpxml:network information in XML' \
'net-edit:edit XML configuration for a network' \
'net-list:list networks' \
'net-name:convert a network UUID to network name' \
'net-start:start a (previously defined) inactive network' \
'net-undefine:undefine an inactive network' \
'net-uuid:convert a network name to network UUID' \
'iface-list:list physical host interfaces' \
'iface-name:convert an interface MAC address to interface name' \
'iface-mac:convert an interface name to interface MAC address' \
'iface-dumpxml:interface information in XML' \
'iface-define:define (but don'"\'"'t start) a physical host interface from an XML file' \
'iface-undefine:undefine a physical host interface (remove it from configuration)' \
'iface-edit:edit XML configuration for a physical host interface' \
'iface-start:start a physical host interface (enable it / "if-up")' \
'iface-destroy:destroy a physical host interface (disable it / "if-down")' \
'managedsave:managed save of a domain state:$expand_domains_running' \
'managedsave-remove:Remove managed save of a domain:$expand_domains' \
'nodeinfo:node information:' \
'nodedev-list:enumerate devices on this host' \
'nodedev-dumpxml:node device details in XML' \
'nodedev-dettach:dettach node device from its device driver' \
'nodedev-reattach:reattach node device to its device driver' \
'nodedev-reset:reset node device' \
'nodedev-create:create a device defined by an XML file on the node' \
'nodedev-destroy:destroy a device on the node' \
'nwfilter-define:define or update a network filter from an XML file:$expand_files' \
'nwfilter-undefine:undefine a network filter' \
'nwfilter-dumpxml:network filter information in XML' \
'nwfilter-list:list network filters' \
'nwfilter-edit:edit XML configuration for a network filter' \
'pool-autostart:autostart a pool' \
'pool-build:build a pool' \
'pool-create:create a pool from an XML file:$expand_files' \
'pool-create-as:create a pool from a set of args' \
'pool-define:define (but don'"\'"'t start) a pool from an XML file:$expand_files' \
'pool-define-as:define a pool from a set of args' \
'pool-destroy:destroy a pool' \
'pool-delete:delete a pool' \
'pool-dumpxml:pool information in XML' \
'pool-edit:edit XML configuration for a storage pool' \
'pool-info:storage pool information' \
'pool-list:list pools' \
'pool-name:convert a pool UUID to pool name' \
'pool-refresh:refresh a pool' \
'pool-start:start a (previously defined) inactive pool' \
'pool-undefine:undefine an inactive pool' \
'pool-uuid:convert a pool name to pool UUID' \
'secret-define:define or modify a secret from an XML file:$expand_files' \
'secret-dumpxml:secret attributes in XML' \
'secret-set-value:set a secret value' \
'secret-get-value:Output a secret value' \
'secret-undefine:undefine a secret' \
'secret-list:list secrets' \
'pwd:print the current directory:' \
'quit:quit this interactive terminal:' \
'exit:quit this interactive terminal:' \
'reboot:reboot a domain:$expand_domains' \
'restore:restore a domain from a saved state in a file:$expand_files' \
'resume:resume a domain:$expand_domains_running' \
'save:save a domain state to a file:$expand_domains $expand_files' \
'schedinfo:show/set scheduler parameters' \
'dump:dump the core of a domain to a file for analysis:$expand_domains $expand_files' \
'shutdown:gracefully shutdown a domain:$expand_domains_running' \
'setmem:change memory allocation:$expand_domains $expand_kilobytes' \
'setmaxmem:change maximum memory limit:$expand_domains $expand_kilobytes' \
'setvcpus:change number of virtual CPUs:$expand_domains $expand_count' \
'suspend:suspend a domain:$expand_domains_running' \
'ttyconsole:tty console:$expand_domains_running' \
'undefine:undefine an inactive domain:$expand_domains_inactive' \
'update-device:update device from an XML file' \
'uri:print the hypervisor canonical URI:' \
'vol-create:create a vol from an XML file' \
'vol-create-from:create a vol, using another volume as input' \
'vol-create-as:create a volume from a set of args' \
'vol-clone:clone a volume.' \
'vol-delete:delete a vol' \
'vol-wipe:wipe a vol' \
'vol-dumpxml:vol information in XML' \
'vol-info:storage vol information' \
'vol-list:list vols' \
'vol-pool:returns the storage pool for a given volume key or path' \
'vol-path:returns the volume path for a given volume name or key' \
'vol-name:returns the volume name for a given volume key or path' \
'vol-key:returns the volume key for a given volume name or path' \
'vcpuinfo:domain vcpu information:$expand_domains_running' \
'vcpupin:control domain vcpu affinity' \
'version:show version:' \
'vncdisplay:vnc display:$expand_domains_running' \
'snapshot-create:Create a snapshot:$expand_domains $expand_files' \
'snapshot-current:Get the current snapshot:$expand_domains' \
'snapshot-delete:Delete a domain snapshot' \
'snapshot-dumpxml:Dump XML for a domain snapshot' \
'snapshot-list:List snapshots for a domain:$expand_domains' \
'snapshot-revert:Revert a domain to a snapshot'
args+=("$reply[@]")
_regex_arguments _virsh "${args[@]}"
_virsh "$@"

View File

@@ -38,73 +38,75 @@
#
# ------------------------------------------------------------------------------
local context state state_descr line
local curcontext="$curcontext" state state_descr line ret=1
typeset -A opt_args
local period="-d --days -h --hours -m --months -w --weeks"
_arguments : \
'--cleartop[Remove all top 10 entries]' \
'--config[Specify alternate configuration file]:file:_files' \
"($period)"{-d,--days}'[Show traffic for days]' \
"($period)"{-h,--hours}'[Show trafic for last 24 hours]' \
"($period)"{-m,--months}'[Show traffic for months]' \
"($period)"{-w,--weeks}'[Show traffic for 7 days]' \
'--dbdir[Specify database directory]:directory:_files -/' \
'(-D --debug)'{-D,--debug}'[Show additional debug output]' \
'--delete[Delete database and stop monitoring selected interface]' \
'--dumpdb[Dump database in parseable format]' \
'(--disable)--enable[Enable updates for selected interface]' \
'(--enable)--disable[Disable updates for selected interface]' \
'(-i --iface)'{-i,--iface}'[Specify interface for actions]:interface:->interface' \
'--iflist[List available interfaces]' \
'(-l --live)'{-l,--live}'[Display current transfer rate]:mode:->live' \
'--locale[Specify locale]:locale:' \
'--nick[Set nickname for alias]:nickname:' \
'--oneline[Traffic summary in one-line, parseable format]' \
'(-q --query)'{-q,--query}'[Force database query mode]' \
'(-r --reset)'{-r,--reset}'[Reset internal counters]' \
'--rebuildtotal[Reset total trafic counters]' \
'(-ru --rateunit)'{-ru,--rateunit}'[Swap configured rate unit]' \
'--savemerged[Write result of database merge]' \
'(-s --short)'{-s,--short}'[Use short output mode]' \
'--style[Modify content and style of output]:style:->style' \
'--sync[Synchronize internal counters]' \
'--testkernel[Test kernel boot time information]' \
'(-t --top10)'{-t,--top10}'[Show all time top 10 traffic days]' \
'-tr[Calculate amount of traffic in given time]:seconds:' \
'(-u --update)'{-u,--update}'[Update databases]' \
'--xml[Show database content in XML format]' \
'(-)'{-v,--version}'[Show current version]' \
'(-)'{-\?,--help}'[Show command summary]' \
'(-)--longhelp[Show complete options list]' \
_arguments -C : \
'--cleartop[remove all top 10 entries]' \
'--config[specify alternate configuration file]:file:_files' \
"($period)"{-d,--days}'[show traffic for days]' \
"($period)"{-h,--hours}'[show trafic for last 24 hours]' \
"($period)"{-m,--months}'[show traffic for months]' \
"($period)"{-w,--weeks}'[show traffic for 7 days]' \
'--dbdir[specify database directory]:directory:_files -/' \
'(-D --debug)'{-D,--debug}'[show additional debug output]' \
'--delete[delete database and stop monitoring selected interface]' \
'--dumpdb[dump database in parseable format]' \
'(--disable)--enable[enable updates for selected interface]' \
'(--enable)--disable[disable updates for selected interface]' \
'(-i --iface)'{-i,--iface}'[specify interface for actions]:interface:->interface' \
'--iflist[list available interfaces]' \
'(-l --live)'{-l,--live}'[display current transfer rate]:mode:->live' \
'--locale[specify locale]:locale:' \
'--nick[set nickname for alias]:nickname:' \
'--oneline[traffic summary in one-line, parseable format]' \
'(-q --query)'{-q,--query}'[force database query mode]' \
'(-r --reset)'{-r,--reset}'[reset internal counters]' \
'--rebuildtotal[reset total trafic counters]' \
'(-ru --rateunit)'{-ru,--rateunit}'[swap configured rate unit]' \
'--savemerged[write result of database merge]' \
'(-s --short)'{-s,--short}'[use short output mode]' \
'--style[modify content and style of output]:style:->style' \
'--sync[synchronize internal counters]' \
'--testkernel[test kernel boot time information]' \
'(-t --top10)'{-t,--top10}'[show all time top 10 traffic days]' \
'-tr[calculate amount of traffic in given time]:seconds:' \
'(-u --update)'{-u,--update}'[update databases]' \
'--xml[show database content in XML format]' \
'(-)'{-v,--version}'[show current version]' \
'(-)'{-\?,--help}'[show command summary]' \
'(-)--longhelp[show complete options list]' \
&& ret=0
case "$state" in
(live)
_values 'Live mode' \
'0[Packets per second]' \
'1[Traffic counters]'
_values 'live mode' \
'0[packets per second]' \
'1[traffic counters]' && ret=0
;;
(style)
_values 'Output style' \
'0[Narrow output]' \
'1[Enable bar column]' \
'2[Bar column with average traffic rate]' \
'3[Enable average traffic rate]' \
'4[Disable use of terminal control characters]'
_values 'output style' \
'0[narrow output]' \
'1[enable bar column]' \
'2[bar column with average traffic rate]' \
'3[enable average traffic rate]' \
'4[disable use of terminal control characters]' && ret=0
;;
(interface)
local interfaces="$(_call_program interfaces 'vnstat --iflist')"
interfaces="${interfaces#*:}"
_values -s + 'Interface' ${(z)interfaces}
_values -s + 'interface' ${(z)interfaces} && ret=0
;;
esac
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2

View File

@@ -35,13 +35,13 @@ _vpnc-connect() {
'--ifname[visible name of the TUN/TAP interface]:name' \
'--ifmode[mode of TUN/TAP interface]: :_vpnc_tun_tap_modes' \
'--debug[show verbose debug messages]: :_vpnc_debug_levels' \
'--no-detach[Don'\''t detach from the console after login]' \
"--no-detach[don't detach from the console after login]" \
'--pid-file[store the pid of background process in the file]:pid file:_files' \
'--local-addr[local IP to use for ISAKMP/ESP/...]: :_hosts' \
'--local-port[local ISAKMP port number to use]: :_vpnc_isakmp_port_numbers' \
'--udp-port[local UDP port number to use]: :_vpnc_udp_port_numbers' \
'--dpd-idle[send DPD packet after not receiving anything for X seconds]: :_vpnc_dpd_idle_times' \
'--non-inter[Don'\''t ask anything, exit on missing options]' \
"--non-inter[don't ask anything, exit on missing options]" \
'--auth-mode[authentication mode]: :_vpnc_authentication_modes' \
'--ca-file[filename and path to the CA-PEM-File]:CA-PEM file:_files' \
'--ca-dir[path of the trusted CA-Directory]:CA directory:_files -/' \
@@ -116,7 +116,7 @@ _vpnc_tun_tap_modes() {
(( $+functions[_vpnc_debug_levels] )) ||
_vpnc_debug_levels() {
local levels; levels=(
'0:do not print debug information'
"0:don't print debug information"
'1:print minimal debug information'
'2:show statemachine and packet/payload type information'
'3:dump everything excluding authentication data'

View File

@@ -0,0 +1,25 @@
#compdef wg-quick
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for wg-quick (a script for easy managemant of wireguard
# VPN tunnels) (https://www.wireguard.com/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Nicolas Lenz <nicolas@eisfunke.com>
#
# ------------------------------------------------------------------------------
# The possible modes
local modes=('up\:"bring a wireguard interface up"'\
'down\:"tear down and remove a wireguard interface"'\
'save\:"save configuration of a running wireguard interface"')
# 1: Complete mode
# 2: Complete interface with all .conf files in /etc/wireguard without the filename extension.
_arguments "1:mode:((${modes}))"\
'2:interface:_path_files -W /etc/wireguard -g "*.conf(^/:r)"'

View File

@@ -92,7 +92,7 @@ _yaourt_action_sync() {
_arguments -s : \
"$_yaourt_opts_common[@]" \
"$_yaourt_opts_sync_modifiers[@]" \
'*-c[Remove old packages from cache]' \
'*-c[remove old packages from cache]' \
;;
sync_group)
_arguments -s : \
@@ -213,110 +213,110 @@ _yaourt() {
# options for passing to _arguments: main pacman commands
typeset -a _yaourt_opts_commands
_yaourt_opts_commands=(
'-Q[Query the package database]'
'-R[Remove a package from the system]'
'-S[Synchronize packages]'
'-U[Upgrade a package]'
'-V[Display version and exit]'
'-h[Display usage]'
'-Q[query the package database]'
'-R[remove a package from the system]'
'-S[synchronize packages]'
'-U[upgrade a package]'
'-V[display version and exit]'
'-h[display usage information]'
'-B[backup pacman database]'
'-G[Get PKGBUILD]'
'-C[Clean backup files]'
'--stats[Package Statistics]'
'-G[get PKGBUILD]'
'-C[clean backup files]'
'--stats[package statistics]'
)
# options for passing to _arguments: options common to all commands
typeset -a _yaourt_opts_common
_yaourt_opts_common=(
'-b[Alternate database location]:database_location:_files -/'
'-h[Display syntax for the given operation]'
'-r[Alternate installation root]:installation root:_files -/'
'-v[Be more verbose]'
'--cachedir[Alternate package cache location]:cache_location:_files -/'
'--config[Alternate configuration file]:config file:_files'
'--debug[Display debug messages]'
'--gpgdir[Alternate GnuPG home directory]:gpg_directory:_files -/'
'--logfile[Alternate log file]:config file:_files'
'--noconfirm[Do not ask for confirmation]'
'--noprogressbar[Do not show a progress bar when downloading files]'
'--noscriptlet[Do not execute the install scriptlet if one exists]'
'--print[Only print the targets instead of performing the operation]'
'-b[alternate database location]:database_location:_files -/'
'-h[display syntax for the given operation]'
'-r[alternate installation root]:installation root:_files -/'
'-v[be more verbose]'
'--cachedir[specify alternate package cache location]:cache_location:_files -/'
'--config[specify alternate configuration file]:config file:_files'
'--debug[display debug messages]'
'--gpgdir[specify alternate GnuPG home directory]:gpg_directory:_files -/'
'--logfile[specify alternate log file]:config file:_files'
"--noconfirm[don't ask for confirmation]"
"--noprogressbar[don't show a progress bar when downloading files]"
"--noscriptlet[don't execute the install scriptlet if one exists]"
'--print[only print the targets instead of performing the operation]'
)
# options for passing to _arguments: options for --upgrade commands
typeset -a _yaourt_opts_pkgfile
_yaourt_opts_pkgfile=(
'-d[Skip dependency checks]'
'-f[Overwrite conflicting files]'
'-d[skip dependency checks]'
'-f[overwrite conflicting files]'
'*:package file:_files -g "*.pkg.tar*(.)"'
)
# options for passing to _arguments: subactions for --query command
typeset -a _yaourt_opts_query_actions
_yaourt_opts_query_actions=(
'-g[View all members of a package group]:*:package groups:->query_group'
'-o[Query the package that owns a file]:file:_files'
'-p[Package file to query]:*:package file:->query_file'
'-s[Search package names and descriptions]:*:search text:->query_search'
'-g[view all members of a package group]:*:package groups:->query_group'
'-o[query the package that owns a file]:file:_files'
'-p[package file to query]:*:package file:->query_file'
'-s[search package names and descriptions]:*:search text:->query_search'
)
# options for passing to _arguments: options for --query and subcommands
typeset -a _yaourt_opts_query_modifiers
_yaourt_opts_query_modifiers=(
'-c[List package changelog]'
'-d[List packages installed as dependencies]'
'-e[List packages explicitly installed]'
'-i[View package information]'
'-ii[View package information including backup files]'
'-k[Check package files]'
'-l[List package contents]'
'-m[List installed packages not found in sync db(s)]'
'-t[List packages not required by any package]'
'-u[List packages that can be upgraded]'
'--aur[Install packages from aur, even if they are in community, or, with the -u option, update packages installed from aur]'
'--devel[Used with -u updates all cvs/svn/git/hg/bzr packages]'
'--date[List packages sorted ascendingly (oldest is printed first) by installation date]'
'-c[list package changelog]'
'-d[list packages installed as dependencies]'
'-e[list packages explicitly installed]'
'-i[view package information]'
'-ii[view package information including backup files]'
'-k[check package files]'
'-l[list package contents]'
'-m[list installed packages not found in sync db(s)]'
'-t[list packages not required by any package]'
'-u[list packages that can be upgraded]'
'--aur[install packages from aur, even if they are in community, or, with the -u option, update packages installed from aur]'
'--devel[used with -u updates all cvs/svn/git/hg/bzr packages]'
'--date[list packages sorted in ascending order (oldest first) by installation date]'
)
# options for passing to _arguments: options for --remove command
typeset -a _yaourt_opts_remove
_yaourt_opts_remove=(
'-c[Remove all dependent packages]'
'-d[Skip dependency checks]'
'-k[Only remove database entry, do not remove files]'
'-n[Remove protected configuration files]'
'-s[Remove dependencies not required by other packages]'
'-c[remove all dependent packages]'
'-d[skip dependency checks]'
"-k[only remove database entry, don't remove files]"
'-n[remove protected configuration files]'
'-s[remove dependencies not required by other packages]'
'*:installed package:_yaourt_completions_installed_packages'
)
# options for passing to _arguments: options for --sync command
typeset -a _yaourt_opts_sync_actions
_yaourt_opts_sync_actions=(
'*-c[Remove old packages from cache]:*:clean:->sync_clean'
'*-cc[Remove all packages from cache]:*:clean:->sync_clean'
'-g[View all members of a package group]:*:package groups:->sync_group'
'-s[Search package names and descriptions]:*:search text:->sync_search'
'*-c[remove old packages from cache]:*:clean:->sync_clean'
'*-cc[remove all packages from cache]:*:clean:->sync_clean'
'-g[view all members of a package group]:*:package group:->sync_group'
'-s[search package names and descriptions]:*:search text:->sync_search'
)
# options for passing to _arguments: options for --sync command
typeset -a _yaourt_opts_sync_modifiers
_yaourt_opts_sync_modifiers=(
'-d[Skip dependency checks]'
'-f[Overwrite conflicting files]'
'-i[View package information]'
'-l[List all packages in a repository]'
'-p[Print download URIs for each package to be installed]'
'-u[Upgrade all out-of-date packages]'
'-w[Download packages only]'
'-y[Download fresh package databases]'
'*--ignore[Ignore a package upgrade]:package:
'-d[skip dependency checks]'
'-f[overwrite conflicting files]'
'-i[view package information]'
'-l[list all packages in a repository]'
'-p[print download URIs for each package to be installed]'
'-u[upgrade all out-of-date packages]'
'-w[download packages only]'
'-y[download fresh package databases]'
'*--ignore[ignore a package upgrade]:package:
_yaourt_completions_all_packages'
'*--ignoregroup[Ignore a group upgrade]:package group:
'*--ignoregroup[ignore a group upgrade]:package group:
_yaourt_completions_all_groups'
'--asdeps[Install packages as non-explicitly installed]'
'--asexplicit[Install packages as explicitly installed]'
'--needed[Do not reinstall up to date packages]'
'--devel[Used with -u updates all cvs/svn/git/hg/bzr packages]'
'--asdeps[install packages as non-explicitly installed]'
'--asexplicit[install packages as explicitly installed]'
"--needed[don't reinstall up to date packages]"
'--devel[used with -u updates all cvs/svn/git/hg/bzr packages]'
)
case $words[2] in

View File

@@ -37,14 +37,14 @@
_commands=(
'access'
'cache'
'autoclean:Clean and remove unnecessary files from package dependencies'
'cache:List or clean every cached package'
"check:Verify package dependencies agains yarn's lock file"
'clean:Cleans and removes unnecessary files from package dependencies'
'config:Manages the yarn configuration files'
'generate-lock-entry:Generates a lock file entry'
'global:Install packages globally on your operating system'
'help:Show information about a command'
'import'
'import:Generate yarn.lock from an existing npm-installed node_modules folder'
'info:Show information about a package'
'init:Interactively creates or updates a package.json file'
'install:Install all the dependencies listed within package.json'
@@ -53,16 +53,16 @@ _commands=(
'list:List installed packages'
'login:Store registry username and email'
'logout:Clear registry username and email'
'outdated:Checks for outdated package dependencies'
'outdated:Check for outdated package dependencies'
'owner:Manage package owners'
'pack:Creates a compressed gzip archive of package dependencies'
'publish:Publishes a package to the npm registry'
'run:Runs a defined package script'
'pack:Create a compressed gzip archive of package dependencies'
'publish:Publish a package to the npm registry'
'run:Run a defined package script'
'tag:Add, remove, or list tags on a package'
'team:Maintain team memberships'
'unlink:Unlink a previously created symlink for a package'
'version:Updates the package version'
'versions'
'version:Update the package version'
'versions:Display version information of currently installed Yarn, Node.js, and its dependencies'
'why:Show information about why a package is installed'
)
@@ -76,13 +76,13 @@ _global_commands=(
_yarn_commands_scripts() {
local -a scripts
scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g' | tr , '\n'))
scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g' | tr , '\n' | sed -e 's/:/\\:/g'))
_describe 'command or script' _commands -- _global_commands -- scripts
}
_yarn_scripts() {
local -a scripts
scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g' | tr , '\n'))
scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g' | tr , '\n' | sed -e 's/:/\\:/g'))
_describe 'script' scripts
}

View File

@@ -38,25 +38,24 @@
#
# ------------------------------------------------------------------------------
_zcash-cli() {
local context state line curcontext="$curcontext"
local state line curcontext="$curcontext" ret=1
_arguments -C \
-?'[This help message]' \
-conf='[Specify configuration file (default: zcash.conf)]:PATH:_files' \
-datadir='[Specify data directory]:PATH:_directories' \
-testnet'[Use the test network]' \
-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.]' \
-rpcconnect='[Send commands to node running on <ip> (default: 127.0.0.1)]:RPCCONNECT:_hosts' \
-rpcport='[Connect to JSON-RPC on <port> (default: 8232 or testnet: 18232)]: :_guard "[[\:digit\:]]#" "PORT"' \
-rpcwait'[Wait for RPC server to start]' \
-rpcuser='[Username for JSON-RPC connections]:RPCUSER:()' \
-rpcpassword='[Password for JSON-RPC connections]:RPCPASSWORD:()' \
-rpcclienttimeout='[Timeout in seconds during HTTP requests, or 0 for no timeout. (default: 900)]: :_guard "[[\:digit\:]]#" "RPCCLIENTTIMEOUT"' \
':subcommand:->subcommand' && ret=0
_arguments -C \
'-?[display usage information]' \
-conf='[specify configuration file]:file [zcash.conf]:_files' \
-datadir='[specify data directory]:directory:_directories' \
-testnet'[use the test network]' \
-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.]' \
-rpcconnect='[send commands to node running on specified ip]:rpcconnect [127.0.0.1]:_hosts' \
-rpcport='[connect to JSON-RPC on specified port]: :_guard "[[\:digit\:]]#" "port [8232 or testnet\: 18232]"' \
-rpcwait'[wait for RPC server to start]' \
-rpcuser='[username for JSON-RPC connections]:rpcuser' \
-rpcpassword='[password for JSON-RPC connections]:rpcpassword' \
-rpcclienttimeout='[specify timeout during HTTP requests, or 0 for no timeout]: :_guard "[[\:digit\:]]#" "timeout (seconds) [900]"' \
':subcommand:->subcommand' && ret=0
case $state in
subcommand)
case $state in
subcommand)
subcommands=(
'getbestblockhash'
'getblock'
@@ -167,13 +166,11 @@ _zcash-cli() {
'zcsamplejoinsplit'
)
_describe -t subcommands 'zcash-cli subcommands' subcommands && ret=0
esac
_describe -t subcommands 'zcash-cli subcommand' subcommands && ret=0
;;
esac
return ret
}
_zcash-cli "$@"
return ret
# Local Variables:
# mode: Shell-Script

View File

@@ -6,7 +6,7 @@ with examples, so that you can learn how to write more advanced completion funct
give enough information and examples to get you up and running. If you need more details you can look it up for yourself in the
[[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System][official documentation]].
Please make any scripts that you create publically available for others (e.g. by forking this repo and making a [[id:64bcd501-b0f0-48c7-b8e2-07af708b95ec][pull request]]).
Please make any scripts that you create publicly available for others (e.g. by forking this repo and making a [[id:64bcd501-b0f0-48c7-b8e2-07af708b95ec][pull request]]).
Also if you have any more information to add or improvements to make to this tutorial, please do.
* Getting started
** Telling zsh which function to use for completing a command
@@ -78,7 +78,7 @@ Examples of how to use these functions are given in the next section.
*** main utility functions for overall completion
| _alternative | Can be used to generate completion candidates from other utility functions or shell code. |
| _arguments | Used to specify how to complete individual options & arguments for a command with unix style options. |
| _describe | Used for creating simple completions consisting of single words with descriptions (but no actions). Easier to use than _arguments |
| _describe | Used for creating simple completions consisting of words with descriptions (but no actions). Easier to use than _arguments |
| _gnu_generic | Can be used to complete options for commands that understand the `--help' option. |
| _regex_arguments | Creates a function for matching commandline arguments with regular expressions, and then performing actions/completions. |
*** functions for performing complex completions of single words
@@ -86,6 +86,7 @@ Examples of how to use these functions are given in the next section.
| _combination | Used to complete combinations of values, for example pairs of hostnames and usernames. |
| _multi_parts | Used for completing multiple parts of words separately where each part is separated by some char, e.g. for completing partial filepaths: /u/i/sy -> /usr/include/sys |
| _sep_parts | Like _multi_parts but allows different separators at different parts of the completion. |
| _sequence | Used as a wrapper around another completion function to complete a delimited list of matches generated by that other function.
*** functions for completing specific types of objects
| _path_files | Used to complete filepaths. Take several options to control behaviour. |
| _files | Calls _path_files with all options except -g and -/. These options depend on file-patterns style setting. |
@@ -119,72 +120,76 @@ _regex_arguments or _alternative functions.
** Writing simple completion functions using _describe
The _describe function can be used for simple completions where the order and position of the options/arguments is
not important. You just need to create an array parameter to hold the options & their descriptions, and then pass
the parameter name as an argument to _describe. The following example creates completion candidates -c and -d, with
the parameter name as an argument to _describe. The following example creates completion candidates c and d, with
the descriptions (note this should be put in a file called _cmd in some directory listed in $fpath).
#+BEGIN_SRC sh
#compdef cmd
local -a options
options=('-c:description for -c opt' '-d:description for -d opt')
_describe 'values' options
local -a subcmds
subcmds=('c:description for c command' 'd:description for d command')
_describe 'command' subcmds
#+END_SRC
You can use several different lists separated by a double hyphen e.g. like this:
You can use several different lists separated by a double hyphen as follows but note that this mixes the matches under and single heading and is not intended to be used with different types of completion candidates:
#+BEGIN_SRC sh
local -a options arguments
options=('-c:description for -c opt' '-d:description for -d opt')
arguments=('e:description for e arg' 'f:description for f arg')
_describe 'values' options -- arguments
local -a subcmds topics
subcmds=('c:description for c command' 'd:description for d command')
topics=('e:description for e help topic' 'f:description for f help topic')
_describe 'command' subcmds -- topics
#+END_SRC
If two candidates have the same description, _describe collects them together on the same rowand ensures that descriptions are aligned in neatedly in columns.
The _describe function can be used in an ACTION as part of a specification for _alternative, _arguments or _regex_arguments.
In this case you will have to put it in braces with its arguments, e.g. 'TAG:DESCRIPTION:{_describe 'values' options}'
** Writing completion functions using _alternative
Like _describe, this function performs simple completions where the order and position of options/arguments is not important.
However, unlike _describe, you can call execute shell code or call functions to obtain the completion candidates.
However, unlike _describe, instead of fixed matches further functions may be called to generate the completion candidates. Furthermore, _alternative allows a mix of different types of completion candidates to be mixed.
As arguments it takes a list of specifications each in the form 'TAG:DESCRIPTION:ACTION' where TAG is a tag name,
DESCRIPTION is a description, and ACTION is one of the action types listed previously (apart from the ->STRING and =ACTION forms).
As arguments it takes a list of specifications each in the form 'TAG:DESCRIPTION:ACTION' where TAG is a special tag that identifies the type of completion matches,
DESCRIPTION is used as a heading to describe the group of completion candidates collectively, and ACTION is one of the action types listed previously (apart from the ->STRING and =ACTION forms).
For example:
#+BEGIN_SRC sh
_alternative 'args:custom args:(a b c)' 'files:filenames:_files'
_alternative 'arguments:custom arg:(a b c)' 'files:filename:_files'
#+END_SRC
The first specification adds completion candidates a, b & c, and the second specification calls the _files function
for completing filepaths.
The first specification adds completion candidates a, b & c, and the second specification calls the _files function for completing filepaths.
We could split the specifications over several lines with \ and add descriptions to each of the custom args like this:
#+BEGIN_SRC sh
_alternative 'args:custom args:((a\:"description a" b\:"description b" c\:"description c"))'\
'files:filenames:_files'
_alternative \
'args:custom arg:((a\:"description a" b\:"description b" c\:"description c"))' \
'files:filename:_files'
#+END_SRC
If we want to call _files with arguments we can put it in braces, like this:
If we want to pass arguments to _files they can simply be included, like this:
#+BEGIN_SRC sh
_alternative 'args:custom args:((a\:"description a" b\:"description b" c\:"description c"))'\
'files:filenames:{_files -/}'
_alternative \
'args:custom arg:((a\:"description a" b\:"description b" c\:"description c"))'\
'files:filename:_files -/'
#+END_SRC
To use parameter expansion to create our list of completions we must use double quotes to quote the specifications,
e.g:
#+BEGIN_SRC sh
_alternative "dirs:user directories:($userdirs)"\
"pids:process IDs:($(ps -A o pid=))"
_alternative \
"dirs:user directory:($userdirs)" \
"pids:process ID:($(ps -A o pid=))"
#+END_SRC
In this case the first specification adds the words stored in the $userdirs variable, and the second specification
evaluates 'ps -A o pid=' to get a list of pids to use as completion candidates.
evaluates 'ps -A o pid=' to get a list of pids to use as completion candidates. In practice, we would make used of the existing _pids function for this.
We can use other utility functions such as _values in the ACTION to perform more complex completions, e.g:
#+BEGIN_SRC sh
_alternative "dirs:user directories:($userdirs)"\
'opts:comma separated opts:{_values -s , a b c}'
_alternative \
"directories:user directory:($userdirs)" \
'options:comma-separated opt: _values -s , letter a b c'
#+END_SRC
this will complete the items in $userdirs, aswell as a comma separated list containing a, b &/or c.
this will complete the items in $userdirs, as well as a comma separated list containing a, b &/or c. Note the use of the initial space before _values. This is needed because _values doesn't understand standard compadd options for descriptions.
As with _describe, the _alternative function can itself be used in an ACTION as part of a specification for _arguments
or _regex_arguments.
** Writing completion functions using _arguments
With the _arguments function you can create more sophisticated completion functions.
With a single call to the _arguments function you can create fairly sophisticated completion functions. It is intended to handle typical commands that take a variety of options along with some normal arguments.
Like the _alternative function, _arguments takes a list of specification strings as arguments.
These specification strings can be for specifying options and any corresponding option arguments (e.g. -f filename),
These specification strings specify options and any corresponding option arguments (e.g. -f filename),
or command arguments.
Basic option specifications take the form '-OPT[DESCRIPTION]', e.g. like this:
@@ -227,11 +232,11 @@ In this case paths to music files are completed stepwise descending down directo
and the flags are completed as a comma separated list using the _values function.
I have just given you the basics of _arguments specifications here, you can also specify mutually exclusive options,
repeated options & arguments, options beginning with + insead of -, etc. For more details see the [[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System][official documentation]].
repeated options & arguments, options beginning with + instead of -, etc. For more details see the [[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System][official documentation]].
Also have a look at the tutorials mentioned at the end of this document, and the completion functions in the [[https://github.com/vapniks/zsh-completions/tree/master/src][src directory]].
** Writing completion functions using _regex_arguments and _regex_words
If you have a complex command line specification with several different possible argument sequences then
the _regex_arguments function may be what you need.
the _regex_arguments function may be what you need. It typically works well where you have a series of keywords followed by a variable number of arguments.
_regex_arguments creates a completion function whose name is given by the first argument.
Hence you need to first call _regex_arguments to create the completion function, and then call that function,
@@ -251,7 +256,7 @@ For example:
_regex_arguments _cmd SEQ1 '|' SEQ2 \( SEQ2a '|' SEQ2b \)
_cmd "$@"
#+END_SRC
this specifies a command line matching either SEQ1, or SEQ2 followed by SEQ2a or SEQ2b.
This specifies a command line matching either SEQ1, or SEQ2 followed by SEQ2a or SEQ2b. You are describing the form arguments to the command take in the form of a regular expression grammar.
Each specification in a sequence must contain a / PATTERN/ part at the start followed by an optional ':TAG:DESCRIPTION:ACTION'
part.
@@ -266,7 +271,7 @@ except that it has an extra : at the start, and now all of the possible ACTION f
Here is an example:
#+BEGIN_SRC sh
_regex_arguments _hello /$'[^\0]##\0'/ \( /$'word1(a|b|c)\0'/ ':word:first word:(word1a word1b word1c)' '|'\
_regex_arguments _cmd /$'[^\0]##\0'/ \( /$'word1(a|b|c)\0'/ ':word:first word:(word1a word1b word1c)' '|'\
/$'word11(a|b|c)\0'/ ':word:first word:(word11a word11b word11c)' \( /$'word2(a|b|c)\0'/ ':word:second word:(word2a word2b word2c)'\
'|' /$'word22(a|b|c)\0'/ ':word:second word:(word22a word22b word22c)' \) \)
_cmd "$@"
@@ -435,6 +440,6 @@ you can add another empty option (i.e. \:) to the ACTION like this ':TAG:DESCRIP
Note this only applies to utility functions that use ACTIONs in their specification arguments (_arguments, _regex_arguments, etc.)
* Other resources
[[http://wikimatze.de/writing-zsh-completion-for-padrino.html][Here]] is a nicely formatted short tutorial showing basic usage of the _arguments function,
[[https://wikimatze.de/writing-zsh-completion-for-padrino/][Here]] is a nicely formatted short tutorial showing basic usage of the _arguments function,
and [[http://www.linux-mag.com/id/1106/][here]] is a slightly more advanced tutorial using the _arguments function.
[[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System][Here]] is the zshcompsys man page.

View File

@@ -99,7 +99,7 @@ zstyle ':completion:*:history-words' remove-all-dups yes
zstyle ':completion:*:history-words' list false
zstyle ':completion:*:history-words' menu yes
# Environmental Variables
# Environment Variables
zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}
# Populate hostname completion. But allow ignoring custom entries from static