Compare commits
No commits in common. "master" and "0.36.0" have entirely different histories.
|
|
@ -18,7 +18,7 @@ zsh-completions  |
|
||||
| Arch Linux / Manjaro / Antergos / Hyperbola | [zsh-completions](https://www.archlinux.org/packages/zsh-completions), [zsh-completions-git](https://aur.archlinux.org/packages/zsh-completions-git) |
|
||||
| Gentoo / Funtoo | [app-shells/zsh-completions](https://packages.gentoo.org/packages/app-shells/zsh-completions) |
|
||||
| NixOS | [zsh-completions](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/zs/zsh-completions/package.nix) |
|
||||
| NixOS | [zsh-completions](https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/zsh/zsh-completions/default.nix) |
|
||||
| Void Linux | [zsh-completions](https://github.com/void-linux/void-packages/blob/master/srcpkgs/zsh-completions/template) |
|
||||
| Slackware | [Slackbuilds](https://slackbuilds.org/repository/14.2/system/zsh-completions/) |
|
||||
| macOS | [homebrew](https://github.com/Homebrew/homebrew-core/blob/master/Formula/z/zsh-completions.rb), [MacPorts](https://github.com/macports/macports-ports/blob/master/sysutils/zsh-completions/Portfile) |
|
||||
|
|
|
|||
80
src/_ab
80
src/_ab
|
|
@ -1,80 +0,0 @@
|
|||
#compdef ab
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for ab 2.4 (https://httpd.apache.org/docs/2.4/programs/ab.html)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'-A[Supply BASIC Authentication credential to the server]:auth' \
|
||||
'-b[Size of TCP send/receive buffer in bytes]:bytes' \
|
||||
'-B[Address to bind to when making outgoing connections]:address' \
|
||||
'-c[Number of multiple requests to perform at a time(Default 1)]:num' \
|
||||
'*-C[Add a cookie]:cookie' \
|
||||
'-d[Do not display "percentage served within XX ms table"]' \
|
||||
'-e[Write a CSV file which contains the time it took to serve that percentage of the requests]:file:_files' \
|
||||
'-E[Specify client certificate in PEM format to authenticate with the server]:file:_files' \
|
||||
'-f[Specify SSL/TLS protocol]:protocol:(SSL2 SSL3 TLS1 TLS1.1 TLS1.2 ALL)' \
|
||||
'-g[Write all measured values out as a "gnuplot" or TSV file]:file:_files' \
|
||||
'(- *)-h[Display usage information]' \
|
||||
'*-H[Append extra headers to the request]:header' \
|
||||
'-i[Do HEAD requests instead of GET]' \
|
||||
'-k[Enable the HTTP KeepAlive feature]' \
|
||||
'-l[Do not report errors if the length of the responses is not constant]' \
|
||||
'-m[Custom HTTP method for the requests]:method:(DELETE GET HEAD POST PUT)' \
|
||||
'-n[Number of requests to perform for the benchmarking session]:requests' \
|
||||
'-p[File containing data to POST, remember to also set -T]:file:_files' \
|
||||
'-P[Supply BASIC Authentication credentials to a proxy en-route]:auth' \
|
||||
'-q[Suppress messages when processing more than 150 requests]' \
|
||||
'-r[Do not exit on socket receive errors]' \
|
||||
'-s[Maximum number of seconds to wait before the socket times out(Default 30seconds)]:seconds' \
|
||||
'-S[Do not display the median and standard deviation values]' \
|
||||
'-t[Maximum number of seconds to spend for benchmarking]:time' \
|
||||
'-T[Content-Type header to use for POST/PUT data]:content_type' \
|
||||
'-u[File containing data to PUT, remember to also set -T]:file:_files' \
|
||||
'-v[Set verbosity level]:level:(1 2 3 4)' \
|
||||
'(- *)-V[Display version number and exit]' \
|
||||
'-w[Print out results in HTML tables]' \
|
||||
'*-x[String to use as attributes for "table" tag]:attribute' \
|
||||
'-X[use a proxy server for the requests]:proxy' \
|
||||
'*-y[String to use as attributes for "tr" tag]:attribute' \
|
||||
'*-z[String to use as attributes for "td" tag]:attribute' \
|
||||
'-Z[Specify SSL/TLS cipher suite(See openssl ciphers)]:cipher' \
|
||||
'*:: :_urls'
|
||||
|
||||
# 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
|
||||
|
|
@ -69,10 +69,3 @@ esac
|
|||
|
||||
return $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ case $service in
|
|||
;;
|
||||
(mp4dash)
|
||||
options+=(
|
||||
'(- *)'{-h,--help}'[Show help message and exit]'
|
||||
'(- *)'{-h,--help}'[Show this help message and exit]'
|
||||
'(-v --verbose)'{-v,--verbose}'[Be verbose]'
|
||||
'(-d --debug)'{-d,--debug}'[Print out debugging information]'
|
||||
'(-o --output-dir)'{-o,--output-dir=}'[Output directory]:dir:_files -/'
|
||||
|
|
@ -148,7 +148,7 @@ case $service in
|
|||
;;
|
||||
(mp4dashclone)
|
||||
options+=(
|
||||
'(- *)'{-h,--help}'[Show help message and exit]'
|
||||
'(- *)'{-h,--help}'[Show this help message and exit]'
|
||||
'--quiet[Be quiet]'
|
||||
'--encrypt=[Encrypt the media with KID and KEY specified in HEX(32 characters each)]:key'
|
||||
'--exec-dir=[Directory where the Bento4 executables are located]:dir:_files -/'
|
||||
|
|
@ -226,7 +226,7 @@ case $service in
|
|||
;;
|
||||
(mp4hls)
|
||||
options+=(
|
||||
'(- *)'{-h,--help}'[Show help message and exit]'
|
||||
'(- *)'{-h,--help}'[Show this help message and exit]'
|
||||
'(-v --verbose)'{-v,--verbose}'[Be verbose]'
|
||||
'(-d --debug)'{-d,--debug}'[Print out debugging information]'
|
||||
'(-o --output-dir)'{-o,--output-dir=}'[Output directory]:dir:_files -/'
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ _bitcoin-cli() {
|
|||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
-?'[Show help message]' \
|
||||
-?'[This help message]' \
|
||||
-addrinfo'[Get the number of addresses known to the node, per network and total]' \
|
||||
-chain='[Use the chain <chain> (default: main). Allowed values: main, test, signet, regtest]:chain:(main test signet regtest)' \
|
||||
-color='[Color setting for CLI output (default: auto)]:when:(always auto never)' \
|
||||
|
|
|
|||
54
src/_bower
54
src/_bower
|
|
@ -43,15 +43,6 @@ local curcontext="$curcontext" state line _opts ret=1
|
|||
|
||||
_arguments -C \
|
||||
'(- 1 *)'{-v,--version}'[display version information]' \
|
||||
'--force[make various commands more forceful]' \
|
||||
'--json[output consumable JSON]' \
|
||||
'--log-level[what level of logs to report]:log level:(error conflict warn action info debug)' \
|
||||
"--offline[don't hit the network]" \
|
||||
'--quiet[only output important information]' \
|
||||
"--silent[don't output anything, besides errors]" \
|
||||
'--verbose[make output more verbose]' \
|
||||
'--allow-root[allow running commands as root]' \
|
||||
'--no-color[disable colors]' \
|
||||
'1: :->cmds' \
|
||||
'*:: :->args' && ret=0
|
||||
|
||||
|
|
@ -75,6 +66,17 @@ case $state in
|
|||
"uninstall[remove a local package]" \
|
||||
"unregister[remove a package from the registry]" \
|
||||
"version[bump a package version]" && ret=0
|
||||
_arguments \
|
||||
'(--force)--force[make various commands more forceful]' \
|
||||
'(--json)--json[output consumable JSON]' \
|
||||
'(--log-level)--log-level[what level of logs to report]' \
|
||||
"(--offline)--offline[don't hit the network]" \
|
||||
'(--quiet)--quiet[only output important information]' \
|
||||
"(--silent)--silent[don't output anything, besides errors]" \
|
||||
'(--verbose)--verbose[make output more verbose]' \
|
||||
'(--allow-root)--allow-root[allow running commands as root]' \
|
||||
'(--version)--version[output Bower version]' \
|
||||
'(--no-color)--no-color[disable colors]' && ret=0
|
||||
;;
|
||||
args)
|
||||
case $line[1] in
|
||||
|
|
@ -99,42 +101,42 @@ case $state in
|
|||
;;
|
||||
(home|info|init|link|lookup|prune|register|search|unregister)
|
||||
_arguments \
|
||||
'--help[show help message]' && ret=0
|
||||
'(--help)--help[show help message]' && ret=0
|
||||
;;
|
||||
install)
|
||||
_arguments \
|
||||
'--force-latest[force latest version on conflict]' \
|
||||
'--help[show help message]' \
|
||||
"--production[don't install project devDependencies]" \
|
||||
"--save[save installed packages into the project's bower.json dependencies]" \
|
||||
"--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[show help message]' \
|
||||
'--paths[generate a simple JSON source mapping]' \
|
||||
'--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[show help message]' \
|
||||
'(--help)--help[show help message]' \
|
||||
'(-t --token)'{-t,--token}'[Pass GitHub auth token (will not prompt for username/password)]' && ret=0
|
||||
;;
|
||||
uninstall)
|
||||
_arguments \
|
||||
'--help[show help message]' \
|
||||
"--save[save installed packages into the project's bower.json dependencies]" \
|
||||
"--save-dev[save installed packages into the project'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 version on conflict]' \
|
||||
'--help[show help message]' \
|
||||
"--production[don't 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[custom git commit and tag message]' && ret=0
|
||||
'(--message)--message[custom git commit and tag message]' && ret=0
|
||||
;;
|
||||
exec)
|
||||
_normal && ret=0
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ _bundle() {
|
|||
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
_arguments -C -A "-v" -A "--version" \
|
||||
'(- 1 *)'{-v,--version}'[display version information]' \
|
||||
'(-r --retry)'{-r,--retry}'[specify the number of times you with to attempt network commands]:number:' \
|
||||
'(-V --verbose)'{-V,--verbose}'[print out additional logging information]' \
|
||||
|
|
|
|||
68
src/_cask
68
src/_cask
|
|
@ -41,32 +41,16 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
function _cask() {
|
||||
typeset -A opt_args
|
||||
local context state line ret=1
|
||||
local curcontext="$curcontext"
|
||||
|
||||
_arguments -C \
|
||||
'(--proxy --http-proxy )--http-proxy[Set emacs proxy for HTTP]:host:_hosts' \
|
||||
'(--proxy --https-proxy)--https-proxy[Set emacs proxy for HTTPS]:host:_hosts' \
|
||||
'( --http-proxy --https-proxy)--proxy[Set emacs proxy for HTTPS and HTTPS]:host:_hosts' \
|
||||
'--no-proxy[Set Emacs no-proxy to HOST (emacs pattern of hosts to not use proxy for)]:pattern:_hosts' \
|
||||
'(- *)--version[Print Cask version and exit]' \
|
||||
'(- *)'{-h,--help}'[Display usage or information for command]::command:->subcommand' \
|
||||
'--debug[Turn on debug output]' \
|
||||
'--path[Run command in this PATH instead of default-directory]:dir:_files -/' \
|
||||
'(--verbose --silent)--verbose[Be verbose and show debug output]' \
|
||||
'(--verbose --silent)--silent[Be silent and do not show anything]' \
|
||||
local ret=1 state
|
||||
_arguments \
|
||||
':subcommand:->subcommand' \
|
||||
'*:: :->subcmds' \
|
||||
&& ret=0
|
||||
'*:: :->subcmds' && ret=0
|
||||
|
||||
case $state in
|
||||
(subcommand)
|
||||
local -a subcommands=(
|
||||
subcommand)
|
||||
subcommands=(
|
||||
"build:build all Elisp files in the files directive"
|
||||
"clean-elc:remove all byte compiled Elisp files in the files directive"
|
||||
"emacs:run emacs"
|
||||
"eval:evaluate FORM as a lisp form"
|
||||
"exec:execute command with correct 'exec-path' and 'load-path'"
|
||||
"exec-path:print 'exec-path' for all packages and dependencies"
|
||||
"files:print list of files specified in the files directive"
|
||||
|
|
@ -87,33 +71,15 @@ function _cask() {
|
|||
"upgrade:upgrade Cask itself and its dependencies"
|
||||
"version:print program version"
|
||||
)
|
||||
|
||||
_describe -t subcommands 'cask subcommands' subcommands && ret=0
|
||||
;;
|
||||
(subcmds)
|
||||
case "$words[1]" in
|
||||
(init)
|
||||
_arguments \
|
||||
'(--dev)--dev[Run in dev mode]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(exec)
|
||||
_generic
|
||||
;;
|
||||
(emacs)
|
||||
_as_if emacs && ret=0
|
||||
;;
|
||||
(help)
|
||||
_as_if cask --help && ret=0
|
||||
;;
|
||||
(link)
|
||||
_message "completion unimplemented"
|
||||
ret=0
|
||||
;;
|
||||
(package)
|
||||
_wanted package-dir expl 'package directory' _files -/ && ret=0
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
case "$words[1]" in
|
||||
init)
|
||||
_arguments \
|
||||
'(--dev)--dev[Run in dev mode]' && ret=0 ;;
|
||||
exec)
|
||||
_generic
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
@ -121,11 +87,3 @@ function _cask() {
|
|||
}
|
||||
|
||||
_cask "$@"
|
||||
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ __ccache_config_keys() {
|
|||
|
||||
if compset -P '--set-config=*='; then
|
||||
case $IPREFIX in
|
||||
( *=absolute_paths_in_stderr= | *=compression= | *=debug= | *=depend_mode= | *=direct_mode= | *=disable= | *=file_clone= | *=hard_link= | *=hash_dir= | *=inode_cache= | *=keep_comments_cpp= | *=read_only= | *=read_only_direct= | *=recache= | *=run_second_cpp= | *=stats= | *=unify= )
|
||||
( *=absolute_paths_in_stderr= | *=compression= | *=debug= | *=depend_mode= | *=direct_mode= | *=disable= | *=file_clone= | *=hard_link= | *=hash_dir= | *=inode_cache= | *=keep_comments_cpp= | *=read_only= | *=read_only_direct= | *=recache= | *=run_second_cpp= | *=stats= | *=unify= )
|
||||
local -a booleans=('true' 'false')
|
||||
_describe -t booleans 'boolean' booleans
|
||||
;;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ _chatblade() {
|
|||
typeset -A opt_args
|
||||
|
||||
args+=(
|
||||
'(- *)'{-h,--help}'[show help message and exit]'
|
||||
'(- *)'{-h,--help}'[show this help message and exit]'
|
||||
'(- *)--version[display the chatblade version]'
|
||||
'--openai-api-key[the OpenAI API key can also be set as env variable OPENAI_API_KEY]:key'
|
||||
'--openai-base-url[a custom URL to use the openAI against a local or custom model]:key'
|
||||
|
|
|
|||
10
src/_chcpu
10
src/_chcpu
|
|
@ -35,12 +35,12 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(- *)'{-V,--version}'[display version]' \
|
||||
'(-c --configure)'{-c,--configure}'[configure the specified CPUs]:cpu list (0,5,7,9-11)' \
|
||||
'(-d --disable)'{-d,--disable}'[disable the specified CPUs]:cpu list (0,5,7,9-11)' \
|
||||
'(-e --enable)'{-e,--enable}'[enable the specified CPUs]:cpu list (0,5,7,9-11)' \
|
||||
'(-g --deconfigure)'{-g,--deconfigure}'[deconfigure the specified CPUs]:cpu_list (0,5,7,9-11)' \
|
||||
'(-c --configure)'{-c,--configure}'[configure the specified CPUs]:cpu_list' \
|
||||
'(-d --disable)'{-d,--disable}'[disable the specified CPUs]:cpu_list' \
|
||||
'(-e --enable)'{-e,--enable}'[enable the specified CPUs]:cpu_list' \
|
||||
'(-g --deconfigure)'{-g,--deconfigure}'[deconfigure the specified CPUs]:cpu_list' \
|
||||
'(-p --dispatch)'{-p,--dispatch}'[set the CPU dispatching mode]:mode:(horizontal vertical)' \
|
||||
'(-r --rescan)'{-r,--rescan}'[trigger a rescan of CPUs]'
|
||||
|
||||
|
|
|
|||
23
src/_chmem
23
src/_chmem
|
|
@ -35,29 +35,14 @@
|
|||
# *Aditi Sharma (https://github.com/Aditi76117)
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local arg
|
||||
if (( ${words[(I)(-b|--blocks)]} )); then
|
||||
arg=blockrange
|
||||
else
|
||||
arg='size or range'
|
||||
fi
|
||||
if (( ${words[(I)(-e|-d|-c|-m|--disable|--enable|--deconfigure|--configure)]} )); then
|
||||
arg="1:${arg}"
|
||||
else
|
||||
unset arg
|
||||
fi
|
||||
_arguments -s \
|
||||
'(-b --blocks)'{-b,--blocks}'[Use a BLOCKRANGE parameter instead of RANGE or SIZE]' \
|
||||
'(-e --enable -d --disable -c --configure -g --deconfigure -m --memmap-on-memory)'{-d,--disable}'[Set the specified RANGE, SIZE, or BLOCKRANGE of memory offline]' \
|
||||
'(-e --enable -d --disable -c --configure -g --deconfigure -m --memmap-on-memory)'{-e,--enable}'[Set the specified RANGE, SIZE, or BLOCKRANGE of memory online]' \
|
||||
'(-e --enable -d --disable -c --configure -g --deconfigure -m --memmap-on-memory)'{-g,--deconfigure}'[Deconfigure the specified RANGE, SIZE, or BLOCKRANGE of memory]' \
|
||||
'(-e --enable -d --disable -c --configure -g --deconfigure )'{-c,--configure}'[Configure the specified RANGE, SIZE, or BLOCKRANGE of memory]' \
|
||||
'(-e --enable -d --disable -g --deconfigure -m --memmap-on-memory)'{-m,--memmap-on-memory}'[Select memmap-on-memory for the specified memory]:memmap-on-memory' \
|
||||
'(-z --zone)'{-z,--zone}'[Select the memory ZONE where to set the specified RANGE, SIZE, or BLOCKRANGE of memory online or offline]:zone' \
|
||||
'(-d --disable)'{-d,--disable}'[Set the specified RANGE, SIZE, or BLOCKRANGE of memory offline]' \
|
||||
'(-e --enable)'{-e,--enable}'[Set the specified RANGE, SIZE, or BLOCKRANGE of memory online]' \
|
||||
'(-z --zone)'{-z,--zone}'[Select the memory ZONE where to set the specified RANGE, SIZE, or BLOCKRANGE of memory online or offline]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Verbose mode]' \
|
||||
'(- *)'{-h,--help}'[Display help text and exit]' \
|
||||
'(- *)'{-V,--version}'[Print version and exit]' \
|
||||
${arg}
|
||||
'(- *)'{-V,--version}'[Print version and exit]'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(-c --crypt-method)'{-c,--crypt-method}'[use the specified method to encrypt the passwords]:method:(DES MD5 SHA256 SHA512 YESCRYPT NONE)' \
|
||||
'(-e --encrypted)'{-e,--encrypted}'[supplied passwords are in encrypted form]' \
|
||||
'(-m --md5)'{-m,--md5}'[use MD5 encryption instead of DES]' \
|
||||
|
|
|
|||
|
|
@ -108,8 +108,8 @@ _chromium_proxyurls () {
|
|||
do
|
||||
while _next_label prefixes expl 'URL prefix' -S '' "$@"
|
||||
do
|
||||
compset -S '[^:/]*' && compstate[to_end]=''
|
||||
compadd "$expl[@]" http:// socks:// socks4:// socks5:// && ret=0
|
||||
compset -S '[^:/]*' && compstate[to_end]=''
|
||||
compadd "$expl[@]" http:// socks:// socks4:// socks5:// && ret=0
|
||||
done
|
||||
(( ret )) || return 0
|
||||
done
|
||||
|
|
@ -123,27 +123,27 @@ _chromium_proxyurls () {
|
|||
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 ;;
|
||||
[[ -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
|
||||
|
|
@ -153,10 +153,10 @@ _chromium_proxyurls () {
|
|||
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
|
||||
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
|
||||
|
|
@ -171,28 +171,28 @@ _chromium_proxyurls () {
|
|||
then
|
||||
if ! compset -P '(#b)([^/]#)/'
|
||||
then
|
||||
_users -S/ "$@"
|
||||
return
|
||||
_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
|
||||
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
|
||||
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
|
||||
|
|
@ -200,8 +200,8 @@ _chromium_proxyurls () {
|
|||
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
|
||||
_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
|
||||
|
|
|
|||
336
src/_cmake
336
src/_cmake
|
|
@ -28,7 +28,7 @@
|
|||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for CMake 4.3.0 (https://cmake.org).
|
||||
# Completion script for CMake 3.31.0 (https://cmake.org).
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
# Authors
|
||||
|
|
@ -51,6 +51,8 @@
|
|||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
local context state line curcontext="$curcontext" cmake_args
|
||||
|
||||
local -a cmake_build_options=(
|
||||
'-S[Explicitly specify a source directory]:source directory:_path_files -/'
|
||||
'-B[Explicitly specify a build directory]:build directory:_path_files -/'
|
||||
|
|
@ -62,7 +64,6 @@ local -a cmake_build_options=(
|
|||
'-A[Specify platform name if supported by generator]:platform name'
|
||||
'--toolchain[Specify toolchain file]: :_files'
|
||||
'--install-prefix[Specify install directory]: :_path_files -/'
|
||||
'--project-file[Specify an alternate project file name]:name'
|
||||
|
||||
# Warnings
|
||||
'(-Wdev)-Wno-dev[Suppress/Enable developer warnings]'
|
||||
|
|
@ -78,12 +79,12 @@ local -a cmake_build_options=(
|
|||
'--list-presets[List available presets]'
|
||||
'--workflow[Run a workflow preset]'
|
||||
|
||||
'-E[CMake command mode]:command:_cmake_commands'
|
||||
'-E[CMake command mode]:command:_cmake_command_help'
|
||||
|
||||
'-L-[List cache variables]::_values "options" "[non-advanced cache variables]" "A[advanced cache variables]" "H[non-advanced cached variables with help]" "AH[advanced cache variables with help]"'
|
||||
'--fresh[Configure a fresh build tree, removing any existing cache file]'
|
||||
|
||||
'--build[Build a CMake-generated project binary tree]::project directory:_path_files -/'
|
||||
'--build[Build a CMake-generated project binary tree]:project directory:_path_files -/'
|
||||
'--install[Install a CMake-generated project binary tree]:project directory:_path_files -/'
|
||||
'--open[Open generated project in the associated application]:project directory:_path_files -/'
|
||||
|
||||
|
|
@ -116,7 +117,6 @@ local -a cmake_build_options=(
|
|||
'--warn-unused-vars[Warn about unused variables]'
|
||||
'--check-system-vars[Find problems with variable usage in system files]'
|
||||
'--compile-no-warning-as-error[Ignore COMPILE_WARNING_AS_ERROR property and CMAKE_COMPILE_WARNING_AS_ERROR variable]'
|
||||
'--link-no-warning-as-error[Ignore LINK_WARNING_AS_ERROR and CMAKE_LINK_WARNING_AS_ERROR]'
|
||||
|
||||
'--profiling-format[Output data for profiling CMake scripts]:profiling format:(google-trace)'
|
||||
'--profiling-output[Select an output path for the profiling data]:filename:_files'
|
||||
|
|
@ -149,11 +149,11 @@ _cmake_generator_options() {
|
|||
# --------------
|
||||
(( $+functions[_cmake_presets] )) ||
|
||||
_cmake_presets() {
|
||||
local invoke=(${(Q)words})
|
||||
local invoke; invoke=(${(Q)words})
|
||||
invoke[$CURRENT]=()
|
||||
# TODO: remove all arguments -* except -S
|
||||
|
||||
local list_presets=(${(f)"$(${invoke} --list-presets 2>/dev/null |
|
||||
local list_presets; list_presets=(${(f)"$(${invoke} --list-presets 2>/dev/null |
|
||||
sed -n -e 's,^[[:space:]]*"\([^"]*\)"[[:space:]]*-[[:space:]]*\(.*\),\1:\2,p' \
|
||||
-e 's,^[[:space:]]*"\([^"]*\)"[[:space:]]*$,\1,p')"})
|
||||
|
||||
|
|
@ -165,16 +165,24 @@ _cmake_presets() {
|
|||
# --------------
|
||||
(( $+functions[_cmake_targets] )) ||
|
||||
_cmake_targets() {
|
||||
local dir="$1"
|
||||
local -a targets=()
|
||||
if [[ -f "${dir}/Makefile" && $+commands[make] ]]; then
|
||||
local -a targets
|
||||
if [ -f $1/Makefile ]
|
||||
then
|
||||
# `make help` doesn't work for Makefiles in general, but for CMake generated Makefiles it does.
|
||||
targets=(${(f)"$(make -f $dir/Makefile help 2>/dev/null | awk '/^\.\.\./ { print $2 }')"})
|
||||
elif [[ -f "${dir}/build.ninja" && $+commands[ninja] ]]; then
|
||||
i=1
|
||||
for target in $(make -f $1/Makefile help | \grep -e "\.\.\." | sed "s/\.\.\. //" | sed "s/ (the default.*//") ; do
|
||||
targets[$i]=$target
|
||||
(( i = $i + 1 ))
|
||||
done
|
||||
elif [ -f $1/build.ninja ]
|
||||
then
|
||||
# `ninja help` doesn't seem to be the list of targets we're interested in
|
||||
targets=(${(f)"$(ninja -C $dir -t targets all 2>/dev/null | awk -F: '{print $1}' )"})
|
||||
i=1
|
||||
for target in $(ninja -C $1 -t targets all 2&>/dev/null | awk -F: '{print $1}') ; do
|
||||
targets[$i]="$target"
|
||||
(( i++ ))
|
||||
done
|
||||
fi
|
||||
|
||||
_describe 'build targets' targets
|
||||
}
|
||||
|
||||
|
|
@ -187,69 +195,60 @@ _cmake_suggest_installdirs() {
|
|||
}
|
||||
|
||||
_cmake_on_build() {
|
||||
local build_extras=(
|
||||
local build_extras;build_extras=(
|
||||
'--[Native build tool options]'
|
||||
'--target[specify build target]'
|
||||
'--clean-first[build target clean first]'
|
||||
'--config[For multi-configuration tools]'
|
||||
'--parallel[maximum number of build processes]'
|
||||
'--use-stderr'
|
||||
)
|
||||
'--use-stderr')
|
||||
local -a undescribed_build_extras
|
||||
local i=1
|
||||
i=1
|
||||
for be in $build_extras ; do
|
||||
undescribed_build_extras[$i]=$(echo $be | sed "s/\[.*//")
|
||||
(( i++ ))
|
||||
done
|
||||
|
||||
local in_build=false
|
||||
local dash_dash_position=-1
|
||||
local build_at=$CURRENT
|
||||
inbuild=false
|
||||
dashdashposition=-1
|
||||
for ((i = (($CURRENT - 1)); i > 1 ; i--)); do
|
||||
if [[ $words[$i] == --build ]]; then
|
||||
in_build=true
|
||||
build_at=$i
|
||||
if [[ $words[$i] == --build ]] ; then
|
||||
inbuild=true
|
||||
buildat=$i
|
||||
(( difference = $CURRENT - $i ))
|
||||
elif [[ $words[$i] == -- ]]; then
|
||||
dash_dash_position=$i
|
||||
elif [[ $words[$i] == -- ]] ; then
|
||||
dashdashposition=$i
|
||||
fi
|
||||
done
|
||||
|
||||
# check if build mode has been left
|
||||
local out_of_build=false
|
||||
for ((i = (($CURRENT - 1)); i > (($build_at + 1)); i--)); do
|
||||
outofbuild=false
|
||||
for ((i = (($CURRENT - 1)); i > (($buildat + 1)); i--)); do
|
||||
# don't check the word after --build (should be a directory)
|
||||
if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $words[(($i - 1))] == --target ]]; then continue ; fi
|
||||
if [[ $words[(($i - 1))] == --config ]]; then continue ; fi
|
||||
if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]] ; then continue ; fi
|
||||
if [[ $words[(($i - 1))] == --target ]] ; then continue ; fi
|
||||
if [[ $words[(($i - 1))] == --config ]] ; then continue ; fi
|
||||
if [[ $words[(($i - 1))] == --parallel ]] ; then continue ; fi
|
||||
out_of_build=true
|
||||
outofbuild=true
|
||||
done
|
||||
|
||||
if (( $dash_dash_position > 0 )) ; then
|
||||
_cmake_generator_options $words[(($build_at + 1))] $dash_dash_position && return 0
|
||||
if (( $dashdashposition > 0 )) ; then
|
||||
_cmake_generator_options $words[(($buildat + 1))] $dashdashposition && return 0
|
||||
fi
|
||||
|
||||
if [[ "$in_build" == false || "$difference" -eq 1 ]] ; then
|
||||
if [[ "$inbuild" == false || "$difference" -eq 1 ]] ; then
|
||||
# either there is no --build or completing the directory after --build
|
||||
_arguments -s \
|
||||
_arguments -C -s \
|
||||
- build_opts \
|
||||
"$cmake_build_options[@]" \
|
||||
- build_cmds \
|
||||
"$cmake_suggest_build[@]" && return 0
|
||||
elif [[ $words[(($CURRENT - 1))] == --target ]] ; then
|
||||
# after --build <dir> --target, suggest targets
|
||||
_cmake_targets $words[(($build_at + 1))] && return 0
|
||||
_cmake_targets $words[(($buildat + 1))] && return 0
|
||||
elif [[ $words[(($CURRENT - 1))] == --config ]] ; then
|
||||
# after --build <dir> --config, no idea
|
||||
return 0
|
||||
elif [[ $words[(($CURRENT - 1))] == --parallel ]] ; then
|
||||
# after --build <dir> --parallel
|
||||
return 0
|
||||
elif [ "$out_of_build" = true ] ; then
|
||||
elif [ "$outofbuild" = true ] ; then
|
||||
# after --build <dir> --<not a --build option>, suggest other cmake_build_options (like -Wno-dev)
|
||||
_arguments "$cmake_build_options[@]" && return 0
|
||||
else
|
||||
|
|
@ -259,51 +258,45 @@ _cmake_on_build() {
|
|||
}
|
||||
|
||||
_cmake_on_install() {
|
||||
local build_extras=(
|
||||
local build_extras;build_extras=(
|
||||
'--[Native build tool options]'
|
||||
'--prefix[Override the installation prefix, CMAKE_INSTALL_PREFIX]'
|
||||
'--config[For multi-configuration generators(e.g. Visual Studio)]'
|
||||
'--component[Component-based install]'
|
||||
'--strip[Strip before installing.]'
|
||||
)
|
||||
|
||||
)
|
||||
local -a undescribed_build_extras
|
||||
local i=1
|
||||
i=1
|
||||
for be in $build_extras ; do
|
||||
undescribed_build_extras[$i]=$(echo $be | sed "s/\[.*//")
|
||||
(( i++ ))
|
||||
done
|
||||
|
||||
local in_build=false
|
||||
local dash_dash_position=-1
|
||||
local build_at=$CURRENT
|
||||
inbuild=false
|
||||
dashdashposition=-1
|
||||
for ((i = (($CURRENT - 1)); i > 1 ; i--)); do
|
||||
if [[ $words[$i] == --install ]]; then
|
||||
in_build=true
|
||||
build_at=$i
|
||||
if [[ $words[$i] == --install ]] ; then
|
||||
inbuild=true
|
||||
buildat=$i
|
||||
(( difference = $CURRENT - $i ))
|
||||
elif [[ $words[$i] == -- ]]; then
|
||||
dash_dash_position=$i
|
||||
elif [[ $words[$i] == -- ]] ; then
|
||||
dashdashposition=$i
|
||||
fi
|
||||
done
|
||||
|
||||
local out_of_build=false
|
||||
for ((i = (($CURRENT - 1)); i > (($build_at + 1)); i--)); do
|
||||
outofbuild=false
|
||||
for ((i = (($CURRENT - 1)); i > (($buildat + 1)); i--)); do
|
||||
# don't check the word after --install (should be a directory)
|
||||
if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]] ; then continue ; fi
|
||||
if [[ $words[(($i - 1))] == --prefix ]]; then continue ; fi
|
||||
if [[ $words[(($i - 1))] == --config ]]; then continue ; fi
|
||||
if [[ $words[(($i - 1))] == --component ]]; then continue ; fi
|
||||
out_of_build=true
|
||||
if [[ $words[(($i - 1))] == --prefix ]] ; then continue ; fi
|
||||
if [[ $words[(($i - 1))] == --config ]] ; then continue ; fi
|
||||
if [[ $words[(($i - 1))] == --component ]] ; then continue ; fi
|
||||
outofbuild=true
|
||||
done
|
||||
|
||||
if (( $dash_dash_position > 0 )) ; then
|
||||
_cmake_generator_options $words[(($build_at + 1))] $dash_dash_position && return 0
|
||||
if (( $dashdashposition > 0 )) ; then
|
||||
_cmake_generator_options $words[(($buildat + 1))] $dashdashposition && return 0
|
||||
fi
|
||||
|
||||
if [[ "$in_build" == false || "$difference" -eq 1 ]] ; then
|
||||
if [[ "$inbuild" == false || "$difference" -eq 1 ]] ; then
|
||||
# either there is no --install or completing the directory after --install
|
||||
_arguments -s \
|
||||
_arguments -C -s \
|
||||
- build_opts \
|
||||
"$cmake_build_options[@]" \
|
||||
- build_cmds \
|
||||
|
|
@ -317,7 +310,7 @@ _cmake_on_install() {
|
|||
elif [[ $words[(($CURRENT - 1))] == --component ]] ; then
|
||||
# after --build <dir> --component, no idea
|
||||
return 0
|
||||
elif [ "$out_of_build" = true ] ; then
|
||||
elif [ "$outofbuild" = true ] ; then
|
||||
# after --build <dir> --<not a --build option>, suggest other cmake_build_options (like -Wno-dev)
|
||||
_arguments "$cmake_build_options[@]" && return 0
|
||||
else
|
||||
|
|
@ -348,16 +341,19 @@ local -a cmake_help_actions=(
|
|||
'(- 1)--help-variable-list[List variables with help available and exit]'
|
||||
'(- 1)--help-variables[Print cmake-variables manual and exit]'
|
||||
)
|
||||
_cmake_help() {
|
||||
_arguments -C -s - help "$cmake_help_actions[@]"
|
||||
}
|
||||
|
||||
# -----------------
|
||||
# _cmake_list_names
|
||||
# -----------------
|
||||
(( $+functions[_cmake_list_names] )) ||
|
||||
_cmake_list_names() {
|
||||
local command="$@[1]"
|
||||
local desc="$@[2]"
|
||||
local opts=($@[3])
|
||||
local list_names=(${(f)"$($service $command 2> /dev/null)"})
|
||||
local command; command="$@[1]"
|
||||
local desc; desc="$@[2]"
|
||||
local opts; opts=($@[3])
|
||||
local list_names; list_names=(${(f)"$($service $command 2> /dev/null)"})
|
||||
# Older CMake (< 3.0) writes out the version
|
||||
list_names=(${^list_names##cmake version*})
|
||||
|
||||
|
|
@ -386,7 +382,7 @@ _cmake_define_property() {
|
|||
# ----------------------------
|
||||
(( $+functions[_cmake_define_property_names] )) ||
|
||||
_cmake_define_property_names() {
|
||||
local alternatives=(
|
||||
local alternatives; alternatives=(
|
||||
'common-property-names:common property name:_cmake_define_common_property_names -qS='
|
||||
)
|
||||
local -A cmake_langs
|
||||
|
|
@ -406,9 +402,8 @@ _cmake_define_property_names() {
|
|||
# ---------------------------------
|
||||
(( $+functions[_cmake_define_lang_property_names] )) ||
|
||||
_cmake_define_lang_property_names() {
|
||||
local cmake_lang="$@[-2]"
|
||||
local cmake_lang_desc="$@[-1]"
|
||||
local -a properties=(
|
||||
local cmake_lang="$@[-2]" cmake_lang_desc="$@[-1]"
|
||||
local properties; properties=(
|
||||
"CMAKE_${cmake_lang}_COMPILER:${cmake_lang_desc} compiler"
|
||||
"CMAKE_${cmake_lang}_COMPILER_LAUNCHER:${cmake_lang_desc} compiler launcher (e.g. ccache)"
|
||||
"CMAKE_${cmake_lang}_FLAGS:${cmake_lang_desc} compiler flags for all builds"
|
||||
|
|
@ -429,7 +424,7 @@ _cmake_define_lang_property_names() {
|
|||
# -----------------------------------
|
||||
(( $+functions[_cmake_define_common_property_names] )) ||
|
||||
_cmake_define_common_property_names() {
|
||||
local -a properties=(
|
||||
local properties; properties=(
|
||||
'CMAKE_MODULE_PATH:Search path for CMake modules (FindPROJECT.cmake)'
|
||||
'CMAKE_PREFIX_PATH:Search path for installations (PROJECTConfig.cmake)'
|
||||
'CMAKE_BUILD_TYPE:Specifies the build type for make based generators'
|
||||
|
|
@ -443,87 +438,51 @@ _cmake_define_common_property_names() {
|
|||
'CMAKE_UNITY_BUILD:Batch include source files'
|
||||
)
|
||||
|
||||
_describe -t 'common-property-names' 'common property name' properties "$@"
|
||||
_describe -t 'common-property-names' 'common property name' properties $@
|
||||
}
|
||||
|
||||
local _cmake_build_types=('Debug' 'Release' 'RelWithDebInfo' 'MinSizeRel')
|
||||
local _cmake_c_standards=(90 99 11)
|
||||
local _cmake_cxx_standards=(98 11 14 17 20)
|
||||
|
||||
# ----------------------------
|
||||
# _cmake_define_property_values
|
||||
# ----------------------------
|
||||
(( $+functions[_cmake_define_property_values] )) ||
|
||||
_cmake_define_property_values() {
|
||||
local ret=1
|
||||
local build_types=('Debug' 'Release' 'RelWithDebInfo' 'MinSizeRel')
|
||||
local c_standards=(90 99 11 17 23)
|
||||
local cxx_standards=(98 11 14 17 20 23)
|
||||
|
||||
setopt localoptions extendedglob
|
||||
case $@[-1] in
|
||||
(CMAKE_BUILD_TYPE)
|
||||
_wanted build-types expl 'build type' _values 'build type' ${build_types[@]} && ret=0
|
||||
;;
|
||||
(BUILD_SHARED_LIBS)
|
||||
_wanted booleans expl 'boolean' _cmake_booleans && ret=0
|
||||
;;
|
||||
(CMAKE_CXX_STANDARD)
|
||||
_wanted cxx-standards expl 'cxx standard' _values 'cxx standard' ${cxx_standards[@]} && ret=0
|
||||
;;
|
||||
(CMAKE_C_STANDARD)
|
||||
_wanted c-standards expl 'c standard' _values 'c standard' ${c_standards[@]} && ret=0
|
||||
;;
|
||||
(CMAKE_TOOLCHAIN_FILE)
|
||||
_wanted toolchain-files expl 'file' _cmake_toolchain_files && ret=0
|
||||
;;
|
||||
(CMAKE_COLOR_MAKEFILE)
|
||||
_wanted booleans expl 'boolean' _cmake_booleans && ret=0
|
||||
;;
|
||||
(CMAKE_RULE_MESSAGES)
|
||||
_wanted booleans expl 'boolean' _cmake_booleans && ret=0
|
||||
;;
|
||||
(CMAKE_VERBOSE_MAKEFILE)
|
||||
_wanted booleans expl 'boolean' _cmake_booleans && ret=0
|
||||
;;
|
||||
(CMAKE_UNITY_BUILD)
|
||||
_wanted booleans expl 'boolean' _cmake_booleans && ret=0
|
||||
;;
|
||||
(CMAKE_INSTALL_PREFIX)
|
||||
_files -/ && ret=0
|
||||
;;
|
||||
(CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
_wanted booleans expl 'boolean' _cmake_booleans && ret=0
|
||||
;;
|
||||
(CMAKE_*_COMPILER)
|
||||
_wanted compilers expl 'compiler' _cmake_compilers && ret=0
|
||||
;;
|
||||
(CMAKE_*_COMPILER_LAUNCHER)
|
||||
_wanted compilers expl 'compiler launcher' _cmake_launchers && ret=0
|
||||
;;
|
||||
(CMAKE_*_FLAGS(|_?*))
|
||||
_message -e compiler-flags 'compiler flags' && _dispatch $service -value-,CPPFLAGS,-default- && ret=0
|
||||
;;
|
||||
(CMAKE_*_STANDARD_REQUIRED)
|
||||
_wanted booleans expl 'boolean' _cmake_booleans && ret=0
|
||||
;;
|
||||
(CMAKE_*_EXTENSIONS)
|
||||
_wanted booleans expl 'boolean' _cmake_booleans && ret=0
|
||||
;;
|
||||
(*)
|
||||
_files && ret=0
|
||||
;;
|
||||
(CMAKE_BUILD_TYPE) _wanted build-types expl 'build type' _values 'build type' ${_cmake_build_types[@]} && ret=0;;
|
||||
(BUILD_SHARED_LIBS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
|
||||
(CMAKE_CXX_STANDARD) _wanted cxx-standards expl 'cxx standard' _values 'cxx standard' ${_cmake_cxx_standards[@]} && ret=0;;
|
||||
(CMAKE_C_STANDARD) _wanted c-standards expl 'c standard' _values 'c standard' ${_cmake_c_standards[@]} && ret=0;;
|
||||
(CMAKE_TOOLCHAIN_FILE) _wanted toolchain-files expl 'file' _cmake_toolchain_files && ret=0;;
|
||||
(CMAKE_COLOR_MAKEFILE) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
|
||||
(CMAKE_RULE_MESSAGES) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
|
||||
(CMAKE_VERBOSE_MAKEFILE) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
|
||||
(CMAKE_UNITY_BUILD) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
|
||||
(CMAKE_INSTALL_PREFIX) _files -/ && ret=0;;
|
||||
(CMAKE_EXPORT_COMPILE_COMMANDS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
|
||||
(CMAKE_*_COMPILER) _wanted compilers expl 'compiler' _cmake_compilers && ret=0;;
|
||||
(CMAKE_*_COMPILER_LAUNCHER) _wanted compilers expl 'compiler launcher' _cmake_launchers && ret=0;;
|
||||
(CMAKE_*_FLAGS(|_?*)) _message -e compiler-flags 'compiler flags' && _dispatch $service -value-,CPPFLAGS,-default- && ret=0;;
|
||||
(CMAKE_*_STANDARD_REQUIRED) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
|
||||
(CMAKE_*_EXTENSIONS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;;
|
||||
(*) _files && ret=0;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
local -a _cmake_generator_list=(${(f)"$(cmake --help | awk '/^Generators/{flag=1} flag && /^[* ] [^ ]/ {sub(/^[* ] /, ""); sub(/=.*$/, ""); sub(/\[arch\]/, ""); sub(/ *$/, ""); print}')"})
|
||||
|
||||
# -----------------
|
||||
# _cmake_generators
|
||||
# -----------------
|
||||
(( $+functions[_cmake_generators] )) ||
|
||||
_cmake_generators() {
|
||||
local -a generators=(
|
||||
${(f)"$(cmake --help | awk '/^Generators/{flag=1} flag && /^[* ] [^ ]/ {sub(/^[* ] /, ""); sub(/=.*$/, ""); sub(/\[arch\]/, ""); sub(/ *$/, ""); print}')"}
|
||||
)
|
||||
|
||||
_describe -t generators 'generator' generators
|
||||
_describe -t generators 'generator' _cmake_generator_list
|
||||
}
|
||||
|
||||
# ----------------------
|
||||
|
|
@ -560,74 +519,75 @@ _cmake_launchers() {
|
|||
_command_names -e
|
||||
}
|
||||
|
||||
(( $+functions[_cmake_commands] )) ||
|
||||
_cmake_commands() {
|
||||
local -a commands=(
|
||||
'capabilities:Report capabilities built into cmake in JSON format'
|
||||
'cat:concat the files and print them to the standard output'
|
||||
'chdir:run command in a given directory'
|
||||
'compare_files:check if file1 is same as file2'
|
||||
'copy:copy files to destination (either file or directory)'
|
||||
'copy_directory:copy content of <dir>... directories to destination directory'
|
||||
'copy_if_different:copy files if it has changed'
|
||||
'echo:displays arguments as text'
|
||||
'echo_append:displays arguments as text but no new line'
|
||||
'env:run command in a modified environment'
|
||||
'environment:display the current environment'
|
||||
'make_directory:create parent and <dir> directories'
|
||||
'md5sum:create MD5 checksum of files'
|
||||
'sha1sum:create SHA1 checksum of files'
|
||||
'sha224sum:create SHA224 checksum of files'
|
||||
'sha256sum:create SHA256 checksum of files'
|
||||
'sha384sum:create SHA384 checksum of files'
|
||||
'sha512sum:create SHA512 checksum of files'
|
||||
'remove:remove the file(s), use -f to force it'
|
||||
'remove_directory:remove directories and their contents'
|
||||
'rename:rename a file or directory (on one volume)'
|
||||
'rm:remove files or directories'
|
||||
'server:start cmake in server mode'
|
||||
'sleep:sleep for given number of seconds'
|
||||
'tar:create or extract a tar or zip archive'
|
||||
'time:run command and display elapsed time'
|
||||
'touch:touch a <file>'
|
||||
'touch_nocreate:touch a <file> but do not create it'
|
||||
'create_symlink:create a symbolic link new -> old'
|
||||
'create_hardlink:create a hard link new -> old'
|
||||
'true:do nothing with an exit code of 0'
|
||||
'false:do nothing with an exit code of 1'
|
||||
)
|
||||
local -a _cmake_commands=(
|
||||
'capabilities:Report capabilities built into cmake in JSON format' \
|
||||
'cat:concat the files and print them to the standard output' \
|
||||
'chdir:run command in a given directory' \
|
||||
'compare_files:check if file1 is same as file2' \
|
||||
'copy:copy files to destination (either file or directory)' \
|
||||
'copy_directory:copy content of <dir>... directories to destination directory' \
|
||||
'copy_if_different:copy files if it has changed' \
|
||||
'echo:displays arguments as text' \
|
||||
'echo_append:displays arguments as text but no new line' \
|
||||
'env:run command in a modified environment' \
|
||||
'environment:display the current environment' \
|
||||
'make_directory:create parent and <dir> directories' \
|
||||
'md5sum:create MD5 checksum of files' \
|
||||
'sha1sum:create SHA1 checksum of files' \
|
||||
'sha224sum:create SHA224 checksum of files' \
|
||||
'sha256sum:create SHA256 checksum of files' \
|
||||
'sha384sum:create SHA384 checksum of files' \
|
||||
'sha512sum:create SHA512 checksum of files' \
|
||||
'remove:remove the file(s), use -f to force it' \
|
||||
'remove_directory:remove directories and their contents' \
|
||||
'rename:rename a file or directory (on one volume)' \
|
||||
'rm:remove files or directories' \
|
||||
'server:start cmake in server mode' \
|
||||
'sleep:sleep for given number of seconds' \
|
||||
'tar:create or extract a tar or zip archive' \
|
||||
'time:run command and display elapsed time' \
|
||||
'touch:touch a <file>' \
|
||||
'touch_nocreate:touch a <file> but do not create it' \
|
||||
'create_symlink:create a symbolic link new -> old' \
|
||||
'create_hardlink:create a hard link new -> old' \
|
||||
'true:do nothing with an exit code of 0' \
|
||||
'false:do nothing with an exit code of 1'
|
||||
)
|
||||
_cmake_command() {
|
||||
_arguments -C \
|
||||
'-E[CMake command mode]:command:(("${_cmake_commands[@]}"))'
|
||||
|
||||
_describe -t commands 'command' commands
|
||||
}
|
||||
|
||||
local -a cmake_suggest_build=(
|
||||
'--build[build]:build dir:_cmake_suggest_builddirs'
|
||||
local cmake_suggest_build;cmake_suggest_build=(
|
||||
'--build[build]:build dir:_cmake_suggest_builddirs'
|
||||
)
|
||||
|
||||
local -a cmake_suggest_install=(
|
||||
'--install[install]:install dir:_cmake_suggest_installdirs'
|
||||
local cmake_suggest_install;cmake_suggest_install=(
|
||||
'--install[install]:install dir:_cmake_suggest_installdirs'
|
||||
)
|
||||
|
||||
if [[ "$service" = -value-*CMAKE_GENERATOR* ]]; then
|
||||
_cmake_generators
|
||||
elif [ $CURRENT -eq 2 ] ; then
|
||||
_arguments -s \
|
||||
_arguments -C -s \
|
||||
- help \
|
||||
"$cmake_help_actions[@]" \
|
||||
- command \
|
||||
'-E[CMake command mode]:command:_cmake_commands' \
|
||||
'-E[CMake command mode]:command:( )' \
|
||||
- build_opts \
|
||||
"$cmake_build_options[@]" \
|
||||
- build_cmds \
|
||||
"$cmake_suggest_build[@]" \
|
||||
- install_cmds \
|
||||
"$cmake_suggest_install[@]" && return 0
|
||||
elif [[ $words[2] = --help* ]] ; then
|
||||
_cmake_help
|
||||
elif [[ $words[2] == --build ]] ; then
|
||||
_cmake_on_build
|
||||
elif [[ $words[2] == --install ]] ; then
|
||||
_cmake_on_install
|
||||
elif [[ $words[2] == --help-* ]] ; then
|
||||
_arguments "$cmake_help_actions[@]"
|
||||
elif [[ $words[2] == -E ]]; then
|
||||
_cmake_command
|
||||
else
|
||||
_arguments "$cmake_build_options[@]"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ _arguments -s -S \
|
|||
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
|
||||
'(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
|
||||
'(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
|
||||
'(- *)'{-h,--help}'[display help message]' \
|
||||
'(- *)'{-h,--help}'[display this help message]' \
|
||||
'(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
|
||||
'(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]: :_files -g "*.coffee"' \
|
||||
'(-l --literate)'{-l,--literate}'[treat stdio as literate style coffeescript]' \
|
||||
|
|
|
|||
|
|
@ -151,9 +151,9 @@ _conan_cache() {
|
|||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
'(- *)'{-h,--help}'[show help message and exit]' \
|
||||
'1: :(clean path)' \
|
||||
'*:: :->args'
|
||||
'(- *)'{-h,--help}'[show help message and exit]' \
|
||||
'1: :(clean path)' \
|
||||
'*:: :->args'
|
||||
|
||||
case $state in
|
||||
(args)
|
||||
|
|
|
|||
156
src/_cpack
156
src/_cpack
|
|
@ -1,156 +0,0 @@
|
|||
#compdef cpack
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for cpack 4.3.0 (https://kitware.com/cmake)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_cpack() {
|
||||
local ret=1
|
||||
|
||||
_arguments \
|
||||
'-G[Override/define CPACK_GENERATOR]:generator:_cpack_generators' \
|
||||
'-C[Specify the project configurations]:configuration:(Debug Release)' \
|
||||
'*-D[Set a CPack variable]:var_val' \
|
||||
'--config[Specify the config file]:file:_files' \
|
||||
'(-V --verbose)'{-V,--verbose}'[Enable verbose output]' \
|
||||
'--trace[Put underlying cmake scripts in trace mode]' \
|
||||
'--trace-expand[Put underlying cmake scripts in expanded trace mode]' \
|
||||
'--debug[Enable debug output]' \
|
||||
'-P[Override/define CPACK_PACKAGE_NAME]:package_name' \
|
||||
'-R[Override/define CPACK_PACKAGE_VERSION]:package_version' \
|
||||
'-B[Override/define CPACK_PACKAGE_DIRECTORY]:package_directory:_files -/' \
|
||||
'--vendor[Override/define CPACK_PACKAGE_VENDOR]:vendor' \
|
||||
'--preset[Read arguments from a package preset]' \
|
||||
'--list-presets[List available package preset]' \
|
||||
'(- *)'{--version,-version}=-'[Print version number and exit]::format:(json-v1)' \
|
||||
'(- *)--help[Print usage information and exit]' \
|
||||
'(- *)--help-full[Print all help manuals and exit]' \
|
||||
'(- *)--help-manual[Print one help manual and exit]:manual:_cpack_help_manuals' \
|
||||
'(- *)--help-manual-list[List help manuals available and exit]' \
|
||||
'(- *)--help-command[Print help for one command and exit]:command:_cpack_help_commands' \
|
||||
'(- *)--help-command-list[List commands with help available and exit]' \
|
||||
'(- *)--help-commands[Print cmake-commands manual and exit]' \
|
||||
'(- *)--help-module[Print help for one module and exit]:module:_cpack_help_modules' \
|
||||
'(- *)--help-module-list[List modules with help available and exit]' \
|
||||
'(- *)--help-modules[Print cmake-modules manual and exit]' \
|
||||
'(- *)--help-policy[Print help for one policy and exit]:policy:_cpack_help_policies' \
|
||||
'(- *)--help-policy-list[List policies with help available and exit]' \
|
||||
'(- *)--help-policies[Print cmake-policies manual and exit]' \
|
||||
'(- *)--help-property[Print help for one property and exit]:property:_cpack_help_properties' \
|
||||
'(- *)--help-property-list[List properties with help available and exit]' \
|
||||
'(- *)--help-properties[Print cmake-properties manual and exit]' \
|
||||
'(- *)--help-variable[Print help for one variable and exit]:variable:_cpack_help_variables' \
|
||||
'(- *)--help-variable-list[List variables with help available and exit]' \
|
||||
'(- *)--help-variables[Print cmake-variables manual and exit]' \
|
||||
&& ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
_cpack_generators() {
|
||||
local -a generators=(
|
||||
"7Z:[7-Zip file format with default compression algorithm]"
|
||||
"7Z_BZ2:[7-Zip file format with BZip2 compression]"
|
||||
"7Z_DEFLATE:[7-Zip file format with Deflate compression]"
|
||||
"7Z_LZMA:[7-Zip file format with LZMA compression]"
|
||||
"7Z_LZMA2:[7-Zip file format with LZMA2 compression]"
|
||||
"7Z_PPMD:[7-Zip file format with PPMd compression]"
|
||||
"7Z_STORE:[7-Zip file format without compression]"
|
||||
"7Z_ZSTD:[7-Zip file format with Zstandard compression]"
|
||||
"AppImage:[AppImage packages]"
|
||||
"DEB:[Debian packages]"
|
||||
"External:[CPack External packages]"
|
||||
"IFW:[Qt Installer Framework]"
|
||||
"INNOSETUP:[Inno Setup packages]"
|
||||
"NSIS:[Null Soft Installer]"
|
||||
"NSIS64:[Null Soft Installer (64-bit)]"
|
||||
"NuGet:[NuGet packages]"
|
||||
"RPM:[RPM packages]"
|
||||
"STGZ:[Self extracting Tar GZip compression]"
|
||||
"TAR:[Tar no compression]"
|
||||
"TBZ2:[Tar BZip2 compression]"
|
||||
"TGZ:[Tar GZip compression]"
|
||||
"TXZ:[Tar XZ compression]"
|
||||
"TZ:[Tar Compress compression]"
|
||||
"TZST:[Tar Zstandard compression]"
|
||||
"ZIP:[ZIP file format with default compression algorithm]"
|
||||
"ZIP_BZ2:[ZIP file format with BZip2 compression]"
|
||||
"ZIP_DEFLATE:[ZIP file format with Deflate compression]"
|
||||
"ZIP_LZMA:[ZIP file format with LZMA compression]"
|
||||
"ZIP_LZMA2:[ZIP file format with LZMA2 compression]"
|
||||
"ZIP_STORE:[ZIP file format without compression]"
|
||||
"ZIP_ZSTD:[ZIP file format with Zstandard compression]"
|
||||
)
|
||||
|
||||
_describe -t 'generators' generator generators
|
||||
}
|
||||
|
||||
_cpack_help_manuals() {
|
||||
local -a manuals=(${(f)"$(cpack --help-manual-list 2>/dev/null | sed 's/([0-9][0-9]*)$//' )"})
|
||||
_values 'manual' $manuals
|
||||
}
|
||||
|
||||
_cpack_help_commands() {
|
||||
local -a commands=(${(f)"$(cpack --help-command-list 2>/dev/null )"})
|
||||
_values 'command' $commands
|
||||
}
|
||||
|
||||
_cpack_help_modules() {
|
||||
local -a modules=(${(f)"$(cpack --help-module-list 2>/dev/null )"})
|
||||
_values 'module' $modules
|
||||
}
|
||||
|
||||
_cpack_help_policies() {
|
||||
local -a policies=(${(f)"$(cpack --help-policy-list 2>/dev/null )"})
|
||||
_values 'policy' $policies
|
||||
}
|
||||
|
||||
_cpack_help_properties() {
|
||||
local -a properties=(${(f)"$(cpack --help-property-list 2>/dev/null )"})
|
||||
_values 'property' $properties
|
||||
}
|
||||
|
||||
_cpack_help_variables() {
|
||||
local -a variables=(${(f)"$(cpack --help-variable-list 2>/dev/null )"})
|
||||
_values 'variable' $variables
|
||||
}
|
||||
|
||||
_cpack "$@"
|
||||
|
||||
# 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
|
||||
103
src/_cpanm
103
src/_cpanm
|
|
@ -1,103 +0,0 @@
|
|||
#compdef cpanm
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for cpanm 1.7049 (https://github.com/miyagawa/cpanminus)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments -n -C -s \
|
||||
'(-i --install)'{-i,--install}'[Install the modules]' \
|
||||
'--self-upgrade[Upgrades itself]' \
|
||||
'--info[Displays the distribution information in "AUTHOR/Dist-Name-ver.tar.gz" format in the stdout]' \
|
||||
"--installdeps[Installs the dependencies of the target distribution but won't build itself]" \
|
||||
'--look[Download and unpack the distribution and then open the directory with your shell]' \
|
||||
'(- *)'{-h,--help}'[Display the help message]' \
|
||||
'(- *)'{-V,--version}'[Display the version number]' \
|
||||
'(-f --force)'{-f,--force}'[Force install modules even when testing failed]' \
|
||||
'(-n --notest)'{-n,--notest}'[Skip the testing of modules]' \
|
||||
'--test-only[Run the tests only]' \
|
||||
'(-S --sudo)'{-S,--sudo}'[Switch to the root user with "sudo" when installing modules]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Makes the output verbose]' \
|
||||
'(-q --quiet)'{-q,--quiet}'[Makes the output even more quiet than the default]' \
|
||||
'(-l --local-lib)'{-l,--local-lib}'[Sets the local::lib compatible path to install modules to]' \
|
||||
'(-L --local-lib-contained)'{-L,--local-lib-contained}'[Same with "--local-lib" but with --self-contained set]' \
|
||||
'--self-contained[When examining the dependencies, assume no non-core modules are installed on the system]' \
|
||||
"--exclude-vendor[Don't include module installed under the 'vendor' paths]" \
|
||||
'--mirror=[Specifies the base URL for the CPAN mirror to use]:mirror' \
|
||||
"--mirror-only[Download the mirror's index file instead of querying the CPAN Meta DB]" \
|
||||
'(-M --from)'{-M,--from}='[Use the given mirror URL and its index as the only source to search and download modules from]' \
|
||||
'--mirror-index[Specifies the file path to "02packages.details.txt" for module search index]' \
|
||||
'--cpanmetadb[Specifies an alternate URI for CPAN MetaDB index lookups]' \
|
||||
'--metacpan[Prefers MetaCPAN API over CPAN MetaDB]' \
|
||||
'--cpanfile=[Specified an alternate path for cpanfile]: :_files' \
|
||||
"--prompt[Prompts when a test fails so that you can skip, force install, retry or look what's going wrong]" \
|
||||
'--dev[Search for a newer developer release as well]' \
|
||||
'--reinstall[Reinstall even if your locally installed version is latest]' \
|
||||
'--interactive[Makes the configuration interactive]' \
|
||||
'(--pp --pureperl)'{--pp,--pureperl}'[Prefer Pure perl build of modules]' \
|
||||
'--with-recommends[Installs dependencies declared as "recommends"]' \
|
||||
'--with-suggests[Installs dependencies declared as "suggests"]' \
|
||||
'--with-develop[Install develop phase dependencies in "cpanfile"]' \
|
||||
'--with-configure[Installs configure phase dependencies in "cpanfile"]' \
|
||||
'--with-feature=[Specifies the feature to enable]::feature' \
|
||||
'--without-feature=[Not specifies the feature to enable]::feature' \
|
||||
'--with-all-feature[Specifies the all features to enable]' \
|
||||
'--configure-timeout=[Specify the timeout length to wait for the configure]' \
|
||||
'--build-timeout=[Specify the timeout length to wait for the build]' \
|
||||
'--test-timeout=[Specify the timeout length to wait for the test]' \
|
||||
'--configure-args=[Pass arguments for configure]:args' \
|
||||
'--build-args=[Pass arguments for build]:args' \
|
||||
'--test-args=[Pass arguments for test]:args' \
|
||||
'--install-args=[Pass arguments for install]:args' \
|
||||
'--scandeps[Scans the dependencies of given modules and output the tree in a text format]' \
|
||||
'--format=[Determines what format to display the scanned dependency tree]:fmt:(tree json yaml dists)' \
|
||||
'--save-dist=[Specifies the optional directory path to copy downloaded tarballs]: :_files -/' \
|
||||
'(-U --uninstall)'{-U,--uninstall}'[Uninstalls a module from the library path]' \
|
||||
'--cascade-search[Specifies whether to cascade search when you specify multiple mirrors]' \
|
||||
'--skip-installed[Skip install if specified module is already installed]' \
|
||||
'--skip-satisfies[Skip install if specified module and version is already installed]' \
|
||||
'--verify[Verify the integrity of distribution files]' \
|
||||
'--report-perl-version[Report perl version as port of User-Agent]' \
|
||||
'--auto-cleanup[Specifies the number of days in which cpanm work directories expire]::days' \
|
||||
'--man-pages[Generate man pages for executables(man1) and libraries(man3)]' \
|
||||
'--lwp[Uses LWP module to download stuff over HTTP]' \
|
||||
'--wget[Uses GNU Wget(if available) to download stuff]' \
|
||||
'--curl[Uses cURL(if available) to download stuff]' \
|
||||
&& return 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
121
src/_cpm
121
src/_cpm
|
|
@ -1,121 +0,0 @@
|
|||
#compdef cpm
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for cpm 0.998003 (https://github.com/skaji/cpm)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_cpm() {
|
||||
typeset -A opt_args
|
||||
local context state line
|
||||
local curcontext="$curcontext"
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
'(- *)'{-h,--help}'[Show help message]' \
|
||||
'(- *)--version[Show version and exit]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Enable debug mode]' \
|
||||
'1: :_cpm_subcommands' \
|
||||
'*::arg:->args' && ret=0
|
||||
|
||||
case $state in
|
||||
(args)
|
||||
case $words[1] in
|
||||
(install)
|
||||
_arguments \
|
||||
'(-w --workers)'{-w,--workers=}'[number of workers(default=5)]:num' \
|
||||
'(-L --local-lib-contained)'{-L,--local-lib-contained=}'[directory to install module into, default=local/]: :_files -/' \
|
||||
'(-g --global)'{-g,--global}'[install modules into current @INC instead of local/]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[verbose mode]' \
|
||||
'(--prebuilt --no-prebuilt)--prebuilt[save builds for CPAN distributions and later install the prebuilts if available]' \
|
||||
'(--prebuilt --no-prebuilt)--no-prebuilt[no prebuilt]' \
|
||||
'--target-perl=[install modules as if version is your perl is VERSION]:version' \
|
||||
'--mirror[base URL for the CPAN mirror to use]:url' \
|
||||
'(--pp --pureperl-only)'{--pp,--pureperl-only}'[prefer pureperl only build]' \
|
||||
'(--static-install --no-static-install)--static-install[enable the static install]' \
|
||||
'(--static-install --no-static-install)--no-static-install[disable the static install]' \
|
||||
\*{-r,--resolver=}'[specify resolvers]:resolver' \
|
||||
'--no-defult-resolvers[Use default resolvers if you specify --resolver option]' \
|
||||
'--reinstall[reinstall the distribution even if you already have the latest version installed]' \
|
||||
'--dev[resolve TRIAL distributions too]' \
|
||||
'(--color --no-color)--color[turn on color output]' \
|
||||
'(--color --no-color)--no-color[turn off color output]' \
|
||||
'(--test --no-test)--test[run test cases]' \
|
||||
'(--test --no-test)--no-test[do not run test cases]' \
|
||||
'--man-pages[generate man pages]' \
|
||||
'(--retry --no-retry)--retry[retry configure/build/test/install if fails]' \
|
||||
'(--retry --no-retry)--no-retry[do not retry]' \
|
||||
'--show-build-log-on-failure[show build.log on failure]' \
|
||||
'--configure-timeout=[specify configure timeout second]:sec' \
|
||||
'--build-timeout=[specify build timeout second]:sec' \
|
||||
'--test-timeout=[specify test timeout second]:sec' \
|
||||
'(--show-progress --no-show-progress)--show-progress[show progress]' \
|
||||
'(--show-progress --no-show-progress)--no-show-progress[do not show progress]' \
|
||||
'--cpmfile=[specify cpmfile path]: :_files' \
|
||||
'--cpanfile=[specify cpanfile path]: :_files' \
|
||||
'--metafile=[specify META file path]: :_files' \
|
||||
'--snapshot=[specify cpanfile.snapshot path]: :_files' \
|
||||
'(- *)'{-V,--version}'[show version]' \
|
||||
'(- *)'{-h,--help}'[show help message]' \
|
||||
'*--feature=[specify the feature to enable in cpanfile]:feature' \
|
||||
'*:modules' \
|
||||
&& ret=0
|
||||
;;
|
||||
(*)
|
||||
ret=0
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_cpm_subcommands] )) ||
|
||||
_cpm_subcommands() {
|
||||
local -a commands=(
|
||||
"install:Install modules"
|
||||
"help:Show help"
|
||||
"version:Show version"
|
||||
)
|
||||
|
||||
_describe -t subcommands "subcommands" commands
|
||||
}
|
||||
|
||||
_cpm "$@"
|
||||
|
||||
# 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
|
||||
|
|
@ -78,7 +78,7 @@ _cppcheck() {
|
|||
"(-f --force)"{-f,--force}"[Force checking of all configurations in files]" \
|
||||
"(--fsigned-char --funsigned-char)--fsigned-char[Treat char type as signed]" \
|
||||
"(--fsigned-char --funsigned-char)--funsigned-char[Treat char type as unsigned]" \
|
||||
"(- 1 *)"{-h,--help}"[Print help]" \
|
||||
"(- 1 *)"{-h,--help}"[Print this help]" \
|
||||
"-I[A file that contains a list of config-excludes]:directory:_files -/" \
|
||||
"--include-file=[Specify directory paths to search for included header files in a text file]:file:_files" \
|
||||
"--include=[Force inclusion of a file before the checked file]:file:_files" \
|
||||
|
|
|
|||
179
src/_ctest
179
src/_ctest
|
|
@ -1,179 +0,0 @@
|
|||
#compdef ctest
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for ctest 4.3.0 (https://kitware.com/cmake)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_ctest() {
|
||||
local ret=1
|
||||
|
||||
_arguments \
|
||||
'--preset=[Read arguments from a test preset]:preset' \
|
||||
'--list-presets[List available test presets]' \
|
||||
'(-C --build-config)'{-C,--build-config}'[Choose configuration to test]:config' \
|
||||
'--progress[Enable short progress output from tests]' \
|
||||
'(-V --verbose -VV --extra-verbose)'{-V,--verbose}'[Enable verbose output from tests]' \
|
||||
'(-V --verbose -VV --extra-verbose)'{-VV,--extra-verbose}'[Enable more verbose output from tests]' \
|
||||
'--debug[Displaying more verbose internals of CTest]' \
|
||||
'--output-on-failure[Output anything outputted by the test program if the test should fail]' \
|
||||
'--stop-on-failure[Stop running the tests after one has failed]' \
|
||||
'--test-output-size-passed[Limit the output for passed tests to <size> bytes]:size' \
|
||||
'--test-output-size-failed[Limit the output for failed tests to <size> bytes]:size' \
|
||||
'--test-output-truncation[Truncate mode]:mode:(tail middle head)' \
|
||||
'-F[Enable failover]' \
|
||||
'(-j --parallel)'{-j,--parallel}'[Run tests in parallel]::level' \
|
||||
'(-Q --quiet)'{-Q,--quiet}'[Make ctest quiet]' \
|
||||
'(-O --output-log)'{-O,--output-log}'[Output to log file]:file:_files' \
|
||||
'--output-junit[Output test results to JUnit XML file]:file:_files' \
|
||||
'(-N --show-only)'{-N,--show-only}'[Disable actual execution of tests]::format:(format human json-v1)' \
|
||||
\*{-L,--label-regex}'[Run tests with labels matching regular expression]:regex' \
|
||||
\*{-R,--tests-regex}'[Run tests matching regular expression]:regex' \
|
||||
\*{-E,--exclude-regex}'[Exclude tests matching regular expression]:regex' \
|
||||
\*{-LE,--label-exclude}'[Exclude tests with labels matching regular expression]:regex' \
|
||||
\*{-FA,--fixture-exclude-any}'[Do not automatically add any tests for fixtures matching regular expression]:regex' \
|
||||
\*{-FS,--fixture-exclude-setup}'[Do not automatically add setup tests for fixtures matching regular expression]:regex' \
|
||||
\*{-FC,--fixture-exclude-cleanup}'[Do not automatically add cleanup tests for fixtures matching regular expression]:regex' \
|
||||
'(--dashboard)'{-D,--dashboard}'[Execute dashboard test]:dashboard' \
|
||||
'*-D[Define a variable for script mode]:var' \
|
||||
'(-M --test-model)'{-M,--test-model}'[Set the model for a dashboard]:model' \
|
||||
'(-T --test-action)'{-T,--test-action}'[Set the dashboard action to perform]' \
|
||||
'--group[Specify what build group on the dashboard]:group' \
|
||||
\*{-S,--script,-Sp,--script-new-process}'[Execute a dashboard for a configuration]:script:_files' \
|
||||
'(-A --add-notes)'{-A,--add-notes}'[Add a notes file with submission]:file:_files' \
|
||||
'(-I --test-information)'{-I,--test-information}'[Run a specific number of tests by number]:number' \
|
||||
'(-U --union)'{-U,--union}'[Take the Union of -I and -R]' \
|
||||
'--rerun-failed[Run only the tests that failed previously]' \
|
||||
'--tests-from-file[Run the tests listed in the given file]:file:_files' \
|
||||
'--exclude-from-file[Run tests except those listed in the given file]:file:_files' \
|
||||
'--repeat-until-fail[Repeat each test to run <n> times without failing]:n' \
|
||||
'--repeat[Repeat each test to run <n> times]:condition-n:(until-fail: until-pass: after-timeout:)' \
|
||||
'--max-width[Set the max width for a test name to output]' \
|
||||
'--interactive-debug-mode[Set the interactive mode to 0 or 1]:n:(0 1)' \
|
||||
'--resource-spec-file[Set the resource spec file to use]:file:_files' \
|
||||
'--no-label-summary[Disable timing summary information for labels]' \
|
||||
'--no-subproject-summary[Disable timing summary information for subprojects]' \
|
||||
'--test-dir[Specify the directory in which to look for tests]:dir:_files -/' \
|
||||
'--build-and-test[Configure, build and run a test]' \
|
||||
'*--build-target[Specify a specific target to build]:target' \
|
||||
'--build-nocmake[Run the build without running cmake first]' \
|
||||
'--build-run-dir[Specify directory to run programs from]:dir:_files -/' \
|
||||
'--build-two-config[Run CMake twice]' \
|
||||
'--build-exe-dir[Specify the directory for the executable]:dir:_files -/' \
|
||||
'--build-generator[Specify the generator to use]:generator' \
|
||||
'--build-generator-platform[Specify the generator-specific platform]:generator_platform' \
|
||||
'--build-generator-toolset[Specify the generator-specific toolset]:build_toolset' \
|
||||
'--build-project[Specify the name of the project to build]:project' \
|
||||
'--build-makeprogram[Specify the make program to use]:make:_files' \
|
||||
'--build-noclean[Skip the make clean step]' \
|
||||
'--build-config-sample[A sample executable to use to determine the configuration]:sample' \
|
||||
'*--build-options[Add extra options to the build step]' \
|
||||
'--test-command[The test to run with the --build-and-test-option]:command' \
|
||||
'--test-timeout[The time limit in seconds]:timeout' \
|
||||
'--test-load[CPU load threshold for starting new parallel tests]:threshold' \
|
||||
'--tomorrow-tag[starts with next day tag]' \
|
||||
'--overwrite[Overwrite CTest configuration option]' \
|
||||
'--extra-submit[Submit extra files to the dashboard]:file:_files' \
|
||||
'*--http-header[Append HTTP header when submitting]:header' \
|
||||
'--schedule-random[Use a random order for scheduling tests]' \
|
||||
'--schedule-random-seed[Override seed for random order of tests]:seed' \
|
||||
'--submit-index[Submit individual dashboard tests with specific index]:index' \
|
||||
'--timeout[Set the default test timeout]:timeout' \
|
||||
'--stop-time[Set a time at which all tests should stop running]:time' \
|
||||
'--http1.0[Submit using HTTP 1.0]' \
|
||||
'--no-compress-output[Do not compress test output when submitting]' \
|
||||
'--print-labels[Print all available test labels]' \
|
||||
'--no-tests=[Regard no tests]:type:(error ignore)' \
|
||||
'(- *)'{--help,-help,-usage,-h,-H}'[Print usage information and exit]' \
|
||||
'(- *)'{--version,-version}'[Print version number and exit]' \
|
||||
'(- *)--help-full[Print all help manuals and exit]' \
|
||||
'(- *)--help-manual[Print one help manual and exit]:manual:_ctest_help_manuals' \
|
||||
'(- *)--help-manual-list[List help manuals available and exit]' \
|
||||
'(- *)--help-command[Print help for one command and exit]:command:_ctest_help_commands' \
|
||||
'(- *)--help-command-list[List commands with help available and exit]' \
|
||||
'(- *)--help-commands[Print cmake-commands manual and exit]' \
|
||||
'(- *)--help-module[Print help for one module and exit]:module:_ctest_help_modules' \
|
||||
'(- *)--help-module-list[List modules with help available and exit]' \
|
||||
'(- *)--help-modules[Print cmake-modules manual and exit]' \
|
||||
'(- *)--help-policy[Print help for one policy and exit]:policy:_ctest_help_policies' \
|
||||
'(- *)--help-policy-list[List policies with help available and exit]' \
|
||||
'(- *)--help-policies[Print cmake-policies manual and exit]' \
|
||||
'(- *)--help-property[Print help for one property and exit]:property:_ctest_help_properties' \
|
||||
'(- *)--help-property-list[List properties with help available and exit]' \
|
||||
'(- *)--help-properties[Print cmake-properties manual and exit]' \
|
||||
'(- *)--help-variable[Print help for one variable and exit]:variable:_ctest_help_variables' \
|
||||
'(- *)--help-variable-list[List variables with help available and exit]' \
|
||||
'(- *)--help-variables[Print cmake-variables manual and exit]' \
|
||||
&& ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
_ctest_help_manuals() {
|
||||
local -a manuals=(${(f)"$(ctest --help-manual-list 2>/dev/null | sed 's/([0-9][0-9]*)$//' )"})
|
||||
_values 'manual' $manuals
|
||||
}
|
||||
|
||||
_ctest_help_commands() {
|
||||
local -a commands=(${(f)"$(ctest --help-command-list 2>/dev/null )"})
|
||||
_values 'command' $commands
|
||||
}
|
||||
|
||||
_ctest_help_modules() {
|
||||
local -a modules=(${(f)"$(ctest --help-module-list 2>/dev/null )"})
|
||||
_values 'module' $modules
|
||||
}
|
||||
|
||||
_ctest_help_policies() {
|
||||
local -a policies=(${(f)"$(ctest --help-policy-list 2>/dev/null )"})
|
||||
_values 'policy' $policies
|
||||
}
|
||||
|
||||
_ctest_help_properties() {
|
||||
local -a properties=(${(f)"$(ctest --help-property-list 2>/dev/null )"})
|
||||
_values 'property' $properties
|
||||
}
|
||||
|
||||
_ctest_help_variables() {
|
||||
local -a variables=(${(f)"$(ctest --help-variable-list 2>/dev/null )"})
|
||||
_values 'variable' $variables
|
||||
}
|
||||
|
||||
_ctest "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
|
|
@ -48,7 +48,7 @@ _arguments \
|
|||
'--waitip=[Wait for an address to assigned before forking to the background]: :(4 6)' \
|
||||
\*{-x,--exit}'[This will signal an existing dhcpcd process running on the interface to exit]: :_net_interfaces' \
|
||||
'(-y --reboot)'{-y,--reboot}'[Allow reboot seconds before moving to the discover phase if we have an old lease to use]:seconds' \
|
||||
'1:network interface:_net_interfaces'
|
||||
'1:network interface:_net_interfaces'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ _direnv_commands() {
|
|||
'exec:Executes a command after loading the first .envrc or .env found in DIR'
|
||||
'export:Loads an .envrc or .env and prints the diff in terms of exports'
|
||||
"fetchurl:Fetches a given URL into direnv's CAS"
|
||||
'help:shows help'
|
||||
'help:shows this help'
|
||||
'hook:Used to setup the shell hook'
|
||||
'prune:removes old allowed files'
|
||||
'reload:triggers an env reload'
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[Show help message and exit]' \
|
||||
'(- *)'{-h,--help}'[Show this help message and exit]' \
|
||||
'(- *)'{-v,--version}'[Show version and exit]' \
|
||||
'(-d --devel-release)'{-d,--devel-release}'[Upgrade to the development release]' \
|
||||
'--data-dir=[Directory that contains the data files]:dir:_files -/' \
|
||||
|
|
|
|||
99
src/_elixir
99
src/_elixir
|
|
@ -1,99 +0,0 @@
|
|||
#compdef elixir elixirc iex
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for elixir 1.19.5 (https://elixir-lang.org/)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
if [[ $service == "iex" ]]; then
|
||||
_arguments \
|
||||
'--dbg[Set the backend for Kernel.dbg/2]:backend:(pry)' \
|
||||
'--dot-iex[Evaluate file, line by line to set up IEx environment]:file:_files' \
|
||||
'--remsh[Connect to a node using a remote shell]:name' \
|
||||
'*::file_or_data:_files -g "*.exs"'
|
||||
else
|
||||
local -a elixir_options=(
|
||||
\*{-e,--eval}'[Evaluate the given command]:command'
|
||||
'(- *)'{-h,--help}'[Print help message]'
|
||||
'*-r[Require the given files or patterns]:file_or_pattern:_files'
|
||||
'-S[Find and execute the given script in $PATH]:file:_files'
|
||||
'*-pr[Require the given files or patterns in parallel]:file_or_pattern:_files'
|
||||
'*-pa[Prepend the given path to Erlang code path]:path:_files -/'
|
||||
'*-pz[Append the given path to Erlang code path]:path:_files -/'
|
||||
'(- *)'{-v,--version}'[Print Erlang/OTP and Elixir versions]'
|
||||
'(--color --no-color)--color[Enable ANSI coloring]'
|
||||
'(--color --no-color)--no-color[Disable ANSI coloring]'
|
||||
'*--erl[Switch to be passed down to Erlang]:switch'
|
||||
'--logger-otp-reports[Enable or disable OTP reporting]:bool:(true false)'
|
||||
'--logger-sasl-reports[Enable or disable SASL reporting]:bool:(true false)'
|
||||
'--no-halt[Do not halt the Erlang VM after execution]'
|
||||
'(- *)--short-version[Print Elixir version]'
|
||||
'--cookie[Set a cookie for this distributed node]:cookie'
|
||||
'--hidden[Make a hidden node]'
|
||||
'--name[Make and assign a name to the distributed node]:name'
|
||||
'*--rpc-eval[Evaluate the given command on the given remote node]:node_command'
|
||||
'--sname[Make and assign a short name to the distributed node]'
|
||||
'--boot[Use the given FILE.boot to start the system]:file:_files'
|
||||
'*--boot-var[Make $VAR available as VALUE to FILE.boot]:var_value'
|
||||
'*--erl-config[Load configuration in FILE.config written in Erlang]:file:_files'
|
||||
'--pipe-to[Start the Erlang VM as a named PIPEDIR and LOGDIR]:pipe_and_log:_files -/'
|
||||
'--vm-wargs[Pass the contents in file as arguments to the VM]:file:_files'
|
||||
)
|
||||
|
||||
case $service in
|
||||
(elixir)
|
||||
_arguments $elixir_options[@]
|
||||
;;
|
||||
(elixirc)
|
||||
_arguments \
|
||||
$elixir_options[@] \
|
||||
'-o[The directory to output compiled files]:dir:_files -/' \
|
||||
'(- *)'{-v,--version}'[Print Elixir version and exit]' \
|
||||
'--ignore-module-conflict[Do not emit warnings if a module was previously defined]' \
|
||||
'--no-debug-info[Do not attach debug info to compiled modules]' \
|
||||
'--no-docs[Do not attach documentation to compiled modules]' \
|
||||
'--profile[Profile to compile modules]:type:(time)' \
|
||||
'--verbose[Print compilation status]' \
|
||||
'--warnings-as-errors[Treat warnings as errors and return non-zero exit status]' \
|
||||
'*::file:_files -g "*.ex"'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
local -a args=(
|
||||
'(-h --help)'{-h+,--help}'[show help message and exit]'
|
||||
'(-h --help)'{-h+,--help}'[show this help message and exit]'
|
||||
'(-)'--version'[display version information and exit]'
|
||||
'(-)1:directory: _path_files -/'
|
||||
'(-)2:command: _command_names -e'
|
||||
|
|
|
|||
95
src/_fab
95
src/_fab
|
|
@ -28,7 +28,9 @@
|
|||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Fabric v3.2.2 (https://www.fabfile.org/)
|
||||
# Completion script for Fabric (https://www.fabfile.org/)
|
||||
#
|
||||
# Source: https://github.com/vhbit/fabric-zsh-autocomplete
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
|
|
@ -38,42 +40,65 @@
|
|||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_fab_tasks() {
|
||||
local -a tasks=(${(f)"$(fab --list 2>/dev/null| awk '/^ /{first=$1;$1="";print first ":" substr($0, 2) }')"})
|
||||
if (( $#tasks > 0)); then
|
||||
_describe -t 'task' tasks tasks
|
||||
fi
|
||||
|
||||
local curcontext=$curcontext state line
|
||||
declare -A opt_args
|
||||
|
||||
declare target_list
|
||||
target_list=(`fab --shortlist 2>/dev/null`)
|
||||
|
||||
_targets() {
|
||||
_describe -t commands "fabric targets" target_list
|
||||
}
|
||||
|
||||
_arguments \
|
||||
'--complete[Print tab-completion candidates for given parse remainder]' \
|
||||
"--hide=[Set default value of run()'s 'hide' kwarg]:str" \
|
||||
'(- *)--list-agent-keys[Display ssh-agent key list, and exit]' \
|
||||
'--no-dedupe[Disable task deduplication]' \
|
||||
'--print-completion-script=[Print the tab-completion script for your preferred shell]:shell:(bash zsh fish)' \
|
||||
'--prompt-for-login-password[Request an upfront SSH-auth password prompt]' \
|
||||
'--prompt-for-passphrase[Request an upfront SSH key passphrase prompt]' \
|
||||
'--prompt-for-sudo-password[Prompt user at start of session for the sudo.password config value]' \
|
||||
'--write-pyc[Enable creation of .pyc files]' \
|
||||
'(-c --collection)'{-c,--collection=}'[Specify collection name to load]:name' \
|
||||
'(-d --debug)'{-d,--debug}'[Enable debug output]' \
|
||||
'(-D --list-depth)'{-D,--list-depth=}'[When listing tasks, only show the first INT levels]:level' \
|
||||
'(-e --echo)'{-e,--echo}'[Echo executed commands before running]' \
|
||||
'(-f --config)'{-f,--config=}'[Runtime configuration file to use]:file:_files' \
|
||||
'(-F --list-format)'{-F,--list-format=}'[Change the display format used when listing tasks]:format:(flat nested json)' \
|
||||
'(- *)'{-h,--help=-}'[Show core or per-task help and exit]::task:_fab_tasks' \
|
||||
'(-H --hosts)'{-H,--hosts=}'[Comma-separated host name(s) to execute tasks against]:host' \
|
||||
\*{-i,--identity=}'[Path to runtime SSH identity (key) file]:file:_files' \
|
||||
'(-l --list)'{-l,--list=-}'[List available tasks, optionally limited to a namespace]::namespace' \
|
||||
'(-p --pty)'{-p,--pty}'[Use a pty when executing shell commands]' \
|
||||
'(-r --search-root)'{-r,--search-root=}'[Change root directory used for finding task modules]:dir:_files -/' \
|
||||
'(-R --dry)'{-R,--dry}'[Echo commands instead of running]' \
|
||||
'(-S --ssh-config)'{-S,--ssh-config=}'[Path to runtime SSH config file]:file:_files' \
|
||||
'(-t --connect-timeout)'{-t,--connect-timeout=}'[Specifies default connection timeout, in seconds]:seconds' \
|
||||
'(-T --command-timeout)'{-T,--command-timeout=}'[Specify a global command execution timeout, in seconds]:seconds' \
|
||||
'(- *)'{-V,--version}'[Show version and exit]' \
|
||||
'(-w --warn-only)'{-w,--warn-only}'[Warn, instead of failing, when shell commands fail]' \
|
||||
'*::task:_fab_tasks'
|
||||
output_levels=(
|
||||
'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.'
|
||||
'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!'
|
||||
'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.'
|
||||
'running: Printouts of commands being executed or files transferred, e.g. [myserver] run: ls /var/www. Also controls printing of tasks being run, e.g. [myserver] Executing task ''foo''.'
|
||||
'stdout: Local, or remote, stdout, i.e. non-error output from commands.'
|
||||
'stderr: Local, or remote, stderr, i.e. error-related output from commands.'
|
||||
'user: User-generated output, i.e. local output printed by fabfile code via use of the fastprint or puts functions.'
|
||||
)
|
||||
|
||||
_arguments -w -S -C \
|
||||
'(-)'{-h,--help}'[show this help message and exit]: :->noargs' \
|
||||
'(-)'{-V,--version}'[show program'\''s version number and exit]: :->noargs' \
|
||||
'(-)--list[print list of possible commands and exit]: :->noargs' \
|
||||
'(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \
|
||||
'(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \
|
||||
'(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \
|
||||
"(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \
|
||||
'(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \
|
||||
'(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \
|
||||
'(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \
|
||||
'(-p+ --password=-)'{-p+,--password=-}'[password for use with authentication and/or sudo]: :' \
|
||||
'(-H+ --hosts=-)'{-H+,--hosts=-}'[comma separated list of hosts to operate on]: :' \
|
||||
'(-R+ --roles=-)'{-R+,--roles=-}'[comma separated list of roles to operate on]: :' \
|
||||
'(-a --no-agent)'{-a,--no-agent}'[don'\''t use the running SSH agent]' \
|
||||
'(-k --no-keys)'{-k,--no-keys}'[don'\''t load private key files from ~/.ssh/]' \
|
||||
'(-w --warn-only)'{-w,--warn-only}'[warn instead of abort, when commands fail]' \
|
||||
'-i+[path to SSH private key file. May be repeated]: :_files' \
|
||||
"(-f+ --fabfile=)"{-f+,--fabfile=}"[Python module file to import]: :_files -g *.py" \
|
||||
'(-c+ --config=-)'{-c+,--config=-}'[specify location of config file to use]: :_files' \
|
||||
'(-s+ --shell=-)'{-s+,--shell=-}'[specify a new shell, defaults to ''/bin/bash -l -c'']: :' \
|
||||
'(--ssh-config-path=)--ssh-config-path=[ssh config path]: :_files' \
|
||||
'(--hide=-)--hide=-[comma-separated list of output levels to hide]: :->levels' \
|
||||
'(--show=-)--show=-[comma-separated list of output levels to show]: :->levels' \
|
||||
'*::: :->subcmds' && return 0
|
||||
|
||||
if [[ CURRENT -ge 1 ]]; then
|
||||
case $state in
|
||||
noargs)
|
||||
_message "nothing to complete";;
|
||||
levels)
|
||||
_describe -t commands "output levels" output_levels;;
|
||||
*)
|
||||
_targets;;
|
||||
esac
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ _fail2ban_client() {
|
|||
'-b[start server in background]' \
|
||||
'-f[start server in foreground]' \
|
||||
'--str2sec[convert time abbreviation format to seconds]:_message str2sec' \
|
||||
'(-h --help)'{-h,--help}'[display help message]' \
|
||||
'(-h --help)'{-h,--help}'[display this help message]' \
|
||||
'(-V --version)'{-V,--version}'[print the version]' \
|
||||
'1:fail2ban command:_fail2ban_client_commands' \
|
||||
'*:fail2ban command argument:_fail2ban_client_command_arguments'
|
||||
|
|
|
|||
|
|
@ -38,16 +38,16 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'(-c --collapse-range -d --dig-holes -p --punch-hole -z --zero-range -n --keep-size)'{-c,--collapse-range}'[Removes a byte range from a file without leaving a hole]' \
|
||||
'(-c --collapse-range -d --dig-holes -p --punch-hole -z --zero-range -n --keep-size)'{-d,--dig-holes}'[Detect and dig holes]' \
|
||||
'(-c --collapse-range -d --dig-holes -p --punch-hole -z --zero-range -n --keep-size)'{-p,--punch-hole}'[Deallocates space in the byte range starting at offset and continuing for length bytes]' \
|
||||
'(-c --collapse-range -d --dig-holes -p --punch-hole -z --zero-range )'{-z,--zero-range}'[Zeroes space in the byte range starting at offset and continuing for length bytes]' \
|
||||
'(-c --collapse-range -d --dig-holes -p --punch-hole -n --keep-size)'{-n,--keep-size}'[Do not modify the apparent length of the file]' \
|
||||
'(-c --collapse-range)'{-c,--collapse-range}'[Removes a byte range from a file without leaving a hole]' \
|
||||
'(-d --dig-holes)'{-d,--dig-holes}'[Detect and dig holes]' \
|
||||
'(-i --insert-range)'{-i,--insert-range}'[Insert a hole of length bytes from offset]' \
|
||||
'(-l --length)'{-l+,--length}'[Specifies the length of the range, in bytes]:bytes' \
|
||||
'(-n --keep-size)'{-n,--keep-size}'[Do not modify the apparent length of the file]' \
|
||||
'(-o --offset)'{-o+,--offset}'[Specifies the beginning offset of the range, in bytes]:offset' \
|
||||
'(-p --punch-hole)'{-p,--punch-hole}'[Deallocates space in the byte range starting at offset and continuing for length bytes]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Enable verbose mode]' \
|
||||
'(-x --posix)'{-x,--posix}'[Enable POSIX operation mode]' \
|
||||
'(-z --zero-range)'{-z,--zero-range}'[Zeroes space in the byte range starting at offset and continuing for length bytes]' \
|
||||
'(- *)'{-h,--help}'[Display help text and exit]' \
|
||||
'(- *)'{-V,--version}'[Print version and exit]' \
|
||||
'*:filename:_files'
|
||||
|
|
|
|||
65
src/_fish
65
src/_fish
|
|
@ -1,65 +0,0 @@
|
|||
#compdef fish
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for fish 4.6.0 (https://fishshell.com/)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_fish_debug_categories() {
|
||||
local -a categories=(${(f)"$(fish --print-debug-categories | awk '{n=$1;$1="";printf("%s[%s]\n",n,substr($0,2)) }')"})
|
||||
_values -s ',' categories $categories
|
||||
}
|
||||
|
||||
_arguments -s \
|
||||
'(-c --command)'{-c,--command=}'[Evaluate the specified commands instead of reading from the commandline]:command' \
|
||||
'(-C --init-command)'{-C,--init-command=}'[Evaluate specified commands after reading the configuration]:command' \
|
||||
'(-d --debug)'{-d,--debug=}'[Enable debug output and specify a pattern for matching categories]:categories:_fish_debug_categories' \
|
||||
'(-i --interactive)'{-i,--interactive}'[The shell is interactive]' \
|
||||
'(-l --login)'{-l,--login}'[Act as if invoked as a login shell]' \
|
||||
'(-N --no-config)'{-N,--no-config}'[Do not read configuration files]' \
|
||||
'(-n --no-execute)'{-n,--no-execute}'[Do not execute any commands, only perform syntax checking]' \
|
||||
'(-p --profile)'{-p,--profile=}'[Output timing information on all executed commands to the specified file]:file:_files' \
|
||||
'--profile-startup=[Write timing for fish startup to specified file]:file:_files' \
|
||||
'(-P --private)'{-P,--private}'[Enable private mode]' \
|
||||
'--print-rusage-self[When fish exits, output stats from getrusage]' \
|
||||
'(- *)--print-debug-categories[Print all debug categories, and then exit]' \
|
||||
'(- *)'{-v,--version}'[Print version and exit]' \
|
||||
'(-f --features)'{-f,--features}'[Enable one or more comma-separated feature flags]:features' \
|
||||
'*:: :_files'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
|
|
@ -727,8 +727,8 @@ _flutter_custom_devices() {
|
|||
|
||||
_arguments -C \
|
||||
'(- *)'{-h,--help}'[Print this usage information]' \
|
||||
'1: :_flutter_custom_devices_subcommands' \
|
||||
'*:: :->args' \
|
||||
'1: :_flutter_custom_devices_subcommands' \
|
||||
'*:: :->args' \
|
||||
&& ret=0
|
||||
|
||||
case $state in
|
||||
|
|
|
|||
2
src/_ghc
2
src/_ghc
|
|
@ -922,7 +922,7 @@ _ghc_pkg() {
|
|||
'--expand-env-vars[expand environment variables in input package descriptions]'
|
||||
'(--expand-pkgroot --no-expand-pkgroot)--expand-pkgroot[expand pkgroot-relative paths in output package descriptions]'
|
||||
'(--expand-pkgroot --no-expand-pkgroot)--no-expand-pkgroot[preserve pkgroot-relative paths in output package descriptions]'
|
||||
'(- *)'{-?,--help}'[display help and exit]'
|
||||
'(- *)'{-?,--help}'[display this help and exit]'
|
||||
'(- *)'{-V,--version}'[output version information and exit]'
|
||||
'--simple-output[print output in easy-to-parse format for some commands]'
|
||||
'--show-unit-ids[print unit-ids instead of package identifiers]'
|
||||
|
|
|
|||
89
src/_gist
89
src/_gist
|
|
@ -40,43 +40,38 @@
|
|||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_gist() {
|
||||
local ret=1
|
||||
local curcontext="$curcontext" state line ret=1
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments \
|
||||
'(--login)--login[Authenticate gist on this computer.]' \
|
||||
'(-f --filename)'{-f,--filename}'[Sets the filename and syntax type.]:NAME' \
|
||||
'(-t --type)'{-t,--type}'[Sets the file extension and syntax type.]:EXT' \
|
||||
'(-p --private --no-private)'{-p,--private}'[Makes your gist private.]' \
|
||||
'(--no-private -p --private)--no-private[Makes your gist no private.]' \
|
||||
'(-d --description)'{-d,--description}'[Adds a description to your gist.]:DESCRIPTION' \
|
||||
'(-s --shorten)'{-s,--shorten}'[Shorten the gist URL using git.io.]' \
|
||||
'(-u --update)'{-u,--update}'[Update an existing gist.]:URL ID:_gist_ids' \
|
||||
'(-c --copy)'{-c,--copy}'[Copy the resulting URL to the clipboard]' \
|
||||
'(-e --embed)'{-e,--embed}'[Copy the embed code for the gist to the clipboard]' \
|
||||
'(-o --open --no-open)'{-o,--open}'[Open the resulting URL in a browser]' \
|
||||
'(--no-open -o --open)--no-open[No open the resulting URL in a browser]' \
|
||||
'--skip-empty[Skip gisting empty files]' \
|
||||
'(-P --paste)'{-P,--paste}'[Paste from the clipboard to gist]' \
|
||||
'(-R --raw)'{-R,--raw}'[Display raw URL of the new gist]' \
|
||||
'(-l --list)'{-l,--list}'[List all gists for user ]::user' \
|
||||
'--delete[Delete a gist]:id:_gist_ids' \
|
||||
'(- *)'{-h,--help}'[print options help]' \
|
||||
'(-v --version)'{-v,--version}'[print version]' \
|
||||
'(-r --read)'{-r,--read}'[Read a gist and print out the contents]:user gists:_gist_ids' \
|
||||
'*: :_files' && ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
_arguments -C \
|
||||
'(--login)--login[Authenticate gist on this computer.]' \
|
||||
'(-f --filename)'{-f,--filename}'[Sets the filename and syntax type.]:NAME' \
|
||||
'(-t --type)'{-t,--type}'[Sets the file extension and syntax type.]:EXT' \
|
||||
'(-p --private --no-private)'{-p,--private}'[Makes your gist private.]' \
|
||||
'(--no-private -p --private)--no-private[Makes your gist no private.]' \
|
||||
'(-d --description)'{-d,--description}'[Adds a description to your gist.]:DESCRIPTION' \
|
||||
'(-s --shorten)'{-s,--shorten}'[Shorten the gist URL using git.io.]' \
|
||||
'(-u --update)'{-u,--update}'[Update an existing gist.]:URL ID:user_gists' \
|
||||
'(-c --copy)'{-c,--copy}'[Copy the resulting URL to the clipboard]' \
|
||||
'(-e --embed)'{-e,--embed}'[Copy the embed code for the gist to the clipboard]' \
|
||||
'(-o --open --no-open)'{-o,--open}'[Open the resulting URL in a browser]' \
|
||||
'(--no-open -o --open)--no-open[No open the resulting URL in a browser]' \
|
||||
'(-P --paste)'{-P,--paste}'[Paste from the clipboard to gist]' \
|
||||
'(-R --raw)'{-R,--raw}'[Display raw URL of the new gist]' \
|
||||
'(-l --list)'{-l,--list}'[List all gists for user ]::user' \
|
||||
'(-h --help)'{-h,--help}'[print options help]' \
|
||||
'(-v --version)'{-v,--version}'[print version]' \
|
||||
'(-r --read)'{-r,--read}'[Read a gist and print out the contents]:user gists:_gist_read_gists' \
|
||||
'*: :_files' && ret=0
|
||||
|
||||
_gist_cache_policy() {
|
||||
# rebuild if cache is more than a day old
|
||||
local -a oldp
|
||||
oldp=( "$1"(m+1) )
|
||||
oldp=( "$1"(mh+1) )
|
||||
(( $#oldp ))
|
||||
}
|
||||
|
||||
_gist_ids() {
|
||||
_gist_read_gists() {
|
||||
local update_policy ret=1
|
||||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
if [[ -z "$update_policy" ]]; then
|
||||
|
|
@ -84,33 +79,43 @@ _gist_ids() {
|
|||
fi
|
||||
|
||||
# stores the gists of the logged in user in the format ID[Description]
|
||||
local -a gist_list
|
||||
_list=()
|
||||
_cached_gists="user_gists"
|
||||
|
||||
# retrieve/Write gists from/to cache
|
||||
if _cache_invalid gist_cached_list || ! _retrieve_cache gist_cached_list; then
|
||||
if (( $+commands[ruby] )); then
|
||||
gist_list=(${(f)"$(gist -l | ruby -ne 'puts "#{$1}:#{$2}" if $_ =~ %r{/([^/ ]+)\s+(.+)}')"})
|
||||
elif (( $+commands[perl])); then
|
||||
gist_list=(${(f)"$(gist -l | perl -wln -e 'm{/([^/ ]+)\s+(.+)} and print qq($1:$2)')"})
|
||||
fi
|
||||
if _cache_invalid $_cached_gists || ! _retrieve_cache $_cached_gists; then
|
||||
_gists=$(gist -l)
|
||||
|
||||
if [[ $? -eq 0 ]]; then
|
||||
_store_cache gist_cached_list gist_list
|
||||
if [ $? -eq 0 ]; then
|
||||
_store_cache $_cached_gists _gists
|
||||
else
|
||||
# some error occurred, the user is probably not logged in
|
||||
# set _gists to an empty string so that no completion is attempted
|
||||
gist_list=()
|
||||
_gists=""
|
||||
fi
|
||||
else
|
||||
_retrieve_cache $_cached_gists
|
||||
fi
|
||||
|
||||
if [[ $#gist_list ]]; then
|
||||
_describe -t gist_ids 'gist_ids' gist_list
|
||||
if [ -n "$_gists" ]; then
|
||||
echo "$_gists" | while read -r line; do
|
||||
# Splitting the gist -l output
|
||||
url="$(echo "$line" | cut -d " " -f 1 | cut -d "/" -f 4)"
|
||||
# gists w/o descriptions can have only one column in the output, those
|
||||
# have their description set to an empty string
|
||||
description="$(echo "$line" | awk '{if(NF > 1){$1=""; print $0}}')"
|
||||
|
||||
_list+=( "${url}[${description}]" )
|
||||
done
|
||||
|
||||
_values "gists" $_list
|
||||
ret=0
|
||||
fi
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
_gist "$@"
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
|
|
|
|||
620
src/_git-flow
620
src/_git-flow
|
|
@ -40,357 +40,397 @@
|
|||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_git-flow () {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
_git-flow ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'init:Initialize a new git repo with support for the branching model.'
|
||||
'feature:Manage your feature branches.'
|
||||
'release:Manage your release branches.'
|
||||
'hotfix:Manage your hotfix branches.'
|
||||
'support:Manage your support branches.'
|
||||
'version:Shows version information.'
|
||||
)
|
||||
_describe -t commands 'git flow' subcommands
|
||||
;;
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(init)
|
||||
_arguments \
|
||||
-f'[Force setting of gitflow branches, even if already configured]' \
|
||||
-d'[Use default branch naming conventions and prefixes]'
|
||||
;;
|
||||
(version)
|
||||
;;
|
||||
(hotfix)
|
||||
__git-flow-hotfix
|
||||
;;
|
||||
(release)
|
||||
__git-flow-release
|
||||
;;
|
||||
(feature)
|
||||
__git-flow-feature
|
||||
;;
|
||||
(support)
|
||||
__git-flow-support
|
||||
;;
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'init:Initialize a new git repo with support for the branching model.'
|
||||
'feature:Manage your feature branches.'
|
||||
'release:Manage your release branches.'
|
||||
'hotfix:Manage your hotfix branches.'
|
||||
'support:Manage your support branches.'
|
||||
'version:Shows version information.'
|
||||
)
|
||||
_describe -t commands 'git flow' subcommands
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(init)
|
||||
_arguments \
|
||||
-f'[Force setting of gitflow branches, even if already configured]' \
|
||||
-d'[Use default branch naming conventions and prefixes]'
|
||||
;;
|
||||
|
||||
(version)
|
||||
;;
|
||||
|
||||
(hotfix)
|
||||
__git-flow-hotfix
|
||||
;;
|
||||
|
||||
(release)
|
||||
__git-flow-release
|
||||
;;
|
||||
|
||||
(feature)
|
||||
__git-flow-feature
|
||||
;;
|
||||
|
||||
(support)
|
||||
__git-flow-support
|
||||
;;
|
||||
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-release () {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
__git-flow-release ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new release branch.'
|
||||
'finish:Finish a release branch.'
|
||||
'list:List all your release branches. (Alias to `git flow release`)'
|
||||
'publish:Publish this release branch to origin.`)'
|
||||
'track:Track a release branch from origin.`)'
|
||||
)
|
||||
_describe -t commands 'git flow release' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-s'[Sign the release tag cryptographically]'\
|
||||
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
|
||||
-m'[Use the given tag message]'\
|
||||
-n'[Don'\''t tag this release]'\
|
||||
-p'[Push to $ORIGIN after performing finish]'\
|
||||
-k'[Keep branch after performing finish]'\
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
(publish)
|
||||
_arguments \
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
(track)
|
||||
_arguments \
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new release branch.'
|
||||
'finish:Finish a release branch.'
|
||||
'list:List all your release branches. (Alias to `git flow release`)'
|
||||
'publish:Publish this release branch to origin.`)'
|
||||
'track:Track a release branch from origin.`)'
|
||||
)
|
||||
_describe -t commands 'git flow release' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-s'[Sign the release tag cryptographically]'\
|
||||
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
|
||||
-m'[Use the given tag message]'\
|
||||
-n'[Don'\''t tag this release]'\
|
||||
-p'[Push to $ORIGIN after performing finish]'\
|
||||
-k'[Keep branch after performing finish]'\
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
|
||||
(publish)
|
||||
_arguments \
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
|
||||
(track)
|
||||
_arguments \
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
|
||||
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-hotfix () {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
__git-flow-hotfix ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new hotfix branch.'
|
||||
'finish:Finish a hotfix branch.'
|
||||
'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
|
||||
'publish:Publish this hotfix branch to origin`)'
|
||||
)
|
||||
_describe -t commands 'git flow hotfix' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':hotfix:__git_flow_version_list'\
|
||||
':branch-name:__git_flow_branch_names'
|
||||
;;
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new hotfix branch.'
|
||||
'finish:Finish a hotfix branch.'
|
||||
'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
|
||||
'publish:Publish this hotfix branch to origin`)'
|
||||
)
|
||||
_describe -t commands 'git flow hotfix' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-s'[Sign the release tag cryptographically]'\
|
||||
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
|
||||
-m'[Use the given tag message]'\
|
||||
-p'[Push to $ORIGIN after performing finish]'\
|
||||
':hotfix:__git_flow_hotfix_list'
|
||||
;;
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(publish)
|
||||
_arguments \
|
||||
':hotfix:__git_flow_hotfix_list'
|
||||
;;
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':hotfix:__git_flow_version_list'\
|
||||
':branch-name:__git_branch_names'
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-s'[Sign the release tag cryptographically]'\
|
||||
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
|
||||
-m'[Use the given tag message]'\
|
||||
-p'[Push to $ORIGIN after performing finish]'\
|
||||
':hotfix:__git_flow_hotfix_list'
|
||||
;;
|
||||
|
||||
(publish)
|
||||
_arguments \
|
||||
':hotfix:__git_flow_hotfix_list'
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-feature () {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
__git-flow-feature ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new feature branch.'
|
||||
'finish:Finish a feature branch.'
|
||||
'list:List all your feature branches. (Alias to `git flow feature`)'
|
||||
'publish:Publish this feature branch to origin.'
|
||||
'track:Track a feature branch from origin.'
|
||||
'diff:Show a diff of changes since this feature branched off.'
|
||||
'rebase:Rebase a feature branch on top of develop.'
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new feature branch.'
|
||||
'finish:Finish a feature branch.'
|
||||
'list:List all your feature branches. (Alias to `git flow feature`)'
|
||||
'publish:Publish this feature branch to origin.'
|
||||
'track:Track a feature branch from origin.'
|
||||
'diff:Show a diff of changes since this feature branched off.'
|
||||
'rebase:Rebase a feature branch on top of develop.'
|
||||
'checkout:Check out (switch to) the given feature branch.'
|
||||
'pull:Pull a feature branch from a remote peer.'
|
||||
)
|
||||
_describe -t commands 'git flow feature' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
'pull:Pull a feature branch from a remote peer.'
|
||||
)
|
||||
_describe -t commands 'git flow feature' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':feature:__git_flow_feature_list'\
|
||||
':branch-name:__git_flow_branch_names'
|
||||
;;
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-r'[Finish branch by rebasing first]'\
|
||||
-k'[Keep branch after performing finish]'\
|
||||
-D'[Force delete feature branch after finish]'\
|
||||
':feature:__git_flow_feature_list'
|
||||
;;
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':feature:__git_flow_feature_list'\
|
||||
':branch-name:__git_branch_names'
|
||||
;;
|
||||
|
||||
(publish)
|
||||
_arguments \
|
||||
':feature:__git_flow_feature_list'\
|
||||
;;
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-r'[Finish branch by rebasing first]'\
|
||||
-k'[Keep branch after performing finish]'\
|
||||
-D'[Force delete feature branch after finish]'\
|
||||
':feature:__git_flow_feature_list'
|
||||
;;
|
||||
|
||||
(track)
|
||||
_arguments \
|
||||
':feature:__git_flow_feature_list'\
|
||||
;;
|
||||
(publish)
|
||||
_arguments \
|
||||
':feature:__git_flow_feature_list'\
|
||||
;;
|
||||
|
||||
(diff)
|
||||
_arguments \
|
||||
':branch:__git_flow_branch_names'\
|
||||
;;
|
||||
(track)
|
||||
_arguments \
|
||||
':feature:__git_flow_feature_list'\
|
||||
;;
|
||||
|
||||
(rebase)
|
||||
_arguments \
|
||||
-i'[Do an interactive rebase]' \
|
||||
':branch:__git_flow_branch_names'
|
||||
;;
|
||||
(diff)
|
||||
_arguments \
|
||||
':branch:__git_branch_names'\
|
||||
;;
|
||||
|
||||
(checkout)
|
||||
_arguments \
|
||||
':branch:__git_flow_feature_list'\
|
||||
;;
|
||||
(rebase)
|
||||
_arguments \
|
||||
-i'[Do an interactive rebase]' \
|
||||
':branch:__git_branch_names'
|
||||
;;
|
||||
|
||||
(pull)
|
||||
_arguments \
|
||||
':remote:__git_flow_remote'\
|
||||
':branch:__git_flow_branch_names'
|
||||
;;
|
||||
(checkout)
|
||||
_arguments \
|
||||
':branch:__git_flow_feature_list'\
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
(pull)
|
||||
_arguments \
|
||||
':remote:__git_remotes'\
|
||||
':branch:__git_branch_names'
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-support() {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
__git-flow-support ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new support branch.'
|
||||
'list:List all your support branches. (Alias to `git flow support`)'
|
||||
)
|
||||
_describe -t commands 'git flow support' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new support branch.'
|
||||
'list:List all your support branches. (Alias to `git flow support`)'
|
||||
)
|
||||
_describe -t commands 'git flow support' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':feature:__git_flow_support_list'\
|
||||
':branch-name:__git_flow_branch_names'
|
||||
;;
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':feature:__git_flow_support_list'\
|
||||
':branch-name:__git_branch_names'
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_version_list() {
|
||||
local expl
|
||||
local -a versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_flow_command_successful || return
|
||||
__git_flow_version_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a versions
|
||||
|
||||
_wanted versions expl 'version' compadd $versions
|
||||
versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted versions expl 'version' compadd $versions
|
||||
}
|
||||
|
||||
__git_flow_feature_list() {
|
||||
local expl
|
||||
local -a features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_flow_command_successful || return
|
||||
__git_flow_feature_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a features
|
||||
|
||||
_wanted features expl 'feature' compadd $features
|
||||
features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted features expl 'feature' compadd $features
|
||||
}
|
||||
|
||||
__git_flow_remote() {
|
||||
local expl gitdir remotes
|
||||
__git_remotes () {
|
||||
local expl gitdir remotes
|
||||
|
||||
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
|
||||
__git_flow_command_successful || return
|
||||
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
|
||||
__git_command_successful || return
|
||||
|
||||
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
|
||||
__git_flow_command_successful || return
|
||||
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
|
||||
__git_command_successful || return
|
||||
|
||||
# TODO: Should combine the two instead of either or.
|
||||
if (( $#remotes > 0 )); then
|
||||
_wanted remotes expl remote compadd $* - $remotes
|
||||
else
|
||||
_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
|
||||
fi
|
||||
# TODO: Should combine the two instead of either or.
|
||||
if (( $#remotes > 0 )); then
|
||||
_wanted remotes expl remote compadd $* - $remotes
|
||||
else
|
||||
_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
|
||||
fi
|
||||
}
|
||||
|
||||
__git_flow_hotfix_list() {
|
||||
local expl
|
||||
local -a hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_flow_command_successful || return
|
||||
__git_flow_hotfix_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a hotfixes
|
||||
|
||||
_wanted hotfixes expl 'hotfix' compadd $hotfixes
|
||||
hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted hotfixes expl 'hotfix' compadd $hotfixes
|
||||
}
|
||||
|
||||
__git_flow_support_list() {
|
||||
local expl
|
||||
local -a support=(${${(f)"$(_call_program support git flow support list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_flow_command_successful || return
|
||||
__git_flow_support_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a support
|
||||
|
||||
_wanted hotfixes expl 'support' compadd $support
|
||||
support=(${${(f)"$(_call_program support git flow support list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted hotfixes expl 'support' compadd $support
|
||||
}
|
||||
|
||||
__git_flow_branch_names() {
|
||||
local expl
|
||||
local -a branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
||||
__git_flow_command_successful || return
|
||||
|
||||
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||
__git_branch_names () {
|
||||
local expl
|
||||
declare -a branch_names
|
||||
|
||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||
}
|
||||
|
||||
__git_flow_command_successful() {
|
||||
if (( ${#pipestatus:#0} > 0 )); then
|
||||
_message 'not a git repository'
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
__git_command_successful () {
|
||||
if (( ${#pipestatus:#0} > 0 )); then
|
||||
_message 'not a git repository'
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
_git-flow "$@"
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
_glances() {
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[show help message and exit]' \
|
||||
'(- *)'{-h,--help}'[show this help message and exit]' \
|
||||
'--print-completion[print shell completion script]:shell:(bash zsh tcsh)' \
|
||||
'(- *)'{-V,--version}"[show program's version number and exit]" \
|
||||
'(-d --debug)'{-d,--debug}'[enable debug mode]' \
|
||||
|
|
|
|||
76
src/_golang
76
src/_golang
|
|
@ -44,7 +44,7 @@
|
|||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
__golang_buildmodes() {
|
||||
__go_buildmodes() {
|
||||
local -a buildmodes=(
|
||||
'archive[non-main packages into .a files]'
|
||||
'c-archive[main package, plus all packages it imports, into a C archive file]'
|
||||
|
|
@ -59,7 +59,7 @@ __golang_buildmodes() {
|
|||
_values 'mode' $buildmodes
|
||||
}
|
||||
|
||||
__golang_runtimedebug() {
|
||||
__go_runtimedebug() {
|
||||
local -a vars=(
|
||||
'allocfreetrace[profile allocations]:boolean:(1 0)'
|
||||
'clobberfree[clobber memory after free]:boolean:(1 0)'
|
||||
|
|
@ -84,7 +84,7 @@ __golang_runtimedebug() {
|
|||
_values -s ',' -S '=' "runtime debug behavior" $vars[@]
|
||||
}
|
||||
|
||||
__golang_gcdebugflags() {
|
||||
__go_gcdebugflags() {
|
||||
_values -s , -S = 'debug flag' \
|
||||
'append[print information about append compilation]' \
|
||||
'checkptr[instrument unsafe pointer conversions]:pointer conversion checks:((0\:"instrumentation disabled" 1\:"conversions involving unsafe.Pointer are instrumented" 2\:"conversions to unsafe.Pointer force heap allocation"))' \
|
||||
|
|
@ -109,7 +109,7 @@ __golang_gcdebugflags() {
|
|||
'ssa/help[print help about SSA debugging]'
|
||||
}
|
||||
|
||||
__golang_gcflags() {
|
||||
__go_gcflags() {
|
||||
_arguments \
|
||||
'-%[debug non-static initializers]' \
|
||||
'-c=[concurrency during compilation]:int' \
|
||||
|
|
@ -131,7 +131,7 @@ __golang_gcflags() {
|
|||
'-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; try -d help]:list: __golang_gcdebugflags' \
|
||||
'-d=[print debug information about items in list; try -d help]:list: __go_gcdebugflags' \
|
||||
'-dwarf[generate DWARF symbols (default true)]' \
|
||||
'-dwarfbasentries[use base address selection entries in DWARF (default true)]' \
|
||||
'-dwarflocationlists[add location lists to DWARF in optimized mode (default true)]' \
|
||||
|
|
@ -173,7 +173,7 @@ __golang_gcflags() {
|
|||
'-wb[enable write barrier (default true)]'
|
||||
}
|
||||
|
||||
__golang_pgo() {
|
||||
__go_pgo() {
|
||||
_alternative \
|
||||
"name:name:(auto off)" \
|
||||
"file:file:_files"
|
||||
|
|
@ -203,9 +203,9 @@ local -a commands=(
|
|||
'help:get more information about a command'
|
||||
)
|
||||
|
||||
__golang_envvarvals() {
|
||||
# if __golang_envvarvals is called for -value-, I use the function argument to
|
||||
# decide which variable to go to. if $1 is not set, then __golang_envvarvals is
|
||||
__go_envvarvals() {
|
||||
# if __go_envvarvals is called for -value-, I use the function argument to
|
||||
# decide which variable to go to. if $1 is not set, then __go_envvarvals is
|
||||
# called from the `go env` completion and the current word (with all after
|
||||
# the first '=' removed) is the current variable.
|
||||
local env_variable=${1-${words[$CURRENT]%%=*}}
|
||||
|
|
@ -276,7 +276,7 @@ __golang_envvarvals() {
|
|||
_dispatch $service -value-,${variable#CGO_},-default-
|
||||
;;
|
||||
(GODEBUG)
|
||||
__golang_runtimedebug
|
||||
__go_runtimedebug
|
||||
;;
|
||||
(GOFLAGS)
|
||||
# not implemented, sorry
|
||||
|
|
@ -294,7 +294,7 @@ __golang_envvarvals() {
|
|||
esac
|
||||
}
|
||||
|
||||
__golang_packages() {
|
||||
__go_packages() {
|
||||
local -a gopaths=("${(s/:/)$(go env GOPATH)}")
|
||||
gopaths+=("$(go env GOROOT)")
|
||||
for p in $gopaths; do
|
||||
|
|
@ -312,7 +312,7 @@ __golang_packages() {
|
|||
fi
|
||||
}
|
||||
|
||||
__golang_fix_analyzers() {
|
||||
__go_fix_analyzers() {
|
||||
local -a fix_analyzers=(
|
||||
"any[replace interface{} with any]"
|
||||
"buildtag[check //go:build and // +build directives]"
|
||||
|
|
@ -341,7 +341,7 @@ __golang_fix_analyzers() {
|
|||
_values 'analyzer' $fix_analyzers
|
||||
}
|
||||
|
||||
__golang_pprof_symbolize_types() {
|
||||
__go_pprof_symbolize_types() {
|
||||
local -a symbolize_types=(
|
||||
"none[Do not attempt symbolization]"
|
||||
"local[Examine only local binaries]"
|
||||
|
|
@ -360,7 +360,7 @@ if [[ "$service" = -value-* ]]; then
|
|||
if (($blacklist[(I)$env_variable])); then
|
||||
return
|
||||
fi
|
||||
__golang_envvarvals $env_variable
|
||||
__go_envvarvals $env_variable
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
@ -382,16 +382,16 @@ case $state in
|
|||
'-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:__golang_buildmodes'
|
||||
'-buildmode[build mode to use]:mode:__go_buildmodes'
|
||||
'-buildvcs[stamp binaries with version control information]:mode:(internal external auto)'
|
||||
'-compiler[name of compiler to use]:name'
|
||||
'-gccgoflags[arguments for gccgo]:args'
|
||||
'*-gcflags=[arguments for each go tool compile invocation]:args:__golang_gcflags'
|
||||
'*-gcflags=[arguments for each go tool compile invocation]:args:__go_gcflags'
|
||||
'-installsuffix[suffix to add to package directory]:suffix'
|
||||
'-ldflags[arguments to pass on each go tool link invocation.]:flags'
|
||||
'-linkshared[link against shared libraries]'
|
||||
'-overlay[read a JSON config file that provides an overlay for build operations]:file:_files -g "*.json"'
|
||||
'-pgo[specify the file path of a profile for profile-guided optimization]:file_or_profile:__golang_pgo'
|
||||
'-pgo[specify the file path of a profile for profile-guided optimization]:file_or_profile:__go_pgo'
|
||||
'-pkgdir[install and load all packages from dir]:dir'
|
||||
'-tags[list of build tags to consider satisfied]:tags'
|
||||
'-trimpath[remove all file system paths from the resulting executable]'
|
||||
|
|
@ -425,7 +425,7 @@ case $state in
|
|||
'help:get more information about a command'
|
||||
)
|
||||
local -a fix_flags=(
|
||||
'-fixtool=[specify fix analyzer]:analyzer:__golang_fix_analyzers'
|
||||
'-fixtool=[specify fix analyzer]:analyzer:__go_fix_analyzers'
|
||||
'-diff[display diffs instead of rewriting files]'
|
||||
'-fixtool=[select analysis tool]:analyzer:'
|
||||
'(- *)-V[print version and exit]'
|
||||
|
|
@ -464,7 +464,7 @@ case $state in
|
|||
'-json[emit build output in JSON suitable for automated processing]' \
|
||||
${build_flags[@]} \
|
||||
${mod_flags[@]} \
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
;;
|
||||
|
||||
(clean)
|
||||
|
|
@ -477,7 +477,7 @@ case $state in
|
|||
'-fuzzcache[remove files stored in the Go build cache for fuzz testing]' \
|
||||
${build_flags[@]} \
|
||||
${mod_flags[@]} \
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
;;
|
||||
|
||||
(doc)
|
||||
|
|
@ -489,7 +489,7 @@ case $state in
|
|||
'-short[one-line representation for each symbol]' \
|
||||
'-src[show the full source code for the symbol]' \
|
||||
'-u[show docs for unexported and exported symbols and methods]' \
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
;;
|
||||
|
||||
(env)
|
||||
|
|
@ -569,12 +569,12 @@ case $state in
|
|||
)
|
||||
local -a exclude_from_w=(GOENV)
|
||||
|
||||
__golang_list_env_vars() {
|
||||
__go_list_env_vars() {
|
||||
# the parameter expansion strops off everything after the first [
|
||||
_values -s ' ' -w 'environment variable' ${goenvvars[@]%%\[*}
|
||||
}
|
||||
|
||||
# the ^ parameter expansion appends ": __golang_envvarvals" to every element of goenvvars
|
||||
# the ^ parameter expansion appends ": __go_envvarvals" to every element of goenvvars
|
||||
# the :# parameter expansion removes all elements matching GOENV*
|
||||
[[ $words[2] != '-w' ]] && _arguments \
|
||||
'-C[change to directory before running the command]: :_files -/' \
|
||||
|
|
@ -582,15 +582,15 @@ case $state in
|
|||
'-changed[prints only those settings whose effective value differs from the default value]' \
|
||||
'-u[unset environment variables]' \
|
||||
'-w[change the default setting of environment variables]' \
|
||||
'*:[show environment variable]: __golang_list_env_vars' || _values \
|
||||
-s ' ' -S "=" -w 'environment variable' ${^goenvvars:#GOENV*}": __golang_envvarvals"
|
||||
'*:[show environment variable]: __go_list_env_vars' || _values \
|
||||
-s ' ' -S "=" -w 'environment variable' ${^goenvvars:#GOENV*}": __go_envvarvals"
|
||||
;;
|
||||
|
||||
(fix)
|
||||
_arguments \
|
||||
'-C[change to directory before running the command]: :_files -/' \
|
||||
$fix_flags[@] \
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
;;
|
||||
|
||||
(fmt)
|
||||
|
|
@ -599,7 +599,7 @@ case $state in
|
|||
'-n[print commands that would be executed]' \
|
||||
'-x[print commands as they are executed]' \
|
||||
'-mod=[set which download mode to use]:mode:(readonly vendor)' \
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
;;
|
||||
|
||||
(generate)
|
||||
|
|
@ -610,7 +610,7 @@ case $state in
|
|||
'-n[print the commands but do not run them]' \
|
||||
'-v[print the names of packages as they are compiled]' \
|
||||
${build_flags[@]} \
|
||||
"*:args:{ _alternative ':importpaths:__golang_packages' _files }"
|
||||
"*:args:{ _alternative ':importpaths:__go_packages' _files }"
|
||||
;;
|
||||
|
||||
(get)
|
||||
|
|
@ -620,13 +620,13 @@ case $state in
|
|||
'-u[use the network to update the named packages]' \
|
||||
'-tool[instructs go to add a matching tool line to go.mod for each listed package]' \
|
||||
${build_flags[@]} \
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
;;
|
||||
|
||||
(install)
|
||||
_arguments \
|
||||
${build_flags[@]} \
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
;;
|
||||
|
||||
(list)
|
||||
|
|
@ -642,7 +642,7 @@ case $state in
|
|||
'-m[list modules instead of packages]'
|
||||
${build_flags[@]}
|
||||
${mod_flags[@]}
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
)
|
||||
# -u and -versions are only available if -m is present on the commandline
|
||||
if (($words[(I)-m])); then
|
||||
|
|
@ -684,7 +684,7 @@ case $state in
|
|||
(init)
|
||||
# Use go packages as module name suggestion
|
||||
_arguments \
|
||||
'*:module:__golang_packages'
|
||||
'*:module:__go_packages'
|
||||
;;
|
||||
(tidy)
|
||||
_arguments \
|
||||
|
|
@ -705,7 +705,7 @@ case $state in
|
|||
_arguments \
|
||||
'-m[treats the arguments as a list of modules]' \
|
||||
'-vendor[exclude tests of dependencies]' \
|
||||
'*:module:__golang_packages'
|
||||
'*:module:__go_packages'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
|
@ -716,7 +716,7 @@ case $state in
|
|||
_arguments \
|
||||
${build_flags[@]} \
|
||||
'-exec[invoke the binary using xprog]:xporg' \
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
;;
|
||||
|
||||
(telemetry)
|
||||
|
|
@ -803,7 +803,7 @@ case $state in
|
|||
${build_flags[@]} \
|
||||
'-exec[run test binary using xprog]:xprog' \
|
||||
'-o[compile test binary to named file]:file:_files' \
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
fi
|
||||
;;
|
||||
|
||||
|
|
@ -963,7 +963,7 @@ case $state in
|
|||
|
||||
(fix)
|
||||
if [[ $words[2] == "help" ]]; then
|
||||
__golang_fix_analyzers
|
||||
__go_fix_analyzers
|
||||
else
|
||||
_arguments \
|
||||
"*:args:{ _alternative ':subcommand:(help)' _files }"
|
||||
|
|
@ -1119,7 +1119,7 @@ case $state in
|
|||
'-add_comment=[free-form annotation to add to the profile]:comment' \
|
||||
'-diff_base=[source of base profile for comparison]:source:_files' \
|
||||
'-base[show delta from this profile]:profile' \
|
||||
'-symbolize=[controls source of symbol information]:source:__golang_pprof_symbolize_types' \
|
||||
'-symbolize=[controls source of symbol information]:source:__go_pprof_symbolize_types' \
|
||||
'-tls_cert=[TLS client certificate file for fetchign profile and symbols]:file:_files' \
|
||||
'-tls_key=[TLS private key file for fetching profile and symbols]:file:_files' \
|
||||
'-tls_ca=[TLS CA certs file for fetching profile and symbols]:file:_files' \
|
||||
|
|
@ -1215,7 +1215,7 @@ case $state in
|
|||
'-x[prints commands as they are executed]' \
|
||||
'-vettool[set a different analysis tool with alternative or additional checks]:prog:_files' \
|
||||
${build_flags[@]} \
|
||||
'*:importpaths:__golang_packages'
|
||||
'*:importpaths:__go_packages'
|
||||
;;
|
||||
|
||||
(work)
|
||||
|
|
|
|||
83
src/_h2load
83
src/_h2load
|
|
@ -1,83 +0,0 @@
|
|||
#compdef h2load
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for h2load 1.64.0 (https://github.com/nghttp2/nghttp2)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'(-n --requests)'{-n,--requests=}'[Number of requests across all clients(Default 1)]:num' \
|
||||
'(-c --clients)'{-c,--clients=}'[Number of concurrent clients(Default 1)]:num' \
|
||||
'(-t --threads)'{-t,--threads=}'[Number of native threads(Default 1)]:num' \
|
||||
'(-i --input-file)'{-i,--input-file=}'[Path of a file with multiple URIs are separated by EOLs]:file:_files' \
|
||||
'(-m --max-concurrent-streams)'{-m,--max-concurrent-streams=}'[Max concurrent streams to issue per session(Default 1)]:num' \
|
||||
'(-f --max-frame-size)'{-f,--max-frame-size=}'[Maximum frame size that the local endpoint is willing to receive(Default 16K)]:size' \
|
||||
'(-w --window-bits)'{-w,--window-bits=}'[Set the stream level initial window size to (2**n)-1(Default 30)]:num' \
|
||||
'(-W --connection-window-bits)'{-W,--connection-window-bits=}'[Set the connection level initial window size to (2**n)-1(Default 30)]:num' \
|
||||
\*{-H,--header=}'[Add/Override a header to the requests]:header' \
|
||||
'--ciphers=[Set allowed cipher list for TLSv1.2 or earlier]:cipher_list' \
|
||||
'--tls13-ciphers=[Set allowed cipher list for TLSv1.3]:cipher_list' \
|
||||
'(-p --no-tls-proto)'{-p,--no-tls-proto=}'[Specify ALPN identifier of the protocol to used when accessing without SSL/TLS(Default h2c)]:protoid' \
|
||||
'(-d --data)'{-d,--data=}'[POST file to server]:file:_files' \
|
||||
'(-r --rate)'{-r,--rate=}'[Specify the fixed rate at which connections are created]:num' \
|
||||
'--rate-period=[Specify the time period between creating connections]:num' \
|
||||
'(-D --duration)'{-D,--duration=}'[Specify the main duration for the measurements]:duration' \
|
||||
'--warm-up-time[Specify the time period before starting the actual measurements]:duration' \
|
||||
'(-T --connection-active-timeout)'{-T,--connection-active-timeout=}'[Specify the maximum time that h2load is willing to keep a connection open]:duration' \
|
||||
'(-N --connection-inactivity-timeout)'{-N,--connection-inactivity-timeout=}'[Specify the amount of time that h2load willing to wait to see activity on a given connection]:duration' \
|
||||
'(--timing-script-file --rps)--timing-script-file=[Path of a timing script file]:file:_files' \
|
||||
'(-B --base-uri)'{-B,--base-uri=}'[Specify URI from which the scheme, host and port will be used for all requests]:uri:_urls' \
|
||||
'--alpn-list=[Comma delimited list of ALPN protocol identifier sorted in the order of preference]:alpn_list' \
|
||||
'--h1[Short hand for --alpn-list=http/1.1 --no-tls-proto=http/1.1]' \
|
||||
'--header-table-size=[Specify decoder header table size(Default 4K)]:size' \
|
||||
'--encoder-header-table-size=[Specify encoder header table size(Default 4K)]:size' \
|
||||
'--log-file=[Path of a request information]:file:_files' \
|
||||
'--qlog-file-base=[Enable qlog output and specify base file name for qlogs]:file:_files' \
|
||||
'--connect-to=[Host and port to connect]:host_port' \
|
||||
'(--timing-script-file --rps)--rps=[Specify request per second for each client]:num' \
|
||||
'--groups=[Specify the supported groups]:groups' \
|
||||
'--no-udp-gso[Disable UDP GSO]' \
|
||||
'--max-udp-payload-size=[Specify the maximum outgoing UDP datagram payload size]:size' \
|
||||
'--ktls[Enable ktls]' \
|
||||
'--sni=[Send given DNS name in TLS SNI]:dns_name' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Output debug information]' \
|
||||
'(- *)--version[Display version information and exit]' \
|
||||
'(- *)'{-h,--help}'[Display help and exit]' \
|
||||
'*:: :_urls'
|
||||
|
||||
# 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
|
||||
11
src/_hello
11
src/_hello
|
|
@ -13,16 +13,7 @@
|
|||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments -s \
|
||||
'(- *)'{-h,--help}'[display help and exit]' \
|
||||
_arguments -s '(- *)'{-h,--help}'[display this help and exit]' \
|
||||
'(- *)'{-v,--version}'[display version information and exit]' \
|
||||
{-t,--traditional}'[use traditional greeting]' \
|
||||
{-g,--greeting=}'[use TEXT as the greeting message]:TEXT'
|
||||
|
||||
# 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
|
||||
|
|
|
|||
10
src/_hledger
10
src/_hledger
|
|
@ -64,7 +64,7 @@ args=(
|
|||
'--forecast=[apply periodic transaction rules to generate future transactions]'
|
||||
)
|
||||
|
||||
_arguments -C -A "-*" "$args[@]" \
|
||||
_arguments -C "$args[@]" -A "-*" \
|
||||
'(- *)--version[print version information]' \
|
||||
'--debug[show debug output]' \
|
||||
'1: :->cmds' \
|
||||
|
|
@ -284,11 +284,3 @@ while (( $#state )); do
|
|||
done
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ _inxi() {
|
|||
local curcontext="$curcontext"
|
||||
local ret=1
|
||||
|
||||
local -a colors=({0..42})
|
||||
local colors=($(seq 0 42))
|
||||
|
||||
_arguments -C -s \
|
||||
'(-A --audio)'{-A,--audio}"[Show Audio/sound card(s) information]" \
|
||||
|
|
|
|||
10
src/_kitchen
10
src/_kitchen
|
|
@ -54,7 +54,7 @@ _kitchen() {
|
|||
args)
|
||||
case $line[1] in
|
||||
converge|create|destroy|diagnose|list|setup|test|verify)
|
||||
_wanted all-instances expl 'all instances' compadd 'all'
|
||||
compadd 'all'
|
||||
_kitchen_instances
|
||||
;;
|
||||
login)
|
||||
|
|
@ -84,11 +84,3 @@ _kitchen_instances() {
|
|||
}
|
||||
|
||||
_kitchen "$@"
|
||||
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ _language_codes() {
|
|||
|
||||
case $command in
|
||||
ISO-639-1)
|
||||
_language_codes_${${command//-/_}:l} "${@[1,-2]}" && ret=0
|
||||
_language_codes_${${command//-/_}:l} "${@[1,-2]}" && ret=0
|
||||
;;
|
||||
*)
|
||||
_message "unknown command: $command"
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ case $state in
|
|||
'gs-load-lily-fonts[load only LilyPond fonts via Ghostscript]:gs-load-lily-fonts:(\#t \#f)' \
|
||||
'gs-never-embed-fonts[make Ghostscript embed only TrueType fonts and no other font format]:gs-never-embed-fonts:(\#t \#f)' \
|
||||
'gui[run LilyPond from a GUI and redirect stderr to a log file]:gui:(\#t \#f)' \
|
||||
'help[show help]:help:(\#t \#f)' \
|
||||
'help[show this help]:help:(\#t \#f)' \
|
||||
'include-book-title-preview[include book titles in preview images]:include-book-title-preview:(\#t \#f)' \
|
||||
'include-eps-fonts[include fonts in separate-system EPS files]:include-eps-fonts:(\#t \#f)' \
|
||||
'include-settings[included file before the score is processed]:include-settings:_files -g "*.(#i)ly(-.)"' \
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ _lscpu_cache() {
|
|||
}
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(- *)'{-V,--version}'[display version]' \
|
||||
'(-a --all)'{-a,--all}'[print both online and offline CPUs(default for -e)]' \
|
||||
'(-b --online)'{-b,--online}'[print online CPUs only]' \
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ _lsipc_output_columns() {
|
|||
}
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(- *)'{-V,--version}'[display version]' \
|
||||
'(-m --shmems)'{-m,--shmems}'[shared memory segments]' \
|
||||
'(-M --posix-shmems)'{-M,--posix-shmems}'[POSIX shared memory segments]' \
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ _lslocks_output_columns() {
|
|||
}
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(- *)'{-V,--version}'[display version]' \
|
||||
'(-b --bytes)'{-b,--bytes}'[print SIZE in bytes rather]' \
|
||||
'(-J --json)'{-J,--json}'[use the JSON output format]' \
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ _lslogins_output_columns() {
|
|||
}
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(- *)'{-V,--version}'[display version]' \
|
||||
'(-a --acc-expiration)'{-a,--acc-expiration}'[display info about passwords expiration]' \
|
||||
'(-c --colon-separate)'{-c,--colon-separate}'[display data in a format similar to /etc/passwd]' \
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ _lsmem_output_columns() {
|
|||
}
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(- *)'{-V,--version}'[display version]' \
|
||||
'(-J --json)'{-J,--json}'[use the JSON output format]' \
|
||||
'(-P --pairs)'{-P,--pairs}'[use key=value output format]' \
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
_arguments \
|
||||
{-f,--file}'[Use file as as cookie seed]:file:_files' \
|
||||
{-m,--max-size}'[Set maximum length of output]:bytes' \
|
||||
{-m,--max-size}'[Set maximum length of output]:number' \
|
||||
{-v,--verbose}'[Print entropy source and random seed info]' \
|
||||
'(- *)'{-h,--help}'[Display help message and exit]' \
|
||||
'(- *)'{-V,--version}'[Display version information and exit]'
|
||||
|
|
|
|||
|
|
@ -154,11 +154,3 @@ case $state in
|
|||
esac
|
||||
|
||||
return ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
|
|
|
|||
|
|
@ -106,11 +106,3 @@ _describe 'command' instances
|
|||
# Reference:
|
||||
# https://zsh.sourceforge.net/Doc/Release/Completion-System.html
|
||||
# https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org
|
||||
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'(- *)--help[display help message]' \
|
||||
'(- *)--help[display this help message]' \
|
||||
'-d-[Verbose debug]:level:(0 1 2)' \
|
||||
'-v-[SSH debug levels]:level:(0 1 2 3)' \
|
||||
'-m-[Run concurrently on the specified hosts at a time. "0" is used for infinite]:count' \
|
||||
|
|
|
|||
89
src/_mvn
89
src/_mvn
|
|
@ -104,11 +104,11 @@ _mvn() {
|
|||
|
||||
if [[ $maven_version == 'maven4' ]]; then
|
||||
opts+=(
|
||||
"($excl_opts -canf --cache-artifact-not-found)"{-canf,--cache-artifact-not-found}'[defines caching behaviour for not found artifacts]: :(false true)'
|
||||
"($excl_opts -fos --fail-on-severity)"{-fos,--fail-on-severity}'[configure which severity of logging should cause the build to fail]: :(WARN ERROR)'
|
||||
"($excl_opts -itr --ignore-transitive-repositories)"{-itr,--ignore-transitive-repositories}'[if set, Maven will ignore remote repositories introduced by transitive dependencies]'
|
||||
"($excl_opts --non-interactive)"'--non-interactive[run in non-interactive mode. Alias for --batch-mode]'
|
||||
"($excl_opts -r --resume)"{-r,--resume}'[resume reactor from the last failed project, using the resume.properties file in the build directory]'
|
||||
"($excl_opts -canf --cache-artifact-not-found)"{-canf,--cache-artifact-not-found}'[defines caching behaviour for not found artifacts]: :(false true)'
|
||||
"($excl_opts -fos --fail-on-severity)"{-fos,--fail-on-severity}'[configure which severity of logging should cause the build to fail]: :(WARN ERROR)'
|
||||
"($excl_opts -itr --ignore-transitive-repositories)"{-itr,--ignore-transitive-repositories}'[if set, Maven will ignore remote repositories introduced by transitive dependencies]'
|
||||
"($excl_opts --non-interactive)"'--non-interactive[run in non-interactive mode. Alias for --batch-mode]'
|
||||
"($excl_opts -r --resume)"{-r,--resume}'[resume reactor from the last failed project, using the resume.properties file in the build directory]'
|
||||
)
|
||||
fi
|
||||
|
||||
|
|
@ -266,19 +266,14 @@ _mvn_groupIds() {
|
|||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_groupIds_caching_policy
|
||||
|
||||
if [[ -d $repository_location ]]; then
|
||||
local -a groupIds
|
||||
local cache_key="mvn/repositories/${repository_location}/groupIds"
|
||||
if ( _cache_invalid $cache_key ) && ! _retrieve_cache $cache_key; then
|
||||
groupIds=($repository_location/**/)
|
||||
groupIds=(${${${(u)_groupIds:h:h}#"$repository_location/"}//\//.})
|
||||
if (( $#groupIds > 0 )); then
|
||||
_store_cache $cache_key groupIds
|
||||
fi
|
||||
unset _groupIds
|
||||
if ( [[ ${+_groupIds} -eq 0 ]] || _cache_invalid "mvn/repositories/${repository_location}/groupIds" ) && ! _retrieve_cache "mvn/repositories/${repository_location}/groupIds"; then
|
||||
_groupIds=($repository_location/**/)
|
||||
_groupIds=(${${${(u)_groupIds:h:h}#"$repository_location/"}//\//.})
|
||||
[[ $#_groupIds -gt 0 ]] && _store_cache "mvn/repositories/${repository_location}/groupIds" _groupIds
|
||||
fi
|
||||
|
||||
if (( $#groupIds > 0 )); then
|
||||
_multi_parts $@ . groupIds && ret=0
|
||||
fi
|
||||
[[ $#_groupIds -gt 0 ]] && _multi_parts $@ . _groupIds && ret=0
|
||||
fi
|
||||
|
||||
return ret
|
||||
|
|
@ -315,19 +310,14 @@ _mvn_plugin_goals() {
|
|||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_goals_caching_policy
|
||||
|
||||
local -a goals
|
||||
local cache_key="mvn/plugins/${plugin}"
|
||||
if _cache_invalid $cache_key && ! _retrieve_cache $cache_key; then
|
||||
unset _goals
|
||||
if ( [[ ${+_goals} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin}" ) && ! _retrieve_cache "mvn/plugins/${plugin}"; then
|
||||
setopt localoptions extendedglob
|
||||
_goals=(${(s:,,,:)${${${(f)${${${(f)${${${${(F)${(S)${(f)"$(_call_program goals $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=$plugin)"}//#$(__mvn_get_plugin_prefix $plugin):/,,,}}:#*BUILD FAILURE*}#*This plugin has*goals#:}%For more information, run \'mvn help:describe*}}//:/\\:}}}// ##/ }// Description\\: /:}})
|
||||
if (( $#goals > 0 )); then
|
||||
_store_cache "mvn/plugins/${plugin}" goals
|
||||
fi
|
||||
[[ $#_goals -gt 0 ]] && _store_cache "mvn/plugins/${plugin}" _goals
|
||||
fi
|
||||
|
||||
if (( $#goals > 0 )); then
|
||||
_describe -t "goals" "${plugin} goal" goals $@[0,-2] && ret=0
|
||||
fi
|
||||
[[ $#_goals -gt 0 ]] && _describe -t "goals" "${plugin} goal" _goals $@[0,-2] && ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
|
|
@ -348,52 +338,44 @@ _mvn_profiles() {
|
|||
|
||||
# Resolve profiles from settings.xml
|
||||
if [[ -f $settings_file ]]; then
|
||||
local -a profiles
|
||||
unset _profiles
|
||||
cache_name="mvn/profiles${settings_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10
|
||||
if _cache_invalid "$cache_name" && ! _retrieve_cache "$cache_name"; then
|
||||
profiles=()
|
||||
if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then
|
||||
_profiles=()
|
||||
profiles_section="${(M)${(f)$(<$settings_file)}:#*<profiles>*}"
|
||||
if [[ -n "$profiles_section" ]]; then
|
||||
for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*<profile>}%</profile>*}//<repositories>*<\/repositories>}//<pluginRepositories>*<\/pluginRepositories>}//<build>*<\/build>}//<\/id>*<id>/,,,}##*<id>}%%</id>*}}; do
|
||||
[[ -z ${(M)profiles:#"$profile"*} ]] && profiles+=("$profile"'['"in settings file"']')
|
||||
[[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in settings file"']')
|
||||
done
|
||||
fi
|
||||
|
||||
if (( $#profiles > 0 )); then
|
||||
_store_cache "$cache_name" profiles
|
||||
fi
|
||||
[[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
|
||||
fi
|
||||
profs+=($profiles)
|
||||
profs+=($_profiles)
|
||||
fi
|
||||
|
||||
# Resolve project profiles
|
||||
if [[ -f $parent_pom_file ]]; then
|
||||
local -a profiles
|
||||
unset _profiles
|
||||
cache_name="mvn/profiles${parent_pom_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10
|
||||
if _cache_invalid "$cache_name" && ! _retrieve_cache "$cache_name"; then
|
||||
profiles=()
|
||||
if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then
|
||||
_profiles=()
|
||||
setopt localoptions extendedglob
|
||||
for file in ${parent_pom_file:h}/**/pom.xml~*target\/*; do # FIXME project.build.directory is not always target/
|
||||
profiles_section="${(M)${(f)$(<$file)}:#*<profiles>*}"
|
||||
if [[ -n "$profiles_section" ]]; then
|
||||
for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*<profile>}%</profile>*}//<repositories>*<\/repositories>}//<pluginRepositories>*<\/pluginRepositories>}//<build>*<\/build>}//<\/id>*<id>/,,,}##*<id>}%%</id>*}}; do
|
||||
[[ -z ${(M)profiles:#"$profile"*} ]] && profiles+=("$profile"'['"in ${file#${parent_pom_file:h}\/}"']')
|
||||
[[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in ${file#${parent_pom_file:h}\/}"']')
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
if (( $#profiles > 0)); then
|
||||
_store_cache "$cache_name" profiles
|
||||
fi
|
||||
[[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
|
||||
fi
|
||||
profs+=($profiles)
|
||||
profs+=($_profiles)
|
||||
fi
|
||||
|
||||
compset -P '-'; compset -P '+'; compset -P '!' # FIXME Only works for the first profile
|
||||
|
||||
if (( $profs > 0 )); then
|
||||
_values $@ 'profile' "${profs[@]}" && ret=0
|
||||
fi
|
||||
[[ $#profs -gt 0 ]] && _values $@ 'profile' "${profs[@]}" && ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
|
|
@ -455,21 +437,16 @@ _mvn_plugin_goal_property_names() {
|
|||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_properties_caching_policy
|
||||
|
||||
local -a properties
|
||||
local cache_key="mvn/plugins/${plugin_colon_goal}"
|
||||
if _cache_invalid $cache_key && ! _retrieve_cache $cache_key; then
|
||||
unset _properties
|
||||
if ( [[ ${+_properties} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin_colon_goal}" ) && ! _retrieve_cache "mvn/plugins/${plugin_colon_goal}"; then
|
||||
# FIXME Does not work for:
|
||||
# android:apk (new line before expression)
|
||||
# ear:ear (unknown cause)
|
||||
properties=(${(M)${(ps:,,,:)${${${${(pj: :)${${${(f)${"$(_call_program properties $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=${plugin_colon_goal%:*} -Dgoal=${plugin_colon_goal##*:} -Ddetail)"#*Available parameters:}%%\[INFO\]*}//# [a-z]*/,,,}##*Expression: \$\{}}//\}[[:space:]]##/:}//[[:space:]]##/ }//[[:space:]]#,,,[[:space:]]#/,,,}}:#[a-zA-Z]##:*})
|
||||
if (( $#properties > 0 )); then
|
||||
_store_cache $cache_key properties
|
||||
fi
|
||||
_properties=(${(M)${(ps:,,,:)${${${${(pj: :)${${${(f)${"$(_call_program properties $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=${plugin_colon_goal%:*} -Dgoal=${plugin_colon_goal##*:} -Ddetail)"#*Available parameters:}%%\[INFO\]*}//# [a-z]*/,,,}##*Expression: \$\{}}//\}[[:space:]]##/:}//[[:space:]]##/ }//[[:space:]]#,,,[[:space:]]#/,,,}}:#[a-zA-Z]##:*})
|
||||
[[ $#_properties -gt 0 ]] && _store_cache "mvn/plugins/${plugin_colon_goal}" _properties
|
||||
fi
|
||||
|
||||
if (( $#properties > 0 )); then
|
||||
_describe -t "${plugin_colon_goal//:/-}-property-names" "${plugin_colon_goal} property name" properties $@[0,-2] && ret=0
|
||||
fi
|
||||
[[ $#_properties -gt 0 ]] && _describe -t "${plugin_colon_goal//:/-}-property-names" "${plugin_colon_goal} property name" _properties $@[0,-2] && ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ if [[ -n $state ]]; then
|
|||
+) _message -e lines "start at a given line" ;;
|
||||
+[crCR]#[/?]) _message -e 'search string' ;;
|
||||
+<->,) _message -e 'column number' ;;
|
||||
*) _files ;;
|
||||
esac && ret=0
|
||||
*) _files && ret=0 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
return ret
|
||||
|
|
|
|||
|
|
@ -144,11 +144,3 @@ local options=(
|
|||
)
|
||||
|
||||
_arguments $options "*::func_name:($func_names)"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
|
|
|
|||
518
src/_nftables
518
src/_nftables
|
|
@ -12,280 +12,278 @@
|
|||
# * Markus Richter ( https://github.com/mqus , <mqus@disroot.org>)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_nft(){
|
||||
local -a rules states prev args families options descriptors
|
||||
local state="start" line nextstate cmd_obj cmd_subcmd cmd_fam cmd_tab cmd_chain #curcontext="$curcontext"
|
||||
local -a rules states prev args families options descriptors
|
||||
local state="start" line nextstate cmd_obj cmd_subcmd cmd_fam cmd_tab cmd_chain #curcontext="$curcontext"
|
||||
|
||||
options=(
|
||||
'(-)'{-h,--help}'[show help]'
|
||||
'(-)'{-v,--version}'[print version information]'
|
||||
"(-i --interactive)"{-i,--interactive}'[read input from interactive CLI]: :->end'
|
||||
"(-f --file)"{-f,--file}'[read input from <filename>]:nftables rule file:_files'
|
||||
'(-c --check -n --numeric -N)'{-c,--check}"[check command's validity without actually applying the changes]"
|
||||
'(-j --json)'{-j,--json}'[format output in json]'
|
||||
'(-c --check -N)*'{-n,--numeric}'[can be specified up to 3 times, Shows 1:network addresses(default behaviour), 2:internet services (port numbers) and 3:protocols, user IDs, and group IDs numerically]'
|
||||
'(-s --stateless)'{-s,--stateless}'[omit stateful information of ruleset]'
|
||||
'(-N -n --numeric -c --check)'-N'[translate IP addresses to names]'
|
||||
'(-a --handle)'{-a,--handle}'[output rule handle]'
|
||||
'(-e --echo)'{-e,--echo}'[echo what has been added, inserted or replaced]'
|
||||
{-I,--includepath}'[add specified directory to the paths searched for include files]:include directory [/usr/share]:include directory:_directories'
|
||||
)
|
||||
options=(
|
||||
'(-)'{-h,--help}'[show help]' \
|
||||
'(-)'{-v,--version}'[print version information]' \
|
||||
"(-i --interactive)"{-i,--interactive}'[read input from interactive CLI]: :->end' \
|
||||
"(-f --file)"{-f,--file}'[read input from <filename>]:nftables rule file:_files' \
|
||||
'(-c --check -n --numeric -N)'{-c,--check}"[check command's validity without actually applying the changes]" \
|
||||
'(-j --json)'{-j,--json}'[format output in json]' \
|
||||
'(-c --check -N)*'{-n,--numeric}'[can be specified up to 3 times, Shows 1:network addresses(default behaviour), 2:internet services (port numbers) and 3:protocols, user IDs, and group IDs numerically]' \
|
||||
'(-s --stateless)'{-s,--stateless}'[omit stateful information of ruleset]' \
|
||||
'(-N -n --numeric -c --check)'-N'[translate IP addresses to names]' \
|
||||
'(-a --handle)'{-a,--handle}'[output rule handle]' \
|
||||
'(-e --echo)'{-e,--echo}'[echo what has been added, inserted or replaced]' \
|
||||
{-I,--includepath}'[add specified directory to the paths searched for include files]:include directory [/usr/share]:include directory:_directories'
|
||||
)
|
||||
|
||||
# start a state machine. The state is modified by _arguments if the
|
||||
# current argument (descriptors) cannot be completed. Each state has to define is successive state and the
|
||||
# 'descriptors' for _arguments, which essentially tells _arguments how to complete
|
||||
local _i=0
|
||||
while true;do
|
||||
(( _i+=1 ))
|
||||
#Guard for endless loops
|
||||
[[ $_i -gt 100 ]] && return 1
|
||||
# start a state machine. The state is modified by _arguments if the
|
||||
# current argument (descriptors) cannot be completed. Each state has to define is successive state and the
|
||||
# 'descriptors' for _arguments, which essentially tells _arguments how to complete
|
||||
local _i=0
|
||||
while true;do
|
||||
(( _i+=1 ))
|
||||
#Guard for endless loops
|
||||
[[ $_i -gt 100 ]] && return 1
|
||||
|
||||
descriptors=()
|
||||
nextstate="end"
|
||||
case $state in
|
||||
(start)
|
||||
##if line is empty (at the start) or ends with semicolon, autocomplete subcommands,
|
||||
# else if we are after a space,complete a semicolon (end the current nft command) and start anew
|
||||
if [[ $line[1] = "" || $line[1] =~ ';$' ]] ; then
|
||||
descriptors=( ":: :_nft_subcommands" )
|
||||
nextstate="category"
|
||||
else
|
||||
if [[ $words =~ ' $' ]]; then
|
||||
descriptors=(':: :(\;)')
|
||||
else
|
||||
descriptors=(':argument: ')
|
||||
fi
|
||||
nextstate="start"
|
||||
fi
|
||||
;;
|
||||
(category)
|
||||
case $line[1] in
|
||||
(add | list | flush | delete | create | rename | insert | replace | reset)
|
||||
descriptors=( ":: :_nft_${line[1]}" )
|
||||
nextstate=$line[1]
|
||||
;;
|
||||
(monitor)
|
||||
descriptors=( ":: : _nft_mon_filter" )
|
||||
nextstate="mon1"
|
||||
;;
|
||||
(export)
|
||||
descriptors=( ":: :(ruleset)" ":: :_nft_out_format" )
|
||||
nextstate="preend"
|
||||
;;
|
||||
(describe)
|
||||
descriptors=( ":expression: ")
|
||||
nextstate="start" #x restart
|
||||
;;
|
||||
(*)
|
||||
return 1;
|
||||
;;
|
||||
esac
|
||||
|
||||
#descriptors=( "(ruleset)" )
|
||||
#nextstate="end"
|
||||
;;
|
||||
(mon1)
|
||||
case $line[1] in
|
||||
(new | destroy)
|
||||
# descriptors=( ":: :_nft_mon_keywords" ":: :_nft_out_format")
|
||||
descriptors=( ":: : _nft_mon_keywords")
|
||||
nextstate="mon1"
|
||||
;;
|
||||
(tables | chains | sets | rules | elements | ruleset)
|
||||
descriptors=( ":: : _nft_out_format")
|
||||
nextstate="preend"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
#all completions for create and insert match with the completions of add
|
||||
(create | insert)
|
||||
state="add"
|
||||
;|
|
||||
#all completions for reset and flush match with the completions of list
|
||||
(reset | flush)
|
||||
state="list"
|
||||
;|
|
||||
#(add(^table)/create(^table)/delete/flush(^ruleset)/insert/list(^ruleset)/rename/replace)[family]table
|
||||
(reset | delete | insert | rename | replace | add | create | flush | list)
|
||||
if [[ $state = "add" && $line[1] = "table" ]]; then
|
||||
descriptors=( ":: :_nft_families" ":table name:")
|
||||
nextstate="start" #x restart
|
||||
elif [[ $state = "list" && ( $line[1] = "ruleset" || $line[1] = "tables" ) ]]; then
|
||||
descriptors=( ":: :_nft_families")
|
||||
nextstate="start" #x restart
|
||||
elif [[ $state = "delete" && $line[1] = "table" ]]; then
|
||||
descriptors=(": : _nft_table all-handle")
|
||||
nextstate="tcomplete-delete-table"
|
||||
else
|
||||
cmd_obj=$line[1]
|
||||
cmd_subcmd=$state
|
||||
descriptors=(": : _nft_table all")
|
||||
nextstate="tcomplete"
|
||||
fi
|
||||
;;
|
||||
(tcomplete-delete-table)
|
||||
# if only a family was completed, complete the table name.
|
||||
case $line[1] in
|
||||
(arp | bridge | inet | ip | ip6 | netdev)
|
||||
descriptors=(": : _nft_table ${line[1]}-handle")
|
||||
cmd_fam=$line[1]
|
||||
;;
|
||||
# if 'handle' was completed, complete the handle number.
|
||||
(handle)
|
||||
descriptors=(": : _nft_table_handle_all " )
|
||||
;;
|
||||
# else, complete nothing and go to the next state. default family is 'ip'
|
||||
(*)
|
||||
descriptors=()
|
||||
cmd_fam="ip"
|
||||
;;
|
||||
esac
|
||||
nextstate="delete-table"
|
||||
;;
|
||||
(tcomplete)
|
||||
# if only a family was completed, complete the table name.
|
||||
case $line[1] in
|
||||
(arp | bridge | inet | ip | ip6 | netdev)
|
||||
descriptors=(": : _nft_table ${line[1]}")
|
||||
cmd_fam=$line[1]
|
||||
;;
|
||||
# else, complete nothing and go to the next state. default family is 'ip'
|
||||
(*)
|
||||
descriptors=()
|
||||
cmd_fam="ip"
|
||||
;;
|
||||
esac
|
||||
nextstate="$cmd_subcmd-$cmd_obj"
|
||||
;;
|
||||
(list-table)
|
||||
descriptors=(":: :(\;)")
|
||||
nextstate="start"
|
||||
;;
|
||||
(delete-table)
|
||||
#if family AND handle were input, complete handle number for given family.
|
||||
if [[ $line[1] == "handle" ]]; then
|
||||
descriptors=(":table handle: _nft_table_handle $cmd_fam" )
|
||||
else
|
||||
descriptors=()
|
||||
fi
|
||||
nextstate="start"
|
||||
;;
|
||||
(delete-chain | delete-set | delete-quota | delete-counter | delete-ct\\ helper)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab $cmd_obj true")
|
||||
nextstate="delete-obj-handle"
|
||||
;;
|
||||
(delete-obj-handle)
|
||||
if [[ $line[1] == "handle" ]]; then
|
||||
descriptors=(": : _nft_object_handle $cmd_fam $cmd_tab $cmd_obj")
|
||||
else
|
||||
descriptors=(": :(\;)")
|
||||
fi
|
||||
nextstate="start"
|
||||
;;
|
||||
(add-chain)
|
||||
descriptors=(":chain name:")
|
||||
nextstate="start"
|
||||
;;
|
||||
(rename-chain)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
|
||||
nextstate="add-chain"
|
||||
;;
|
||||
(replace-rule | delete-rule)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
|
||||
nextstate="repdel-rule"
|
||||
;;
|
||||
(repdel-rule)
|
||||
cmd_chain=$line[1]
|
||||
descriptors=(": :(handle)" ": : _nft_rule_handle $cmd_fam $cmd_tab ${line[1]}")
|
||||
if [[ $cmd_subcmd = "replace" ]];then
|
||||
nextstate="rule-stmt"
|
||||
else
|
||||
nextstate="start"
|
||||
fi
|
||||
;;
|
||||
(add-rule)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
|
||||
nextstate="add-rule-2"
|
||||
;;
|
||||
(add-rule-2)
|
||||
cmd_chain=$line[1]
|
||||
descriptors=(": :(handle index position)")
|
||||
nextstate="add-rule-3"
|
||||
;;
|
||||
(add-rule-3)
|
||||
case $line[1] in
|
||||
(index | position)
|
||||
descriptors=(":${line[1]}:")
|
||||
;;
|
||||
(handle)
|
||||
descriptors=(": : _nft_rule_handle $cmd_fam $cmd_tab $cmd_chain")
|
||||
;;
|
||||
(*)
|
||||
descriptors=()
|
||||
;;
|
||||
esac
|
||||
nextstate="rule-stmt"
|
||||
;;
|
||||
(rule-stmt)
|
||||
#TODO
|
||||
# _nft_rule $cmd_fam $cmd_tab $cmd_chain\
|
||||
# && return 0;
|
||||
descriptors=(":expression: ")
|
||||
nextstate="start"
|
||||
;;
|
||||
(list-set | list-map | delete-map | list-chain | list-flowtable | delete-flowtable | list-ct\\ helper | list-counter | list-quota | list-meter)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab $cmd_obj false")
|
||||
descriptors=()
|
||||
nextstate="end"
|
||||
case $state in
|
||||
(start)
|
||||
##if line is empty (at the start) or ends with semicolon, autocomplete subcommands,
|
||||
# else if we are after a space,complete a semicolon (end the current nft command) and start anew
|
||||
if [[ $line[1] = "" || $line[1] =~ ';$' ]] ; then
|
||||
descriptors=( ":: :_nft_subcommands" )
|
||||
nextstate="category"
|
||||
else
|
||||
if [[ $words =~ ' $' ]]; then
|
||||
descriptors=(':: :(\;)')
|
||||
else
|
||||
descriptors=(':argument: ')
|
||||
fi
|
||||
nextstate="start"
|
||||
;;
|
||||
(add-element | delete-element)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab '\(map\|set\)' false")
|
||||
nextstate="start"
|
||||
;;
|
||||
#TODO:
|
||||
#(add-set | add-map)
|
||||
#(add-flowtable)
|
||||
#("add-ct\ helper")
|
||||
#(add-counter)
|
||||
#(add-quota)
|
||||
|
||||
(*)
|
||||
return 1;
|
||||
;;
|
||||
fi
|
||||
;;
|
||||
(category)
|
||||
case $line[1] in
|
||||
(add | list | flush | delete | create | rename | insert | replace | reset)
|
||||
descriptors=( ":: :_nft_${line[1]}" )
|
||||
nextstate=$line[1]
|
||||
;;
|
||||
(monitor)
|
||||
descriptors=( ":: : _nft_mon_filter" )
|
||||
nextstate="mon1"
|
||||
;;
|
||||
(export)
|
||||
descriptors=( ":: :(ruleset)" ":: :_nft_out_format" )
|
||||
nextstate="preend"
|
||||
;;
|
||||
(describe)
|
||||
descriptors=( ":expression: ")
|
||||
nextstate="start" #x restart
|
||||
;;
|
||||
(*)
|
||||
return 1;
|
||||
;;
|
||||
esac
|
||||
_arguments -C -s \
|
||||
"${options[@]}" \
|
||||
"${descriptors[@]}" \
|
||||
"*:: :->$nextstate" \
|
||||
&& return 0;
|
||||
|
||||
done
|
||||
#descriptors=( "(ruleset)" )
|
||||
#nextstate="end"
|
||||
;;
|
||||
(mon1)
|
||||
case $line[1] in
|
||||
(new | destroy)
|
||||
# descriptors=( ":: :_nft_mon_keywords" ":: :_nft_out_format")
|
||||
descriptors=( ":: : _nft_mon_keywords")
|
||||
nextstate="mon1"
|
||||
;;
|
||||
(tables | chains | sets | rules | elements | ruleset)
|
||||
descriptors=( ":: : _nft_out_format")
|
||||
nextstate="preend"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
#all completions for create and insert match with the completions of add
|
||||
(create | insert)
|
||||
state="add"
|
||||
;|
|
||||
#all completions for reset and flush match with the completions of list
|
||||
(reset | flush)
|
||||
state="list"
|
||||
;|
|
||||
#(add(^table)/create(^table)/delete/flush(^ruleset)/insert/list(^ruleset)/rename/replace)[family]table
|
||||
(reset | delete | insert | rename | replace | add | create | flush | list)
|
||||
if [[ $state = "add" && $line[1] = "table" ]]; then
|
||||
descriptors=( ":: :_nft_families" ":table name:")
|
||||
nextstate="start" #x restart
|
||||
elif [[ $state = "list" && ( $line[1] = "ruleset" || $line[1] = "tables" ) ]]; then
|
||||
descriptors=( ":: :_nft_families")
|
||||
nextstate="start" #x restart
|
||||
elif [[ $state = "delete" && $line[1] = "table" ]]; then
|
||||
descriptors=(": : _nft_table all-handle")
|
||||
nextstate="tcomplete-delete-table"
|
||||
else
|
||||
cmd_obj=$line[1]
|
||||
cmd_subcmd=$state
|
||||
descriptors=(": : _nft_table all")
|
||||
nextstate="tcomplete"
|
||||
fi
|
||||
;;
|
||||
(tcomplete-delete-table)
|
||||
# if only a family was completed, complete the table name.
|
||||
case $line[1] in
|
||||
(arp | bridge | inet | ip | ip6 | netdev)
|
||||
descriptors=(": : _nft_table ${line[1]}-handle")
|
||||
cmd_fam=$line[1]
|
||||
;;
|
||||
# if 'handle' was completed, complete the handle number.
|
||||
(handle)
|
||||
descriptors=(": : _nft_table_handle_all " )
|
||||
;;
|
||||
# else, complete nothing and go to the next state. default family is 'ip'
|
||||
(*)
|
||||
descriptors=()
|
||||
cmd_fam="ip"
|
||||
;;
|
||||
esac
|
||||
nextstate="delete-table"
|
||||
;;
|
||||
(tcomplete)
|
||||
# if only a family was completed, complete the table name.
|
||||
case $line[1] in
|
||||
(arp | bridge | inet | ip | ip6 | netdev)
|
||||
descriptors=(": : _nft_table ${line[1]}")
|
||||
cmd_fam=$line[1]
|
||||
;;
|
||||
# else, complete nothing and go to the next state. default family is 'ip'
|
||||
(*)
|
||||
descriptors=()
|
||||
cmd_fam="ip"
|
||||
;;
|
||||
esac
|
||||
nextstate="$cmd_subcmd-$cmd_obj"
|
||||
;;
|
||||
(list-table)
|
||||
descriptors=(":: :(\;)")
|
||||
nextstate="start"
|
||||
;;
|
||||
(delete-table)
|
||||
#if family AND handle were input, complete handle number for given family.
|
||||
if [[ $line[1] == "handle" ]]; then
|
||||
descriptors=(":table handle: _nft_table_handle $cmd_fam" )
|
||||
else
|
||||
descriptors=()
|
||||
fi
|
||||
nextstate="start"
|
||||
;;
|
||||
(delete-chain | delete-set | delete-quota | delete-counter | delete-ct\\ helper)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab $cmd_obj true")
|
||||
nextstate="delete-obj-handle"
|
||||
;;
|
||||
(delete-obj-handle)
|
||||
if [[ $line[1] == "handle" ]]; then
|
||||
descriptors=(": : _nft_object_handle $cmd_fam $cmd_tab $cmd_obj")
|
||||
else
|
||||
descriptors=(": :(\;)")
|
||||
fi
|
||||
nextstate="start"
|
||||
;;
|
||||
(add-chain)
|
||||
descriptors=(":chain name:")
|
||||
nextstate="start"
|
||||
;;
|
||||
(rename-chain)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
|
||||
nextstate="add-chain"
|
||||
;;
|
||||
(replace-rule | delete-rule)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
|
||||
nextstate="repdel-rule"
|
||||
;;
|
||||
(repdel-rule)
|
||||
cmd_chain=$line[1]
|
||||
descriptors=(": :(handle)" ": : _nft_rule_handle $cmd_fam $cmd_tab ${line[1]}")
|
||||
if [[ $cmd_subcmd = "replace" ]];then
|
||||
nextstate="rule-stmt"
|
||||
else
|
||||
nextstate="start"
|
||||
fi
|
||||
;;
|
||||
(add-rule)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
|
||||
nextstate="add-rule-2"
|
||||
;;
|
||||
(add-rule-2)
|
||||
cmd_chain=$line[1]
|
||||
descriptors=(": :(handle index position)")
|
||||
nextstate="add-rule-3"
|
||||
;;
|
||||
(add-rule-3)
|
||||
case $line[1] in
|
||||
(index | position)
|
||||
descriptors=(":${line[1]}:")
|
||||
;;
|
||||
(handle)
|
||||
descriptors=(": : _nft_rule_handle $cmd_fam $cmd_tab $cmd_chain")
|
||||
;;
|
||||
(*)
|
||||
descriptors=()
|
||||
;;
|
||||
esac
|
||||
nextstate="rule-stmt"
|
||||
;;
|
||||
(rule-stmt)
|
||||
#TODO
|
||||
# _nft_rule $cmd_fam $cmd_tab $cmd_chain\
|
||||
# && return 0;
|
||||
descriptors=(":expression: ")
|
||||
nextstate="start"
|
||||
;;
|
||||
(list-set | list-map | delete-map | list-chain | list-flowtable | delete-flowtable | list-ct\\ helper | list-counter | list-quota | list-meter)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab $cmd_obj false")
|
||||
nextstate="start"
|
||||
;;
|
||||
(add-element | delete-element)
|
||||
cmd_tab=$line[1]
|
||||
descriptors=(": : _nft_object $cmd_fam $cmd_tab '\(map\|set\)' false")
|
||||
nextstate="start"
|
||||
;;
|
||||
#TODO:
|
||||
#(add-set | add-map)
|
||||
#(add-flowtable)
|
||||
#("add-ct\ helper")
|
||||
#(add-counter)
|
||||
#(add-quota)
|
||||
|
||||
(*)
|
||||
return 1;
|
||||
;;
|
||||
esac
|
||||
_arguments -C -s \
|
||||
"${options[@]}" \
|
||||
"${descriptors[@]}" \
|
||||
"*:: :->$nextstate" \
|
||||
&& return 0;
|
||||
|
||||
done
|
||||
} # end _nft
|
||||
|
||||
_nft_subcommands(){
|
||||
local commands=(
|
||||
'add:add a table, chain, rule, set, map, or object'
|
||||
'list:list a ruleset, table, chain, set, map, or object'
|
||||
'flush:flush (delete everything from) a ruleset, table, chain, set, or map'
|
||||
'export:print the ruleset in a machine readable format (json or xml)'
|
||||
'delete:delete a table, chain, rule, set, element, map, or object'
|
||||
'create:similar to add but returns an error for existing chain'
|
||||
'rename:rename the specified chain'
|
||||
'insert:similar to the add command, but the rule is prepended to the beginning of the chain or before the rule at the given position'
|
||||
'replace:similar to the add command, but replaces the specified rule'
|
||||
'reset:list-and-reset stateful object'
|
||||
'monitor:listen to Netlink events'
|
||||
'describe:show information about the type of an expression and its data type'
|
||||
'add:add a table, chain, rule, set, map, or object'
|
||||
'list:list a ruleset, table, chain, set, map, or object'
|
||||
'flush:flush (delete everything from) a ruleset, table, chain, set, or map'
|
||||
'export:print the ruleset in a machine readable format (json or xml)'
|
||||
'delete:delete a table, chain, rule, set, element, map, or object'
|
||||
'create:similar to add but returns an error for existing chain'
|
||||
'rename:rename the specified chain'
|
||||
'insert:similar to the add command, but the rule is prepended to the beginning of the chain or before the rule at the given position'
|
||||
'replace:similar to the add command, but replaces the specified rule'
|
||||
'reset:list-and-reset stateful object'
|
||||
'monitor:listen to Netlink events'
|
||||
'describe:show information about the type of an expression and its data type'
|
||||
)
|
||||
_describe -t commands 'nft subcommand' commands "$@"
|
||||
}
|
||||
|
||||
_nft_mon_filter(){
|
||||
local monitor_filters=(
|
||||
'new:show only events of created objects'
|
||||
|
|
|
|||
20
src/_node
20
src/_node
|
|
@ -28,7 +28,7 @@
|
|||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for Node.js v25.9.0 (https://nodejs.org)
|
||||
# Completion script for Node.js v25.8.0 (https://nodejs.org)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
|
|
@ -70,23 +70,6 @@ _node_scripts() {
|
|||
}
|
||||
|
||||
_node() {
|
||||
# See https://github.com/nodejs/node/blob/main/doc/api/cli.md
|
||||
# Note some allowed v8 options are listed in 'node --help' but others are not
|
||||
local -a v8_options=(
|
||||
'--max-heap-size=[max size of the heap in Mbytes]:size'
|
||||
'--max-old-space-size=[max size of the old space in Mbytes]:size'
|
||||
'--max-semi-space-size=[max size of a semi-space in Mbytes]:size'
|
||||
'--stack-trace-limit=[number of stack frames to capture]:limit'
|
||||
)
|
||||
if [[ $OSTYPE == linux* ]]; then
|
||||
v8_options+=(
|
||||
'--perf-basic-prof-only-functions[only report function code ranges to perf]'
|
||||
'--perf-basic-prof[enable basic support for perf profiler]'
|
||||
'--perf-prof-unwinding-info[enable unwinding info for perf linux profiler]'
|
||||
'--perf-prof[enable annotate support for perf profiler]'
|
||||
)
|
||||
fi
|
||||
|
||||
local ret=1
|
||||
|
||||
_arguments \
|
||||
|
|
@ -269,7 +252,6 @@ _node() {
|
|||
"--watch-path=[path to watch]: :_node_files" \
|
||||
'--watch-preserve-output[preserve outputs on watch mode restart]' \
|
||||
'--zero-fill-buffers[automatically zero-fill all newly allocated Buffer and SlowBuffer instances]' \
|
||||
$v8_options[@] \
|
||||
'(- 1 *)'{-h,--help}'[print node command line options]' \
|
||||
'(- 1 *)'{-v,--version}'[print Node.js version]' \
|
||||
'*: :_node_args' && ret=0
|
||||
|
|
|
|||
85
src/_nu
85
src/_nu
|
|
@ -1,85 +0,0 @@
|
|||
#compdef nu
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for nu 0.111.0 (https://www.nushell.sh/)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
local -a table_modes=(
|
||||
ascii_rounded basic_compact basic compact_double compact default
|
||||
dots double heavy light markdown none psql reinforced restructured
|
||||
rounded single thin with_love
|
||||
)
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[show help message]' \
|
||||
'(- *)'{-v,--version}'[print the version]' \
|
||||
'(-i --interactive)'{-i,--interactive}'[start as an interactive shell]' \
|
||||
'(-l --login)'{-l,--login}'[start as a login shell]' \
|
||||
'(-c --commands)'{-c,--commands}'[run the given command and then exit]:command' \
|
||||
'(-e --execute)'{-e,--execute}'[run the given commands and then enter an interactive shell]:command' \
|
||||
'(-m --table-mode)'{-m,--table-mode}'[table mode to use]:mode:($table_modes)' \
|
||||
'--error-style[error style to use]:style:(fancy plain)' \
|
||||
'--no-newline[print the result for --commands(-c) without a newline]' \
|
||||
'--stdin[redirect standard input to a command(with "-c") or a script file]' \
|
||||
'--testbin[run internal test binary]:binary' \
|
||||
"--mcp[start nu's model context protocol server]" \
|
||||
'--mcp-transport[transport to use for MCP server]:transport:(stdin http)' \
|
||||
'--mcp-port[port for MCP HTTP transport(default: 8080)]:port' \
|
||||
'(-I --include-path)'{-I,--include-path}'[set the NU_LIB_DIRS for the given script]:dir:_files -/' \
|
||||
'(-n --no-config-file)'{-n,--no-config-file}'[start with no config file and no env file]' \
|
||||
'--no-history[disable reading and writing to command history]' \
|
||||
'--no-std-lib[start with no standard library]' \
|
||||
'--config[start with an alternate config file]:file:_files' \
|
||||
'--env-config[start with an alternate environment config file]:file:_files' \
|
||||
'--log-level[log level for diagnostic logs]:level:(error warn info debug trace)' \
|
||||
'--log-target[set the target for the log to output]:target: _alternative "std\:std\:(stdout stderr)" "files\:file\:_files"' \
|
||||
'--log-include[set the Rust module prefixes to include in the log output]:prefix' \
|
||||
'--log-exclude[set the Rust module prefixes to exclude from the log output]:prefix' \
|
||||
"--lsp[start nu's language server protocol]" \
|
||||
'--ide-goto-def[go to the definition of the item at the given position]:pos' \
|
||||
'--ide-hover[give information about the item at the given position]:pos' \
|
||||
'--ide-complete[list completions for the item at the given position]:pos' \
|
||||
'--ide-check[run a diagnostic check on the given source and limit number of errors returned to provided number]:num' \
|
||||
'--ide-ast[generate the ast on the given source]' \
|
||||
'--experimental-options[enable or disable experimental options]:options:(all)' \
|
||||
'--plugin-config[start with an alternative plugin registry file]:file:_files' \
|
||||
'--plugins[list of plugin executable files to load]:file:_files' \
|
||||
'*:: :_files'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
405
src/_openssl
405
src/_openssl
|
|
@ -28,7 +28,7 @@
|
|||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for OpenSSL 4.0.0 (https://www.openssl-library.org/)
|
||||
# Completion script for OpenSSL 3.5.3 (https://www.openssl-library.org/)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
|
|
@ -844,8 +844,6 @@ _openssl_dgst() {
|
|||
'-prverify[private key file to verify the signature]:file:_files' \
|
||||
'-signature[actual signature file to verify]:file:_files' \
|
||||
'-hmac[key to create a hashed MAC]:key' \
|
||||
'-hmac-env[create a hashed MAC using a key from the given environment variable]:var:_parameters -g "*export*"' \
|
||||
'-hmac-stdin[create a hashed MAC using a key obtained from the standard input]' \
|
||||
'-mac[MAC algorithm]:alg:_openssl_mac_algorithms' \
|
||||
'-macopt[options of MAC algorithm]:options' \
|
||||
'-fips-fingerprint[compute HMAC using a specific key for certain OpenSSL-FIPS operations]' \
|
||||
|
|
@ -1114,22 +1112,22 @@ _openssl_genpkey() {
|
|||
done
|
||||
|
||||
_arguments \
|
||||
'(- *)-help[print help message]' \
|
||||
'-out[output private key file]:file:_files' \
|
||||
'-outpubkey[output public key file]:file:_files' \
|
||||
'-outform[output format]:format:(DER PEM)' \
|
||||
'-verbose[output "status dots" while generating keys]' \
|
||||
'-quiet[do not output "status dots" while generating keys]' \
|
||||
'-pass[output file password source]:source:_openssl_pass_phrase_options' \
|
||||
$cipher_flags[@] \
|
||||
'-algorithm[public key algorithm]:alg:(($builtin_algorithms))' \
|
||||
'-pkeyopt[public key algorithm option]:option' \
|
||||
'-genparam[generate a set of parameters instead of a private key]' \
|
||||
'-paramfile[file to supply public key parameters]:file:_files' \
|
||||
'-text[print an (unencrypted) text representation of private and public keys and parameters]' \
|
||||
$openssl_random_state_options[@] \
|
||||
$openssl_provider_options[@] \
|
||||
'-config[configuration file]:file:_files'
|
||||
'(- *)-help[print help message]' \
|
||||
'-out[output private key file]:file:_files' \
|
||||
'-outpubkey[output public key file]:file:_files' \
|
||||
'-outform[output format]:format:(DER PEM)' \
|
||||
'-verbose[output "status dots" while generating keys]' \
|
||||
'-quiet[do not output "status dots" while generating keys]' \
|
||||
'-pass[output file password source]:source:_openssl_pass_phrase_options' \
|
||||
$cipher_flags[@] \
|
||||
'-algorithm[public key algorithm]:alg:(($builtin_algorithms))' \
|
||||
'-pkeyopt[public key algorithm option]:option' \
|
||||
'-genparam[generate a set of parameters instead of a private key]' \
|
||||
'-paramfile[file to supply public key parameters]:file:_files' \
|
||||
'-text[print an (unencrypted) text representation of private and public keys and parameters]' \
|
||||
$openssl_random_state_options[@] \
|
||||
$openssl_provider_options[@] \
|
||||
'-config[configuration file]:file:_files'
|
||||
}
|
||||
|
||||
_openssl_genrsa() {
|
||||
|
|
@ -1443,17 +1441,17 @@ _openssl_pkcs12() {
|
|||
|
||||
_openssl_pkcs7() {
|
||||
_arguments \
|
||||
'(- *)-help[print help message]' \
|
||||
'-inform[input format]:format:(DER PEM)' \
|
||||
'-outform[output format]:format:(DER PEM)' \
|
||||
'-in[input file name]:file:_files' \
|
||||
'-out[output file name]:file:_files' \
|
||||
'-print[print out the full PKCS7 object]' \
|
||||
'-print_certs[print out any certificates or CRLs contained in the file]' \
|
||||
'-quiet[print out just the PEM-encoded certificates without any other output]' \
|
||||
'-text[print out certificate details in full]' \
|
||||
'-noout[do not output the encoded version of the PKCS#7 structure]' \
|
||||
$openssl_provider_options[@]
|
||||
'(- *)-help[print help message]' \
|
||||
'-inform[input format]:format:(DER PEM)' \
|
||||
'-outform[output format]:format:(DER PEM)' \
|
||||
'-in[input file name]:file:_files' \
|
||||
'-out[output file name]:file:_files' \
|
||||
'-print[print out the full PKCS7 object]' \
|
||||
'-print_certs[print out any certificates or CRLs contained in the file]' \
|
||||
'-quiet[print out just the PEM-encoded certificates without any other output]' \
|
||||
'-text[print out certificate details in full]' \
|
||||
'-noout[do not output the encoded version of the PKCS#7 structure]' \
|
||||
$openssl_provider_options[@]
|
||||
}
|
||||
|
||||
_openssl_pkcs8() {
|
||||
|
|
@ -1462,51 +1460,51 @@ _openssl_pkcs8() {
|
|||
)
|
||||
|
||||
_arguments \
|
||||
'(- *)-help[print help message]' \
|
||||
'-topk8[read a private key and write a PkCS#8 format key]' \
|
||||
'-inform[input format]:format:(DER PEM)' \
|
||||
'-outform[output format]:format:(DER PEM)' \
|
||||
'-traditional[traditional format]' \
|
||||
'-in[input file name]:file:_files' \
|
||||
'-passin[input password source]:source:_openssl_pass_phrase_options' \
|
||||
'-passout[output password source]:source:_openssl_pass_phrase_options' \
|
||||
'-out[output file name]:files:_files' \
|
||||
'-iter[number of iterations to create PKCS#8 containers]:count' \
|
||||
'-noiter[use 1 as iteration count]' \
|
||||
'-nocrypt[output unencrypted PrivateKeyInfo structure]' \
|
||||
'-v2[algorithm for PKCS#5 v2.0]:alg:_openssl_cipher_algorithms' \
|
||||
'-v2prf[PRF algorithm to use with PKCS#5 v2.0]:alg:(($prf_algorithms))' \
|
||||
'-v1[algorithm for PKCS#5 v1.5 or PKCS#12]:alg:_openssl_cipher_algorithms' \
|
||||
'-scrypt[use the script algorithm for private key encryption]' \
|
||||
'-scrypt_N[scrypt "N" parameter]:n' \
|
||||
'-scrypt_r[scrypt "r" parameter]:r' \
|
||||
'-scrypt_p[scrypt "p" parameter]:p' \
|
||||
'-saltlen[length of the salt to use for the PBE algorithm]:length' \
|
||||
$openssl_random_state_options[@] \
|
||||
$openssl_provider_options[@]
|
||||
'(- *)-help[print help message]' \
|
||||
'-topk8[read a private key and write a PkCS#8 format key]' \
|
||||
'-inform[input format]:format:(DER PEM)' \
|
||||
'-outform[output format]:format:(DER PEM)' \
|
||||
'-traditional[traditional format]' \
|
||||
'-in[input file name]:file:_files' \
|
||||
'-passin[input password source]:source:_openssl_pass_phrase_options' \
|
||||
'-passout[output password source]:source:_openssl_pass_phrase_options' \
|
||||
'-out[output file name]:files:_files' \
|
||||
'-iter[number of iterations to create PKCS#8 containers]:count' \
|
||||
'-noiter[use 1 as iteration count]' \
|
||||
'-nocrypt[output unencrypted PrivateKeyInfo structure]' \
|
||||
'-v2[algorithm for PKCS#5 v2.0]:alg:_openssl_cipher_algorithms' \
|
||||
'-v2prf[PRF algorithm to use with PKCS#5 v2.0]:alg:(($prf_algorithms))' \
|
||||
'-v1[algorithm for PKCS#5 v1.5 or PKCS#12]:alg:_openssl_cipher_algorithms' \
|
||||
'-scrypt[use the script algorithm for private key encryption]' \
|
||||
'-scrypt_N[scrypt "N" parameter]:n' \
|
||||
'-scrypt_r[scrypt "r" parameter]:r' \
|
||||
'-scrypt_p[scrypt "p" parameter]:p' \
|
||||
'-saltlen[length of the salt to use for the PBE algorithm]:length' \
|
||||
$openssl_random_state_options[@] \
|
||||
$openssl_provider_options[@]
|
||||
}
|
||||
|
||||
_openssl_pkey() {
|
||||
_arguments \
|
||||
'(- *)-help[print help message]' \
|
||||
$openssl_provider_options[@] \
|
||||
'-check[check the consistency of a key pair for both public and private components]' \
|
||||
'-pubcheck[check the correctness of either a public key or the public components of a key pair]' \
|
||||
'-in[input file or URI]:file_or_uri:_files' \
|
||||
'-inform[key input format]:format:(DER PEM P12 ENGINE)' \
|
||||
'-passin[password source for the key input]:source:_openssl_pass_phrase_options' \
|
||||
'-pubin[read public key instead of private key]' \
|
||||
'-out[output file name]' \
|
||||
'-outform[key output format]:format:(DER PEM)' \
|
||||
'-cipher[cipher to encrypt the PEM encoded private key]:cipher:_openssl_ciphers' \
|
||||
'-passout[password source for the output file]:source:_openssl_pass_phrase_options' \
|
||||
'-traditional[use older "traditional" format]' \
|
||||
'-pubout[output the public components]' \
|
||||
'-noout[do not output the key in encoded form]' \
|
||||
'-text[output the various key components in plain text]' \
|
||||
'-text_pub[output only the public key components in text form]' \
|
||||
'-ec_conv_form[specify how the points on the elliptic-curve curve are converted into octet strings]:type:(compressed uncompressed hybrid)' \
|
||||
'-ec_param_enc[specify how the elliptic curve parameters are encoded]:type:(named_curve explicit)'
|
||||
'(- *)-help[print help message]' \
|
||||
$openssl_provider_options[@] \
|
||||
'-check[check the consistency of a key pair for both public and private components]' \
|
||||
'-pubcheck[check the correctness of either a public key or the public components of a key pair]' \
|
||||
'-in[input file or URI]:file_or_uri:_files' \
|
||||
'-inform[key input format]:format:(DER PEM P12 ENGINE)' \
|
||||
'-passin[password source for the key input]:source:_openssl_pass_phrase_options' \
|
||||
'-pubin[read public key instead of private key]' \
|
||||
'-out[output file name]' \
|
||||
'-outform[key output format]:format:(DER PEM)' \
|
||||
'-cipher[cipher to encrypt the PEM encoded private key]:cipher:_openssl_ciphers' \
|
||||
'-passout[password source for the output file]:source:_openssl_pass_phrase_options' \
|
||||
'-traditional[use older "traditional" format]' \
|
||||
'-pubout[output the public components]' \
|
||||
'-noout[do not output the key in encoded form]' \
|
||||
'-text[output the various key components in plain text]' \
|
||||
'-text_pub[output only the public key components in text form]' \
|
||||
'-ec_conv_form[specify how the points on the elliptic-curve curve are converted into octet strings]:type:(compressed uncompressed hybrid)' \
|
||||
'-ec_param_enc[specify how the elliptic curve parameters are encoded]:type:(named_curve explicit)'
|
||||
}
|
||||
|
||||
_openssl_pkeyparam() {
|
||||
|
|
@ -1723,8 +1721,8 @@ _openssl_s_client() {
|
|||
local tls_start_protocols=(smtp pop3 imap ftp xmpp xmpp-server irc postgres mysql lmtp nntp sieve ldap)
|
||||
|
||||
_arguments \
|
||||
'(- *)-help[print help message]' \
|
||||
'-ssl_config[section of the configuration file to configure the SSL_CTX object]:section' \
|
||||
'(- *)-help[print help message]' \
|
||||
'-ssl_config[section of the configuration file to configure the SSL_CTX object]:section' \
|
||||
'-connect[host and optional port to connect to]:host_port' \
|
||||
'-host[host to connect to]:host' \
|
||||
'-port[port to connect to]:port' \
|
||||
|
|
@ -1832,149 +1830,134 @@ _openssl_s_client() {
|
|||
$openssl_verification_options[@] \
|
||||
'-enable_server_rpk[enable support for receiving raw public keys from the server]' \
|
||||
'-enable_client_rpk[enable support for sending raw public keys to the server]' \
|
||||
'*-expected-rpks[specify public keys expected from the remote peer used to authenticate the connection]:file:_files' \
|
||||
'-ech_outer_alpn[specify ALPN values to use in the outer ClientHello]:protocol' \
|
||||
'-ech_grease[emit a GREASE value]' \
|
||||
'-ech_grease_suite[specify ECH ciphersuites to use when -ech_grease is specified]:suite' \
|
||||
'-ech_grease_type[specify a GREASEd ECH value]:type' \
|
||||
'-ech_ignore_cid[use random value for ECH]' \
|
||||
'-ech_outer_sni[specify a subject name indication value to use in hte outer ClientHello]:value' \
|
||||
'-ech_no_outer_sni[no SNI will be emitted in the outer ClientHello]' \
|
||||
'-ech_select[specify which ECHConfigList to use using a zero-based index]:index' \
|
||||
'*::host_port'
|
||||
}
|
||||
|
||||
_openssl_s_server() {
|
||||
_arguments \
|
||||
'(- *)-help[print help message]' \
|
||||
'-port[TCP port to listen on for connections(default: 4433)]:port' \
|
||||
'-accept[optional TCP host and port to listen on for connections(default: *:4433)]:host_port' \
|
||||
'-unix[Unix domain socket path]:path:_files' \
|
||||
'(-4 -6)-4[use IPv4 only]' \
|
||||
'(-4 -6)-6[use IPv6 only]' \
|
||||
'-unlink[for -unix, unlink any existing socket first]' \
|
||||
'-context[SSL context ID]:id' \
|
||||
'(-verify -Verify)'{-verify,-Verify}'[verify depth]:depth' \
|
||||
'-cert[certificate file]:file:_files' \
|
||||
'-cert2[certificate file to use for servername(default: server2.pem)]:file:_files' \
|
||||
'-certform[server certificate file format]:format:(DER PEM P12)' \
|
||||
'-cert_chain[file or URI of untrusted certificates to build the certificate chain]:file_or_uri:_files' \
|
||||
'-build_chain[application should build the server certificate chain]' \
|
||||
'-serverinfo[file containing one or more blocks of PEM data]:file:_files' \
|
||||
'-key[private key file or URI]:file_or_uri:_files' \
|
||||
'-key2[private key file or URI to use for servername]:file_or_uri:_files' \
|
||||
'-keyform[key format]:format:(DER PEM P12 ENGINE)' \
|
||||
'-pass[private key and certificate file password source]:source:_openssl_pass_phrase_options' \
|
||||
'-dcert[additional certificate file]:file:_files' \
|
||||
'-dkey[additional private key file or URI]:file_or_uri:_files' \
|
||||
'-dcert_chain[file or URI of untrusted certificates to build the server certificate chain]:file_or_uri:_files' \
|
||||
'-dcertform[format of the additional certificate file]:format:(DER PEM P12)' \
|
||||
'-dkeyform[format of the additional private key]:format:(DER PEM P12 ENGINE)' \
|
||||
'-dpass[passphrase for the additional private key and certificate]:pass:_openssl_pass_phrase_options' \
|
||||
'-nbio_test[test non blocking I/O]' \
|
||||
'-crlf[translate a line feed from the terminal into CR+LF]' \
|
||||
'-debug[print extensive debugging information including a hex dump of all traffic]' \
|
||||
'-security_debug[print output from SSL/TLS security framework]' \
|
||||
'-security_debug_verbose[print more output from SSL/TLS security framework]' \
|
||||
'-msg[show all protocol messages with hex dump]' \
|
||||
'-msgfile[file to send output of -msg or -trace to]:file:_files' \
|
||||
'-state[print the SSL session states]' \
|
||||
'-CRL[CRL file]:file:_files' \
|
||||
'-CRLform[CRL file format]:format:(DER PEM)' \
|
||||
'-crl_download[download CRLs from distribution points]' \
|
||||
'-verifyCAfile[file in PEM format CA containing trusted certificates to verify client certificates]:file:_files' \
|
||||
'-verifyCApath[directory containing trusted certificates to verify client certificates]:dir:_files -/' \
|
||||
'-verifyCAstore[URI of a store containing trusted certificates to verify client certificates]:uri:_urls' \
|
||||
'-chainCAfile[file in PEM format containing trusted certificates to build the server certificate chain]:file:_files' \
|
||||
'-chainCApath[directory containing trusted certificates for building server certificate chain]:dir:_files -/' \
|
||||
'-chainCAstore[URI of a store containing trusted certificates for building server certificate chain]:uri:_urls' \
|
||||
'-nocert[no certificate is used]' \
|
||||
'-quiet[inhibit printing of session and certificate information]' \
|
||||
'-no_resume_ephemeral[disable caching and tickets if ephemeral (EC)DH is used]' \
|
||||
'-tlsextdebug[print a hex dump of any TLS extensions received from the server]' \
|
||||
'-www[send a status message back to the client when it connects]' \
|
||||
'(-WWW -HTTP)'{-WWW,-HTTP}'[emulate a simple web server]' \
|
||||
'-http_server_binmode[acting as web-server open files in binary mode]' \
|
||||
'-no_ca_names[disable TLS Extension CA Names]' \
|
||||
'-ignore_unexpected_eof[peer does not need to send the close_notify alert]' \
|
||||
'-servername[servername for HostName TLS extension]' \
|
||||
'-servername_fatal[send fatal alert on servername mismatch]' \
|
||||
'-id_prefix[generate SSL/TLS session IDs prefixed by this ID]:id' \
|
||||
'-keymatexport[export keying material using label]:label' \
|
||||
'-keymatexportlen[export the given number of bytes of keying material(default: 20)]:length' \
|
||||
'-no_cache[disable session cache]' \
|
||||
'-ext_cache[disable internal cache]' \
|
||||
'-verify_return_error[close the connection when verification errors occur]' \
|
||||
'-verify_quiet[no verify output except verify errors]' \
|
||||
'(-no_ign_eof -ign_eof)-ign_eof[ignore input EOF]' \
|
||||
'(-no_ign_eof -ign_eof)-no_ign_eof[do not ignore input EOF]' \
|
||||
'-no_ems[disable Extended master secret negotiation]' \
|
||||
'-status[enable certificate status request support]' \
|
||||
'-status_verbose[enable certificate status request support and verbose output of OCSP response]' \
|
||||
'-status_timeout[set the timeout for OCSP reponse to the given seconds]:seconds' \
|
||||
'-proxy[HTTP(S) proxy server]:proxy' \
|
||||
'-no_proxy[list of IP addresses and/or DNS names not to use an HTTP(S) proxy for]:addresses' \
|
||||
'-status_url[set a fallback responder URL]:url:_urls' \
|
||||
'-status_file[status file]:file:_files' \
|
||||
'-ssl_config[configure SSL_CTX using the given configure value]:config' \
|
||||
'-trace[show verbose trace output of protocol messages]' \
|
||||
'-brief[provide a brief summary of connection parameters]' \
|
||||
'-rev[simple echo server that sends back received text reserved]' \
|
||||
'-async[switch on asynchronous mode]' \
|
||||
'-max_send_frag[maximum size of data fragment to send]:size' \
|
||||
'-split_send_frag[size used to split data for encrypt pipelines]:size' \
|
||||
'-max_pipelines[maximum number of encrypt/decrypt pipelines]:number' \
|
||||
'-naccept[server will exit after receiving the specified number of connections(default: unlimited)]:number' \
|
||||
'-read_buf[default read buffer size for connections]:size' \
|
||||
'-no_tx_cert_comp[disable support for sending TLSv1.3 compressed certificates]' \
|
||||
'-no_rx_cert_comp[disable support for receiving TLSv1.3 compressed certificates]' \
|
||||
'-no_comp[disable negotiation of TLS compression]' \
|
||||
'-num_tickets[control the number of tickets that will be sent to the client after a full handshake in TLSv1.3]' \
|
||||
'-dhparam[DH parameter file to use]:file:_files' \
|
||||
'-nbio[turn on non blocking I/O]' \
|
||||
'-timeout[enable timeout]' \
|
||||
'-mtu[set link-layer MTU]:size' \
|
||||
'-psk_identity[PSK identify when using a PSK cipher suite]:id' \
|
||||
'-psk_hint[PSK identity hint when using a PSK cipher suite]:hint' \
|
||||
'-psk[PSK key when using a PSK cipher suite]:key' \
|
||||
'-psk_session[file contains pem encoded SSL_SESSION data]:file:_files' \
|
||||
'-srpvfile[verifier file for SRP]:file:_files' \
|
||||
'-listen[listen on a UDP port for incoming connections]' \
|
||||
'-sctp[use SCTP for the transport protocol instead of UDP in DTLS]' \
|
||||
'-sctp_label_bug[allow communication with older broken implementations]' \
|
||||
'-use_srtp[offer SRTP key management with a colon-separated profile list]:list' \
|
||||
'-no_dhe[no DH parameters will be loaded]' \
|
||||
'-alpn[enable the Application-Layer Protocol Negotiation extension]:protocol' \
|
||||
'-nextprotoneg[enable the Next Protocol Negotiation extension]:protocol' \
|
||||
'-ktls[enable kernel TLS for sending and receiving]' \
|
||||
'-sendfile[SSL_sendfile will be used instead of BIO_write to send response]' \
|
||||
'-zerocopy_sendfile[SSL_sendfile will use the zerocopy TX mode]' \
|
||||
'-keylogfile[append TLS secrets to the specified keylog file]:file:_files' \
|
||||
'-max_early_data[change the default maximum early data bytes for new sessions and incoming early data]:size' \
|
||||
'-recv_max_early_data[hard limit on the maximum number of early data bytes that will be accepted]:bytes' \
|
||||
'-early_data[accept early data where possible]' \
|
||||
'-stateless[require TLSv1.3 cookies]' \
|
||||
'(-anti_replay -no_anti_replay)-anti_replay[switch replay protection on]' \
|
||||
'(-anti_replay -no_anti_replay)-no_anti_replay[switch replay protection off]' \
|
||||
'-tfo[enable acceptance of TCP fast Open connections]' \
|
||||
'-cert_comp[pre-compresses certificates that will be sent during the handshake]' \
|
||||
'-nameopt[how the subject or issuer names are displayed]:how:_openssl_name_display_options' \
|
||||
$openssl_tls_flags[@] \
|
||||
$openssl_dtls_flags[@] \
|
||||
$openssl_supported_commands_flags[@] \
|
||||
$openssl_extended_verification_flags[@] \
|
||||
$openssl_trusted_certificate_options[@] \
|
||||
$openssl_random_state_options[@] \
|
||||
$openssl_provider_options[@] \
|
||||
$openssl_verification_options[@] \
|
||||
'-enable_server_rpk[enable support for sending raw public keys to the client]' \
|
||||
'-enable_client_rpk[enable support for receiving raw public keys from the client]' \
|
||||
'*-expected-rpks[specify public keys expected from the remote peer used to authenticate the connection]:file:_files' \
|
||||
'-ech_key[load one Encrypted Client Hello(ECH) key pair]:file:_files' \
|
||||
'-ech_dir[load an ECH key pair from every file in the named directory]:dir:_files -/' \
|
||||
'-ech_noretry_dir[load an ECH key pair from every file in the named directory. not return in "retry_configs"]:file:_files -/' \
|
||||
'-ech_trialdecrypt[ECH config_id is used to match against the loaded ECH private keys and decryption is only attempted]' \
|
||||
'-ech_greaseretries[servers will add GREASEy ECHConfigList values to those sent in retry_configs]'
|
||||
'(- *)-help[print help message]' \
|
||||
'-port[TCP port to listen on for connections(default: 4433)]:port' \
|
||||
'-accept[optional TCP host and port to listen on for connections(default: *:4433)]:host_port' \
|
||||
'-unix[Unix domain socket path]:path:_files' \
|
||||
'(-4 -6)-4[use IPv4 only]' \
|
||||
'(-4 -6)-6[use IPv6 only]' \
|
||||
'-unlink[for -unix, unlink any existing socket first]' \
|
||||
'-context[SSL context ID]:id' \
|
||||
'(-verify -Verify)'{-verify,-Verify}'[verify depth]:depth' \
|
||||
'-cert[certificate file]:file:_files' \
|
||||
'-cert2[certificate file to use for servername(default: server2.pem)]:file:_files' \
|
||||
'-certform[server certificate file format]:format:(DER PEM P12)' \
|
||||
'-cert_chain[file or URI of untrusted certificates to build the certificate chain]:file_or_uri:_files' \
|
||||
'-build_chain[application should build the server certificate chain]' \
|
||||
'-serverinfo[file containing one or more blocks of PEM data]:file:_files' \
|
||||
'-key[private key file or URI]:file_or_uri:_files' \
|
||||
'-key2[private key file or URI to use for servername]:file_or_uri:_files' \
|
||||
'-keyform[key format]:format:(DER PEM P12 ENGINE)' \
|
||||
'-pass[private key and certificate file password source]:source:_openssl_pass_phrase_options' \
|
||||
'-dcert[additional certificate file]:file:_files' \
|
||||
'-dkey[additional private key file or URI]:file_or_uri:_files' \
|
||||
'-dcert_chain[file or URI of untrusted certificates to build the server certificate chain]:file_or_uri:_files' \
|
||||
'-dcertform[format of the additional certificate file]:format:(DER PEM P12)' \
|
||||
'-dkeyform[format of the additional private key]:format:(DER PEM P12 ENGINE)' \
|
||||
'-dpass[passphrase for the additional private key and certificate]:pass:_openssl_pass_phrase_options' \
|
||||
'-nbio_test[test non blocking I/O]' \
|
||||
'-crlf[translate a line feed from the terminal into CR+LF]' \
|
||||
'-debug[print extensive debugging information including a hex dump of all traffic]' \
|
||||
'-security_debug[print output from SSL/TLS security framework]' \
|
||||
'-security_debug_verbose[print more output from SSL/TLS security framework]' \
|
||||
'-msg[show all protocol messages with hex dump]' \
|
||||
'-msgfile[file to send output of -msg or -trace to]:file:_files' \
|
||||
'-state[print the SSL session states]' \
|
||||
'-CRL[CRL file]:file:_files' \
|
||||
'-CRLform[CRL file format]:format:(DER PEM)' \
|
||||
'-crl_download[download CRLs from distribution points]' \
|
||||
'-verifyCAfile[file in PEM format CA containing trusted certificates to verify client certificates]:file:_files' \
|
||||
'-verifyCApath[directory containing trusted certificates to verify client certificates]:dir:_files -/' \
|
||||
'-verifyCAstore[URI of a store containing trusted certificates to verify client certificates]:uri:_urls' \
|
||||
'-chainCAfile[file in PEM format containing trusted certificates to build the server certificate chain]:file:_files' \
|
||||
'-chainCApath[directory containing trusted certificates for building server certificate chain]:dir:_files -/' \
|
||||
'-chainCAstore[URI of a store containing trusted certificates for building server certificate chain]:uri:_urls' \
|
||||
'-nocert[no certificate is used]' \
|
||||
'-quiet[inhibit printing of session and certificate information]' \
|
||||
'-no_resume_ephemeral[disable caching and tickets if ephemeral (EC)DH is used]' \
|
||||
'-tlsextdebug[print a hex dump of any TLS extensions received from the server]' \
|
||||
'-www[send a status message back to the client when it connects]' \
|
||||
'(-WWW -HTTP)'{-WWW,-HTTP}'[emulate a simple web server]' \
|
||||
'-http_server_binmode[acting as web-server open files in binary mode]' \
|
||||
'-no_ca_names[disable TLS Extension CA Names]' \
|
||||
'-ignore_unexpected_eof[peer does not need to send the close_notify alert]' \
|
||||
'-servername[servername for HostName TLS extension]' \
|
||||
'-servername_fatal[send fatal alert on servername mismatch]' \
|
||||
'-id_prefix[generate SSL/TLS session IDs prefixed by this ID]:id' \
|
||||
'-keymatexport[export keying material using label]:label' \
|
||||
'-keymatexportlen[export the given number of bytes of keying material(default: 20)]:length' \
|
||||
'-no_cache[disable session cache]' \
|
||||
'-ext_cache[disable internal cache]' \
|
||||
'-verify_return_error[close the connection when verification errors occur]' \
|
||||
'-verify_quiet[no verify output except verify errors]' \
|
||||
'(-no_ign_eof -ign_eof)-ign_eof[ignore input EOF]' \
|
||||
'(-no_ign_eof -ign_eof)-no_ign_eof[do not ignore input EOF]' \
|
||||
'-no_ems[disable Extended master secret negotiation]' \
|
||||
'-status[enable certificate status request support]' \
|
||||
'-status_verbose[enable certificate status request support and verbose output of OCSP response]' \
|
||||
'-status_timeout[set the timeout for OCSP reponse to the given seconds]:seconds' \
|
||||
'-proxy[HTTP(S) proxy server]:proxy' \
|
||||
'-no_proxy[list of IP addresses and/or DNS names not to use an HTTP(S) proxy for]:addresses' \
|
||||
'-status_url[set a fallback responder URL]:url:_urls' \
|
||||
'-status_file[status file]:file:_files' \
|
||||
'-ssl_config[configure SSL_CTX using the given configure value]:config' \
|
||||
'-trace[show verbose trace output of protocol messages]' \
|
||||
'-brief[provide a brief summary of connection parameters]' \
|
||||
'-rev[simple echo server that sends back received text reserved]' \
|
||||
'-async[switch on asynchronous mode]' \
|
||||
'-max_send_frag[maximum size of data fragment to send]:size' \
|
||||
'-split_send_frag[size used to split data for encrypt pipelines]:size' \
|
||||
'-max_pipelines[maximum number of encrypt/decrypt pipelines]:number' \
|
||||
'-naccept[server will exit after receiving the specified number of connections(default: unlimited)]:number' \
|
||||
'-read_buf[default read buffer size for connections]:size' \
|
||||
'-no_tx_cert_comp[disable support for sending TLSv1.3 compressed certificates]' \
|
||||
'-no_rx_cert_comp[disable support for receiving TLSv1.3 compressed certificates]' \
|
||||
'-no_comp[disable negotiation of TLS compression]' \
|
||||
'-num_tickets[control the number of tickets that will be sent to the client after a full handshake in TLSv1.3]' \
|
||||
'-dhparam[DH parameter file to use]:file:_files' \
|
||||
'-nbio[turn on non blocking I/O]' \
|
||||
'-timeout[enable timeout]' \
|
||||
'-mtu[set link-layer MTU]:size' \
|
||||
'-psk_identity[PSK identify when using a PSK cipher suite]:id' \
|
||||
'-psk_hint[PSK identity hint when using a PSK cipher suite]:hint' \
|
||||
'-psk[PSK key when using a PSK cipher suite]:key' \
|
||||
'-psk_session[file contains pem encoded SSL_SESSION data]:file:_files' \
|
||||
'-srpvfile[verifier file for SRP]:file:_files' \
|
||||
'-listen[listen on a UDP port for incoming connections]' \
|
||||
'-sctp[use SCTP for the transport protocol instead of UDP in DTLS]' \
|
||||
'-sctp_label_bug[allow communication with older broken implementations]' \
|
||||
'-use_srtp[offer SRTP key management with a colon-separated profile list]:list' \
|
||||
'-no_dhe[no DH parameters will be loaded]' \
|
||||
'-alpn[enable the Application-Layer Protocol Negotiation extension]:protocol' \
|
||||
'-nextprotoneg[enable the Next Protocol Negotiation extension]:protocol' \
|
||||
'-ktls[enable kernel TLS for sending and receiving]' \
|
||||
'-sendfile[SSL_sendfile will be used instead of BIO_write to send response]' \
|
||||
'-zerocopy_sendfile[SSL_sendfile will use the zerocopy TX mode]' \
|
||||
'-keylogfile[append TLS secrets to the specified keylog file]:file:_files' \
|
||||
'-max_early_data[change the default maximum early data bytes for new sessions and incoming early data]:size' \
|
||||
'-recv_max_early_data[hard limit on the maximum number of early data bytes that will be accepted]:bytes' \
|
||||
'-early_data[accept early data where possible]' \
|
||||
'-stateless[require TLSv1.3 cookies]' \
|
||||
'(-anti_replay -no_anti_replay)-anti_replay[switch replay protection on]' \
|
||||
'(-anti_replay -no_anti_replay)-no_anti_replay[switch replay protection off]' \
|
||||
'-tfo[enable acceptance of TCP fast Open connections]' \
|
||||
'-cert_comp[pre-compresses certificates that will be sent during the handshake]' \
|
||||
'-nameopt[how the subject or issuer names are displayed]:how:_openssl_name_display_options' \
|
||||
$openssl_tls_flags[@] \
|
||||
$openssl_dtls_flags[@] \
|
||||
$openssl_supported_commands_flags[@] \
|
||||
$openssl_extended_verification_flags[@] \
|
||||
$openssl_trusted_certificate_options[@] \
|
||||
$openssl_random_state_options[@] \
|
||||
$openssl_provider_options[@] \
|
||||
$openssl_verification_options[@] \
|
||||
'-enable_server_rpk[enable support for sending raw public keys to the client]' \
|
||||
'-enable_client_rpk[enable support for receiving raw public keys from the client]'
|
||||
}
|
||||
|
||||
_openssl_s_time() {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ _openvpn3_config-acl() {
|
|||
_arguments \
|
||||
{-s,--show}"[Show the current access control lists]" \
|
||||
{-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \
|
||||
{-S,--seal}"[Make the configuration profile permanently read-only]" \
|
||||
{-R,--revoke}"[<UID | username> Revoke this user access from this configuration profile]" \
|
||||
|
|
@ -67,7 +67,7 @@ _openvpn3_config-import() {
|
|||
_arguments \
|
||||
{-p,--persistent}"[Make the configuration profile persistent through service restarts]" \
|
||||
{-n,--name}"[NAME Provide a different name for the configuration (default: CFG-FILE)]" \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CFG-FILE Configuration file to import]: :_files"
|
||||
}
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ _openvpn3_config-manage() {
|
|||
{-s,--show}"[Show current configuration options]" \
|
||||
{-r,--rename}"[NEW-CONFIG-NAME Renames the configuration]" \
|
||||
{-o,--path}"[CONFIG-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \
|
||||
"--unset-override[<name> Removes the <name> override]" \
|
||||
"--tls-version-min[<tls_1_0|tls_1_1|tls_1_2|tls_1_3> Sets the minimal TLS version for the control channel]: :(tls_1_0 tls_1_1 tls_1_2 tls_1_3)" \
|
||||
|
|
@ -103,7 +103,7 @@ _openvpn3_config-manage() {
|
|||
_openvpn3_config-remove() {
|
||||
_arguments \
|
||||
{-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \
|
||||
"--force[Force the deletion process without asking for confirmation]" \
|
||||
"--config-path[OBJ-PATH Alias for --path]: :($configs_paths)"
|
||||
|
|
@ -113,24 +113,24 @@ _openvpn3_config-show() {
|
|||
_arguments \
|
||||
{-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
|
||||
{-j,--json}"[Dump the configuration in JSON format]" \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \
|
||||
"--config-path[OBJ-PATH Alias for --path]: :($configs_paths)"
|
||||
}
|
||||
|
||||
_openvpn3_configs-list() {
|
||||
_arguments \
|
||||
{-h,--help}"[Show help screen]"
|
||||
{-h,--help}"[This help screen]"
|
||||
}
|
||||
|
||||
_openvpn3_help() {
|
||||
_arguments \
|
||||
{-h,--help}"[Show help screen]"
|
||||
{-h,--help}"[This help screen]"
|
||||
}
|
||||
|
||||
_openvpn3_log() {
|
||||
_arguments \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --session-path, where configuration profile name is used instead]: :($sessions_configs_names $configs_names)" \
|
||||
{-I,--interface}"[INTERFACE Alternative to --session-path, where tun interface name is used instead]: :($sessions_interfaces)" \
|
||||
"--session-path[SESSION-PATH Receive log events for a specific session]: :($sessions_paths)" \
|
||||
|
|
@ -142,7 +142,7 @@ _openvpn3_session-acl() {
|
|||
_arguments \
|
||||
{-s,--show}"[Show the current access control lists]" \
|
||||
{-o,--path}"[SESSION-PATH Path to the session in the session manager]: :($sessions_paths)" \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($sessions_configs_names)" \
|
||||
{-R,--revoke}"[<UID | username> Revoke this user access from this session]" \
|
||||
{-I,--interface}"[INTERFACE Alternative to --path, where tun interface name is used instead]: :($sessions_interfaces)" \
|
||||
|
|
@ -155,7 +155,7 @@ _openvpn3_session-acl() {
|
|||
_openvpn3_session-manage() {
|
||||
_arguments \
|
||||
{-o,--path}"[SESSION-PATH Path to the session in the session manager]: :($sessions_paths)" \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($sessions_configs_names)" \
|
||||
{-R,--resume}"[Resumes a paused VPN session]" \
|
||||
{-P,--pause}"[Pauses the VPN session]" \
|
||||
|
|
@ -169,7 +169,7 @@ _openvpn3_session-manage() {
|
|||
_openvpn3_session-start() {
|
||||
_arguments \
|
||||
{-p,--config-path}"[CONFIG-PATH Configuration path to an already imported configuration]: :($configs_paths)" \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-FILE Configuration file to start directly]: :_files" \
|
||||
"--persist-tun[Enforces persistent tun/seamless tunnel (requires --config)]"
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ _openvpn3_session-stats() {
|
|||
_arguments \
|
||||
{-o,--path}"[SESSION-PATH Path to the configuration in the configuration manager]: :($sessions_paths)" \
|
||||
{-j,--json}"[Dump the configuration in JSON format]" \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($sessions_configs_names)" \
|
||||
{-I,--interface}"[INTERFACE Alternative to --path, where tun interface name is used instead]: :($sessions_interfaces)" \
|
||||
"--session-path[SESSION-PATH Alias for --path]: :($sessions_paths)"
|
||||
|
|
@ -186,12 +186,12 @@ _openvpn3_session-stats() {
|
|||
|
||||
_openvpn3_sessions-list() {
|
||||
_arguments \
|
||||
{-h,--help}"[Show help screen]"
|
||||
{-h,--help}"[This help screen]"
|
||||
}
|
||||
|
||||
_openvpn3_shell-completion() {
|
||||
_arguments \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[This help screen]" \
|
||||
"--list-commands[List all available commands]" \
|
||||
"--list-options[COMMAND List all available options for a specific command]: :($(openvpn3 shell-completion --list-commands))" \
|
||||
"--arg-helper[OPTION Used together with --list-options, lists value hint to an option]"
|
||||
|
|
@ -199,7 +199,7 @@ _openvpn3_shell-completion() {
|
|||
|
||||
_openvpn3_version() {
|
||||
_arguments \
|
||||
{-h,--help}"[Show help screen]"
|
||||
{-h,--help}"[This help screen]"
|
||||
}
|
||||
|
||||
_openvpn3_command() {
|
||||
|
|
@ -210,7 +210,7 @@ _openvpn3_command() {
|
|||
"config-remove: Remove an available configuration profile"
|
||||
"config-show: Show/dump a configuration profile"
|
||||
"configs-list: List all available configuration profiles"
|
||||
"help: Show help screen"
|
||||
"help: This help screen"
|
||||
"log: Receive log events as they occur"
|
||||
"session-acl: Manage access control lists for sessions"
|
||||
"session-manage: Manage VPN sessions"
|
||||
|
|
@ -225,7 +225,7 @@ _openvpn3_command() {
|
|||
_describe -t commands 'openvpn3 commands' openvpn3_cmds
|
||||
else
|
||||
local curcontext="$curcontext"
|
||||
local cmd="${${openvpn3_cmds[(r)$words[1]:*]%%:*}}"
|
||||
cmd="${${openvpn3_cmds[(r)$words[1]:*]%%:*}}"
|
||||
if (($#cmd)); then
|
||||
if (( $+functions[_openvpn3_$cmd] )); then
|
||||
_openvpn3_$cmd
|
||||
|
|
@ -239,7 +239,7 @@ _openvpn3_command() {
|
|||
}
|
||||
|
||||
_arguments \
|
||||
{-h,--help}"[Show help screen]" \
|
||||
{-h,--help}"[that This help screen]" \
|
||||
"*::openvpn3 commands:_openvpn3_command" \
|
||||
|
||||
# Local Variables:
|
||||
|
|
|
|||
30
src/_pm2
30
src/_pm2
|
|
@ -73,7 +73,7 @@ _pm2() {
|
|||
'--no-color[skip colors]' \
|
||||
'--no-vizion[start an app without vizion feature]' \
|
||||
'--np-autorestart[start an app without automatic restart]' \
|
||||
'--no-treekill[only kill the main process, not detached children]' \
|
||||
'--no-treekill[Only kill the main process, not detached children]' \
|
||||
'--no-pmx[start an app without pmx]' \
|
||||
'--no-automation[start an app without automation]' \
|
||||
'(--disable-trace --trace)--trace[enable transaction tracing with km]' \
|
||||
|
|
@ -93,9 +93,9 @@ _pm2() {
|
|||
(start)
|
||||
_arguments \
|
||||
'--watch[watch folder for changes]' \
|
||||
'--fresh[rebuild Dockerfile]' \
|
||||
'--daemon[run container in daemon mode(debug purposes)]' \
|
||||
'--container[start application in container mode]' \
|
||||
'--fresh[Rebuild Dockerfile]' \
|
||||
'--daemon[Run container in Daemon mode(debug purposes)]' \
|
||||
'--container[Start application in container mode]' \
|
||||
'--dist[--with-container; change local Dockerfile to containerize all files in current directory]' \
|
||||
'--image-name[with --dist; set the exported image name]:name' \
|
||||
'--node-version[with --container, set a specific major Node.js version]:version' \
|
||||
|
|
@ -119,7 +119,7 @@ _pm2() {
|
|||
(stop|restart)
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[output usage information]' \
|
||||
'--watch[stop watching folder for changes]' \
|
||||
'--watch[Stop watching folder for changes]' \
|
||||
'*: :_pm2_id_namespace_all' \
|
||||
&& ret=0
|
||||
;;
|
||||
|
|
@ -231,8 +231,8 @@ _pm2_subcommands() {
|
|||
"stop:stop a process"
|
||||
"restart:restart a process"
|
||||
"scale:scale up/down a process in cluster mode depending on total_number param"
|
||||
"profile\:mem:sample PM2 heap memory"
|
||||
"profile\:cpu:profile PM2 cpu"
|
||||
"profile\:mem:Sample PM2 heap memory"
|
||||
"profile\:cpu:Profile PM2 cpu"
|
||||
"reload:reload processes (note that its for app using HTTP/HTTPS)"
|
||||
"id:get process id by name"
|
||||
"inspect:inspect a process"
|
||||
|
|
@ -244,12 +244,12 @@ _pm2_subcommands() {
|
|||
"install:install or update a module and run it forever"
|
||||
"module\:install:install or update a module and run it forever"
|
||||
"module\:update:update a module and run it forever"
|
||||
"module\:generate:generate a sample module in current folder"
|
||||
"module\:generate:Generate a sample module in current folder"
|
||||
"uninstall:stop and uninstall a module"
|
||||
"module\:uninstall:stop and uninstall a module"
|
||||
"package:check & package TAR type module"
|
||||
"publish:publish the module you are currently on"
|
||||
"module\:publish:publish the module you are currently on"
|
||||
"package:Check & Package TAR type module"
|
||||
"publish:Publish the module you are currently on"
|
||||
"module\:publish:Publish the module you are currently on"
|
||||
"set:sets the specified config <key> <value>"
|
||||
"multiset:multiset eg \"key1 val1 key2 val2\""
|
||||
"get:get value for <key>"
|
||||
|
|
@ -263,11 +263,11 @@ _pm2_subcommands() {
|
|||
"unmonitor:unmonitor target process"
|
||||
"open:open the pm2 monitoring dashboard"
|
||||
"plus:enable pm2 plus"
|
||||
"login:login to pm2 plus"
|
||||
"logout:logout from pm2 plus"
|
||||
"login:Login to pm2 plus"
|
||||
"logout:Logout from pm2 plus"
|
||||
"dump:dump all processes for resurrecting them later"
|
||||
"save:dump all processes for resurrecting them later"
|
||||
"cleardump:create empty dump file"
|
||||
"cleardump:Create empty dump file"
|
||||
"send:send stdin to <pm_id>"
|
||||
"attach:attach stdin/stdout to application identified by <pm_id>"
|
||||
"resurrect:resurrect previously dumped processes"
|
||||
|
|
@ -297,7 +297,7 @@ _pm2_subcommands() {
|
|||
"dash:launch dashboard with monitoring and logs"
|
||||
"flush:flush logs"
|
||||
"reloadLogs:reload all logs"
|
||||
"logs:stream logs file (default is to stream all logs)"
|
||||
"logs:stream logs file. Default stream all logs"
|
||||
"kill:kill daemon"
|
||||
"pull:updates repository for a given app"
|
||||
"forward:updates repository to the next commit for a given app"
|
||||
|
|
|
|||
299
src/_pre-commit
299
src/_pre-commit
|
|
@ -14,103 +14,12 @@
|
|||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_pre_commit() {
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext"
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
'(- *)'{-h,--help}'[show help message and exit]' \
|
||||
'(- *)'{-V,--version}'[show version number and exit]' \
|
||||
'1:command:_pre_commit_commands' \
|
||||
'*:: :->args' \
|
||||
&& ret=0
|
||||
|
||||
case "$state" in
|
||||
(args)
|
||||
local -a options=(
|
||||
'(- : *)'{-h,--help}'[show help message and exit]'
|
||||
"--color[Whether to use color in output(default: auto)]:color:(auto always never)"
|
||||
)
|
||||
local -a hook_types=(
|
||||
commit-msg post-checkout post-commit post-merge post-rewrite pre-commit
|
||||
pre-merge-commit pre-push pre-rebase prepare-commit-msg
|
||||
)
|
||||
local -a hook_stages=($hook_types[@] manual)
|
||||
|
||||
case $words[1] in
|
||||
(help)
|
||||
_pre_commit_commands && ret=0
|
||||
return ret
|
||||
(autoupdate|init-templatedir|install|install-hooks|migrate-config|run|uninstall)
|
||||
options+=(
|
||||
'(-c --config)'{-c,--config}'[Path to alternate config file]:config:_files -g "*.yaml"'
|
||||
)
|
||||
;|
|
||||
(init-templatedir|install|uninstall)
|
||||
options+=(
|
||||
'(-t --hook-type)'{-t,--hook-type}'[hook type]:type:($hook_types)'
|
||||
)
|
||||
;|
|
||||
(autoupdate)
|
||||
options+=(
|
||||
'--bleeding-edge[Update to the bleeding edge of 'HEAD' instead of the latest tagged version]'
|
||||
'--freeze[Store "frozen" hashes in "rev" instead of tag names]'
|
||||
'*--repo[Only update this repository -- may be specified multiple times]:repos'
|
||||
'(-j --jobs)'{-j,--jobs}'[Number of threads to use(default: 1)]:jobs'
|
||||
)
|
||||
;;
|
||||
(init-templatedir)
|
||||
options+=(
|
||||
'--no-allow-missing-config[Assume cloned repos should have a "pre-commit" config]'
|
||||
'*::dir:_files -/'
|
||||
)
|
||||
;;
|
||||
(install)
|
||||
options+=(
|
||||
'(-f --overwrite)'{-f,--overwrite}'[Overwrite existing hooks / remove migration mode]'
|
||||
'--install-hooks[Whether to install hook environments for all environments]'
|
||||
'--allow-missing-config[Allow a missing "pre-commit" configuration file]'
|
||||
)
|
||||
;;
|
||||
(run|try-repo)
|
||||
options+=(
|
||||
'(-v --verbose)'{-v,--verbose}'[verbose mode]'
|
||||
'(-a --all-files)'{-a,--all-files}'[Run on all the files in the repo]'
|
||||
'--files[Specific filenames to run hooks on]:file:_files'
|
||||
'--show-diff-on-failure[When hooks fail, run "git diff" directly afterward]'
|
||||
'--hook-stage[The stage during which the hook is fired]:stage:($hook_stages)'
|
||||
'--remote-branch[Remote branch ref used by "git push"]:remote_branch:_pre_commit_git_remote_branches'
|
||||
'--local-branch[Local branch ref used by "git push"]:local_branch:_pre_commit_git_local_branches'
|
||||
'(--from-ref --source -s)'{--from-ref,--source,-s}'[original ref in "from_ref..to_ref" diff expression]:ref:_pre_commit_git_refs'
|
||||
'(--to-ref --origin -o)'{--to-ref,--origin,-o}'[destination ref in "from_ref..to_ref" diff expression]:ref:_pre_commit_git_refs'
|
||||
'--pre-rebase-upstream[upstream from which the series was forked]:upstream'
|
||||
'--pre-rebase-branch[branch being rebased and is not set when rebasing the current branch]:branch'
|
||||
'--commit-msg-filename[file name to check when running during "commit-msg"]:file:_files'
|
||||
'--prepare-commit-message-source[source of the commit message]:source'
|
||||
'--commit-object-name[commit object name]:object_name'
|
||||
'--remote-name[Remote name used by "git push"]:name:remote:_pre_commit_git_remotes'
|
||||
'--remote-url[Remote url used by "git push"]:url:_urls'
|
||||
'--checkout-type[branch check out or a file checkout]:type:_pre_commit_commit_types'
|
||||
'--is-squash-merge[use squash merge]:flag:(0 1)'
|
||||
'--rewrite-command[specify the command that invoked the rewrite]:command'
|
||||
"2:hook_id"
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
_arguments $options[@] && ret=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
_pre_commit_commands() {
|
||||
local -a commands=(
|
||||
local commands=(
|
||||
"autoupdate:Auto-update pre-commit config to the latest repos' versions"
|
||||
"clean:Clean out pre-commit files"
|
||||
"gc:Clean unused cached repos"
|
||||
"help:Show help for a specific command"
|
||||
"init-templatedir:Install hook script in a directory intended for use with 'git config init.templateDir'"
|
||||
"install:Install the pre-commit script"
|
||||
"install-hooks:Install hook environments for all environments in the config file"
|
||||
|
|
@ -123,47 +32,181 @@ _pre_commit_commands() {
|
|||
"validate-manifest:Validate .pre-commit-hooks.yaml files"
|
||||
"help:Show help for a specific command"
|
||||
)
|
||||
|
||||
_describe 'pre-commit commands' commands
|
||||
}
|
||||
|
||||
_pre_commit_git_remote_branches() {
|
||||
if (( $+commands[git] )); then
|
||||
local -a remote_branches=(${(f)"$(git branch -a 2>/dev/null | \grep 'remotes/' | \grep -v HEAD | awk -F/ '{print $NF}' | uniq)"})
|
||||
_values 'branch' $remote_branches
|
||||
fi
|
||||
}
|
||||
|
||||
_pre_commit_git_local_branches() {
|
||||
if (( $+commands[git] )); then
|
||||
local -a local_branches=(${(f)"$(git branch 2>/dev/null | cut -c3-)"})
|
||||
_values 'branch' $local_branches
|
||||
fi
|
||||
}
|
||||
|
||||
_pre_commit_git_remotes() {
|
||||
if (( $+commands[git] )); then
|
||||
local -a remote_names=(${(f)"$(git remote 2>/dev/null)"})
|
||||
_values 'remote' $remote_names
|
||||
fi
|
||||
}
|
||||
|
||||
_pre_commit_commit_types() {
|
||||
local -a types=(
|
||||
'0:retrieving a file from the index'
|
||||
'1:changing branches'
|
||||
)
|
||||
|
||||
_describe 'commit types' types
|
||||
}
|
||||
|
||||
_pre_commit_git_refs() {
|
||||
if (( $+commands[git] )); then
|
||||
local -a refs=(${(f)"$(git branch -a 2>/dev/null | \grep -v HEAD | cut -c3- | sed 's/^remotes\///')"})
|
||||
_values 'ref' $refs
|
||||
_pre_commit_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"(- : *)"{-V,--version}"[show program\'s version number and exit]"
|
||||
)
|
||||
|
||||
_pre_commit_autoupdate_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
{-c,--config}"[Path to alternate config file]:config:_files -g '*.yaml'"
|
||||
"--bleeding-edge[Update to the bleeding edge of 'HEAD' instead of the latest tagged version]"
|
||||
"--freeze[Store 'frozen' hashes in 'rev' instead of tag names]"
|
||||
"*--repo[Only update this repository -- may be specified multiple times]:repos:"
|
||||
{-j,--jobs}"[Number of threads to use]:jobs"
|
||||
)
|
||||
|
||||
_pre_commit_clean_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
)
|
||||
|
||||
_pre_commit_gc_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
)
|
||||
|
||||
_pre_commit_help_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
":Command to show help for.:"
|
||||
)
|
||||
|
||||
_pre_commit_init_templatedir_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
{-c,--config}"[Path to alternate config file]:config:_files -g '*.yaml'"
|
||||
"--no-allow-missing-config[Assume cloned repos should have a 'pre-commit' config]"
|
||||
"*"{-t,--hook-type}"[which hook type to install]:hook_types:(commit-msg post-checkout post-commit post-merge post-rewrite pre-commit pre-merge-commit pre-push pre-rebase prepare-commit-msg)"
|
||||
":The directory in which to write the hook script.:_files -/"
|
||||
)
|
||||
|
||||
_pre_commit_install_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
{-c,--config}"[Path to alternate config file]:config:_files -g '*.yaml'"
|
||||
{-f,--overwrite}"[Overwrite existing hooks / remove migration mode]"
|
||||
"--install-hooks[Whether to install hook environments for all environments in the config file]"
|
||||
{-t,--hook-type}"[which hook type to install]:hook_type:(commit-msg post-checkout post-commit post-merge post-rewrite pre-commit pre-merge-commit pre-push pre-rebase prepare-commit-msg)"
|
||||
"--allow-missing-config[Hook scripts will permit a missing configuration file]"
|
||||
)
|
||||
|
||||
_pre_commit_install_hooks_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
{-c,--config}"[Path to alternate config file]:config:_files -g '*.yaml'"
|
||||
)
|
||||
|
||||
_pre_commit_migrate_config_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
{-c,--config}"[Path to alternate config file]:config:_files -g '*.yaml'"
|
||||
)
|
||||
|
||||
_pre_commit_run_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
{-c,--config}"[Path to alternate config file]:config:_files -g '*.yaml'"
|
||||
{--verbose,-v}"[ produce hook output independent of success]"
|
||||
{--all-files,-a}"[Run on all the files in the repo]"
|
||||
"--files[Specific filenames to run hooks on]:files:_files"
|
||||
"--show-diff-on-failure[When hooks fail, run 'git diff' directly afterward]"
|
||||
"--hook-stage[The stage during which the hook is fired]:hook_stage:(commit-msg post-checkout post-commit post-merge post-rewrite pre-commit pre-merge-commit pre-push pre-rebase prepare-commit-msg manual)"
|
||||
"--remote-branch[Remote branch ref used by 'git push']:remote_branch:"
|
||||
"--local-branch[Local branch ref used by 'git push']:local_branch:"
|
||||
{--from-ref,--source,-s}"[the original ref in a 'from_ref...to_ref' diff expression]:from_ref:"
|
||||
{--to-ref,--origin,-o}"[the destination ref in a 'from_ref...to_ref' diff expression]:to_ref:"
|
||||
"--pre-rebase-upstream[the upstream from which the series was forked]:pre_rebase_upstream"
|
||||
"--pre-rebase-branch[the branch being rebased and is not set when rebasing the current branch]:pre_rebase_branch"
|
||||
"--commit-msg-filename[Filename to check when running during 'commit-msg']:commit_msg_filename:"
|
||||
"--prepare-commit-message-source[Source of the commit message]:prepare_commit_message_source:"
|
||||
"--commit-object-name[Commit object name]:commit_object_name:"
|
||||
"--remote-name[Remote name used by 'git push']:remote_name:"
|
||||
"--remote-url[Remote url used by 'git push']:remote_url:"
|
||||
"--checkout-type[Indicates whether the checkout was a branch checkout or a file checkout]:checkout_type:((0\:file\ checkout 1\:branch\ checkout))"
|
||||
"--is-squash-merge[During a post-merge hook, indicates whether the merge was a squash merge]:is_squash_merge:"
|
||||
"--rewrite-command[During a post-rewrite hook, specifies the command that invoked the rewrite]:rewrite_command:"
|
||||
":A single hook-id to run:"
|
||||
)
|
||||
|
||||
_pre_commit_sample_config_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
)
|
||||
|
||||
_pre_commit_try_repo_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
{-c,--config}"[Path to alternate config file]:config:_files -g '*.yaml'"
|
||||
{--ref,--rev}"[Manually select a rev to run against, otherwise 'HEAD']:ref:"
|
||||
{--verbose,-v}"[verbose output]"
|
||||
{--all-files,-a}"[Run on all the files in the repo]"
|
||||
"--files[Specific filenames to run hooks on]:files:_files"
|
||||
"--show-diff-on-failure[When hooks fail, run 'git diff' directly afterward]"
|
||||
"--hook-stage[The stage during which the hook is fired]:hook_stage:(commit-msg post-checkout post-commit post-merge post-rewrite pre-commit pre-merge-commit pre-push pre-rebase prepare-commit-msg manual)"
|
||||
"--remote-branch[Remote branch ref used by 'git push']:remote_branch:"
|
||||
"--local-branch[Local branch ref used by 'git push']:local_branch:"
|
||||
{--from-ref,--source,-s}"[the original ref in a 'from_ref...to_ref' diff expression]:from_ref:"
|
||||
{--to-ref,--origin,-o}"[the destination ref in a 'from_ref...to_ref' diff expression]:to_ref:"
|
||||
"--pre-rebase-upstream[the upstream from which the series was forked]:pre_rebase_upstream"
|
||||
"--pre-rebase-branch[the branch being rebased and is not set when rebasing the current branch]:pre_rebase_branch"
|
||||
"--commit-msg-filename[Filename to check when running during 'commit-msg']:commit_msg_filename:"
|
||||
"--prepare-commit-message-source[Source of the commit message]:prepare_commit_message_source:"
|
||||
"--commit-object-name[Commit object name]:commit_object_name:"
|
||||
"--remote-name[Remote name used by 'git push']:remote_name:"
|
||||
"--remote-url[Remote url used by 'git push']:remote_url:"
|
||||
"--checkout-type[Indicates whether the checkout was a branch checkout or a file checkout]:checkout_type:((0\:file\ checkout 1\:branch\ checkout))"
|
||||
"--is-squash-merge[During a post-merge hook, indicates whether the merge was a squash merge]:is_squash_merge:"
|
||||
"--rewrite-command[During a post-rewrite hook, specifies the command that invoked the rewrite]:rewrite_command:"
|
||||
":Repository to source hooks from.:"
|
||||
":A single hook-id to run:"
|
||||
)
|
||||
|
||||
_pre_commit_uninstall_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
{-c,--config}"[Path to alternate config file]:config:_files -g '*.yaml'"
|
||||
"*"{-t,--hook-type}"[which hook type to uninstall]:hook_types:(commit-msg post-checkout post-commit post-merge post-rewrite pre-commit pre-merge-commit pre-push pre-rebase prepare-commit-msg)"
|
||||
)
|
||||
|
||||
_pre_commit_validate_config_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
"(*)::filenames:_files"
|
||||
)
|
||||
|
||||
_pre_commit_validate_manifest_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)"
|
||||
"(*)::filenames:_files"
|
||||
)
|
||||
|
||||
_pre_commit() {
|
||||
local context state line curcontext="$curcontext" one_or_more='(-)*' reminder='(*)'
|
||||
|
||||
if ((${_pre_commit_options[(I)${(q)one_or_more}*]} + ${_pre_commit_options[(I)${(q)reminder}*]} == 0)); then # noqa: E501
|
||||
_pre_commit_options+=(': :_pre_commit_commands' '*::: :->pre-commit')
|
||||
fi
|
||||
_arguments -C $_pre_commit_options
|
||||
|
||||
case $state in
|
||||
pre-commit)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:_pre_commit-$line[1]:"
|
||||
case $line[1] in
|
||||
autoupdate) _arguments -C $_pre_commit_autoupdate_options ;;
|
||||
clean) _arguments -C $_pre_commit_clean_options ;;
|
||||
gc) _arguments -C $_pre_commit_gc_options ;;
|
||||
help) _arguments -C $_pre_commit_help_options ;;
|
||||
init-templatedir) _arguments -C $_pre_commit_init_templatedir_options ;;
|
||||
install) _arguments -C $_pre_commit_install_options ;;
|
||||
install-hooks) _arguments -C $_pre_commit_install_hooks_options ;;
|
||||
migrate-config) _arguments -C $_pre_commit_migrate_config_options ;;
|
||||
run) _arguments -C $_pre_commit_run_options ;;
|
||||
sample-config) _arguments -C $_pre_commit_sample_config_options ;;
|
||||
try-repo) _arguments -C $_pre_commit_try_repo_options ;;
|
||||
uninstall) _arguments -C $_pre_commit_uninstall_options ;;
|
||||
validate-config) _arguments -C $_pre_commit_validate_config_options ;;
|
||||
validate-manifest) _arguments -C $_pre_commit_validate_manifest_options ;;
|
||||
esac
|
||||
esac
|
||||
}
|
||||
|
||||
typeset -A opt_args
|
||||
_pre_commit "$@"
|
||||
|
||||
# Local Variables:
|
||||
|
|
|
|||
85
src/_pwsh
85
src/_pwsh
|
|
@ -1,85 +0,0 @@
|
|||
#compdef pwsh
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for PowerShell 7.6.0 (https://github.com/PowerShell/PowerShell)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_pwsh_execution_policies() {
|
||||
local -a policies=(
|
||||
"AllSigned:Require that all scripts and config files are signed by a trusted publisher"
|
||||
"Bypass:Nothing is blocked and there are no warnings or prompts"
|
||||
"Default:Sets the default execution policy"
|
||||
"RemoteSigned:Require that all scripts and config files downloaded from the Internet are signed by a trusted publisher"
|
||||
"Restricted:Doesn't load configuration files or run scripts"
|
||||
"Undefined:No execution policy is set for the scope"
|
||||
"Unrestricted:Loads all configuration files and runs all scripts"
|
||||
)
|
||||
|
||||
_describe -t policy policies policies
|
||||
}
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-Help,-?}'[Display help for pwsh]' \
|
||||
'(-f -File)'{-f,-File}'[Specify file name to execute, "-" means reading from standard input]:file:_files' \
|
||||
'(-c -Command)'{-c,-Command}'[Execute the specified command, "-" means reading from standard input]:command' \
|
||||
'(-cwa -CommandWithArgs)'{-cwa,-CommandWithArgs}'[Execute PowerShell command with arguments]:command_and_args' \
|
||||
'(-config -ConfigurationName)'{-config,-ConfigurationName}'[Specify a configuration endpoint in which PowerShell is run]:config' \
|
||||
'-ConfigurationFile[Specify a session configuration file path]:path:_files -g "*.pssc"' \
|
||||
'-CustomPipeName[Specify the name to use for an additional IPC server]:pipe_name' \
|
||||
'(-e -ec -EncodedCommand)'{-e,-ec,-EncodedCommand}'[Accept a Base64-encoded string version of a command]:encoded_command' \
|
||||
'(-ex -ep -ExecutionPolicy)'{-ex,-ep,-ExecutionPolicy}'[Set the default execution policy for the current session]:policy:_pwsh_execution_policies' \
|
||||
'(-inp -if -InputFormat)'{-inp,-if,-InputFormat}'[Describe the format of data sent to PowerShell]:format:(Text XML)' \
|
||||
'(-i -Interactive -noni -NonInteractive)'{-i,-Interactive}'[Present an interactive prompt to the user]' \
|
||||
'(-l -Login)'{-l,-Login}'[Start PowerShell as a login shell]' \
|
||||
'(-MTA -STA)-MTA[Start PowerShell using a multi-threaded apartment, available only on Windows]' \
|
||||
'(-noe -NoExit)'{-noe,-NoExit}'[Do not exit after running startup Completion]' \
|
||||
'(-nol -NoLogo)'{-nol,-NoLogo}'[Hide the banner text at startup of interactive sessions]' \
|
||||
'(-i -Interactive -noni -NonInteractive)'{-noni,-NonInteractive}'[Create sessions that should not require user input]' \
|
||||
'(-nop -NoProfile)'{-nop,-NoProfile}'[Do not load the PowerShell profiles]' \
|
||||
'-NoProfileLoadTime[Hide the PowerShell profile load time text shown at startup when it takes more than 500msecs]' \
|
||||
'(-o -of -OutputFormat)'{-o,-of,-OutputFormat}'[Determine how output from PowerShell is formatted]:format:(Text XML)' \
|
||||
'(-settings -SettingsFile)'{-settings,-SettingsFile}'[Override the system-wide settings file for the session]:file:_files -g "*.json"' \
|
||||
'(-sshs -SSHServerMode)'{-sshs,-SSHServerMode}'[Used in sshd_config for running PowerShell as an SSH subsystem]' \
|
||||
'(-MTA -STA)-STA[Start PowerShell using a single-threaded apartment, only available on Windows]' \
|
||||
'(- *)'{-v,-Version}'[Display the version of PowerShell]' \
|
||||
'(-w -WindowStyle)'{-w,-WindowStyle}'[Set the window style for the session]:style:(Normal Minimized Maximized Hidden)' \
|
||||
'(-wd -WorkingDirectory)'{-wd,-WorkingDirectory}'[Set the initial working directory]:dir:_files -/' \
|
||||
'*:: :_files'
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
16
src/_rails
16
src/_rails
|
|
@ -45,7 +45,7 @@ _rails() {
|
|||
|
||||
local -a runtime_options rails_options
|
||||
runtime_options=(
|
||||
'(- *)'{-h,--help}'[Show help message and quit]'
|
||||
'(- *)'{-h,--help}'[Show this help message and quit]'
|
||||
'(- *)'{-v,--version}'[Show Rails version and quit]'
|
||||
)
|
||||
|
||||
|
|
@ -74,14 +74,14 @@ _rails() {
|
|||
;;
|
||||
(console|c)
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[Show help message and quit]' \
|
||||
'(- *)'{-h,--help}'[Show this help message and quit]' \
|
||||
'(-e --environment)'{-e,--environment=}'[The environment to run "console" in]:env:(test development production)' \
|
||||
'(-s --sandbox)'{-s,--sandbox}'[Rollback database modifications on exit]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(server|s)
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[Show help message and quit]' \
|
||||
'(- *)'{-h,--help}'[Show this help message and quit]' \
|
||||
'(-e --environment)'{-e,--environment=}'[The environment to run "server" in]:env:(test development production)' \
|
||||
'(-p --port)'{-p,--port}'[Run Rails on the specified port]:port' \
|
||||
'(-b --binding)'{-b,--binding=}'[Bind Rails to the specified IP]:binding' \
|
||||
|
|
@ -98,7 +98,7 @@ _rails() {
|
|||
;;
|
||||
(dbconsole|db)
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[Show help message and quit]' \
|
||||
'(- *)'{-h,--help}'[Show this help message and quit]' \
|
||||
'(-e --environment)'{-e,--environment=}'[The environment to run "server" in]:env:(test development production)' \
|
||||
'(-p --include-password)'{-p,--include-password}'[Automatically provide the password from database.yml]' \
|
||||
'--mode=[Automatically put the sqlite3 database in the specified mode]:mode:(html list line column)' \
|
||||
|
|
@ -109,7 +109,7 @@ _rails() {
|
|||
;;
|
||||
(test|t|test:system)
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[Show help message and quit]' \
|
||||
'(- *)'{-h,--help}'[Show this help message and quit]' \
|
||||
'--no-plugins[Bypass minitest plugin auto-loading]' \
|
||||
'(-s --seed)'{-s,--seed=}'[Sets random seed]:seed' \
|
||||
'(-v --verbose -q --quiet)'{-v,--verbose}'[Show progress processing files]' \
|
||||
|
|
@ -133,7 +133,7 @@ _rails() {
|
|||
;;
|
||||
(runner|r)
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[Show help message and quit]' \
|
||||
'(- *)'{-h,--help}'[Show this help message and quit]' \
|
||||
'(-e --environment)'{-e,--environment=}'[The environment to run "runner"]:env:(test development production)' \
|
||||
'(-w --skip-executor)'{-w,--skip-executor}'[Do not wrap with Rails Executor]' \
|
||||
'*:: :_files -g "*.rb"' \
|
||||
|
|
@ -147,7 +147,7 @@ _rails() {
|
|||
;;
|
||||
(routes)
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[Show help message and quit]' \
|
||||
'(- *)'{-h,--help}'[Show this help message and quit]' \
|
||||
'(-c --controller)'{-c,--controller=}'[Filter by a specific controller]:controller' \
|
||||
'(-g --grep)'{-g,--grep}'[Grep routes by a specific pattern]' \
|
||||
'(-E --expanded)'{-E,--expanded}'[Print routes expanded vertically with parts explained]' \
|
||||
|
|
@ -353,7 +353,7 @@ _rails_generate() {
|
|||
(generate)
|
||||
local -a opts
|
||||
opts=(
|
||||
'(- *)'{-h,--help}'[Show help message and quit]'
|
||||
'(- *)'{-h,--help}'[Show this help message and quit]'
|
||||
$runtime_options
|
||||
'--skip-namespace[Skip namespace]'
|
||||
'--skip-collision-check[Skip collision check]'
|
||||
|
|
|
|||
2
src/_rev
2
src/_rev
|
|
@ -35,7 +35,7 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(- *)'{-V,--version}'[display version]' \
|
||||
'(-0 --zero)'{-0,--zero}'[use the nul character as line separator]'
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for rubocop 1.86.1 (https://github.com/rubocop/rubocop)
|
||||
# Completion script for rubocop 1.82.1 (https://github.com/rubocop/rubocop)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
|
|
@ -73,7 +73,6 @@ _arguments \
|
|||
'(-C --cache)'{-C,--cache}'[Use result caching or not]:flag:(true false)' \
|
||||
'--cache-root[Set the cache root directory]:dir:_files -/' \
|
||||
'--lsp[Start a language server listening on STDIN]' \
|
||||
'--mcp[Start an MCP server that communicates over stdio]' \
|
||||
'--server[If a server process has not been started yet start the server process and execute inspection with server]' \
|
||||
'(--restart-server --start-server --stop-server)--restart-server[Restart server process]' \
|
||||
'(--restart-server --start-server --stop-server)--start-server[Start server process]' \
|
||||
|
|
|
|||
2
src/_sbt
2
src/_sbt
|
|
@ -93,7 +93,7 @@ _sbt() {
|
|||
unfiltered/unfiltered.g8
|
||||
scalatra/scalatra-sbt.g8
|
||||
)
|
||||
_values 'g8_templates' $g8_templates && ret=0
|
||||
_values 'g8_templates' $g8_templates
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
|
|
|||
14
src/_scala
14
src/_scala
|
|
@ -208,13 +208,13 @@ _scala() {
|
|||
;;
|
||||
(*)
|
||||
case $service in
|
||||
(scala)
|
||||
_arguments $scala_options $common_options "*::filename:_files" && ret=0
|
||||
;;
|
||||
(scalac)
|
||||
_arguments $common_options "*::filename:_files" && ret=0
|
||||
;;
|
||||
esac
|
||||
(scala)
|
||||
_arguments $scala_options $common_options "*::filename:_files" && ret=0
|
||||
;;
|
||||
(scalac)
|
||||
_arguments $common_options "*::filename:_files" && ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
|||
|
|
@ -121,10 +121,10 @@ _setcap_capabilities() {
|
|||
|
||||
_setcap "$@"
|
||||
|
||||
# Local Variables:
|
||||
# Local variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# ex: sw=2 ts=2 et filetype=sh
|
||||
|
|
|
|||
16
src/_tmuxp
16
src/_tmuxp
|
|
@ -93,8 +93,8 @@ _tmuxp() {
|
|||
&& ret=0
|
||||
;;
|
||||
(shell)
|
||||
local sessions="$(__tmuxp_tmux_sessions)"
|
||||
local windows="$(__tmuxp_tmux_windows)"
|
||||
local sessions="$(__tmux_sessions)"
|
||||
local windows="$(__tmux_windows)"
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[show help message and exit]' \
|
||||
'-S[pass-through for tmux -S]: :_files' \
|
||||
|
|
@ -173,19 +173,21 @@ __tmuxp_import() {
|
|||
(project)
|
||||
if [[ $line[1] == 'tmuxinator' ]]
|
||||
then
|
||||
_wanted tmuxinator-projects expl 'tmuxinator projects' compadd $(tmuxinator completions start)
|
||||
_wanted tmuxinator-projects exp 'tmuxinator projects' compadd $(tmuxinator completions start)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__tmuxp_tmux_sessions() {
|
||||
local tmux_sessions=($(_call_program tmux_sessions 'tmux ls -F "#{session_name}"'))
|
||||
__tmux_sessions () {
|
||||
local tmux_sessions
|
||||
tmux_sessions=($(_call_program tmux_sessions 'tmux ls -F "#{session_name}"'))
|
||||
echo $tmux_sessions
|
||||
}
|
||||
|
||||
__tmuxp_tmux_windows() {
|
||||
local tmux_windows=($(_call_program tmux_sessions 'tmux ls -F "#{window_name}"'))
|
||||
__tmux_windows () {
|
||||
local tmux_windows
|
||||
tmux_windows=($(_call_program tmux_sessions 'tmux ls -F "#{window_name}"'))
|
||||
echo $tmux_windows
|
||||
}
|
||||
|
||||
|
|
|
|||
2
src/_tsc
2
src/_tsc
|
|
@ -194,7 +194,7 @@ local -a opts=(
|
|||
"--excludeFiles[Remove a list of files from the watch mode's processing]:files:_files"
|
||||
"--libReplacement[Enable library replacement]"
|
||||
"--erasableSyntaxOnly[Ensures that runtime constructs which are not part of ECMAScript are not allowed]"
|
||||
'*:: :_files'
|
||||
'*:: :_files' \
|
||||
)
|
||||
|
||||
if (( $+opt_args[--build] )); then
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ case $OSTYPE in
|
|||
;;
|
||||
(*)
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(- *)'{-V,--version}'[display version]' \
|
||||
'(-r --random)'{-r,--random}'[generate random-based uuid]' \
|
||||
'(-t --time)'{-t,--time}'[generate time-based uuid]' \
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(-g --group -p --passwd)'{-g,--group}'[edit group database]' \
|
||||
'(-g --group -p --passwd)'{-p,--passwd}'[edit passwd database]' \
|
||||
'(-q --quiet)'{-q,--quiet}'[quiet mode]' \
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ _wdctl_output_columns() {
|
|||
}
|
||||
|
||||
_arguments -s \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(- *)'{-V,--version}'[display version]' \
|
||||
'(-f --flags)'{-f,--flags}'[print selected flags only]:flags' \
|
||||
'(-F --noflags)'{-F,--noflags}'[do not print information about flags]' \
|
||||
|
|
|
|||
|
|
@ -23,11 +23,3 @@ local modes=('up\:"bring a wireguard interface up"'\
|
|||
# 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)"'
|
||||
|
||||
# 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
|
||||
|
|
|
|||
12
src/_yarn
12
src/_yarn
|
|
@ -345,8 +345,7 @@ _yarn_cache() {
|
|||
_arguments \
|
||||
'(- *)'{-h,--help}'[show help message and exit]' \
|
||||
'--mirror[remove the global cache files instead of the local cache files]' \
|
||||
'--all[remove both the global cache files and the local cache files of the current project]' \
|
||||
&& ret=0
|
||||
'--all[remove both the global cache files and the local cache files of the current project]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
|
@ -641,6 +640,8 @@ _yarn_plugin_subcommands() {
|
|||
|
||||
(( $+functions[_yarn_run] )) ||
|
||||
_yarn_run() {
|
||||
local ret=1
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[show help message and exit]' \
|
||||
'--json[format the output as an NDJSON stream]' \
|
||||
|
|
@ -650,7 +651,10 @@ _yarn_run() {
|
|||
'(-B --binaries-only)'{-B,--binaries-only}'[ignore any user defined scripts and only check binaries]' \
|
||||
'*--require[preload given module]:module' \
|
||||
'1: :_yarn_scripts' \
|
||||
'*:: :_files'
|
||||
'*:: :_files' \
|
||||
&& ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
(( $+functions[_yarn_set] )) ||
|
||||
|
|
@ -904,7 +908,7 @@ _yarn_scripts() {
|
|||
fi
|
||||
|
||||
local -a candidates=($scripts $binaries)
|
||||
_wanted candidates expl 'scripts' compadd -a candidates
|
||||
_values 'scripts' $candidates
|
||||
}
|
||||
|
||||
_yarn "$@"
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ _zramctl_output_columns() {
|
|||
}
|
||||
|
||||
_arguments \
|
||||
'(- *)'{-h,--help}'[display help]' \
|
||||
'(- *)'{-h,--help}'[display this help]' \
|
||||
'(- *)'{-V,--version}'[display version]' \
|
||||
'(-a --algorithm)'{-a,--algorithm}'[compression algorithm to use]:algorithm:(lzo lz4 lz4hc deflate 842 zstd)' \
|
||||
'(-b --bytes)'{-b,--bytes}'[print sizes in bytes rather than in human readable format]:bytes' \
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ _regex_arguments _cmd /$'[^\0]##\0'/ \( /$'word1(a|b|c)\0'/ ':word:first word:(w
|
|||
_cmd "$@"
|
||||
#+END_SRC
|
||||
in this case the first word can be word1 or word11 followed by an a, b or c, and if the first word contains 11 then a second
|
||||
word is allowed which can be word2 or word22 followed by and a, b, or c.
|
||||
word is allowed which can be word2 followed by and a, b, or c, or a filename.
|
||||
|
||||
If this sounds too complicated a much simpler alternative is to use the _regex_words function for creating
|
||||
specifications for _regex_arguments.
|
||||
|
|
|
|||
Loading…
Reference in New Issue