Compare commits

...

96 Commits

Author SHA1 Message Date
Shohei YOSHIDA 7a7ed4ea32
Merge pull request #1262 from zsh-users/update_openssl
Update openssl completion to 4.0.0
2026-05-06 14:02:16 +09:00
Shohei YOSHIDA d215391952
Update openssl completion to 4.0.0 2026-05-03 15:28:01 +09:00
Mikael Magnusson d4d30592c2 _tmuxp: typo expl 2026-05-03 04:19:53 +02:00
Mikael Magnusson 7a2db2fe49 _yarn: return values and _wanted 2026-05-03 04:19:53 +02:00
Mikael Magnusson 21621f3458 _tsc: remove stray backslash 2026-05-03 04:19:53 +02:00
Mikael Magnusson 8dd06dfaaf _sbt: add missing ret=0 2026-05-03 04:19:53 +02:00
Mikael Magnusson 96420d8c73 _pm2: consistent capitalization 2026-05-03 04:19:53 +02:00
Mikael Magnusson 32cff31cca _nano: set ret=0 for all the state stuff 2026-05-03 04:19:53 +02:00
Mikael Magnusson 41d22dc6e4 _mcookie: more useful heading for -m 2026-05-03 04:19:53 +02:00
Mikael Magnusson 4be40305ba _kitchen: don't use bare compadd 2026-05-03 04:19:53 +02:00
Mikael Magnusson 9a94ecb9c9 _hledger: fix bogus -A option placement
It got offered as a completion instead
2026-05-03 04:19:53 +02:00
Mikael Magnusson f916eeb8a3 _fallocate: mutually exclusive options
-n is disallowed with -c, and implied with -d/-p, so there's no point passing it there
2026-05-03 04:19:53 +02:00
Mikael Magnusson ef53598cbd _bundle: remove nonsensical -A options 2026-05-03 04:19:53 +02:00
Mikael Magnusson c4d76587ae Remove the 'this' from 'show this help and exit' in completers 2026-05-03 04:19:41 +02:00
Mikael Magnusson 5879b07714 _chmem: update with new options 2026-05-03 04:18:54 +02:00
Mikael Magnusson d5bf7ae200 _chcpu: improve help text for cpu list 2026-05-03 04:18:54 +02:00
Mikael Magnusson cf98cc27ba _cask: update a bit
It's unclear to me what arguments link actually takes from the
documentation so no attempt there.
2026-05-03 04:18:54 +02:00
Mikael Magnusson 8d536db182 _bower: fix completing options
the (--foo)--foo is harmless but redundant and makes things hard to
read, we only need that syntax when we want to prevent an option being
completed together with *another* option, such as the instance with
(-t --token){-t,--token} where _arguments doesn't know those do the same
thing.
2026-05-03 04:18:21 +02:00
Shohei YOSHIDA d3578edb5f
Merge pull request #1261 from zsh-users/update-rubocop
Update rubocop completion to version 1.86.1
2026-04-28 09:15:55 +09:00
Shohei YOSHIDA d862f3b114
Update rubocop completion to version 1.86.1 2026-04-27 11:48:13 +09:00
Shohei YOSHIDA dbaeafd96c
Merge pull request #1260 from tborychowski/patch-1
fix yarn run completions
2026-04-23 19:52:05 +09:00
Dziad Borowy 8b1b94a0d5
fix yarn run completions
`yarn run<TAB>` doesn't show scripts that have `:` in them (e.g. `lint:js`, `test:e2e`), which is a popular pattern.
this change fixes that.
2026-04-23 10:38:29 +01:00
Shohei YOSHIDA 47e40c923c
Merge pull request #1259 from vapniks/patch-1
Update zsh-completions-howto.org
2026-04-20 10:55:23 +09:00
vapniks fbdd3b36b6
Update zsh-completions-howto.org
Fix explanation of _regex_arguments example
2026-04-18 22:59:48 +01:00
Shohei YOSHIDA ed67fbb8ee
Merge pull request #1258 from zsh-users/add-net-bench
Add network benchmark tools completions, ab and h2load
2026-04-12 10:13:10 +09:00
Shohei YOSHIDA 72d91588a3
Merge pull request #1257 from zsh-users/add-shells
Add other shell completions
2026-04-10 13:18:17 +09:00
Shohei YOSHIDA b546f87141
add h2load completion 2026-04-07 23:33:28 +09:00
Shohei YOSHIDA b988a84e1e
Add apache bench completion 2026-04-07 23:16:54 +09:00
Shohei YOSHIDA cc3181fcaa
add nu shell completion 2026-04-07 07:07:08 +09:00
Shohei YOSHIDA 5464333f29
add fish completion 2026-04-07 07:06:56 +09:00
Shohei YOSHIDA 8b97eaf521
Merge pull request #1255 from zsh-users/add_pwsh
Add PowerShell completion for macOS and Linux
2026-04-04 10:06:45 +09:00
Shohei YOSHIDA 959c0fa665
Merge pull request #1256 from zsh-users/add-v8-options
Add valid v8 options
2026-04-02 15:39:11 +09:00
Shohei YOSHIDA 3bf359f3cb
Merge pull request #1253 from zsh-users/elixir_completions
Add elixir(elixir, elixirc, iex) completions
2026-04-02 15:38:39 +09:00
Shohei YOSHIDA 673251514c
Add valid v8 options 2026-04-02 12:01:35 +09:00
Shohei YOSHIDA 7fa1a78810
Add PowerShell completion for macOS and Linux 2026-03-31 10:34:56 +09:00
Shohei YOSHIDA adad765241
Merge pull request #1254 from zsh-users/update_cmake
Update cmake completion to version 4.3.0
2026-03-31 09:59:52 +09:00
Shohei YOSHIDA 44be5b104f
Update cmake completion to version 4.3.0
add new flags
2026-03-31 09:54:02 +09:00
Shohei YOSHIDA dbad2d3a85
Add elixir completions 2026-03-29 16:44:33 +09:00
Shohei YOSHIDA f0b1a348a1
Merge pull request #1244 from zsh-users/perl-package-managers
Add perl package manager, cpm and cpam completions
2026-03-28 11:04:09 +09:00
Shohei YOSHIDA 60966d8044
Merge pull request #1252 from zsh-users/update_fab
Update fab completion to version 3.2.2
2026-03-28 10:51:37 +09:00
Shohei YOSHIDA c288ac1660
Update fab completion to version 3.2.2 2026-03-27 19:57:14 +09:00
Shohei YOSHIDA fd4a16961f
Merge pull request #1247 from zsh-users/refactor_mix
Refactor mix completion
2026-03-27 00:00:59 +09:00
Shohei YOSHIDA 012017166b
Merge pull request #1243 from zsh-users/ctest_cpack
Add ctest and cpack completions
2026-03-27 00:00:18 +09:00
Shohei YOSHIDA 109a9c809d
Merge pull request #1250 from zsh-users/refactor_mvn
Refactor mvn completion
2026-03-26 23:58:22 +09:00
Shohei YOSHIDA 64487c7f40
Merge pull request #1249 from zsh-users/refactor_golang
Use __golang prefix instead of __go prefix
2026-03-26 23:57:30 +09:00
Shohei YOSHIDA 47d0792461
Merge pull request #1251 from zsh-users/refactor_inxi
Use builtin generating sequential number instead of external commands
2026-03-26 23:55:18 +09:00
Shohei YOSHIDA 748efd8af7
Use builtin generating sequential number instead of external commands
`seq` is not installed on some BSD platforms by default.
2026-03-26 17:30:13 +09:00
Shohei YOSHIDA 519f6d6cee
Refactor mvn completion
- use local variables for cache variables
- use if for conditional executions
2026-03-26 15:14:58 +09:00
Shohei YOSHIDA 748d11083a
Use __golang prefix instead of __go prefix
Because __go_ is used in zsh old golang completions and they could
conflict with functions in _golang.
2026-03-26 14:04:23 +09:00
Shohei YOSHIDA a5d34d3aef
Improve portability 2026-03-26 13:52:05 +09:00
Shohei YOSHIDA b1ffb771c9
Merge pull request #1248 from zsh-users/cache-expiration-date
Fix cache expiration according to comment
2026-03-26 11:26:39 +09:00
Shohei YOSHIDA 77ec5ecd6b
Fix cache expiration according to comment
'mh+1' means 1 hour
2026-03-25 23:28:17 +09:00
Shohei YOSHIDA 118705c01a
implement minimum Phoenix tasks completions 2026-03-25 18:29:36 +09:00
Shohei YOSHIDA 6879291030
implement cache 2026-03-25 15:10:11 +09:00
Shohei YOSHIDA 41fb750ec0
Merge pull request #1246 from sadan4/patch-1
Fix link rot for NixOS package
2026-03-25 08:56:52 +09:00
sadan4 601aa61311
Fix link rot for NixOS package 2026-03-24 16:24:45 -04:00
Shohei YOSHIDA e118561a37
use dynamic completion but it seems we should use cache 2026-03-24 18:02:45 +09:00
Shohei YOSHIDA 2fdd13ab92
Refactor _mix completion 2026-03-24 17:45:58 +09:00
Shohei YOSHIDA 9c0e68a83b
Add cpanm completion 2026-03-23 11:38:56 +09:00
Shohei YOSHIDA fab6ac22ff
Add cpm completion 2026-03-23 11:38:41 +09:00
Shohei YOSHIDA 5993fc38e7
Add cpack completion 2026-03-22 18:22:26 +09:00
Shohei YOSHIDA e4006dea72
add ctest 2026-03-22 18:22:23 +09:00
Shohei YOSHIDA e461417f4e
Merge pull request #1241 from zsh-users/fix_cmake_help_completion
Fix cmake help item completion
2026-03-21 10:42:53 +09:00
Shohei YOSHIDA 97654f2813
Merge pull request #1240 from zsh-users/update-pre-commit
Refactor pre-commit
2026-03-21 10:42:04 +09:00
Shohei YOSHIDA 87378081ee
Remove needless variable declarations 2026-03-19 19:04:12 +09:00
Shohei YOSHIDA bb21390881
fix formatting issue 2026-03-19 19:02:43 +09:00
Shohei YOSHIDA be63667ca5
fix help item completion 2026-03-19 19:01:53 +09:00
Shohei YOSHIDA 986177c01f
Refactor pre-commit
- simplify the code
- reduce global variables
- add completing functions for remote names, branches, refs
2026-03-17 09:46:18 +09:00
Shohei YOSHIDA bce05f9352
Merge pull request #1236 from zsh-users/refactor_gist
Refactor gist and fix cache broken cache implementation
2026-03-16 15:10:54 +09:00
Shohei YOSHIDA 504b84f000
Merge pull request #1235 from zsh-users/refactor_cmake
Refactor cmake completion
2026-03-16 15:09:55 +09:00
Shohei YOSHIDA 84d9053354
Merge pull request #1234 from zsh-users/refactor_cf
Refactoring _cf completion
2026-03-16 14:54:01 +09:00
Shohei YOSHIDA 51025ba738
Merge pull request #1237 from zsh-users/refactor-cask
Refactor cask completion
2026-03-16 14:37:26 +09:00
Shohei YOSHIDA 83748eefc0
Merge pull request #1238 from zsh-users/refactor_git_flow
Refactor git flow
2026-03-16 14:13:23 +09:00
Shohei YOSHIDA 8ef1a35c32
Merge pull request #1239 from zsh-users/refactor_openvpn3
Refactor openvpn3
2026-03-16 14:12:18 +09:00
Shohei YOSHIDA f1cd0e8940
Merge pull request #1233 from zsh-users/refactor_tmuxp
refactoring _tmuxp
2026-03-16 14:11:56 +09:00
Shohei YOSHIDA 31236f26de
Use git_flow prefix instead of git for functions 2026-03-15 22:14:52 +09:00
Shohei YOSHIDA 8758ee4809
Use local variables 2026-03-15 22:11:41 +09:00
Shohei YOSHIDA 45f8084e70
Don't use global variables 2026-03-15 22:09:37 +09:00
Shohei YOSHIDA d1180f126a
Add global options 2026-03-15 15:14:40 +09:00
Shohei YOSHIDA 96316552ea
Merge two switch-case 2026-03-15 15:08:37 +09:00
Shohei YOSHIDA 0dce3a833b
Don't overwrite context variables 2026-03-15 15:08:30 +09:00
Shohei YOSHIDA da6814a485
Don't use global variables 2026-03-15 15:04:17 +09:00
Shohei YOSHIDA b9c943a9e8
Fix cache implementation 2026-03-15 13:24:57 +09:00
Shohei YOSHIDA 5c4fd5c1c5
Don't use global variables 2026-03-15 12:08:49 +09:00
Shohei YOSHIDA e534d39076
simplify assignments and remove needless functions 2026-03-14 21:04:01 +09:00
Shohei YOSHIDA 8e505348f3
Reduce top level local variables, use function local variables instead 2026-03-14 20:56:20 +09:00
Shohei YOSHIDA 309d615eb5
Simplify cmake targets
- Don't use for loop
- Use reduce filtering commands
2026-03-14 20:27:54 +09:00
Shohei YOSHIDA 9240b691d0
Do not use global variables 2026-03-14 20:06:03 +09:00
Shohei YOSHIDA 003afbe513
Refactoring _cf completion
- don't overwrite global variables
- add `__cf_` prefix to private functions
- improve command function dispatch
- use zsh way for array value check
2026-03-14 01:01:16 +09:00
Shohei YOSHIDA f1153d7a9d
add command name prefix to functions 2026-03-14 00:17:55 +09:00
Shohei YOSHIDA ce3bdfed22
Merge pull request #1232 from zsh-users/fix-format
Fix format issues
2026-03-13 16:30:56 +09:00
Shohei YOSHIDA fe94956940
Merge pull request #1231 from zsh-users/issue-1214
`--build` option should be an optional parameter
2026-03-13 16:01:19 +09:00
Shohei YOSHIDA b5da595150
Fix indentation size 2026-03-13 11:46:25 +09:00
Shohei YOSHIDA 7ea6b7a971
Add editor settings to all files 2026-03-13 11:38:48 +09:00
Shohei YOSHIDA 32210c83c5
Use spaces instead of tabs 2026-03-13 11:31:47 +09:00
Shohei YOSHIDA 867fb5a09c
`--build` option should be an optional parameter 2026-03-12 13:38:49 +09:00
81 changed files with 3823 additions and 2162 deletions

View File

@ -18,7 +18,7 @@ zsh-completions ![GitHub release](https://img.shields.io/github/release/zsh-user
| OpenSUSE / SLE | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) | | OpenSUSE / SLE | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) |
| Arch Linux / Manjaro / Antergos / Hyperbola | [zsh-completions](https://www.archlinux.org/packages/zsh-completions), [zsh-completions-git](https://aur.archlinux.org/packages/zsh-completions-git) | | 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) | | Gentoo / Funtoo | [app-shells/zsh-completions](https://packages.gentoo.org/packages/app-shells/zsh-completions) |
| NixOS | [zsh-completions](https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/zsh/zsh-completions/default.nix) | | NixOS | [zsh-completions](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/zs/zsh-completions/package.nix) |
| Void Linux | [zsh-completions](https://github.com/void-linux/void-packages/blob/master/srcpkgs/zsh-completions/template) | | 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/) | | 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) | | 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 Normal file
View File

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

View File

@ -69,3 +69,10 @@ esac
return $ret return $ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -91,7 +91,7 @@ case $service in
;; ;;
(mp4dash) (mp4dash)
options+=( options+=(
'(- *)'{-h,--help}'[Show this help message and exit]' '(- *)'{-h,--help}'[Show help message and exit]'
'(-v --verbose)'{-v,--verbose}'[Be verbose]' '(-v --verbose)'{-v,--verbose}'[Be verbose]'
'(-d --debug)'{-d,--debug}'[Print out debugging information]' '(-d --debug)'{-d,--debug}'[Print out debugging information]'
'(-o --output-dir)'{-o,--output-dir=}'[Output directory]:dir:_files -/' '(-o --output-dir)'{-o,--output-dir=}'[Output directory]:dir:_files -/'
@ -148,7 +148,7 @@ case $service in
;; ;;
(mp4dashclone) (mp4dashclone)
options+=( options+=(
'(- *)'{-h,--help}'[Show this help message and exit]' '(- *)'{-h,--help}'[Show help message and exit]'
'--quiet[Be quiet]' '--quiet[Be quiet]'
'--encrypt=[Encrypt the media with KID and KEY specified in HEX(32 characters each)]:key' '--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 -/' '--exec-dir=[Directory where the Bento4 executables are located]:dir:_files -/'
@ -226,7 +226,7 @@ case $service in
;; ;;
(mp4hls) (mp4hls)
options+=( options+=(
'(- *)'{-h,--help}'[Show this help message and exit]' '(- *)'{-h,--help}'[Show help message and exit]'
'(-v --verbose)'{-v,--verbose}'[Be verbose]' '(-v --verbose)'{-v,--verbose}'[Be verbose]'
'(-d --debug)'{-d,--debug}'[Print out debugging information]' '(-d --debug)'{-d,--debug}'[Print out debugging information]'
'(-o --output-dir)'{-o,--output-dir=}'[Output directory]:dir:_files -/' '(-o --output-dir)'{-o,--output-dir=}'[Output directory]:dir:_files -/'

View File

@ -43,7 +43,7 @@ _bitcoin-cli() {
local ret=1 local ret=1
_arguments -C \ _arguments -C \
-?'[This help message]' \ -?'[Show help message]' \
-addrinfo'[Get the number of addresses known to the node, per network and total]' \ -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)' \ -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)' \ -color='[Color setting for CLI output (default: auto)]:when:(always auto never)' \

View File

@ -43,6 +43,15 @@ local curcontext="$curcontext" state line _opts ret=1
_arguments -C \ _arguments -C \
'(- 1 *)'{-v,--version}'[display version information]' \ '(- 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' \ '1: :->cmds' \
'*:: :->args' && ret=0 '*:: :->args' && ret=0
@ -66,17 +75,6 @@ case $state in
"uninstall[remove a local package]" \ "uninstall[remove a local package]" \
"unregister[remove a package from the registry]" \ "unregister[remove a package from the registry]" \
"version[bump a package version]" && ret=0 "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) args)
case $line[1] in case $line[1] in
@ -101,42 +99,42 @@ case $state in
;; ;;
(home|info|init|link|lookup|prune|register|search|unregister) (home|info|init|link|lookup|prune|register|search|unregister)
_arguments \ _arguments \
'(--help)--help[show help message]' && ret=0 '--help[show help message]' && ret=0
;; ;;
install) install)
_arguments \ _arguments \
'(--force-latest)--force-latest[force latest version on conflict]' \ '--force-latest[force latest version on conflict]' \
'(--help)--help[show help message]' \ '--help[show help message]' \
"(--production)--production[don't install project devDependencies]" \ "--production[don't install project devDependencies]" \
"(--save)--save[save installed packages into the project's bower.json dependencies]" \ "--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 "--save-dev[save installed packages into the project's bower.json devDependencies]" && ret=0
;; ;;
list) list)
_arguments \ _arguments \
'(--help)--help[show help message]' \ '--help[show help message]' \
'(--paths)--paths[generate a simple JSON source mapping]' \ '--paths[generate a simple JSON source mapping]' \
'(--relative)--relative[make paths relative to the directory config property, which defaults to bower_components]' && ret=0 '--relative[make paths relative to the directory config property, which defaults to bower_components]' && ret=0
;; ;;
login) login)
_arguments \ _arguments \
'(--help)--help[show help message]' \ '--help[show help message]' \
'(-t --token)'{-t,--token}'[Pass GitHub auth token (will not prompt for username/password)]' && ret=0 '(-t --token)'{-t,--token}'[Pass GitHub auth token (will not prompt for username/password)]' && ret=0
;; ;;
uninstall) uninstall)
_arguments \ _arguments \
'(--help)--help[show help message]' \ '--help[show help message]' \
"(--save)--save[save installed packages into the project's bower.json dependencies]" \ "--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 "--save-dev[save installed packages into the project's bower.json devDependencies]" && ret=0
;; ;;
update) update)
_arguments \ _arguments \
'(--force-latest)--force-latest[force latest version on conflict]' \ '--force-latest[force latest version on conflict]' \
'(--help)--help[show help message]' \ '--help[show help message]' \
"(--production)--production[don't install project devDependencies]" && ret=0 "--production[don't install project devDependencies]" && ret=0
;; ;;
version) version)
_arguments \ _arguments \
'(--message)--message[custom git commit and tag message]' && ret=0 '--message[custom git commit and tag message]' && ret=0
;; ;;
exec) exec)
_normal && ret=0 _normal && ret=0

View File

@ -46,7 +46,7 @@ _bundle() {
local ret=1 local ret=1
_arguments -C -A "-v" -A "--version" \ _arguments -C \
'(- 1 *)'{-v,--version}'[display version information]' \ '(- 1 *)'{-v,--version}'[display version information]' \
'(-r --retry)'{-r,--retry}'[specify the number of times you with to attempt network commands]:number:' \ '(-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]' \ '(-V --verbose)'{-V,--verbose}'[print out additional logging information]' \

View File

@ -41,16 +41,32 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
function _cask() { function _cask() {
local ret=1 state typeset -A opt_args
_arguments \ 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]' \
':subcommand:->subcommand' \ ':subcommand:->subcommand' \
'*:: :->subcmds' && ret=0 '*:: :->subcmds' \
&& ret=0
case $state in case $state in
subcommand) (subcommand)
subcommands=( local -a subcommands=(
"build:build all Elisp files in the files directive" "build:build all Elisp files in the files directive"
"clean-elc:remove all byte compiled 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:execute command with correct 'exec-path' and 'load-path'"
"exec-path:print 'exec-path' for all packages and dependencies" "exec-path:print 'exec-path' for all packages and dependencies"
"files:print list of files specified in the files directive" "files:print list of files specified in the files directive"
@ -71,15 +87,33 @@ function _cask() {
"upgrade:upgrade Cask itself and its dependencies" "upgrade:upgrade Cask itself and its dependencies"
"version:print program version" "version:print program version"
) )
_describe -t subcommands 'cask subcommands' subcommands && ret=0
esac
case "$words[1]" in _describe -t subcommands 'cask subcommands' subcommands && ret=0
init) ;;
_arguments \ (subcmds)
'(--dev)--dev[Run in dev mode]' && ret=0 ;; case "$words[1]" in
exec) (init)
_generic _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 esac
@ -87,3 +121,11 @@ function _cask() {
} }
_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

View File

@ -248,7 +248,7 @@ __ccache_config_keys() {
if compset -P '--set-config=*='; then if compset -P '--set-config=*='; then
case $IPREFIX in 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') local -a booleans=('true' 'false')
_describe -t booleans 'boolean' booleans _describe -t booleans 'boolean' booleans
;; ;;

719
src/_cf

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ _chatblade() {
typeset -A opt_args typeset -A opt_args
args+=( args+=(
'(- *)'{-h,--help}'[show this help message and exit]' '(- *)'{-h,--help}'[show help message and exit]'
'(- *)--version[display the chatblade version]' '(- *)--version[display the chatblade version]'
'--openai-api-key[the OpenAI API key can also be set as env variable OPENAI_API_KEY]:key' '--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' '--openai-base-url[a custom URL to use the openAI against a local or custom model]:key'

View File

@ -35,12 +35,12 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(- *)'{-V,--version}'[display version]' \ '(- *)'{-V,--version}'[display version]' \
'(-c --configure)'{-c,--configure}'[configure the specified CPUs]:cpu_list' \ '(-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' \ '(-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' \ '(-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' \ '(-g --deconfigure)'{-g,--deconfigure}'[deconfigure the specified CPUs]:cpu_list (0,5,7,9-11)' \
'(-p --dispatch)'{-p,--dispatch}'[set the CPU dispatching mode]:mode:(horizontal vertical)' \ '(-p --dispatch)'{-p,--dispatch}'[set the CPU dispatching mode]:mode:(horizontal vertical)' \
'(-r --rescan)'{-r,--rescan}'[trigger a rescan of CPUs]' '(-r --rescan)'{-r,--rescan}'[trigger a rescan of CPUs]'

View File

@ -35,14 +35,29 @@
# *Aditi Sharma (https://github.com/Aditi76117) # *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 \ _arguments -s \
'(-b --blocks)'{-b,--blocks}'[Use a BLOCKRANGE parameter instead of RANGE or SIZE]' \ '(-b --blocks)'{-b,--blocks}'[Use a BLOCKRANGE parameter instead of RANGE or SIZE]' \
'(-d --disable)'{-d,--disable}'[Set the specified RANGE, SIZE, or BLOCKRANGE of memory offline]' \ '(-e --enable -d --disable -c --configure -g --deconfigure -m --memmap-on-memory)'{-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]' \ '(-e --enable -d --disable -c --configure -g --deconfigure -m --memmap-on-memory)'{-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]' \ '(-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' \
'(-v --verbose)'{-v,--verbose}'[Verbose mode]' \ '(-v --verbose)'{-v,--verbose}'[Verbose mode]' \
'(- *)'{-h,--help}'[Display help text and exit]' \ '(- *)'{-h,--help}'[Display help text and exit]' \
'(- *)'{-V,--version}'[Print version and exit]' '(- *)'{-V,--version}'[Print version and exit]' \
${arg}
# Local Variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script

View File

@ -35,7 +35,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(-c --crypt-method)'{-c,--crypt-method}'[use the specified method to encrypt the passwords]:method:(DES MD5 SHA256 SHA512 YESCRYPT NONE)' \ '(-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]' \ '(-e --encrypted)'{-e,--encrypted}'[supplied passwords are in encrypted form]' \
'(-m --md5)'{-m,--md5}'[use MD5 encryption instead of DES]' \ '(-m --md5)'{-m,--md5}'[use MD5 encryption instead of DES]' \

View File

@ -108,8 +108,8 @@ _chromium_proxyurls () {
do do
while _next_label prefixes expl 'URL prefix' -S '' "$@" while _next_label prefixes expl 'URL prefix' -S '' "$@"
do do
compset -S '[^:/]*' && compstate[to_end]='' compset -S '[^:/]*' && compstate[to_end]=''
compadd "$expl[@]" http:// socks:// socks4:// socks5:// && ret=0 compadd "$expl[@]" http:// socks:// socks4:// socks5:// && ret=0
done done
(( ret )) || return 0 (( ret )) || return 0
done done
@ -123,27 +123,27 @@ _chromium_proxyurls () {
return return
fi ;; fi ;;
(file) [[ -prefix //(127.0.0.1|localhost)/ ]] && compset -P '//(127.0.0.1|localhost)' (file) [[ -prefix //(127.0.0.1|localhost)/ ]] && compset -P '//(127.0.0.1|localhost)'
[[ -prefix /// ]] && compset -P // [[ -prefix /// ]] && compset -P //
if ! compset -P // if ! compset -P //
then then
_tags -C file files _tags -C file files
while _tags while _tags
do do
while _next_label files expl 'local file' while _next_label files expl 'local file'
do do
if [[ -prefix / ]] if [[ -prefix / ]]
then then
_path_files "$expl[@]" -S '' "${glob[@]}" && ret=0 _path_files "$expl[@]" -S '' "${glob[@]}" && ret=0
_path_files "$expl[@]" -S/ -r '/' -/ && ret=0 _path_files "$expl[@]" -S/ -r '/' -/ && ret=0
elif [[ -z "$PREFIX" ]] elif [[ -z "$PREFIX" ]]
then then
compadd -S '/' -r '/' "$expl[@]" "$@" - "${PWD%/}" && ret=0 compadd -S '/' -r '/' "$expl[@]" "$@" - "${PWD%/}" && ret=0
fi fi
done done
(( ret )) || return 0 (( ret )) || return 0
done done
return 1 return 1
fi ;; fi ;;
esac esac
if ! compset -P '(#b)([^:/]#)([:/])' if ! compset -P '(#b)([^:/]#)([:/])'
then then
@ -153,10 +153,10 @@ _chromium_proxyurls () {
do do
while _next_label hosts expl host while _next_label hosts expl host
do do
compset -S '[:/]*' || suf="/" compset -S '[:/]*' || suf="/"
(( $#uhosts )) || _hosts -S "$suf" -r '/:' "$expl[@]" && ret=0 (( $#uhosts )) || _hosts -S "$suf" -r '/:' "$expl[@]" && ret=0
[[ "$scheme" = http ]] && uhosts=($uhosts $localhttp_servername) [[ "$scheme" = http ]] && uhosts=($uhosts $localhttp_servername)
compadd -S "$suf" -r '/:' "$expl[@]" -a uhosts && ret=0 compadd -S "$suf" -r '/:' "$expl[@]" -a uhosts && ret=0
done done
(( ret )) || return 0 (( ret )) || return 0
done done
@ -171,28 +171,28 @@ _chromium_proxyurls () {
then then
if ! compset -P '(#b)([^/]#)/' if ! compset -P '(#b)([^/]#)/'
then then
_users -S/ "$@" _users -S/ "$@"
return return
fi fi
user="$match[1]" user="$match[1]"
while _tags while _tags
do do
while _next_label files expl 'local file' while _next_label files expl 'local file'
do do
_path_files "$expl[@]" "$@" -W ~$user/$localhttp_userdir "${glob[@]}" && ret=0 _path_files "$expl[@]" "$@" -W ~$user/$localhttp_userdir "${glob[@]}" && ret=0
_path_files -S/ -r '/' "$expl[@]" -W ~$user/$localhttp_userdir-/ && ret=0 _path_files -S/ -r '/' "$expl[@]" -W ~$user/$localhttp_userdir-/ && ret=0
done done
(( ret )) || return 0 (( ret )) || return 0
done done
else else
while _tags while _tags
do do
while _next_label files expl 'local file' while _next_label files expl 'local file'
do do
_path_files "$expl[@]" "$@" -W $localhttp_documentroot "${glob[@]}" && ret=0 _path_files "$expl[@]" "$@" -W $localhttp_documentroot "${glob[@]}" && ret=0
_path_files -S/ -r '/' "$expl[@]" -W $localhttp_documentroot -/ && ret=0 _path_files -S/ -r '/' "$expl[@]" -W $localhttp_documentroot -/ && ret=0
done done
(( ret )) || return 0 (( ret )) || return 0
done done
fi fi
else else
@ -200,8 +200,8 @@ _chromium_proxyurls () {
do do
(( $#urls )) && while _next_label files expl 'local file' (( $#urls )) && while _next_label files expl 'local file'
do do
_path_files "$expl[@]" "$@" -W $urls/$scheme/$host "${glob[@]}" && ret=0 _path_files "$expl[@]" "$@" -W $urls/$scheme/$host "${glob[@]}" && ret=0
_path_files -S/ -r '/' "$expl[@]" -W $urls/$scheme/$host -/ && ret=0 _path_files -S/ -r '/' "$expl[@]" -W $urls/$scheme/$host -/ && ret=0
done done
[[ $scheme = (scp|sftp) ]] && _requested remote-files && _remote_files -h $host -- ssh && ret=0 [[ $scheme = (scp|sftp) ]] && _requested remote-files && _remote_files -h $host -- ssh && ret=0
(( ret )) || return 0 (( ret )) || return 0

View File

@ -28,7 +28,7 @@
# Description # Description
# ----------- # -----------
# #
# Completion script for CMake 3.31.0 (https://cmake.org). # Completion script for CMake 4.3.0 (https://cmake.org).
# #
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Authors # Authors
@ -51,8 +51,6 @@
# #
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
local context state line curcontext="$curcontext" cmake_args
local -a cmake_build_options=( local -a cmake_build_options=(
'-S[Explicitly specify a source directory]:source directory:_path_files -/' '-S[Explicitly specify a source directory]:source directory:_path_files -/'
'-B[Explicitly specify a build directory]:build directory:_path_files -/' '-B[Explicitly specify a build directory]:build directory:_path_files -/'
@ -64,6 +62,7 @@ local -a cmake_build_options=(
'-A[Specify platform name if supported by generator]:platform name' '-A[Specify platform name if supported by generator]:platform name'
'--toolchain[Specify toolchain file]: :_files' '--toolchain[Specify toolchain file]: :_files'
'--install-prefix[Specify install directory]: :_path_files -/' '--install-prefix[Specify install directory]: :_path_files -/'
'--project-file[Specify an alternate project file name]:name'
# Warnings # Warnings
'(-Wdev)-Wno-dev[Suppress/Enable developer warnings]' '(-Wdev)-Wno-dev[Suppress/Enable developer warnings]'
@ -79,12 +78,12 @@ local -a cmake_build_options=(
'--list-presets[List available presets]' '--list-presets[List available presets]'
'--workflow[Run a workflow preset]' '--workflow[Run a workflow preset]'
'-E[CMake command mode]:command:_cmake_command_help' '-E[CMake command mode]:command:_cmake_commands'
'-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]"' '-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]' '--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 -/' '--install[Install a CMake-generated project binary tree]:project directory:_path_files -/'
'--open[Open generated project in the associated application]:project directory:_path_files -/' '--open[Open generated project in the associated application]:project directory:_path_files -/'
@ -117,6 +116,7 @@ local -a cmake_build_options=(
'--warn-unused-vars[Warn about unused variables]' '--warn-unused-vars[Warn about unused variables]'
'--check-system-vars[Find problems with variable usage in system files]' '--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]' '--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-format[Output data for profiling CMake scripts]:profiling format:(google-trace)'
'--profiling-output[Select an output path for the profiling data]:filename:_files' '--profiling-output[Select an output path for the profiling data]:filename:_files'
@ -149,11 +149,11 @@ _cmake_generator_options() {
# -------------- # --------------
(( $+functions[_cmake_presets] )) || (( $+functions[_cmake_presets] )) ||
_cmake_presets() { _cmake_presets() {
local invoke; invoke=(${(Q)words}) local invoke=(${(Q)words})
invoke[$CURRENT]=() invoke[$CURRENT]=()
# TODO: remove all arguments -* except -S # TODO: remove all arguments -* except -S
local list_presets; list_presets=(${(f)"$(${invoke} --list-presets 2>/dev/null | local list_presets=(${(f)"$(${invoke} --list-presets 2>/dev/null |
sed -n -e 's,^[[:space:]]*"\([^"]*\)"[[:space:]]*-[[:space:]]*\(.*\),\1:\2,p' \ sed -n -e 's,^[[:space:]]*"\([^"]*\)"[[:space:]]*-[[:space:]]*\(.*\),\1:\2,p' \
-e 's,^[[:space:]]*"\([^"]*\)"[[:space:]]*$,\1,p')"}) -e 's,^[[:space:]]*"\([^"]*\)"[[:space:]]*$,\1,p')"})
@ -165,24 +165,16 @@ _cmake_presets() {
# -------------- # --------------
(( $+functions[_cmake_targets] )) || (( $+functions[_cmake_targets] )) ||
_cmake_targets() { _cmake_targets() {
local -a targets local dir="$1"
if [ -f $1/Makefile ] local -a targets=()
then if [[ -f "${dir}/Makefile" && $+commands[make] ]]; then
# `make help` doesn't work for Makefiles in general, but for CMake generated Makefiles it does. # `make help` doesn't work for Makefiles in general, but for CMake generated Makefiles it does.
i=1 targets=(${(f)"$(make -f $dir/Makefile help 2>/dev/null | awk '/^\.\.\./ { print $2 }')"})
for target in $(make -f $1/Makefile help | \grep -e "\.\.\." | sed "s/\.\.\. //" | sed "s/ (the default.*//") ; do elif [[ -f "${dir}/build.ninja" && $+commands[ninja] ]]; then
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 # `ninja help` doesn't seem to be the list of targets we're interested in
i=1 targets=(${(f)"$(ninja -C $dir -t targets all 2>/dev/null | awk -F: '{print $1}' )"})
for target in $(ninja -C $1 -t targets all 2&>/dev/null | awk -F: '{print $1}') ; do
targets[$i]="$target"
(( i++ ))
done
fi fi
_describe 'build targets' targets _describe 'build targets' targets
} }
@ -195,60 +187,69 @@ _cmake_suggest_installdirs() {
} }
_cmake_on_build() { _cmake_on_build() {
local build_extras;build_extras=( local build_extras=(
'--[Native build tool options]' '--[Native build tool options]'
'--target[specify build target]' '--target[specify build target]'
'--clean-first[build target clean first]' '--clean-first[build target clean first]'
'--config[For multi-configuration tools]' '--config[For multi-configuration tools]'
'--parallel[maximum number of build processes]' '--parallel[maximum number of build processes]'
'--use-stderr') '--use-stderr'
)
local -a undescribed_build_extras local -a undescribed_build_extras
i=1 local i=1
for be in $build_extras ; do for be in $build_extras ; do
undescribed_build_extras[$i]=$(echo $be | sed "s/\[.*//") undescribed_build_extras[$i]=$(echo $be | sed "s/\[.*//")
(( i++ )) (( i++ ))
done done
inbuild=false
dashdashposition=-1 local in_build=false
local dash_dash_position=-1
local build_at=$CURRENT
for ((i = (($CURRENT - 1)); i > 1 ; i--)); do for ((i = (($CURRENT - 1)); i > 1 ; i--)); do
if [[ $words[$i] == --build ]] ; then if [[ $words[$i] == --build ]]; then
inbuild=true in_build=true
buildat=$i build_at=$i
(( difference = $CURRENT - $i )) (( difference = $CURRENT - $i ))
elif [[ $words[$i] == -- ]] ; then elif [[ $words[$i] == -- ]]; then
dashdashposition=$i dash_dash_position=$i
fi fi
done done
# check if build mode has been left # check if build mode has been left
outofbuild=false local out_of_build=false
for ((i = (($CURRENT - 1)); i > (($buildat + 1)); i--)); do for ((i = (($CURRENT - 1)); i > (($build_at + 1)); i--)); do
# don't check the word after --build (should be a directory) # don't check the word after --build (should be a directory)
if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]] ; then continue ; fi if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]]; then
if [[ $words[(($i - 1))] == --target ]] ; then continue ; fi continue
if [[ $words[(($i - 1))] == --config ]] ; then continue ; fi 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 if [[ $words[(($i - 1))] == --parallel ]] ; then continue ; fi
outofbuild=true out_of_build=true
done done
if (( $dashdashposition > 0 )) ; then
_cmake_generator_options $words[(($buildat + 1))] $dashdashposition && return 0 if (( $dash_dash_position > 0 )) ; then
_cmake_generator_options $words[(($build_at + 1))] $dash_dash_position && return 0
fi fi
if [[ "$inbuild" == false || "$difference" -eq 1 ]] ; then
if [[ "$in_build" == false || "$difference" -eq 1 ]] ; then
# either there is no --build or completing the directory after --build # either there is no --build or completing the directory after --build
_arguments -C -s \ _arguments -s \
- build_opts \ - build_opts \
"$cmake_build_options[@]" \ "$cmake_build_options[@]" \
- build_cmds \ - build_cmds \
"$cmake_suggest_build[@]" && return 0 "$cmake_suggest_build[@]" && return 0
elif [[ $words[(($CURRENT - 1))] == --target ]] ; then elif [[ $words[(($CURRENT - 1))] == --target ]] ; then
# after --build <dir> --target, suggest targets # after --build <dir> --target, suggest targets
_cmake_targets $words[(($buildat + 1))] && return 0 _cmake_targets $words[(($build_at + 1))] && return 0
elif [[ $words[(($CURRENT - 1))] == --config ]] ; then elif [[ $words[(($CURRENT - 1))] == --config ]] ; then
# after --build <dir> --config, no idea # after --build <dir> --config, no idea
return 0 return 0
elif [[ $words[(($CURRENT - 1))] == --parallel ]] ; then elif [[ $words[(($CURRENT - 1))] == --parallel ]] ; then
# after --build <dir> --parallel # after --build <dir> --parallel
return 0 return 0
elif [ "$outofbuild" = true ] ; then elif [ "$out_of_build" = true ] ; then
# after --build <dir> --<not a --build option>, suggest other cmake_build_options (like -Wno-dev) # after --build <dir> --<not a --build option>, suggest other cmake_build_options (like -Wno-dev)
_arguments "$cmake_build_options[@]" && return 0 _arguments "$cmake_build_options[@]" && return 0
else else
@ -258,45 +259,51 @@ _cmake_on_build() {
} }
_cmake_on_install() { _cmake_on_install() {
local build_extras;build_extras=( local build_extras=(
'--[Native build tool options]' '--[Native build tool options]'
'--prefix[Override the installation prefix, CMAKE_INSTALL_PREFIX]' '--prefix[Override the installation prefix, CMAKE_INSTALL_PREFIX]'
'--config[For multi-configuration generators(e.g. Visual Studio)]' '--config[For multi-configuration generators(e.g. Visual Studio)]'
'--component[Component-based install]' '--component[Component-based install]'
'--strip[Strip before installing.]' '--strip[Strip before installing.]'
) )
local -a undescribed_build_extras local -a undescribed_build_extras
i=1 local i=1
for be in $build_extras ; do for be in $build_extras ; do
undescribed_build_extras[$i]=$(echo $be | sed "s/\[.*//") undescribed_build_extras[$i]=$(echo $be | sed "s/\[.*//")
(( i++ )) (( i++ ))
done done
inbuild=false
dashdashposition=-1 local in_build=false
local dash_dash_position=-1
local build_at=$CURRENT
for ((i = (($CURRENT - 1)); i > 1 ; i--)); do for ((i = (($CURRENT - 1)); i > 1 ; i--)); do
if [[ $words[$i] == --install ]] ; then if [[ $words[$i] == --install ]]; then
inbuild=true in_build=true
buildat=$i build_at=$i
(( difference = $CURRENT - $i )) (( difference = $CURRENT - $i ))
elif [[ $words[$i] == -- ]] ; then elif [[ $words[$i] == -- ]]; then
dashdashposition=$i dash_dash_position=$i
fi fi
done done
outofbuild=false
for ((i = (($CURRENT - 1)); i > (($buildat + 1)); i--)); do local out_of_build=false
for ((i = (($CURRENT - 1)); i > (($build_at + 1)); i--)); do
# don't check the word after --install (should be a directory) # don't check the word after --install (should be a directory)
if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]] ; then continue ; fi if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]] ; then continue ; fi
if [[ $words[(($i - 1))] == --prefix ]] ; then continue ; fi if [[ $words[(($i - 1))] == --prefix ]]; then continue ; fi
if [[ $words[(($i - 1))] == --config ]] ; then continue ; fi if [[ $words[(($i - 1))] == --config ]]; then continue ; fi
if [[ $words[(($i - 1))] == --component ]] ; then continue ; fi if [[ $words[(($i - 1))] == --component ]]; then continue ; fi
outofbuild=true out_of_build=true
done done
if (( $dashdashposition > 0 )) ; then
_cmake_generator_options $words[(($buildat + 1))] $dashdashposition && return 0 if (( $dash_dash_position > 0 )) ; then
_cmake_generator_options $words[(($build_at + 1))] $dash_dash_position && return 0
fi fi
if [[ "$inbuild" == false || "$difference" -eq 1 ]] ; then
if [[ "$in_build" == false || "$difference" -eq 1 ]] ; then
# either there is no --install or completing the directory after --install # either there is no --install or completing the directory after --install
_arguments -C -s \ _arguments -s \
- build_opts \ - build_opts \
"$cmake_build_options[@]" \ "$cmake_build_options[@]" \
- build_cmds \ - build_cmds \
@ -310,7 +317,7 @@ _cmake_on_install() {
elif [[ $words[(($CURRENT - 1))] == --component ]] ; then elif [[ $words[(($CURRENT - 1))] == --component ]] ; then
# after --build <dir> --component, no idea # after --build <dir> --component, no idea
return 0 return 0
elif [ "$outofbuild" = true ] ; then elif [ "$out_of_build" = true ] ; then
# after --build <dir> --<not a --build option>, suggest other cmake_build_options (like -Wno-dev) # after --build <dir> --<not a --build option>, suggest other cmake_build_options (like -Wno-dev)
_arguments "$cmake_build_options[@]" && return 0 _arguments "$cmake_build_options[@]" && return 0
else else
@ -341,19 +348,16 @@ local -a cmake_help_actions=(
'(- 1)--help-variable-list[List variables with help available and exit]' '(- 1)--help-variable-list[List variables with help available and exit]'
'(- 1)--help-variables[Print cmake-variables manual and exit]' '(- 1)--help-variables[Print cmake-variables manual and exit]'
) )
_cmake_help() {
_arguments -C -s - help "$cmake_help_actions[@]"
}
# ----------------- # -----------------
# _cmake_list_names # _cmake_list_names
# ----------------- # -----------------
(( $+functions[_cmake_list_names] )) || (( $+functions[_cmake_list_names] )) ||
_cmake_list_names() { _cmake_list_names() {
local command; command="$@[1]" local command="$@[1]"
local desc; desc="$@[2]" local desc="$@[2]"
local opts; opts=($@[3]) local opts=($@[3])
local list_names; list_names=(${(f)"$($service $command 2> /dev/null)"}) local list_names=(${(f)"$($service $command 2> /dev/null)"})
# Older CMake (< 3.0) writes out the version # Older CMake (< 3.0) writes out the version
list_names=(${^list_names##cmake version*}) list_names=(${^list_names##cmake version*})
@ -382,7 +386,7 @@ _cmake_define_property() {
# ---------------------------- # ----------------------------
(( $+functions[_cmake_define_property_names] )) || (( $+functions[_cmake_define_property_names] )) ||
_cmake_define_property_names() { _cmake_define_property_names() {
local alternatives; alternatives=( local alternatives=(
'common-property-names:common property name:_cmake_define_common_property_names -qS=' 'common-property-names:common property name:_cmake_define_common_property_names -qS='
) )
local -A cmake_langs local -A cmake_langs
@ -402,8 +406,9 @@ _cmake_define_property_names() {
# --------------------------------- # ---------------------------------
(( $+functions[_cmake_define_lang_property_names] )) || (( $+functions[_cmake_define_lang_property_names] )) ||
_cmake_define_lang_property_names() { _cmake_define_lang_property_names() {
local cmake_lang="$@[-2]" cmake_lang_desc="$@[-1]" local cmake_lang="$@[-2]"
local properties; properties=( local cmake_lang_desc="$@[-1]"
local -a properties=(
"CMAKE_${cmake_lang}_COMPILER:${cmake_lang_desc} compiler" "CMAKE_${cmake_lang}_COMPILER:${cmake_lang_desc} compiler"
"CMAKE_${cmake_lang}_COMPILER_LAUNCHER:${cmake_lang_desc} compiler launcher (e.g. ccache)" "CMAKE_${cmake_lang}_COMPILER_LAUNCHER:${cmake_lang_desc} compiler launcher (e.g. ccache)"
"CMAKE_${cmake_lang}_FLAGS:${cmake_lang_desc} compiler flags for all builds" "CMAKE_${cmake_lang}_FLAGS:${cmake_lang_desc} compiler flags for all builds"
@ -424,7 +429,7 @@ _cmake_define_lang_property_names() {
# ----------------------------------- # -----------------------------------
(( $+functions[_cmake_define_common_property_names] )) || (( $+functions[_cmake_define_common_property_names] )) ||
_cmake_define_common_property_names() { _cmake_define_common_property_names() {
local properties; properties=( local -a properties=(
'CMAKE_MODULE_PATH:Search path for CMake modules (FindPROJECT.cmake)' 'CMAKE_MODULE_PATH:Search path for CMake modules (FindPROJECT.cmake)'
'CMAKE_PREFIX_PATH:Search path for installations (PROJECTConfig.cmake)' 'CMAKE_PREFIX_PATH:Search path for installations (PROJECTConfig.cmake)'
'CMAKE_BUILD_TYPE:Specifies the build type for make based generators' 'CMAKE_BUILD_TYPE:Specifies the build type for make based generators'
@ -438,51 +443,87 @@ _cmake_define_common_property_names() {
'CMAKE_UNITY_BUILD:Batch include source files' '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 # _cmake_define_property_values
# ---------------------------- # ----------------------------
(( $+functions[_cmake_define_property_values] )) || (( $+functions[_cmake_define_property_values] )) ||
_cmake_define_property_values() { _cmake_define_property_values() {
local ret=1 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 setopt localoptions extendedglob
case $@[-1] in case $@[-1] in
(CMAKE_BUILD_TYPE) _wanted build-types expl 'build type' _values 'build type' ${_cmake_build_types[@]} && ret=0;; (CMAKE_BUILD_TYPE)
(BUILD_SHARED_LIBS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; _wanted build-types expl 'build type' _values 'build type' ${build_types[@]} && ret=0
(CMAKE_CXX_STANDARD) _wanted cxx-standards expl 'cxx standard' _values 'cxx standard' ${_cmake_cxx_standards[@]} && ret=0;; ;;
(CMAKE_C_STANDARD) _wanted c-standards expl 'c standard' _values 'c standard' ${_cmake_c_standards[@]} && ret=0;; (BUILD_SHARED_LIBS)
(CMAKE_TOOLCHAIN_FILE) _wanted toolchain-files expl 'file' _cmake_toolchain_files && ret=0;; _wanted booleans expl 'boolean' _cmake_booleans && 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_CXX_STANDARD)
(CMAKE_VERBOSE_MAKEFILE) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; _wanted cxx-standards expl 'cxx standard' _values 'cxx standard' ${cxx_standards[@]} && ret=0
(CMAKE_UNITY_BUILD) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; ;;
(CMAKE_INSTALL_PREFIX) _files -/ && ret=0;; (CMAKE_C_STANDARD)
(CMAKE_EXPORT_COMPILE_COMMANDS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; _wanted c-standards expl 'c standard' _values 'c standard' ${c_standards[@]} && 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_TOOLCHAIN_FILE)
(CMAKE_*_FLAGS(|_?*)) _message -e compiler-flags 'compiler flags' && _dispatch $service -value-,CPPFLAGS,-default- && ret=0;; _wanted toolchain-files expl 'file' _cmake_toolchain_files && ret=0
(CMAKE_*_STANDARD_REQUIRED) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; ;;
(CMAKE_*_EXTENSIONS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; (CMAKE_COLOR_MAKEFILE)
(*) _files && ret=0;; _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 esac
return ret return ret
} }
local -a _cmake_generator_list=(${(f)"$(cmake --help | awk '/^Generators/{flag=1} flag && /^[* ] [^ ]/ {sub(/^[* ] /, ""); sub(/=.*$/, ""); sub(/\[arch\]/, ""); sub(/ *$/, ""); print}')"})
# ----------------- # -----------------
# _cmake_generators # _cmake_generators
# ----------------- # -----------------
(( $+functions[_cmake_generators] )) || (( $+functions[_cmake_generators] )) ||
_cmake_generators() { _cmake_generators() {
_describe -t generators 'generator' _cmake_generator_list local -a generators=(
${(f)"$(cmake --help | awk '/^Generators/{flag=1} flag && /^[* ] [^ ]/ {sub(/^[* ] /, ""); sub(/=.*$/, ""); sub(/\[arch\]/, ""); sub(/ *$/, ""); print}')"}
)
_describe -t generators 'generator' generators
} }
# ---------------------- # ----------------------
@ -519,75 +560,74 @@ _cmake_launchers() {
_command_names -e _command_names -e
} }
local -a _cmake_commands=( (( $+functions[_cmake_commands] )) ||
'capabilities:Report capabilities built into cmake in JSON format' \ _cmake_commands() {
'cat:concat the files and print them to the standard output' \ local -a commands=(
'chdir:run command in a given directory' \ 'capabilities:Report capabilities built into cmake in JSON format'
'compare_files:check if file1 is same as file2' \ 'cat:concat the files and print them to the standard output'
'copy:copy files to destination (either file or directory)' \ 'chdir:run command in a given directory'
'copy_directory:copy content of <dir>... directories to destination directory' \ 'compare_files:check if file1 is same as file2'
'copy_if_different:copy files if it has changed' \ 'copy:copy files to destination (either file or directory)'
'echo:displays arguments as text' \ 'copy_directory:copy content of <dir>... directories to destination directory'
'echo_append:displays arguments as text but no new line' \ 'copy_if_different:copy files if it has changed'
'env:run command in a modified environment' \ 'echo:displays arguments as text'
'environment:display the current environment' \ 'echo_append:displays arguments as text but no new line'
'make_directory:create parent and <dir> directories' \ 'env:run command in a modified environment'
'md5sum:create MD5 checksum of files' \ 'environment:display the current environment'
'sha1sum:create SHA1 checksum of files' \ 'make_directory:create parent and <dir> directories'
'sha224sum:create SHA224 checksum of files' \ 'md5sum:create MD5 checksum of files'
'sha256sum:create SHA256 checksum of files' \ 'sha1sum:create SHA1 checksum of files'
'sha384sum:create SHA384 checksum of files' \ 'sha224sum:create SHA224 checksum of files'
'sha512sum:create SHA512 checksum of files' \ 'sha256sum:create SHA256 checksum of files'
'remove:remove the file(s), use -f to force it' \ 'sha384sum:create SHA384 checksum of files'
'remove_directory:remove directories and their contents' \ 'sha512sum:create SHA512 checksum of files'
'rename:rename a file or directory (on one volume)' \ 'remove:remove the file(s), use -f to force it'
'rm:remove files or directories' \ 'remove_directory:remove directories and their contents'
'server:start cmake in server mode' \ 'rename:rename a file or directory (on one volume)'
'sleep:sleep for given number of seconds' \ 'rm:remove files or directories'
'tar:create or extract a tar or zip archive' \ 'server:start cmake in server mode'
'time:run command and display elapsed time' \ 'sleep:sleep for given number of seconds'
'touch:touch a <file>' \ 'tar:create or extract a tar or zip archive'
'touch_nocreate:touch a <file> but do not create it' \ 'time:run command and display elapsed time'
'create_symlink:create a symbolic link new -> old' \ 'touch:touch a <file>'
'create_hardlink:create a hard link new -> old' \ 'touch_nocreate:touch a <file> but do not create it'
'true:do nothing with an exit code of 0' \ 'create_symlink:create a symbolic link new -> old'
'false:do nothing with an exit code of 1' 'create_hardlink:create a hard link new -> old'
) 'true:do nothing with an exit code of 0'
_cmake_command() { 'false:do nothing with an exit code of 1'
_arguments -C \ )
'-E[CMake command mode]:command:(("${_cmake_commands[@]}"))'
_describe -t commands 'command' commands
} }
local cmake_suggest_build;cmake_suggest_build=(
'--build[build]:build dir:_cmake_suggest_builddirs' local -a cmake_suggest_build=(
'--build[build]:build dir:_cmake_suggest_builddirs'
) )
local cmake_suggest_install;cmake_suggest_install=( local -a cmake_suggest_install=(
'--install[install]:install dir:_cmake_suggest_installdirs' '--install[install]:install dir:_cmake_suggest_installdirs'
) )
if [[ "$service" = -value-*CMAKE_GENERATOR* ]]; then if [[ "$service" = -value-*CMAKE_GENERATOR* ]]; then
_cmake_generators _cmake_generators
elif [ $CURRENT -eq 2 ] ; then elif [ $CURRENT -eq 2 ] ; then
_arguments -C -s \ _arguments -s \
- help \ - help \
"$cmake_help_actions[@]" \ "$cmake_help_actions[@]" \
- command \ - command \
'-E[CMake command mode]:command:( )' \ '-E[CMake command mode]:command:_cmake_commands' \
- build_opts \ - build_opts \
"$cmake_build_options[@]" \ "$cmake_build_options[@]" \
- build_cmds \ - build_cmds \
"$cmake_suggest_build[@]" \ "$cmake_suggest_build[@]" \
- install_cmds \ - install_cmds \
"$cmake_suggest_install[@]" && return 0 "$cmake_suggest_install[@]" && return 0
elif [[ $words[2] = --help* ]] ; then
_cmake_help
elif [[ $words[2] == --build ]] ; then elif [[ $words[2] == --build ]] ; then
_cmake_on_build _cmake_on_build
elif [[ $words[2] == --install ]] ; then elif [[ $words[2] == --install ]] ; then
_cmake_on_install _cmake_on_install
elif [[ $words[2] == -E ]]; then elif [[ $words[2] == --help-* ]] ; then
_cmake_command _arguments "$cmake_help_actions[@]"
else else
_arguments "$cmake_build_options[@]" _arguments "$cmake_build_options[@]"
fi fi

View File

@ -47,7 +47,7 @@ _arguments -s -S \
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \ '(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
'(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \ '(-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' \ '(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
'(- *)'{-h,--help}'[display this help message]' \ '(- *)'{-h,--help}'[display help message]' \
'(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \ '(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
'(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]: :_files -g "*.coffee"' \ '(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]: :_files -g "*.coffee"' \
'(-l --literate)'{-l,--literate}'[treat stdio as literate style coffeescript]' \ '(-l --literate)'{-l,--literate}'[treat stdio as literate style coffeescript]' \

View File

@ -151,9 +151,9 @@ _conan_cache() {
local ret=1 local ret=1
_arguments -C \ _arguments -C \
'(- *)'{-h,--help}'[show help message and exit]' \ '(- *)'{-h,--help}'[show help message and exit]' \
'1: :(clean path)' \ '1: :(clean path)' \
'*:: :->args' '*:: :->args'
case $state in case $state in
(args) (args)

156
src/_cpack Normal file
View File

@ -0,0 +1,156 @@
#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 Normal file
View File

@ -0,0 +1,103 @@
#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 Normal file
View File

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

View File

@ -78,7 +78,7 @@ _cppcheck() {
"(-f --force)"{-f,--force}"[Force checking of all configurations in files]" \ "(-f --force)"{-f,--force}"[Force checking of all configurations in files]" \
"(--fsigned-char --funsigned-char)--fsigned-char[Treat char type as signed]" \ "(--fsigned-char --funsigned-char)--fsigned-char[Treat char type as signed]" \
"(--fsigned-char --funsigned-char)--funsigned-char[Treat char type as unsigned]" \ "(--fsigned-char --funsigned-char)--funsigned-char[Treat char type as unsigned]" \
"(- 1 *)"{-h,--help}"[Print this help]" \ "(- 1 *)"{-h,--help}"[Print help]" \
"-I[A file that contains a list of config-excludes]:directory:_files -/" \ "-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-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" \ "--include=[Force inclusion of a file before the checked file]:file:_files" \

179
src/_ctest Normal file
View File

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

View File

@ -48,7 +48,7 @@ _arguments \
'--waitip=[Wait for an address to assigned before forking to the background]: :(4 6)' \ '--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' \ \*{-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' \ '(-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: # Local Variables:
# mode: Shell-Script # mode: Shell-Script

View File

@ -49,7 +49,7 @@ _direnv_commands() {
'exec:Executes a command after loading the first .envrc or .env found in DIR' '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' 'export:Loads an .envrc or .env and prints the diff in terms of exports'
"fetchurl:Fetches a given URL into direnv's CAS" "fetchurl:Fetches a given URL into direnv's CAS"
'help:shows this help' 'help:shows help'
'hook:Used to setup the shell hook' 'hook:Used to setup the shell hook'
'prune:removes old allowed files' 'prune:removes old allowed files'
'reload:triggers an env reload' 'reload:triggers an env reload'

View File

@ -35,7 +35,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_arguments \ _arguments \
'(- *)'{-h,--help}'[Show this help message and exit]' \ '(- *)'{-h,--help}'[Show help message and exit]' \
'(- *)'{-v,--version}'[Show version and exit]' \ '(- *)'{-v,--version}'[Show version and exit]' \
'(-d --devel-release)'{-d,--devel-release}'[Upgrade to the development release]' \ '(-d --devel-release)'{-d,--devel-release}'[Upgrade to the development release]' \
'--data-dir=[Directory that contains the data files]:dir:_files -/' \ '--data-dir=[Directory that contains the data files]:dir:_files -/' \

99
src/_elixir Normal file
View File

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

View File

@ -40,7 +40,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
local -a args=( local -a args=(
'(-h --help)'{-h+,--help}'[show this help message and exit]' '(-h --help)'{-h+,--help}'[show help message and exit]'
'(-)'--version'[display version information and exit]' '(-)'--version'[display version information and exit]'
'(-)1:directory: _path_files -/' '(-)1:directory: _path_files -/'
'(-)2:command: _command_names -e' '(-)2:command: _command_names -e'

View File

@ -28,9 +28,7 @@
# Description # Description
# ----------- # -----------
# #
# Completion script for Fabric (https://www.fabfile.org/) # Completion script for Fabric v3.2.2 (https://www.fabfile.org/)
#
# Source: https://github.com/vhbit/fabric-zsh-autocomplete
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
@ -40,65 +38,42 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_fab_tasks() {
local curcontext=$curcontext state line local -a tasks=(${(f)"$(fab --list 2>/dev/null| awk '/^ /{first=$1;$1="";print first ":" substr($0, 2) }')"})
declare -A opt_args if (( $#tasks > 0)); then
_describe -t 'task' tasks tasks
declare target_list fi
target_list=(`fab --shortlist 2>/dev/null`)
_targets() {
_describe -t commands "fabric targets" target_list
} }
output_levels=( _arguments \
'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.' '--complete[Print tab-completion candidates for given parse remainder]' \
'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 wont be any output about why Fabric aborted!' "--hide=[Set default value of run()'s 'hide' kwarg]:str" \
'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.' '(- *)--list-agent-keys[Display ssh-agent key list, and exit]' \
'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''.' '--no-dedupe[Disable task deduplication]' \
'stdout: Local, or remote, stdout, i.e. non-error output from commands.' '--print-completion-script=[Print the tab-completion script for your preferred shell]:shell:(bash zsh fish)' \
'stderr: Local, or remote, stderr, i.e. error-related output from commands.' '--prompt-for-login-password[Request an upfront SSH-auth password prompt]' \
'user: User-generated output, i.e. local output printed by fabfile code via use of the fastprint or puts functions.' '--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]' \
_arguments -w -S -C \ '(-c --collection)'{-c,--collection=}'[Specify collection name to load]:name' \
'(-)'{-h,--help}'[show this help message and exit]: :->noargs' \ '(-d --debug)'{-d,--debug}'[Enable debug output]' \
'(-)'{-V,--version}'[show program'\''s version number and exit]: :->noargs' \ '(-D --list-depth)'{-D,--list-depth=}'[When listing tasks, only show the first INT levels]:level' \
'(-)--list[print list of possible commands and exit]: :->noargs' \ '(-e --echo)'{-e,--echo}'[Echo executed commands before running]' \
'(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \ '(-f --config)'{-f,--config=}'[Runtime configuration file to use]:file:_files' \
'(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \ '(-F --list-format)'{-F,--list-format=}'[Change the display format used when listing tasks]:format:(flat nested json)' \
'(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \ '(- *)'{-h,--help=-}'[Show core or per-task help and exit]::task:_fab_tasks' \
"(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \ '(-H --hosts)'{-H,--hosts=}'[Comma-separated host name(s) to execute tasks against]:host' \
'(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \ \*{-i,--identity=}'[Path to runtime SSH identity (key) file]:file:_files' \
'(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \ '(-l --list)'{-l,--list=-}'[List available tasks, optionally limited to a namespace]::namespace' \
'(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \ '(-p --pty)'{-p,--pty}'[Use a pty when executing shell commands]' \
'(-p+ --password=-)'{-p+,--password=-}'[password for use with authentication and/or sudo]: :' \ '(-r --search-root)'{-r,--search-root=}'[Change root directory used for finding task modules]:dir:_files -/' \
'(-H+ --hosts=-)'{-H+,--hosts=-}'[comma separated list of hosts to operate on]: :' \ '(-R --dry)'{-R,--dry}'[Echo commands instead of running]' \
'(-R+ --roles=-)'{-R+,--roles=-}'[comma separated list of roles to operate on]: :' \ '(-S --ssh-config)'{-S,--ssh-config=}'[Path to runtime SSH config file]:file:_files' \
'(-a --no-agent)'{-a,--no-agent}'[don'\''t use the running SSH agent]' \ '(-t --connect-timeout)'{-t,--connect-timeout=}'[Specifies default connection timeout, in seconds]:seconds' \
'(-k --no-keys)'{-k,--no-keys}'[don'\''t load private key files from ~/.ssh/]' \ '(-T --command-timeout)'{-T,--command-timeout=}'[Specify a global command execution timeout, in seconds]:seconds' \
'(-w --warn-only)'{-w,--warn-only}'[warn instead of abort, when commands fail]' \ '(- *)'{-V,--version}'[Show version and exit]' \
'-i+[path to SSH private key file. May be repeated]: :_files' \ '(-w --warn-only)'{-w,--warn-only}'[Warn, instead of failing, when shell commands fail]' \
"(-f+ --fabfile=)"{-f+,--fabfile=}"[Python module file to import]: :_files -g *.py" \ '*::task:_fab_tasks'
'(-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: # Local Variables:
# mode: Shell-Script # mode: Shell-Script

View File

@ -54,7 +54,7 @@ _fail2ban_client() {
'-b[start server in background]' \ '-b[start server in background]' \
'-f[start server in foreground]' \ '-f[start server in foreground]' \
'--str2sec[convert time abbreviation format to seconds]:_message str2sec' \ '--str2sec[convert time abbreviation format to seconds]:_message str2sec' \
'(-h --help)'{-h,--help}'[display this help message]' \ '(-h --help)'{-h,--help}'[display help message]' \
'(-V --version)'{-V,--version}'[print the version]' \ '(-V --version)'{-V,--version}'[print the version]' \
'1:fail2ban command:_fail2ban_client_commands' \ '1:fail2ban command:_fail2ban_client_commands' \
'*:fail2ban command argument:_fail2ban_client_command_arguments' '*:fail2ban command argument:_fail2ban_client_command_arguments'

View File

@ -38,16 +38,16 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_arguments \ _arguments \
'(-c --collapse-range)'{-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)'{-c,--collapse-range}'[Removes a byte range from a file without leaving a hole]' \
'(-d --dig-holes)'{-d,--dig-holes}'[Detect and dig holes]' \ '(-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]' \
'(-i --insert-range)'{-i,--insert-range}'[Insert a hole of length bytes from offset]' \ '(-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' \ '(-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' \ '(-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]' \ '(-v --verbose)'{-v,--verbose}'[Enable verbose mode]' \
'(-x --posix)'{-x,--posix}'[Enable POSIX operation 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]' \ '(- *)'{-h,--help}'[Display help text and exit]' \
'(- *)'{-V,--version}'[Print version and exit]' \ '(- *)'{-V,--version}'[Print version and exit]' \
'*:filename:_files' '*:filename:_files'

65
src/_fish Normal file
View File

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

View File

@ -727,8 +727,8 @@ _flutter_custom_devices() {
_arguments -C \ _arguments -C \
'(- *)'{-h,--help}'[Print this usage information]' \ '(- *)'{-h,--help}'[Print this usage information]' \
'1: :_flutter_custom_devices_subcommands' \ '1: :_flutter_custom_devices_subcommands' \
'*:: :->args' \ '*:: :->args' \
&& ret=0 && ret=0
case $state in case $state in

View File

@ -922,7 +922,7 @@ _ghc_pkg() {
'--expand-env-vars[expand environment variables in input package descriptions]' '--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)--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]' '(--expand-pkgroot --no-expand-pkgroot)--no-expand-pkgroot[preserve pkgroot-relative paths in output package descriptions]'
'(- *)'{-?,--help}'[display this help and exit]' '(- *)'{-?,--help}'[display help and exit]'
'(- *)'{-V,--version}'[output version information and exit]' '(- *)'{-V,--version}'[output version information and exit]'
'--simple-output[print output in easy-to-parse format for some commands]' '--simple-output[print output in easy-to-parse format for some commands]'
'--show-unit-ids[print unit-ids instead of package identifiers]' '--show-unit-ids[print unit-ids instead of package identifiers]'

View File

@ -40,38 +40,43 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1 _gist() {
typeset -A opt_args local ret=1
_arguments -C \ _arguments \
'(--login)--login[Authenticate gist on this computer.]' \ '(--login)--login[Authenticate gist on this computer.]' \
'(-f --filename)'{-f,--filename}'[Sets the filename and syntax type.]:NAME' \ '(-f --filename)'{-f,--filename}'[Sets the filename and syntax type.]:NAME' \
'(-t --type)'{-t,--type}'[Sets the file extension and syntax type.]:EXT' \ '(-t --type)'{-t,--type}'[Sets the file extension and syntax type.]:EXT' \
'(-p --private --no-private)'{-p,--private}'[Makes your gist private.]' \ '(-p --private --no-private)'{-p,--private}'[Makes your gist private.]' \
'(--no-private -p --private)--no-private[Makes your gist no private.]' \ '(--no-private -p --private)--no-private[Makes your gist no private.]' \
'(-d --description)'{-d,--description}'[Adds a description to your gist.]:DESCRIPTION' \ '(-d --description)'{-d,--description}'[Adds a description to your gist.]:DESCRIPTION' \
'(-s --shorten)'{-s,--shorten}'[Shorten the gist URL using git.io.]' \ '(-s --shorten)'{-s,--shorten}'[Shorten the gist URL using git.io.]' \
'(-u --update)'{-u,--update}'[Update an existing gist.]:URL ID:user_gists' \ '(-u --update)'{-u,--update}'[Update an existing gist.]:URL ID:_gist_ids' \
'(-c --copy)'{-c,--copy}'[Copy the resulting URL to the clipboard]' \ '(-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]' \ '(-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]' \ '(-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]' \ '(--no-open -o --open)--no-open[No open the resulting URL in a browser]' \
'(-P --paste)'{-P,--paste}'[Paste from the clipboard to gist]' \ '--skip-empty[Skip gisting empty files]' \
'(-R --raw)'{-R,--raw}'[Display raw URL of the new gist]' \ '(-P --paste)'{-P,--paste}'[Paste from the clipboard to gist]' \
'(-l --list)'{-l,--list}'[List all gists for user ]::user' \ '(-R --raw)'{-R,--raw}'[Display raw URL of the new gist]' \
'(-h --help)'{-h,--help}'[print options help]' \ '(-l --list)'{-l,--list}'[List all gists for user ]::user' \
'(-v --version)'{-v,--version}'[print version]' \ '--delete[Delete a gist]:id:_gist_ids' \
'(-r --read)'{-r,--read}'[Read a gist and print out the contents]:user gists:_gist_read_gists' \ '(- *)'{-h,--help}'[print options help]' \
'*: :_files' && ret=0 '(-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
}
_gist_cache_policy() { _gist_cache_policy() {
# rebuild if cache is more than a day old # rebuild if cache is more than a day old
local -a oldp local -a oldp
oldp=( "$1"(mh+1) ) oldp=( "$1"(m+1) )
(( $#oldp )) (( $#oldp ))
} }
_gist_read_gists() { _gist_ids() {
local update_policy ret=1 local update_policy ret=1
zstyle -s ":completion:${curcontext}:" cache-policy update_policy zstyle -s ":completion:${curcontext}:" cache-policy update_policy
if [[ -z "$update_policy" ]]; then if [[ -z "$update_policy" ]]; then
@ -79,43 +84,33 @@ _gist_read_gists() {
fi fi
# stores the gists of the logged in user in the format ID[Description] # stores the gists of the logged in user in the format ID[Description]
_list=() local -a gist_list
_cached_gists="user_gists"
# retrieve/Write gists from/to cache # retrieve/Write gists from/to cache
if _cache_invalid $_cached_gists || ! _retrieve_cache $_cached_gists; then if _cache_invalid gist_cached_list || ! _retrieve_cache gist_cached_list; then
_gists=$(gist -l) 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 [ $? -eq 0 ]; then if [[ $? -eq 0 ]]; then
_store_cache $_cached_gists _gists _store_cache gist_cached_list gist_list
else else
# some error occurred, the user is probably not logged in # some error occurred, the user is probably not logged in
# set _gists to an empty string so that no completion is attempted # set _gists to an empty string so that no completion is attempted
_gists="" gist_list=()
fi fi
else
_retrieve_cache $_cached_gists
fi fi
if [ -n "$_gists" ]; then if [[ $#gist_list ]]; then
echo "$_gists" | while read -r line; do _describe -t gist_ids 'gist_ids' gist_list
# 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 fi
return ret return ret
} }
return ret _gist "$@"
# Local Variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script

View File

@ -40,397 +40,357 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_git-flow () {
local curcontext="$curcontext" state line
typeset -A opt_args
_git-flow () _arguments -C \
{ ':command:->command' \
local curcontext="$curcontext" state line '*::options:->options'
typeset -A opt_args
_arguments -C \ case $state in
':command:->command' \ (command)
'*::options:->options' 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
;;
case $state in (options)
(command) 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
;;
local -a subcommands esac
subcommands=( ;;
'init:Initialize a new git repo with support for the branching model.' esac
'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 () __git-flow-release () {
{ local curcontext="$curcontext" state line
local curcontext="$curcontext" state line typeset -A opt_args
typeset -A opt_args
_arguments -C \ _arguments -C \
':command:->command' \ ':command:->command' \
'*::options:->options' '*::options:->options'
case $state in case $state in
(command) (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]'
;;
local -a subcommands (options)
subcommands=( case $line[1] in
'start:Start a new release branch.' (start)
'finish:Finish a release branch.' _arguments \
'list:List all your release branches. (Alias to `git flow release`)' -F'[Fetch from origin before performing finish]'\
'publish:Publish this release branch to origin.`)' ':version:__git_flow_version_list'
'track:Track a release branch from origin.`)' ;;
) (finish)
_describe -t commands 'git flow release' subcommands _arguments \
_arguments \ -F'[Fetch from origin before performing finish]' \
-v'[Verbose (more) output]' -s'[Sign the release tag cryptographically]'\
;; -u'[Use the given GPG-key for the digital signature (implies -s)]'\
-m'[Use the given tag message]'\
(options) -n'[Don'\''t tag this release]'\
case $line[1] in -p'[Push to $ORIGIN after performing finish]'\
-k'[Keep branch after performing finish]'\
(start) ':version:__git_flow_version_list'
_arguments \ ;;
-F'[Fetch from origin before performing finish]'\ (publish)
':version:__git_flow_version_list' _arguments \
;; ':version:__git_flow_version_list'
;;
(finish) (track)
_arguments \ _arguments \
-F'[Fetch from origin before performing finish]' \ ':version:__git_flow_version_list'
-s'[Sign the release tag cryptographically]'\ ;;
-u'[Use the given GPG-key for the digital signature (implies -s)]'\ *)
-m'[Use the given tag message]'\ _arguments \
-n'[Don'\''t tag this release]'\ -v'[Verbose (more) output]'
-p'[Push to $ORIGIN after performing finish]'\ ;;
-k'[Keep branch after performing finish]'\ esac
':version:__git_flow_version_list' ;;
;; esac
(publish)
_arguments \
':version:__git_flow_version_list'
;;
(track)
_arguments \
':version:__git_flow_version_list'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
} }
__git-flow-hotfix () __git-flow-hotfix () {
{ local curcontext="$curcontext" state line
local curcontext="$curcontext" state line typeset -A opt_args
typeset -A opt_args
_arguments -C \ _arguments -C \
':command:->command' \ ':command:->command' \
'*::options:->options' '*::options:->options'
case $state in case $state in
(command) (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]'
;;
local -a subcommands (options)
subcommands=( case $line[1] in
'start:Start a new hotfix branch.' (start)
'finish:Finish a hotfix branch.' _arguments \
'list:List all your hotfix branches. (Alias to `git flow hotfix`)' -F'[Fetch from origin before performing finish]'\
'publish:Publish this hotfix branch to origin`)' ':hotfix:__git_flow_version_list'\
) ':branch-name:__git_flow_branch_names'
_describe -t commands 'git flow hotfix' subcommands ;;
_arguments \
-v'[Verbose (more) output]'
;;
(options) (finish)
case $line[1] in _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'
;;
(start) (publish)
_arguments \ _arguments \
-F'[Fetch from origin before performing finish]'\ ':hotfix:__git_flow_hotfix_list'
':hotfix:__git_flow_version_list'\ ;;
':branch-name:__git_branch_names'
;;
(finish) *)
_arguments \ _arguments \
-F'[Fetch from origin before performing finish]' \ -v'[Verbose (more) output]'
-s'[Sign the release tag cryptographically]'\ ;;
-u'[Use the given GPG-key for the digital signature (implies -s)]'\ esac
-m'[Use the given tag message]'\ ;;
-p'[Push to $ORIGIN after performing finish]'\ esac
':hotfix:__git_flow_hotfix_list'
;;
(publish)
_arguments \
':hotfix:__git_flow_hotfix_list'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
} }
__git-flow-feature () __git-flow-feature () {
{ local curcontext="$curcontext" state line
local curcontext="$curcontext" state line typeset -A opt_args
typeset -A opt_args
_arguments -C \ _arguments -C \
':command:->command' \ ':command:->command' \
'*::options:->options' '*::options:->options'
case $state in case $state in
(command) (command)
local -a subcommands
local -a subcommands subcommands=(
subcommands=( 'start:Start a new feature branch.'
'start:Start a new feature branch.' 'finish:Finish a feature branch.'
'finish:Finish a feature branch.' 'list:List all your feature branches. (Alias to `git flow feature`)'
'list:List all your feature branches. (Alias to `git flow feature`)' 'publish:Publish this feature branch to origin.'
'publish:Publish this feature branch to origin.' 'track:Track a feature branch from origin.'
'track:Track a feature branch from origin.' 'diff:Show a diff of changes since this feature branched off.'
'diff:Show a diff of changes since this feature branched off.' 'rebase:Rebase a feature branch on top of develop.'
'rebase:Rebase a feature branch on top of develop.'
'checkout:Check out (switch to) the given feature branch.' 'checkout:Check out (switch to) the given feature branch.'
'pull:Pull a feature branch from a remote peer.' 'pull:Pull a feature branch from a remote peer.'
) )
_describe -t commands 'git flow feature' subcommands _describe -t commands 'git flow feature' subcommands
_arguments \ _arguments \
-v'[Verbose (more) output]' -v'[Verbose (more) output]'
;; ;;
(options) (options)
case $line[1] in case $line[1] in
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':feature:__git_flow_feature_list'\
':branch-name:__git_flow_branch_names'
;;
(start) (finish)
_arguments \ _arguments \
-F'[Fetch from origin before performing finish]'\ -F'[Fetch from origin before performing finish]' \
':feature:__git_flow_feature_list'\ -r'[Finish branch by rebasing first]'\
':branch-name:__git_branch_names' -k'[Keep branch after performing finish]'\
;; -D'[Force delete feature branch after finish]'\
':feature:__git_flow_feature_list'
;;
(finish) (publish)
_arguments \ _arguments \
-F'[Fetch from origin before performing finish]' \ ':feature:__git_flow_feature_list'\
-r'[Finish branch by rebasing first]'\ ;;
-k'[Keep branch after performing finish]'\
-D'[Force delete feature branch after finish]'\
':feature:__git_flow_feature_list'
;;
(publish) (track)
_arguments \ _arguments \
':feature:__git_flow_feature_list'\ ':feature:__git_flow_feature_list'\
;; ;;
(track) (diff)
_arguments \ _arguments \
':feature:__git_flow_feature_list'\ ':branch:__git_flow_branch_names'\
;; ;;
(diff) (rebase)
_arguments \ _arguments \
':branch:__git_branch_names'\ -i'[Do an interactive rebase]' \
;; ':branch:__git_flow_branch_names'
;;
(rebase) (checkout)
_arguments \ _arguments \
-i'[Do an interactive rebase]' \ ':branch:__git_flow_feature_list'\
':branch:__git_branch_names' ;;
;;
(checkout) (pull)
_arguments \ _arguments \
':branch:__git_flow_feature_list'\ ':remote:__git_flow_remote'\
;; ':branch:__git_flow_branch_names'
;;
(pull) *)
_arguments \ _arguments \
':remote:__git_remotes'\ -v'[Verbose (more) output]'
':branch:__git_branch_names' ;;
;; esac
;;
*) esac
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
} }
__git-flow-support () __git-flow-support() {
{ local curcontext="$curcontext" state line
local curcontext="$curcontext" state line typeset -A opt_args
typeset -A opt_args
_arguments -C \ _arguments -C \
':command:->command' \ ':command:->command' \
'*::options:->options' '*::options:->options'
case $state in case $state in
(command) (command)
local -a subcommands local -a subcommands
subcommands=( subcommands=(
'start:Start a new support branch.' 'start:Start a new support branch.'
'list:List all your support branches. (Alias to `git flow support`)' 'list:List all your support branches. (Alias to `git flow support`)'
) )
_describe -t commands 'git flow support' subcommands _describe -t commands 'git flow support' subcommands
_arguments \ _arguments \
-v'[Verbose (more) output]' -v'[Verbose (more) output]'
;; ;;
(options) (options)
case $line[1] in case $line[1] in
(start) (start)
_arguments \ _arguments \
-F'[Fetch from origin before performing finish]'\ -F'[Fetch from origin before performing finish]'\
':feature:__git_flow_support_list'\ ':feature:__git_flow_support_list'\
':branch-name:__git_branch_names' ':branch-name:__git_flow_branch_names'
;; ;;
*) *)
_arguments \ _arguments \
-v'[Verbose (more) output]' -v'[Verbose (more) output]'
;; ;;
esac esac
;; ;;
esac esac
} }
__git_flow_version_list () __git_flow_version_list() {
{ local expl
local expl local -a versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
declare -a versions __git_flow_command_successful || return
versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) _wanted versions expl 'version' compadd $versions
__git_command_successful || return
_wanted versions expl 'version' compadd $versions
} }
__git_flow_feature_list () __git_flow_feature_list() {
{ local expl
local expl local -a features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
declare -a features __git_flow_command_successful || return
features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) _wanted features expl 'feature' compadd $features
__git_command_successful || return
_wanted features expl 'feature' compadd $features
} }
__git_remotes () { __git_flow_remote() {
local expl gitdir remotes local expl gitdir remotes
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
__git_command_successful || return __git_flow_command_successful || return
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
__git_command_successful || return __git_flow_command_successful || return
# TODO: Should combine the two instead of either or. # TODO: Should combine the two instead of either or.
if (( $#remotes > 0 )); then if (( $#remotes > 0 )); then
_wanted remotes expl remote compadd $* - $remotes _wanted remotes expl remote compadd $* - $remotes
else else
_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
fi fi
} }
__git_flow_hotfix_list () __git_flow_hotfix_list() {
{ local expl
local expl local -a hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
declare -a hotfixes __git_flow_command_successful || return
hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) _wanted hotfixes expl 'hotfix' compadd $hotfixes
__git_command_successful || return
_wanted hotfixes expl 'hotfix' compadd $hotfixes
} }
__git_flow_support_list () __git_flow_support_list() {
{ local expl
local expl local -a support=(${${(f)"$(_call_program support git flow support list 2> /dev/null | tr -d ' |*')"}})
declare -a support __git_flow_command_successful || return
support=(${${(f)"$(_call_program support git flow support list 2> /dev/null | tr -d ' |*')"}}) _wanted hotfixes expl 'support' compadd $support
__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
__git_branch_names () { _wanted branch-names expl branch-name compadd $* - $branch_names
local expl
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
__git_command_successful || return
_wanted branch-names expl branch-name compadd $* - $branch_names
} }
__git_command_successful () { __git_flow_command_successful() {
if (( ${#pipestatus:#0} > 0 )); then if (( ${#pipestatus:#0} > 0 )); then
_message 'not a git repository' _message 'not a git repository'
return 1 return 1
fi fi
return 0 return 0
} }
_git-flow "$@" _git-flow "$@"

View File

@ -41,7 +41,7 @@
_glances() { _glances() {
_arguments \ _arguments \
'(- *)'{-h,--help}'[show this help message and exit]' \ '(- *)'{-h,--help}'[show help message and exit]' \
'--print-completion[print shell completion script]:shell:(bash zsh tcsh)' \ '--print-completion[print shell completion script]:shell:(bash zsh tcsh)' \
'(- *)'{-V,--version}"[show program's version number and exit]" \ '(- *)'{-V,--version}"[show program's version number and exit]" \
'(-d --debug)'{-d,--debug}'[enable debug mode]' \ '(-d --debug)'{-d,--debug}'[enable debug mode]' \

View File

@ -44,7 +44,7 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
__go_buildmodes() { __golang_buildmodes() {
local -a buildmodes=( local -a buildmodes=(
'archive[non-main packages into .a files]' 'archive[non-main packages into .a files]'
'c-archive[main package, plus all packages it imports, into a C archive file]' 'c-archive[main package, plus all packages it imports, into a C archive file]'
@ -59,7 +59,7 @@ __go_buildmodes() {
_values 'mode' $buildmodes _values 'mode' $buildmodes
} }
__go_runtimedebug() { __golang_runtimedebug() {
local -a vars=( local -a vars=(
'allocfreetrace[profile allocations]:boolean:(1 0)' 'allocfreetrace[profile allocations]:boolean:(1 0)'
'clobberfree[clobber memory after free]:boolean:(1 0)' 'clobberfree[clobber memory after free]:boolean:(1 0)'
@ -84,7 +84,7 @@ __go_runtimedebug() {
_values -s ',' -S '=' "runtime debug behavior" $vars[@] _values -s ',' -S '=' "runtime debug behavior" $vars[@]
} }
__go_gcdebugflags() { __golang_gcdebugflags() {
_values -s , -S = 'debug flag' \ _values -s , -S = 'debug flag' \
'append[print information about append compilation]' \ '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"))' \ '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 @@ __go_gcdebugflags() {
'ssa/help[print help about SSA debugging]' 'ssa/help[print help about SSA debugging]'
} }
__go_gcflags() { __golang_gcflags() {
_arguments \ _arguments \
'-%[debug non-static initializers]' \ '-%[debug non-static initializers]' \
'-c=[concurrency during compilation]:int' \ '-c=[concurrency during compilation]:int' \
@ -131,7 +131,7 @@ __go_gcflags() {
'-buildid=[record id as the build id in the export metadata]:id' \ '-buildid=[record id as the build id in the export metadata]:id' \
'-complete[compiling complete package (no C or assembly)]' \ '-complete[compiling complete package (no C or assembly)]' \
'-cpuprofile=[write cpu profile to file]:file' \ '-cpuprofile=[write cpu profile to file]:file' \
'-d=[print debug information about items in list; try -d help]:list: __go_gcdebugflags' \ '-d=[print debug information about items in list; try -d help]:list: __golang_gcdebugflags' \
'-dwarf[generate DWARF symbols (default true)]' \ '-dwarf[generate DWARF symbols (default true)]' \
'-dwarfbasentries[use base address selection entries in DWARF (default true)]' \ '-dwarfbasentries[use base address selection entries in DWARF (default true)]' \
'-dwarflocationlists[add location lists to DWARF in optimized mode (default true)]' \ '-dwarflocationlists[add location lists to DWARF in optimized mode (default true)]' \
@ -173,7 +173,7 @@ __go_gcflags() {
'-wb[enable write barrier (default true)]' '-wb[enable write barrier (default true)]'
} }
__go_pgo() { __golang_pgo() {
_alternative \ _alternative \
"name:name:(auto off)" \ "name:name:(auto off)" \
"file:file:_files" "file:file:_files"
@ -203,9 +203,9 @@ local -a commands=(
'help:get more information about a command' 'help:get more information about a command'
) )
__go_envvarvals() { __golang_envvarvals() {
# if __go_envvarvals is called for -value-, I use the function argument to # 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 __go_envvarvals is # decide which variable to go to. if $1 is not set, then __golang_envvarvals is
# called from the `go env` completion and the current word (with all after # called from the `go env` completion and the current word (with all after
# the first '=' removed) is the current variable. # the first '=' removed) is the current variable.
local env_variable=${1-${words[$CURRENT]%%=*}} local env_variable=${1-${words[$CURRENT]%%=*}}
@ -276,7 +276,7 @@ __go_envvarvals() {
_dispatch $service -value-,${variable#CGO_},-default- _dispatch $service -value-,${variable#CGO_},-default-
;; ;;
(GODEBUG) (GODEBUG)
__go_runtimedebug __golang_runtimedebug
;; ;;
(GOFLAGS) (GOFLAGS)
# not implemented, sorry # not implemented, sorry
@ -294,7 +294,7 @@ __go_envvarvals() {
esac esac
} }
__go_packages() { __golang_packages() {
local -a gopaths=("${(s/:/)$(go env GOPATH)}") local -a gopaths=("${(s/:/)$(go env GOPATH)}")
gopaths+=("$(go env GOROOT)") gopaths+=("$(go env GOROOT)")
for p in $gopaths; do for p in $gopaths; do
@ -312,7 +312,7 @@ __go_packages() {
fi fi
} }
__go_fix_analyzers() { __golang_fix_analyzers() {
local -a fix_analyzers=( local -a fix_analyzers=(
"any[replace interface{} with any]" "any[replace interface{} with any]"
"buildtag[check //go:build and // +build directives]" "buildtag[check //go:build and // +build directives]"
@ -341,7 +341,7 @@ __go_fix_analyzers() {
_values 'analyzer' $fix_analyzers _values 'analyzer' $fix_analyzers
} }
__go_pprof_symbolize_types() { __golang_pprof_symbolize_types() {
local -a symbolize_types=( local -a symbolize_types=(
"none[Do not attempt symbolization]" "none[Do not attempt symbolization]"
"local[Examine only local binaries]" "local[Examine only local binaries]"
@ -360,7 +360,7 @@ if [[ "$service" = -value-* ]]; then
if (($blacklist[(I)$env_variable])); then if (($blacklist[(I)$env_variable])); then
return return
fi fi
__go_envvarvals $env_variable __golang_envvarvals $env_variable
return return
fi fi
@ -382,16 +382,16 @@ case $state in
'-work[print temporary work directory and keep it]' '-work[print temporary work directory and keep it]'
'-x[print the commands]' '-x[print the commands]'
'-asmflags[arguments for each go tool asm invocation]:flags' '-asmflags[arguments for each go tool asm invocation]:flags'
'-buildmode[build mode to use]:mode:__go_buildmodes' '-buildmode[build mode to use]:mode:__golang_buildmodes'
'-buildvcs[stamp binaries with version control information]:mode:(internal external auto)' '-buildvcs[stamp binaries with version control information]:mode:(internal external auto)'
'-compiler[name of compiler to use]:name' '-compiler[name of compiler to use]:name'
'-gccgoflags[arguments for gccgo]:args' '-gccgoflags[arguments for gccgo]:args'
'*-gcflags=[arguments for each go tool compile invocation]:args:__go_gcflags' '*-gcflags=[arguments for each go tool compile invocation]:args:__golang_gcflags'
'-installsuffix[suffix to add to package directory]:suffix' '-installsuffix[suffix to add to package directory]:suffix'
'-ldflags[arguments to pass on each go tool link invocation.]:flags' '-ldflags[arguments to pass on each go tool link invocation.]:flags'
'-linkshared[link against shared libraries]' '-linkshared[link against shared libraries]'
'-overlay[read a JSON config file that provides an overlay for build operations]:file:_files -g "*.json"' '-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:__go_pgo' '-pgo[specify the file path of a profile for profile-guided optimization]:file_or_profile:__golang_pgo'
'-pkgdir[install and load all packages from dir]:dir' '-pkgdir[install and load all packages from dir]:dir'
'-tags[list of build tags to consider satisfied]:tags' '-tags[list of build tags to consider satisfied]:tags'
'-trimpath[remove all file system paths from the resulting executable]' '-trimpath[remove all file system paths from the resulting executable]'
@ -425,7 +425,7 @@ case $state in
'help:get more information about a command' 'help:get more information about a command'
) )
local -a fix_flags=( local -a fix_flags=(
'-fixtool=[specify fix analyzer]:analyzer:__go_fix_analyzers' '-fixtool=[specify fix analyzer]:analyzer:__golang_fix_analyzers'
'-diff[display diffs instead of rewriting files]' '-diff[display diffs instead of rewriting files]'
'-fixtool=[select analysis tool]:analyzer:' '-fixtool=[select analysis tool]:analyzer:'
'(- *)-V[print version and exit]' '(- *)-V[print version and exit]'
@ -464,7 +464,7 @@ case $state in
'-json[emit build output in JSON suitable for automated processing]' \ '-json[emit build output in JSON suitable for automated processing]' \
${build_flags[@]} \ ${build_flags[@]} \
${mod_flags[@]} \ ${mod_flags[@]} \
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
;; ;;
(clean) (clean)
@ -477,7 +477,7 @@ case $state in
'-fuzzcache[remove files stored in the Go build cache for fuzz testing]' \ '-fuzzcache[remove files stored in the Go build cache for fuzz testing]' \
${build_flags[@]} \ ${build_flags[@]} \
${mod_flags[@]} \ ${mod_flags[@]} \
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
;; ;;
(doc) (doc)
@ -489,7 +489,7 @@ case $state in
'-short[one-line representation for each symbol]' \ '-short[one-line representation for each symbol]' \
'-src[show the full source code for the symbol]' \ '-src[show the full source code for the symbol]' \
'-u[show docs for unexported and exported symbols and methods]' \ '-u[show docs for unexported and exported symbols and methods]' \
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
;; ;;
(env) (env)
@ -569,12 +569,12 @@ case $state in
) )
local -a exclude_from_w=(GOENV) local -a exclude_from_w=(GOENV)
__go_list_env_vars() { __golang_list_env_vars() {
# the parameter expansion strops off everything after the first [ # the parameter expansion strops off everything after the first [
_values -s ' ' -w 'environment variable' ${goenvvars[@]%%\[*} _values -s ' ' -w 'environment variable' ${goenvvars[@]%%\[*}
} }
# the ^ parameter expansion appends ": __go_envvarvals" to every element of goenvvars # the ^ parameter expansion appends ": __golang_envvarvals" to every element of goenvvars
# the :# parameter expansion removes all elements matching GOENV* # the :# parameter expansion removes all elements matching GOENV*
[[ $words[2] != '-w' ]] && _arguments \ [[ $words[2] != '-w' ]] && _arguments \
'-C[change to directory before running the command]: :_files -/' \ '-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]' \ '-changed[prints only those settings whose effective value differs from the default value]' \
'-u[unset environment variables]' \ '-u[unset environment variables]' \
'-w[change the default setting of environment variables]' \ '-w[change the default setting of environment variables]' \
'*:[show environment variable]: __go_list_env_vars' || _values \ '*:[show environment variable]: __golang_list_env_vars' || _values \
-s ' ' -S "=" -w 'environment variable' ${^goenvvars:#GOENV*}": __go_envvarvals" -s ' ' -S "=" -w 'environment variable' ${^goenvvars:#GOENV*}": __golang_envvarvals"
;; ;;
(fix) (fix)
_arguments \ _arguments \
'-C[change to directory before running the command]: :_files -/' \ '-C[change to directory before running the command]: :_files -/' \
$fix_flags[@] \ $fix_flags[@] \
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
;; ;;
(fmt) (fmt)
@ -599,7 +599,7 @@ case $state in
'-n[print commands that would be executed]' \ '-n[print commands that would be executed]' \
'-x[print commands as they are executed]' \ '-x[print commands as they are executed]' \
'-mod=[set which download mode to use]:mode:(readonly vendor)' \ '-mod=[set which download mode to use]:mode:(readonly vendor)' \
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
;; ;;
(generate) (generate)
@ -610,7 +610,7 @@ case $state in
'-n[print the commands but do not run them]' \ '-n[print the commands but do not run them]' \
'-v[print the names of packages as they are compiled]' \ '-v[print the names of packages as they are compiled]' \
${build_flags[@]} \ ${build_flags[@]} \
"*:args:{ _alternative ':importpaths:__go_packages' _files }" "*:args:{ _alternative ':importpaths:__golang_packages' _files }"
;; ;;
(get) (get)
@ -620,13 +620,13 @@ case $state in
'-u[use the network to update the named packages]' \ '-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]' \ '-tool[instructs go to add a matching tool line to go.mod for each listed package]' \
${build_flags[@]} \ ${build_flags[@]} \
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
;; ;;
(install) (install)
_arguments \ _arguments \
${build_flags[@]} \ ${build_flags[@]} \
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
;; ;;
(list) (list)
@ -642,7 +642,7 @@ case $state in
'-m[list modules instead of packages]' '-m[list modules instead of packages]'
${build_flags[@]} ${build_flags[@]}
${mod_flags[@]} ${mod_flags[@]}
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
) )
# -u and -versions are only available if -m is present on the commandline # -u and -versions are only available if -m is present on the commandline
if (($words[(I)-m])); then if (($words[(I)-m])); then
@ -684,7 +684,7 @@ case $state in
(init) (init)
# Use go packages as module name suggestion # Use go packages as module name suggestion
_arguments \ _arguments \
'*:module:__go_packages' '*:module:__golang_packages'
;; ;;
(tidy) (tidy)
_arguments \ _arguments \
@ -705,7 +705,7 @@ case $state in
_arguments \ _arguments \
'-m[treats the arguments as a list of modules]' \ '-m[treats the arguments as a list of modules]' \
'-vendor[exclude tests of dependencies]' \ '-vendor[exclude tests of dependencies]' \
'*:module:__go_packages' '*:module:__golang_packages'
;; ;;
esac esac
;; ;;
@ -716,7 +716,7 @@ case $state in
_arguments \ _arguments \
${build_flags[@]} \ ${build_flags[@]} \
'-exec[invoke the binary using xprog]:xporg' \ '-exec[invoke the binary using xprog]:xporg' \
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
;; ;;
(telemetry) (telemetry)
@ -803,7 +803,7 @@ case $state in
${build_flags[@]} \ ${build_flags[@]} \
'-exec[run test binary using xprog]:xprog' \ '-exec[run test binary using xprog]:xprog' \
'-o[compile test binary to named file]:file:_files' \ '-o[compile test binary to named file]:file:_files' \
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
fi fi
;; ;;
@ -963,7 +963,7 @@ case $state in
(fix) (fix)
if [[ $words[2] == "help" ]]; then if [[ $words[2] == "help" ]]; then
__go_fix_analyzers __golang_fix_analyzers
else else
_arguments \ _arguments \
"*:args:{ _alternative ':subcommand:(help)' _files }" "*:args:{ _alternative ':subcommand:(help)' _files }"
@ -1119,7 +1119,7 @@ case $state in
'-add_comment=[free-form annotation to add to the profile]:comment' \ '-add_comment=[free-form annotation to add to the profile]:comment' \
'-diff_base=[source of base profile for comparison]:source:_files' \ '-diff_base=[source of base profile for comparison]:source:_files' \
'-base[show delta from this profile]:profile' \ '-base[show delta from this profile]:profile' \
'-symbolize=[controls source of symbol information]:source:__go_pprof_symbolize_types' \ '-symbolize=[controls source of symbol information]:source:__golang_pprof_symbolize_types' \
'-tls_cert=[TLS client certificate file for fetchign profile and symbols]:file:_files' \ '-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_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' \ '-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]' \ '-x[prints commands as they are executed]' \
'-vettool[set a different analysis tool with alternative or additional checks]:prog:_files' \ '-vettool[set a different analysis tool with alternative or additional checks]:prog:_files' \
${build_flags[@]} \ ${build_flags[@]} \
'*:importpaths:__go_packages' '*:importpaths:__golang_packages'
;; ;;
(work) (work)

83
src/_h2load Normal file
View File

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

View File

@ -13,7 +13,16 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_arguments -s '(- *)'{-h,--help}'[display this help and exit]' \ _arguments -s \
'(- *)'{-h,--help}'[display help and exit]' \
'(- *)'{-v,--version}'[display version information and exit]' \ '(- *)'{-v,--version}'[display version information and exit]' \
{-t,--traditional}'[use traditional greeting]' \ {-t,--traditional}'[use traditional greeting]' \
{-g,--greeting=}'[use TEXT as the greeting message]:TEXT' {-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

View File

@ -64,7 +64,7 @@ args=(
'--forecast=[apply periodic transaction rules to generate future transactions]' '--forecast=[apply periodic transaction rules to generate future transactions]'
) )
_arguments -C "$args[@]" -A "-*" \ _arguments -C -A "-*" "$args[@]" \
'(- *)--version[print version information]' \ '(- *)--version[print version information]' \
'--debug[show debug output]' \ '--debug[show debug output]' \
'1: :->cmds' \ '1: :->cmds' \
@ -284,3 +284,11 @@ while (( $#state )); do
done done
return ret return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -21,7 +21,7 @@ _inxi() {
local curcontext="$curcontext" local curcontext="$curcontext"
local ret=1 local ret=1
local colors=($(seq 0 42)) local -a colors=({0..42})
_arguments -C -s \ _arguments -C -s \
'(-A --audio)'{-A,--audio}"[Show Audio/sound card(s) information]" \ '(-A --audio)'{-A,--audio}"[Show Audio/sound card(s) information]" \

View File

@ -54,7 +54,7 @@ _kitchen() {
args) args)
case $line[1] in case $line[1] in
converge|create|destroy|diagnose|list|setup|test|verify) converge|create|destroy|diagnose|list|setup|test|verify)
compadd 'all' _wanted all-instances expl 'all instances' compadd 'all'
_kitchen_instances _kitchen_instances
;; ;;
login) login)
@ -84,3 +84,11 @@ _kitchen_instances() {
} }
_kitchen "$@" _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

View File

@ -230,7 +230,7 @@ _language_codes() {
case $command in case $command in
ISO-639-1) ISO-639-1)
_language_codes_${${command//-/_}:l} "${@[1,-2]}" && ret=0 _language_codes_${${command//-/_}:l} "${@[1,-2]}" && ret=0
;; ;;
*) *)
_message "unknown command: $command" _message "unknown command: $command"

View File

@ -90,7 +90,7 @@ case $state in
'gs-load-lily-fonts[load only LilyPond fonts via Ghostscript]:gs-load-lily-fonts:(\#t \#f)' \ 'gs-load-lily-fonts[load only LilyPond fonts via Ghostscript]:gs-load-lily-fonts:(\#t \#f)' \
'gs-never-embed-fonts[make Ghostscript embed only TrueType fonts and no other font format]:gs-never-embed-fonts:(\#t \#f)' \ '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)' \ 'gui[run LilyPond from a GUI and redirect stderr to a log file]:gui:(\#t \#f)' \
'help[show this help]:help:(\#t \#f)' \ 'help[show help]:help:(\#t \#f)' \
'include-book-title-preview[include book titles in preview images]:include-book-title-preview:(\#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-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(-.)"' \ 'include-settings[included file before the score is processed]:include-settings:_files -g "*.(#i)ly(-.)"' \

View File

@ -80,7 +80,7 @@ _lscpu_cache() {
} }
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(- *)'{-V,--version}'[display version]' \ '(- *)'{-V,--version}'[display version]' \
'(-a --all)'{-a,--all}'[print both online and offline CPUs(default for -e)]' \ '(-a --all)'{-a,--all}'[print both online and offline CPUs(default for -e)]' \
'(-b --online)'{-b,--online}'[print online CPUs only]' \ '(-b --online)'{-b,--online}'[print online CPUs only]' \

View File

@ -91,7 +91,7 @@ _lsipc_output_columns() {
} }
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(- *)'{-V,--version}'[display version]' \ '(- *)'{-V,--version}'[display version]' \
'(-m --shmems)'{-m,--shmems}'[shared memory segments]' \ '(-m --shmems)'{-m,--shmems}'[shared memory segments]' \
'(-M --posix-shmems)'{-M,--posix-shmems}'[POSIX shared memory segments]' \ '(-M --posix-shmems)'{-M,--posix-shmems}'[POSIX shared memory segments]' \

View File

@ -56,7 +56,7 @@ _lslocks_output_columns() {
} }
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(- *)'{-V,--version}'[display version]' \ '(- *)'{-V,--version}'[display version]' \
'(-b --bytes)'{-b,--bytes}'[print SIZE in bytes rather]' \ '(-b --bytes)'{-b,--bytes}'[print SIZE in bytes rather]' \
'(-J --json)'{-J,--json}'[use the JSON output format]' \ '(-J --json)'{-J,--json}'[use the JSON output format]' \

View File

@ -70,7 +70,7 @@ _lslogins_output_columns() {
} }
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(- *)'{-V,--version}'[display version]' \ '(- *)'{-V,--version}'[display version]' \
'(-a --acc-expiration)'{-a,--acc-expiration}'[display info about passwords expiration]' \ '(-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]' \ '(-c --colon-separate)'{-c,--colon-separate}'[display data in a format similar to /etc/passwd]' \

View File

@ -50,7 +50,7 @@ _lsmem_output_columns() {
} }
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(- *)'{-V,--version}'[display version]' \ '(- *)'{-V,--version}'[display version]' \
'(-J --json)'{-J,--json}'[use the JSON output format]' \ '(-J --json)'{-J,--json}'[use the JSON output format]' \
'(-P --pairs)'{-P,--pairs}'[use key=value output format]' \ '(-P --pairs)'{-P,--pairs}'[use key=value output format]' \

View File

@ -37,7 +37,7 @@
_arguments \ _arguments \
{-f,--file}'[Use file as as cookie seed]:file:_files' \ {-f,--file}'[Use file as as cookie seed]:file:_files' \
{-m,--max-size}'[Set maximum length of output]:number' \ {-m,--max-size}'[Set maximum length of output]:bytes' \
{-v,--verbose}'[Print entropy source and random seed info]' \ {-v,--verbose}'[Print entropy source and random seed info]' \
'(- *)'{-h,--help}'[Display help message and exit]' \ '(- *)'{-h,--help}'[Display help message and exit]' \
'(- *)'{-V,--version}'[Display version information and exit]' '(- *)'{-V,--version}'[Display version information and exit]'

View File

@ -154,3 +154,11 @@ case $state in
esac esac
return ret return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

1127
src/_mix

File diff suppressed because it is too large Load Diff

View File

@ -106,3 +106,11 @@ _describe 'command' instances
# Reference: # Reference:
# https://zsh.sourceforge.net/Doc/Release/Completion-System.html # https://zsh.sourceforge.net/Doc/Release/Completion-System.html
# https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org # 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

View File

@ -39,7 +39,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_arguments \ _arguments \
'(- *)--help[display this help message]' \ '(- *)--help[display help message]' \
'-d-[Verbose debug]:level:(0 1 2)' \ '-d-[Verbose debug]:level:(0 1 2)' \
'-v-[SSH debug levels]:level:(0 1 2 3)' \ '-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' \ '-m-[Run concurrently on the specified hosts at a time. "0" is used for infinite]:count' \

View File

@ -104,11 +104,11 @@ _mvn() {
if [[ $maven_version == 'maven4' ]]; then if [[ $maven_version == 'maven4' ]]; then
opts+=( opts+=(
"($excl_opts -canf --cache-artifact-not-found)"{-canf,--cache-artifact-not-found}'[defines caching behaviour for not found artifacts]: :(false true)' "($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 -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 -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 --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 -r --resume)"{-r,--resume}'[resume reactor from the last failed project, using the resume.properties file in the build directory]'
) )
fi fi
@ -266,14 +266,19 @@ _mvn_groupIds() {
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_groupIds_caching_policy [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_groupIds_caching_policy
if [[ -d $repository_location ]]; then if [[ -d $repository_location ]]; then
unset _groupIds local -a groupIds
if ( [[ ${+_groupIds} -eq 0 ]] || _cache_invalid "mvn/repositories/${repository_location}/groupIds" ) && ! _retrieve_cache "mvn/repositories/${repository_location}/groupIds"; then local cache_key="mvn/repositories/${repository_location}/groupIds"
_groupIds=($repository_location/**/) if ( _cache_invalid $cache_key ) && ! _retrieve_cache $cache_key; then
_groupIds=(${${${(u)_groupIds:h:h}#"$repository_location/"}//\//.}) groupIds=($repository_location/**/)
[[ $#_groupIds -gt 0 ]] && _store_cache "mvn/repositories/${repository_location}/groupIds" _groupIds groupIds=(${${${(u)_groupIds:h:h}#"$repository_location/"}//\//.})
if (( $#groupIds > 0 )); then
_store_cache $cache_key groupIds
fi
fi fi
[[ $#_groupIds -gt 0 ]] && _multi_parts $@ . _groupIds && ret=0 if (( $#groupIds > 0 )); then
_multi_parts $@ . groupIds && ret=0
fi
fi fi
return ret return ret
@ -310,14 +315,19 @@ _mvn_plugin_goals() {
zstyle -s ":completion:${curcontext}:" cache-policy update_policy zstyle -s ":completion:${curcontext}:" cache-policy update_policy
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_goals_caching_policy [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_goals_caching_policy
unset _goals local -a goals
if ( [[ ${+_goals} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin}" ) && ! _retrieve_cache "mvn/plugins/${plugin}"; then local cache_key="mvn/plugins/${plugin}"
if _cache_invalid $cache_key && ! _retrieve_cache $cache_key; then
setopt localoptions extendedglob setopt localoptions extendedglob
_goals=(${(s:,,,:)${${${(f)${${${(f)${${${${(F)${(S)${(f)"$(_call_program goals $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=$plugin)"}//#$(__mvn_get_plugin_prefix $plugin):/,,,}}:#*BUILD FAILURE*}#*This plugin has*goals#:}%For more information, run \'mvn help:describe*}}//:/\\:}}}// ##/ }// Description\\: /:}}) _goals=(${(s:,,,:)${${${(f)${${${(f)${${${${(F)${(S)${(f)"$(_call_program goals $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=$plugin)"}//#$(__mvn_get_plugin_prefix $plugin):/,,,}}:#*BUILD FAILURE*}#*This plugin has*goals#:}%For more information, run \'mvn help:describe*}}//:/\\:}}}// ##/ }// Description\\: /:}})
[[ $#_goals -gt 0 ]] && _store_cache "mvn/plugins/${plugin}" _goals if (( $#goals > 0 )); then
_store_cache "mvn/plugins/${plugin}" goals
fi
fi fi
[[ $#_goals -gt 0 ]] && _describe -t "goals" "${plugin} goal" _goals $@[0,-2] && ret=0 if (( $#goals > 0 )); then
_describe -t "goals" "${plugin} goal" goals $@[0,-2] && ret=0
fi
return ret return ret
} }
@ -338,44 +348,52 @@ _mvn_profiles() {
# Resolve profiles from settings.xml # Resolve profiles from settings.xml
if [[ -f $settings_file ]]; then if [[ -f $settings_file ]]; then
unset _profiles local -a profiles
cache_name="mvn/profiles${settings_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10 cache_name="mvn/profiles${settings_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10
if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then if _cache_invalid "$cache_name" && ! _retrieve_cache "$cache_name"; then
_profiles=() profiles=()
profiles_section="${(M)${(f)$(<$settings_file)}:#*<profiles>*}" profiles_section="${(M)${(f)$(<$settings_file)}:#*<profiles>*}"
if [[ -n "$profiles_section" ]]; then 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 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 done
fi fi
[[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
if (( $#profiles > 0 )); then
_store_cache "$cache_name" profiles
fi
fi fi
profs+=($_profiles) profs+=($profiles)
fi fi
# Resolve project profiles # Resolve project profiles
if [[ -f $parent_pom_file ]]; then if [[ -f $parent_pom_file ]]; then
unset _profiles local -a profiles
cache_name="mvn/profiles${parent_pom_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10 cache_name="mvn/profiles${parent_pom_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10
if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then if _cache_invalid "$cache_name" && ! _retrieve_cache "$cache_name"; then
_profiles=() profiles=()
setopt localoptions extendedglob setopt localoptions extendedglob
for file in ${parent_pom_file:h}/**/pom.xml~*target\/*; do # FIXME project.build.directory is not always target/ 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>*}" profiles_section="${(M)${(f)$(<$file)}:#*<profiles>*}"
if [[ -n "$profiles_section" ]]; then 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 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 done
fi fi
done done
[[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
if (( $#profiles > 0)); then
_store_cache "$cache_name" profiles
fi
fi fi
profs+=($_profiles) profs+=($profiles)
fi fi
compset -P '-'; compset -P '+'; compset -P '!' # FIXME Only works for the first profile compset -P '-'; compset -P '+'; compset -P '!' # FIXME Only works for the first profile
[[ $#profs -gt 0 ]] && _values $@ 'profile' "${profs[@]}" && ret=0 if (( $profs > 0 )); then
_values $@ 'profile' "${profs[@]}" && ret=0
fi
return ret return ret
} }
@ -437,16 +455,21 @@ _mvn_plugin_goal_property_names() {
zstyle -s ":completion:${curcontext}:" cache-policy update_policy zstyle -s ":completion:${curcontext}:" cache-policy update_policy
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_properties_caching_policy [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_properties_caching_policy
unset _properties local -a properties
if ( [[ ${+_properties} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin_colon_goal}" ) && ! _retrieve_cache "mvn/plugins/${plugin_colon_goal}"; then local cache_key="mvn/plugins/${plugin_colon_goal}"
if _cache_invalid $cache_key && ! _retrieve_cache $cache_key; then
# FIXME Does not work for: # FIXME Does not work for:
# android:apk (new line before expression) # android:apk (new line before expression)
# ear:ear (unknown cause) # ear:ear (unknown cause)
_properties=(${(M)${(ps:,,,:)${${${${(pj: :)${${${(f)${"$(_call_program properties $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=${plugin_colon_goal%:*} -Dgoal=${plugin_colon_goal##*:} -Ddetail)"#*Available parameters:}%%\[INFO\]*}//# [a-z]*/,,,}##*Expression: \$\{}}//\}[[:space:]]##/:}//[[:space:]]##/ }//[[:space:]]#,,,[[:space:]]#/,,,}}:#[a-zA-Z]##:*}) properties=(${(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 if (( $#properties > 0 )); then
_store_cache $cache_key properties
fi
fi fi
[[ $#_properties -gt 0 ]] && _describe -t "${plugin_colon_goal//:/-}-property-names" "${plugin_colon_goal} property name" _properties $@[0,-2] && ret=0 if (( $#properties > 0 )); then
_describe -t "${plugin_colon_goal//:/-}-property-names" "${plugin_colon_goal} property name" properties $@[0,-2] && ret=0
fi
return ret return ret
} }

View File

@ -77,8 +77,8 @@ if [[ -n $state ]]; then
+) _message -e lines "start at a given line" ;; +) _message -e lines "start at a given line" ;;
+[crCR]#[/?]) _message -e 'search string' ;; +[crCR]#[/?]) _message -e 'search string' ;;
+<->,) _message -e 'column number' ;; +<->,) _message -e 'column number' ;;
*) _files && ret=0 ;; *) _files ;;
esac esac && ret=0
fi fi
return ret return ret

View File

@ -144,3 +144,11 @@ local options=(
) )
_arguments $options "*::func_name:($func_names)" _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

View File

@ -12,278 +12,280 @@
# * Markus Richter ( https://github.com/mqus , <mqus@disroot.org>) # * Markus Richter ( https://github.com/mqus , <mqus@disroot.org>)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_nft(){ _nft(){
local -a rules states prev args families options descriptors 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 state="start" line nextstate cmd_obj cmd_subcmd cmd_fam cmd_tab cmd_chain #curcontext="$curcontext"
options=( options=(
'(-)'{-h,--help}'[show help]' \ '(-)'{-h,--help}'[show help]'
'(-)'{-v,--version}'[print version information]' \ '(-)'{-v,--version}'[print version information]'
"(-i --interactive)"{-i,--interactive}'[read input from interactive CLI]: :->end' \ "(-i --interactive)"{-i,--interactive}'[read input from interactive CLI]: :->end'
"(-f --file)"{-f,--file}'[read input from <filename>]:nftables rule file:_files' \ "(-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]" \ '(-c --check -n --numeric -N)'{-c,--check}"[check command's validity without actually applying the changes]"
'(-j --json)'{-j,--json}'[format output in json]' \ '(-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]' \ '(-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]' \ '(-s --stateless)'{-s,--stateless}'[omit stateful information of ruleset]'
'(-N -n --numeric -c --check)'-N'[translate IP addresses to names]' \ '(-N -n --numeric -c --check)'-N'[translate IP addresses to names]'
'(-a --handle)'{-a,--handle}'[output rule handle]' \ '(-a --handle)'{-a,--handle}'[output rule handle]'
'(-e --echo)'{-e,--echo}'[echo what has been added, inserted or replaced]' \ '(-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' {-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 # 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 # 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 # 'descriptors' for _arguments, which essentially tells _arguments how to complete
local _i=0 local _i=0
while true;do while true;do
(( _i+=1 )) (( _i+=1 ))
#Guard for endless loops #Guard for endless loops
[[ $_i -gt 100 ]] && return 1 [[ $_i -gt 100 ]] && return 1
descriptors=() descriptors=()
nextstate="end" nextstate="end"
case $state in case $state in
(start) (start)
##if line is empty (at the start) or ends with semicolon, autocomplete subcommands, ##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 # else if we are after a space,complete a semicolon (end the current nft command) and start anew
if [[ $line[1] = "" || $line[1] =~ ';$' ]] ; then if [[ $line[1] = "" || $line[1] =~ ';$' ]] ; then
descriptors=( ":: :_nft_subcommands" ) descriptors=( ":: :_nft_subcommands" )
nextstate="category" nextstate="category"
else else
if [[ $words =~ ' $' ]]; then if [[ $words =~ ' $' ]]; then
descriptors=(':: :(\;)') descriptors=(':: :(\;)')
else else
descriptors=(':argument: ') descriptors=(':argument: ')
fi fi
nextstate="start"
fi
;;
(category)
case $line[1] in
(add | list | flush | delete | create | rename | insert | replace | reset)
descriptors=( ":: :_nft_${line[1]}" )
nextstate=$line[1]
;;
(monitor)
descriptors=( ":: : _nft_mon_filter" )
nextstate="mon1"
;;
(export)
descriptors=( ":: :(ruleset)" ":: :_nft_out_format" )
nextstate="preend"
;;
(describe)
descriptors=( ":expression: ")
nextstate="start" #x restart
;;
(*)
return 1;
;;
esac
#descriptors=( "(ruleset)" )
#nextstate="end"
;;
(mon1)
case $line[1] in
(new | destroy)
# descriptors=( ":: :_nft_mon_keywords" ":: :_nft_out_format")
descriptors=( ":: : _nft_mon_keywords")
nextstate="mon1"
;;
(tables | chains | sets | rules | elements | ruleset)
descriptors=( ":: : _nft_out_format")
nextstate="preend"
;;
esac
;;
#all completions for create and insert match with the completions of add
(create | insert)
state="add"
;|
#all completions for reset and flush match with the completions of list
(reset | flush)
state="list"
;|
#(add(^table)/create(^table)/delete/flush(^ruleset)/insert/list(^ruleset)/rename/replace)[family]table
(reset | delete | insert | rename | replace | add | create | flush | list)
if [[ $state = "add" && $line[1] = "table" ]]; then
descriptors=( ":: :_nft_families" ":table name:")
nextstate="start" #x restart
elif [[ $state = "list" && ( $line[1] = "ruleset" || $line[1] = "tables" ) ]]; then
descriptors=( ":: :_nft_families")
nextstate="start" #x restart
elif [[ $state = "delete" && $line[1] = "table" ]]; then
descriptors=(": : _nft_table all-handle")
nextstate="tcomplete-delete-table"
else
cmd_obj=$line[1]
cmd_subcmd=$state
descriptors=(": : _nft_table all")
nextstate="tcomplete"
fi
;;
(tcomplete-delete-table)
# if only a family was completed, complete the table name.
case $line[1] in
(arp | bridge | inet | ip | ip6 | netdev)
descriptors=(": : _nft_table ${line[1]}-handle")
cmd_fam=$line[1]
;;
# if 'handle' was completed, complete the handle number.
(handle)
descriptors=(": : _nft_table_handle_all " )
;;
# else, complete nothing and go to the next state. default family is 'ip'
(*)
descriptors=()
cmd_fam="ip"
;;
esac
nextstate="delete-table"
;;
(tcomplete)
# if only a family was completed, complete the table name.
case $line[1] in
(arp | bridge | inet | ip | ip6 | netdev)
descriptors=(": : _nft_table ${line[1]}")
cmd_fam=$line[1]
;;
# else, complete nothing and go to the next state. default family is 'ip'
(*)
descriptors=()
cmd_fam="ip"
;;
esac
nextstate="$cmd_subcmd-$cmd_obj"
;;
(list-table)
descriptors=(":: :(\;)")
nextstate="start"
;;
(delete-table)
#if family AND handle were input, complete handle number for given family.
if [[ $line[1] == "handle" ]]; then
descriptors=(":table handle: _nft_table_handle $cmd_fam" )
else
descriptors=()
fi
nextstate="start"
;;
(delete-chain | delete-set | delete-quota | delete-counter | delete-ct\\ helper)
cmd_tab=$line[1]
descriptors=(": : _nft_object $cmd_fam $cmd_tab $cmd_obj true")
nextstate="delete-obj-handle"
;;
(delete-obj-handle)
if [[ $line[1] == "handle" ]]; then
descriptors=(": : _nft_object_handle $cmd_fam $cmd_tab $cmd_obj")
else
descriptors=(": :(\;)")
fi
nextstate="start"
;;
(add-chain)
descriptors=(":chain name:")
nextstate="start"
;;
(rename-chain)
cmd_tab=$line[1]
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
nextstate="add-chain"
;;
(replace-rule | delete-rule)
cmd_tab=$line[1]
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
nextstate="repdel-rule"
;;
(repdel-rule)
cmd_chain=$line[1]
descriptors=(": :(handle)" ": : _nft_rule_handle $cmd_fam $cmd_tab ${line[1]}")
if [[ $cmd_subcmd = "replace" ]];then
nextstate="rule-stmt"
else
nextstate="start"
fi
;;
(add-rule)
cmd_tab=$line[1]
descriptors=(": : _nft_object $cmd_fam $cmd_tab chain false")
nextstate="add-rule-2"
;;
(add-rule-2)
cmd_chain=$line[1]
descriptors=(": :(handle index position)")
nextstate="add-rule-3"
;;
(add-rule-3)
case $line[1] in
(index | position)
descriptors=(":${line[1]}:")
;;
(handle)
descriptors=(": : _nft_rule_handle $cmd_fam $cmd_tab $cmd_chain")
;;
(*)
descriptors=()
;;
esac
nextstate="rule-stmt"
;;
(rule-stmt)
#TODO
# _nft_rule $cmd_fam $cmd_tab $cmd_chain\
# && return 0;
descriptors=(":expression: ")
nextstate="start"
;;
(list-set | list-map | delete-map | list-chain | list-flowtable | delete-flowtable | list-ct\\ helper | list-counter | list-quota | list-meter)
cmd_tab=$line[1]
descriptors=(": : _nft_object $cmd_fam $cmd_tab $cmd_obj false")
nextstate="start" nextstate="start"
fi ;;
;; (add-element | delete-element)
(category) cmd_tab=$line[1]
case $line[1] in descriptors=(": : _nft_object $cmd_fam $cmd_tab '\(map\|set\)' false")
(add | list | flush | delete | create | rename | insert | replace | reset) nextstate="start"
descriptors=( ":: :_nft_${line[1]}" ) ;;
nextstate=$line[1] #TODO:
;; #(add-set | add-map)
(monitor) #(add-flowtable)
descriptors=( ":: : _nft_mon_filter" ) #("add-ct\ helper")
nextstate="mon1" #(add-counter)
;; #(add-quota)
(export)
descriptors=( ":: :(ruleset)" ":: :_nft_out_format" )
nextstate="preend"
;;
(describe)
descriptors=( ":expression: ")
nextstate="start" #x restart
;;
(*)
return 1;
;;
esac
#descriptors=( "(ruleset)" ) (*)
#nextstate="end" return 1;
;; ;;
(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 esac
;; _arguments -C -s \
#all completions for create and insert match with the completions of add "${options[@]}" \
(create | insert) "${descriptors[@]}" \
state="add" "*:: :->$nextstate" \
;| && return 0;
#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)
(*) done
return 1;
;;
esac
_arguments -C -s \
"${options[@]}" \
"${descriptors[@]}" \
"*:: :->$nextstate" \
&& return 0;
done
} # end _nft } # end _nft
_nft_subcommands(){ _nft_subcommands(){
local commands=( local commands=(
'add:add a table, chain, rule, set, map, or object' 'add:add a table, chain, rule, set, map, or object'
'list:list a ruleset, table, chain, 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' 'flush:flush (delete everything from) a ruleset, table, chain, set, or map'
'export:print the ruleset in a machine readable format (json or xml)' 'export:print the ruleset in a machine readable format (json or xml)'
'delete:delete a table, chain, rule, set, element, map, or object' 'delete:delete a table, chain, rule, set, element, map, or object'
'create:similar to add but returns an error for existing chain' 'create:similar to add but returns an error for existing chain'
'rename:rename the specified 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' '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' 'replace:similar to the add command, but replaces the specified rule'
'reset:list-and-reset stateful object' 'reset:list-and-reset stateful object'
'monitor:listen to Netlink events' 'monitor:listen to Netlink events'
'describe:show information about the type of an expression and its data type' 'describe:show information about the type of an expression and its data type'
) )
_describe -t commands 'nft subcommand' commands "$@" _describe -t commands 'nft subcommand' commands "$@"
} }
_nft_mon_filter(){ _nft_mon_filter(){
local monitor_filters=( local monitor_filters=(
'new:show only events of created objects' 'new:show only events of created objects'

View File

@ -28,7 +28,7 @@
# Description # Description
# ----------- # -----------
# #
# Completion script for Node.js v25.8.0 (https://nodejs.org) # Completion script for Node.js v25.9.0 (https://nodejs.org)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
@ -70,6 +70,23 @@ _node_scripts() {
} }
_node() { _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 local ret=1
_arguments \ _arguments \
@ -252,6 +269,7 @@ _node() {
"--watch-path=[path to watch]: :_node_files" \ "--watch-path=[path to watch]: :_node_files" \
'--watch-preserve-output[preserve outputs on watch mode restart]' \ '--watch-preserve-output[preserve outputs on watch mode restart]' \
'--zero-fill-buffers[automatically zero-fill all newly allocated Buffer and SlowBuffer instances]' \ '--zero-fill-buffers[automatically zero-fill all newly allocated Buffer and SlowBuffer instances]' \
$v8_options[@] \
'(- 1 *)'{-h,--help}'[print node command line options]' \ '(- 1 *)'{-h,--help}'[print node command line options]' \
'(- 1 *)'{-v,--version}'[print Node.js version]' \ '(- 1 *)'{-v,--version}'[print Node.js version]' \
'*: :_node_args' && ret=0 '*: :_node_args' && ret=0

85
src/_nu Normal file
View File

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

View File

@ -28,7 +28,7 @@
# Description # Description
# ----------- # -----------
# #
# Completion script for OpenSSL 3.5.3 (https://www.openssl-library.org/) # Completion script for OpenSSL 4.0.0 (https://www.openssl-library.org/)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
@ -844,6 +844,8 @@ _openssl_dgst() {
'-prverify[private key file to verify the signature]:file:_files' \ '-prverify[private key file to verify the signature]:file:_files' \
'-signature[actual signature file to verify]:file:_files' \ '-signature[actual signature file to verify]:file:_files' \
'-hmac[key to create a hashed MAC]:key' \ '-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' \ '-mac[MAC algorithm]:alg:_openssl_mac_algorithms' \
'-macopt[options of MAC algorithm]:options' \ '-macopt[options of MAC algorithm]:options' \
'-fips-fingerprint[compute HMAC using a specific key for certain OpenSSL-FIPS operations]' \ '-fips-fingerprint[compute HMAC using a specific key for certain OpenSSL-FIPS operations]' \
@ -1112,22 +1114,22 @@ _openssl_genpkey() {
done done
_arguments \ _arguments \
'(- *)-help[print help message]' \ '(- *)-help[print help message]' \
'-out[output private key file]:file:_files' \ '-out[output private key file]:file:_files' \
'-outpubkey[output public key file]:file:_files' \ '-outpubkey[output public key file]:file:_files' \
'-outform[output format]:format:(DER PEM)' \ '-outform[output format]:format:(DER PEM)' \
'-verbose[output "status dots" while generating keys]' \ '-verbose[output "status dots" while generating keys]' \
'-quiet[do not 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' \ '-pass[output file password source]:source:_openssl_pass_phrase_options' \
$cipher_flags[@] \ $cipher_flags[@] \
'-algorithm[public key algorithm]:alg:(($builtin_algorithms))' \ '-algorithm[public key algorithm]:alg:(($builtin_algorithms))' \
'-pkeyopt[public key algorithm option]:option' \ '-pkeyopt[public key algorithm option]:option' \
'-genparam[generate a set of parameters instead of a private key]' \ '-genparam[generate a set of parameters instead of a private key]' \
'-paramfile[file to supply public key parameters]:file:_files' \ '-paramfile[file to supply public key parameters]:file:_files' \
'-text[print an (unencrypted) text representation of private and public keys and parameters]' \ '-text[print an (unencrypted) text representation of private and public keys and parameters]' \
$openssl_random_state_options[@] \ $openssl_random_state_options[@] \
$openssl_provider_options[@] \ $openssl_provider_options[@] \
'-config[configuration file]:file:_files' '-config[configuration file]:file:_files'
} }
_openssl_genrsa() { _openssl_genrsa() {
@ -1441,17 +1443,17 @@ _openssl_pkcs12() {
_openssl_pkcs7() { _openssl_pkcs7() {
_arguments \ _arguments \
'(- *)-help[print help message]' \ '(- *)-help[print help message]' \
'-inform[input format]:format:(DER PEM)' \ '-inform[input format]:format:(DER PEM)' \
'-outform[output format]:format:(DER PEM)' \ '-outform[output format]:format:(DER PEM)' \
'-in[input file name]:file:_files' \ '-in[input file name]:file:_files' \
'-out[output file name]:file:_files' \ '-out[output file name]:file:_files' \
'-print[print out the full PKCS7 object]' \ '-print[print out the full PKCS7 object]' \
'-print_certs[print out any certificates or CRLs contained in the file]' \ '-print_certs[print out any certificates or CRLs contained in the file]' \
'-quiet[print out just the PEM-encoded certificates without any other output]' \ '-quiet[print out just the PEM-encoded certificates without any other output]' \
'-text[print out certificate details in full]' \ '-text[print out certificate details in full]' \
'-noout[do not output the encoded version of the PKCS#7 structure]' \ '-noout[do not output the encoded version of the PKCS#7 structure]' \
$openssl_provider_options[@] $openssl_provider_options[@]
} }
_openssl_pkcs8() { _openssl_pkcs8() {
@ -1460,51 +1462,51 @@ _openssl_pkcs8() {
) )
_arguments \ _arguments \
'(- *)-help[print help message]' \ '(- *)-help[print help message]' \
'-topk8[read a private key and write a PkCS#8 format key]' \ '-topk8[read a private key and write a PkCS#8 format key]' \
'-inform[input format]:format:(DER PEM)' \ '-inform[input format]:format:(DER PEM)' \
'-outform[output format]:format:(DER PEM)' \ '-outform[output format]:format:(DER PEM)' \
'-traditional[traditional format]' \ '-traditional[traditional format]' \
'-in[input file name]:file:_files' \ '-in[input file name]:file:_files' \
'-passin[input password source]:source:_openssl_pass_phrase_options' \ '-passin[input password source]:source:_openssl_pass_phrase_options' \
'-passout[output password source]:source:_openssl_pass_phrase_options' \ '-passout[output password source]:source:_openssl_pass_phrase_options' \
'-out[output file name]:files:_files' \ '-out[output file name]:files:_files' \
'-iter[number of iterations to create PKCS#8 containers]:count' \ '-iter[number of iterations to create PKCS#8 containers]:count' \
'-noiter[use 1 as iteration count]' \ '-noiter[use 1 as iteration count]' \
'-nocrypt[output unencrypted PrivateKeyInfo structure]' \ '-nocrypt[output unencrypted PrivateKeyInfo structure]' \
'-v2[algorithm for PKCS#5 v2.0]:alg:_openssl_cipher_algorithms' \ '-v2[algorithm for PKCS#5 v2.0]:alg:_openssl_cipher_algorithms' \
'-v2prf[PRF algorithm to use with PKCS#5 v2.0]:alg:(($prf_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' \ '-v1[algorithm for PKCS#5 v1.5 or PKCS#12]:alg:_openssl_cipher_algorithms' \
'-scrypt[use the script algorithm for private key encryption]' \ '-scrypt[use the script algorithm for private key encryption]' \
'-scrypt_N[scrypt "N" parameter]:n' \ '-scrypt_N[scrypt "N" parameter]:n' \
'-scrypt_r[scrypt "r" parameter]:r' \ '-scrypt_r[scrypt "r" parameter]:r' \
'-scrypt_p[scrypt "p" parameter]:p' \ '-scrypt_p[scrypt "p" parameter]:p' \
'-saltlen[length of the salt to use for the PBE algorithm]:length' \ '-saltlen[length of the salt to use for the PBE algorithm]:length' \
$openssl_random_state_options[@] \ $openssl_random_state_options[@] \
$openssl_provider_options[@] $openssl_provider_options[@]
} }
_openssl_pkey() { _openssl_pkey() {
_arguments \ _arguments \
'(- *)-help[print help message]' \ '(- *)-help[print help message]' \
$openssl_provider_options[@] \ $openssl_provider_options[@] \
'-check[check the consistency of a key pair for both public and private components]' \ '-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]' \ '-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' \ '-in[input file or URI]:file_or_uri:_files' \
'-inform[key input format]:format:(DER PEM P12 ENGINE)' \ '-inform[key input format]:format:(DER PEM P12 ENGINE)' \
'-passin[password source for the key input]:source:_openssl_pass_phrase_options' \ '-passin[password source for the key input]:source:_openssl_pass_phrase_options' \
'-pubin[read public key instead of private key]' \ '-pubin[read public key instead of private key]' \
'-out[output file name]' \ '-out[output file name]' \
'-outform[key output format]:format:(DER PEM)' \ '-outform[key output format]:format:(DER PEM)' \
'-cipher[cipher to encrypt the PEM encoded private key]:cipher:_openssl_ciphers' \ '-cipher[cipher to encrypt the PEM encoded private key]:cipher:_openssl_ciphers' \
'-passout[password source for the output file]:source:_openssl_pass_phrase_options' \ '-passout[password source for the output file]:source:_openssl_pass_phrase_options' \
'-traditional[use older "traditional" format]' \ '-traditional[use older "traditional" format]' \
'-pubout[output the public components]' \ '-pubout[output the public components]' \
'-noout[do not output the key in encoded form]' \ '-noout[do not output the key in encoded form]' \
'-text[output the various key components in plain text]' \ '-text[output the various key components in plain text]' \
'-text_pub[output only the public key components in text form]' \ '-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_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)' '-ec_param_enc[specify how the elliptic curve parameters are encoded]:type:(named_curve explicit)'
} }
_openssl_pkeyparam() { _openssl_pkeyparam() {
@ -1721,8 +1723,8 @@ _openssl_s_client() {
local tls_start_protocols=(smtp pop3 imap ftp xmpp xmpp-server irc postgres mysql lmtp nntp sieve ldap) local tls_start_protocols=(smtp pop3 imap ftp xmpp xmpp-server irc postgres mysql lmtp nntp sieve ldap)
_arguments \ _arguments \
'(- *)-help[print help message]' \ '(- *)-help[print help message]' \
'-ssl_config[section of the configuration file to configure the SSL_CTX object]:section' \ '-ssl_config[section of the configuration file to configure the SSL_CTX object]:section' \
'-connect[host and optional port to connect to]:host_port' \ '-connect[host and optional port to connect to]:host_port' \
'-host[host to connect to]:host' \ '-host[host to connect to]:host' \
'-port[port to connect to]:port' \ '-port[port to connect to]:port' \
@ -1830,134 +1832,149 @@ _openssl_s_client() {
$openssl_verification_options[@] \ $openssl_verification_options[@] \
'-enable_server_rpk[enable support for receiving raw public keys from the server]' \ '-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]' \ '-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' '*::host_port'
} }
_openssl_s_server() { _openssl_s_server() {
_arguments \ _arguments \
'(- *)-help[print help message]' \ '(- *)-help[print help message]' \
'-port[TCP port to listen on for connections(default: 4433)]:port' \ '-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' \ '-accept[optional TCP host and port to listen on for connections(default: *:4433)]:host_port' \
'-unix[Unix domain socket path]:path:_files' \ '-unix[Unix domain socket path]:path:_files' \
'(-4 -6)-4[use IPv4 only]' \ '(-4 -6)-4[use IPv4 only]' \
'(-4 -6)-6[use IPv6 only]' \ '(-4 -6)-6[use IPv6 only]' \
'-unlink[for -unix, unlink any existing socket first]' \ '-unlink[for -unix, unlink any existing socket first]' \
'-context[SSL context ID]:id' \ '-context[SSL context ID]:id' \
'(-verify -Verify)'{-verify,-Verify}'[verify depth]:depth' \ '(-verify -Verify)'{-verify,-Verify}'[verify depth]:depth' \
'-cert[certificate file]:file:_files' \ '-cert[certificate file]:file:_files' \
'-cert2[certificate file to use for servername(default: server2.pem)]:file:_files' \ '-cert2[certificate file to use for servername(default: server2.pem)]:file:_files' \
'-certform[server certificate file format]:format:(DER PEM P12)' \ '-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' \ '-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]' \ '-build_chain[application should build the server certificate chain]' \
'-serverinfo[file containing one or more blocks of PEM data]:file:_files' \ '-serverinfo[file containing one or more blocks of PEM data]:file:_files' \
'-key[private key file or URI]:file_or_uri:_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' \ '-key2[private key file or URI to use for servername]:file_or_uri:_files' \
'-keyform[key format]:format:(DER PEM P12 ENGINE)' \ '-keyform[key format]:format:(DER PEM P12 ENGINE)' \
'-pass[private key and certificate file password source]:source:_openssl_pass_phrase_options' \ '-pass[private key and certificate file password source]:source:_openssl_pass_phrase_options' \
'-dcert[additional certificate file]:file:_files' \ '-dcert[additional certificate file]:file:_files' \
'-dkey[additional private key file or URI]:file_or_uri:_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' \ '-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)' \ '-dcertform[format of the additional certificate file]:format:(DER PEM P12)' \
'-dkeyform[format of the additional private key]:format:(DER PEM P12 ENGINE)' \ '-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' \ '-dpass[passphrase for the additional private key and certificate]:pass:_openssl_pass_phrase_options' \
'-nbio_test[test non blocking I/O]' \ '-nbio_test[test non blocking I/O]' \
'-crlf[translate a line feed from the terminal into CR+LF]' \ '-crlf[translate a line feed from the terminal into CR+LF]' \
'-debug[print extensive debugging information including a hex dump of all traffic]' \ '-debug[print extensive debugging information including a hex dump of all traffic]' \
'-security_debug[print output from SSL/TLS security framework]' \ '-security_debug[print output from SSL/TLS security framework]' \
'-security_debug_verbose[print more 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]' \ '-msg[show all protocol messages with hex dump]' \
'-msgfile[file to send output of -msg or -trace to]:file:_files' \ '-msgfile[file to send output of -msg or -trace to]:file:_files' \
'-state[print the SSL session states]' \ '-state[print the SSL session states]' \
'-CRL[CRL file]:file:_files' \ '-CRL[CRL file]:file:_files' \
'-CRLform[CRL file format]:format:(DER PEM)' \ '-CRLform[CRL file format]:format:(DER PEM)' \
'-crl_download[download CRLs from distribution points]' \ '-crl_download[download CRLs from distribution points]' \
'-verifyCAfile[file in PEM format CA containing trusted certificates to verify client certificates]:file:_files' \ '-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 -/' \ '-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' \ '-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' \ '-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 -/' \ '-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' \ '-chainCAstore[URI of a store containing trusted certificates for building server certificate chain]:uri:_urls' \
'-nocert[no certificate is used]' \ '-nocert[no certificate is used]' \
'-quiet[inhibit printing of session and certificate information]' \ '-quiet[inhibit printing of session and certificate information]' \
'-no_resume_ephemeral[disable caching and tickets if ephemeral (EC)DH is used]' \ '-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]' \ '-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[send a status message back to the client when it connects]' \
'(-WWW -HTTP)'{-WWW,-HTTP}'[emulate a simple web server]' \ '(-WWW -HTTP)'{-WWW,-HTTP}'[emulate a simple web server]' \
'-http_server_binmode[acting as web-server open files in binary mode]' \ '-http_server_binmode[acting as web-server open files in binary mode]' \
'-no_ca_names[disable TLS Extension CA Names]' \ '-no_ca_names[disable TLS Extension CA Names]' \
'-ignore_unexpected_eof[peer does not need to send the close_notify alert]' \ '-ignore_unexpected_eof[peer does not need to send the close_notify alert]' \
'-servername[servername for HostName TLS extension]' \ '-servername[servername for HostName TLS extension]' \
'-servername_fatal[send fatal alert on servername mismatch]' \ '-servername_fatal[send fatal alert on servername mismatch]' \
'-id_prefix[generate SSL/TLS session IDs prefixed by this ID]:id' \ '-id_prefix[generate SSL/TLS session IDs prefixed by this ID]:id' \
'-keymatexport[export keying material using label]:label' \ '-keymatexport[export keying material using label]:label' \
'-keymatexportlen[export the given number of bytes of keying material(default: 20)]:length' \ '-keymatexportlen[export the given number of bytes of keying material(default: 20)]:length' \
'-no_cache[disable session cache]' \ '-no_cache[disable session cache]' \
'-ext_cache[disable internal cache]' \ '-ext_cache[disable internal cache]' \
'-verify_return_error[close the connection when verification errors occur]' \ '-verify_return_error[close the connection when verification errors occur]' \
'-verify_quiet[no verify output except verify errors]' \ '-verify_quiet[no verify output except verify errors]' \
'(-no_ign_eof -ign_eof)-ign_eof[ignore input EOF]' \ '(-no_ign_eof -ign_eof)-ign_eof[ignore input EOF]' \
'(-no_ign_eof -ign_eof)-no_ign_eof[do not ignore input EOF]' \ '(-no_ign_eof -ign_eof)-no_ign_eof[do not ignore input EOF]' \
'-no_ems[disable Extended master secret negotiation]' \ '-no_ems[disable Extended master secret negotiation]' \
'-status[enable certificate status request support]' \ '-status[enable certificate status request support]' \
'-status_verbose[enable certificate status request support and verbose output of OCSP response]' \ '-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' \ '-status_timeout[set the timeout for OCSP reponse to the given seconds]:seconds' \
'-proxy[HTTP(S) proxy server]:proxy' \ '-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' \ '-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_url[set a fallback responder URL]:url:_urls' \
'-status_file[status file]:file:_files' \ '-status_file[status file]:file:_files' \
'-ssl_config[configure SSL_CTX using the given configure value]:config' \ '-ssl_config[configure SSL_CTX using the given configure value]:config' \
'-trace[show verbose trace output of protocol messages]' \ '-trace[show verbose trace output of protocol messages]' \
'-brief[provide a brief summary of connection parameters]' \ '-brief[provide a brief summary of connection parameters]' \
'-rev[simple echo server that sends back received text reserved]' \ '-rev[simple echo server that sends back received text reserved]' \
'-async[switch on asynchronous mode]' \ '-async[switch on asynchronous mode]' \
'-max_send_frag[maximum size of data fragment to send]:size' \ '-max_send_frag[maximum size of data fragment to send]:size' \
'-split_send_frag[size used to split data for encrypt pipelines]:size' \ '-split_send_frag[size used to split data for encrypt pipelines]:size' \
'-max_pipelines[maximum number of encrypt/decrypt pipelines]:number' \ '-max_pipelines[maximum number of encrypt/decrypt pipelines]:number' \
'-naccept[server will exit after receiving the specified number of connections(default: unlimited)]:number' \ '-naccept[server will exit after receiving the specified number of connections(default: unlimited)]:number' \
'-read_buf[default read buffer size for connections]:size' \ '-read_buf[default read buffer size for connections]:size' \
'-no_tx_cert_comp[disable support for sending TLSv1.3 compressed certificates]' \ '-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_rx_cert_comp[disable support for receiving TLSv1.3 compressed certificates]' \
'-no_comp[disable negotiation of TLS compression]' \ '-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]' \ '-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' \ '-dhparam[DH parameter file to use]:file:_files' \
'-nbio[turn on non blocking I/O]' \ '-nbio[turn on non blocking I/O]' \
'-timeout[enable timeout]' \ '-timeout[enable timeout]' \
'-mtu[set link-layer MTU]:size' \ '-mtu[set link-layer MTU]:size' \
'-psk_identity[PSK identify when using a PSK cipher suite]:id' \ '-psk_identity[PSK identify when using a PSK cipher suite]:id' \
'-psk_hint[PSK identity hint when using a PSK cipher suite]:hint' \ '-psk_hint[PSK identity hint when using a PSK cipher suite]:hint' \
'-psk[PSK key when using a PSK cipher suite]:key' \ '-psk[PSK key when using a PSK cipher suite]:key' \
'-psk_session[file contains pem encoded SSL_SESSION data]:file:_files' \ '-psk_session[file contains pem encoded SSL_SESSION data]:file:_files' \
'-srpvfile[verifier file for SRP]:file:_files' \ '-srpvfile[verifier file for SRP]:file:_files' \
'-listen[listen on a UDP port for incoming connections]' \ '-listen[listen on a UDP port for incoming connections]' \
'-sctp[use SCTP for the transport protocol instead of UDP in DTLS]' \ '-sctp[use SCTP for the transport protocol instead of UDP in DTLS]' \
'-sctp_label_bug[allow communication with older broken implementations]' \ '-sctp_label_bug[allow communication with older broken implementations]' \
'-use_srtp[offer SRTP key management with a colon-separated profile list]:list' \ '-use_srtp[offer SRTP key management with a colon-separated profile list]:list' \
'-no_dhe[no DH parameters will be loaded]' \ '-no_dhe[no DH parameters will be loaded]' \
'-alpn[enable the Application-Layer Protocol Negotiation extension]:protocol' \ '-alpn[enable the Application-Layer Protocol Negotiation extension]:protocol' \
'-nextprotoneg[enable the Next Protocol Negotiation extension]:protocol' \ '-nextprotoneg[enable the Next Protocol Negotiation extension]:protocol' \
'-ktls[enable kernel TLS for sending and receiving]' \ '-ktls[enable kernel TLS for sending and receiving]' \
'-sendfile[SSL_sendfile will be used instead of BIO_write to send response]' \ '-sendfile[SSL_sendfile will be used instead of BIO_write to send response]' \
'-zerocopy_sendfile[SSL_sendfile will use the zerocopy TX mode]' \ '-zerocopy_sendfile[SSL_sendfile will use the zerocopy TX mode]' \
'-keylogfile[append TLS secrets to the specified keylog file]:file:_files' \ '-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' \ '-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' \ '-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]' \ '-early_data[accept early data where possible]' \
'-stateless[require TLSv1.3 cookies]' \ '-stateless[require TLSv1.3 cookies]' \
'(-anti_replay -no_anti_replay)-anti_replay[switch replay protection on]' \ '(-anti_replay -no_anti_replay)-anti_replay[switch replay protection on]' \
'(-anti_replay -no_anti_replay)-no_anti_replay[switch replay protection off]' \ '(-anti_replay -no_anti_replay)-no_anti_replay[switch replay protection off]' \
'-tfo[enable acceptance of TCP fast Open connections]' \ '-tfo[enable acceptance of TCP fast Open connections]' \
'-cert_comp[pre-compresses certificates that will be sent during the handshake]' \ '-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' \ '-nameopt[how the subject or issuer names are displayed]:how:_openssl_name_display_options' \
$openssl_tls_flags[@] \ $openssl_tls_flags[@] \
$openssl_dtls_flags[@] \ $openssl_dtls_flags[@] \
$openssl_supported_commands_flags[@] \ $openssl_supported_commands_flags[@] \
$openssl_extended_verification_flags[@] \ $openssl_extended_verification_flags[@] \
$openssl_trusted_certificate_options[@] \ $openssl_trusted_certificate_options[@] \
$openssl_random_state_options[@] \ $openssl_random_state_options[@] \
$openssl_provider_options[@] \ $openssl_provider_options[@] \
$openssl_verification_options[@] \ $openssl_verification_options[@] \
'-enable_server_rpk[enable support for sending raw public keys to the client]' \ '-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]' '-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]'
} }
_openssl_s_time() { _openssl_s_time() {

View File

@ -53,7 +53,7 @@ _openvpn3_config-acl() {
_arguments \ _arguments \
{-s,--show}"[Show the current access control lists]" \ {-s,--show}"[Show the current access control lists]" \
{-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \ {-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \ {-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]" \ {-S,--seal}"[Make the configuration profile permanently read-only]" \
{-R,--revoke}"[<UID | username> Revoke this user access from this configuration profile]" \ {-R,--revoke}"[<UID | username> Revoke this user access from this configuration profile]" \
@ -67,7 +67,7 @@ _openvpn3_config-import() {
_arguments \ _arguments \
{-p,--persistent}"[Make the configuration profile persistent through service restarts]" \ {-p,--persistent}"[Make the configuration profile persistent through service restarts]" \
{-n,--name}"[NAME Provide a different name for the configuration (default: CFG-FILE)]" \ {-n,--name}"[NAME Provide a different name for the configuration (default: CFG-FILE)]" \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
{-c,--config}"[CFG-FILE Configuration file to import]: :_files" {-c,--config}"[CFG-FILE Configuration file to import]: :_files"
} }
@ -76,7 +76,7 @@ _openvpn3_config-manage() {
{-s,--show}"[Show current configuration options]" \ {-s,--show}"[Show current configuration options]" \
{-r,--rename}"[NEW-CONFIG-NAME Renames the configuration]" \ {-r,--rename}"[NEW-CONFIG-NAME Renames the configuration]" \
{-o,--path}"[CONFIG-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \ {-o,--path}"[CONFIG-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \ {-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \
"--unset-override[<name> Removes the <name> override]" \ "--unset-override[<name> Removes the <name> override]" \
"--tls-version-min[<tls_1_0|tls_1_1|tls_1_2|tls_1_3> Sets the minimal TLS version for the control channel]: :(tls_1_0 tls_1_1 tls_1_2 tls_1_3)" \ "--tls-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() { _openvpn3_config-remove() {
_arguments \ _arguments \
{-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \ {-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \ {-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]" \ "--force[Force the deletion process without asking for confirmation]" \
"--config-path[OBJ-PATH Alias for --path]: :($configs_paths)" "--config-path[OBJ-PATH Alias for --path]: :($configs_paths)"
@ -113,24 +113,24 @@ _openvpn3_config-show() {
_arguments \ _arguments \
{-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \ {-o,--path}"[OBJ-PATH Path to the configuration in the configuration manager]: :($configs_paths)" \
{-j,--json}"[Dump the configuration in JSON format]" \ {-j,--json}"[Dump the configuration in JSON format]" \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($configs_names)" \ {-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)" "--config-path[OBJ-PATH Alias for --path]: :($configs_paths)"
} }
_openvpn3_configs-list() { _openvpn3_configs-list() {
_arguments \ _arguments \
{-h,--help}"[This help screen]" {-h,--help}"[Show help screen]"
} }
_openvpn3_help() { _openvpn3_help() {
_arguments \ _arguments \
{-h,--help}"[This help screen]" {-h,--help}"[Show help screen]"
} }
_openvpn3_log() { _openvpn3_log() {
_arguments \ _arguments \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
{-c,--config}"[CONFIG-NAME Alternative to --session-path, where configuration profile name is used instead]: :($sessions_configs_names $configs_names)" \ {-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)" \ {-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)" \ "--session-path[SESSION-PATH Receive log events for a specific session]: :($sessions_paths)" \
@ -142,7 +142,7 @@ _openvpn3_session-acl() {
_arguments \ _arguments \
{-s,--show}"[Show the current access control lists]" \ {-s,--show}"[Show the current access control lists]" \
{-o,--path}"[SESSION-PATH Path to the session in the session manager]: :($sessions_paths)" \ {-o,--path}"[SESSION-PATH Path to the session in the session manager]: :($sessions_paths)" \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($sessions_configs_names)" \ {-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]" \ {-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)" \ {-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() { _openvpn3_session-manage() {
_arguments \ _arguments \
{-o,--path}"[SESSION-PATH Path to the session in the session manager]: :($sessions_paths)" \ {-o,--path}"[SESSION-PATH Path to the session in the session manager]: :($sessions_paths)" \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($sessions_configs_names)" \ {-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($sessions_configs_names)" \
{-R,--resume}"[Resumes a paused VPN session]" \ {-R,--resume}"[Resumes a paused VPN session]" \
{-P,--pause}"[Pauses the VPN session]" \ {-P,--pause}"[Pauses the VPN session]" \
@ -169,7 +169,7 @@ _openvpn3_session-manage() {
_openvpn3_session-start() { _openvpn3_session-start() {
_arguments \ _arguments \
{-p,--config-path}"[CONFIG-PATH Configuration path to an already imported configuration]: :($configs_paths)" \ {-p,--config-path}"[CONFIG-PATH Configuration path to an already imported configuration]: :($configs_paths)" \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
{-c,--config}"[CONFIG-FILE Configuration file to start directly]: :_files" \ {-c,--config}"[CONFIG-FILE Configuration file to start directly]: :_files" \
"--persist-tun[Enforces persistent tun/seamless tunnel (requires --config)]" "--persist-tun[Enforces persistent tun/seamless tunnel (requires --config)]"
} }
@ -178,7 +178,7 @@ _openvpn3_session-stats() {
_arguments \ _arguments \
{-o,--path}"[SESSION-PATH Path to the configuration in the configuration manager]: :($sessions_paths)" \ {-o,--path}"[SESSION-PATH Path to the configuration in the configuration manager]: :($sessions_paths)" \
{-j,--json}"[Dump the configuration in JSON format]" \ {-j,--json}"[Dump the configuration in JSON format]" \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
{-c,--config}"[CONFIG-NAME Alternative to --path, where configuration profile name is used instead]: :($sessions_configs_names)" \ {-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)" \ {-I,--interface}"[INTERFACE Alternative to --path, where tun interface name is used instead]: :($sessions_interfaces)" \
"--session-path[SESSION-PATH Alias for --path]: :($sessions_paths)" "--session-path[SESSION-PATH Alias for --path]: :($sessions_paths)"
@ -186,12 +186,12 @@ _openvpn3_session-stats() {
_openvpn3_sessions-list() { _openvpn3_sessions-list() {
_arguments \ _arguments \
{-h,--help}"[This help screen]" {-h,--help}"[Show help screen]"
} }
_openvpn3_shell-completion() { _openvpn3_shell-completion() {
_arguments \ _arguments \
{-h,--help}"[This help screen]" \ {-h,--help}"[Show help screen]" \
"--list-commands[List all available commands]" \ "--list-commands[List all available commands]" \
"--list-options[COMMAND List all available options for a specific command]: :($(openvpn3 shell-completion --list-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]" "--arg-helper[OPTION Used together with --list-options, lists value hint to an option]"
@ -199,7 +199,7 @@ _openvpn3_shell-completion() {
_openvpn3_version() { _openvpn3_version() {
_arguments \ _arguments \
{-h,--help}"[This help screen]" {-h,--help}"[Show help screen]"
} }
_openvpn3_command() { _openvpn3_command() {
@ -210,7 +210,7 @@ _openvpn3_command() {
"config-remove: Remove an available configuration profile" "config-remove: Remove an available configuration profile"
"config-show: Show/dump a configuration profile" "config-show: Show/dump a configuration profile"
"configs-list: List all available configuration profiles" "configs-list: List all available configuration profiles"
"help: This help screen" "help: Show help screen"
"log: Receive log events as they occur" "log: Receive log events as they occur"
"session-acl: Manage access control lists for sessions" "session-acl: Manage access control lists for sessions"
"session-manage: Manage VPN sessions" "session-manage: Manage VPN sessions"
@ -225,7 +225,7 @@ _openvpn3_command() {
_describe -t commands 'openvpn3 commands' openvpn3_cmds _describe -t commands 'openvpn3 commands' openvpn3_cmds
else else
local curcontext="$curcontext" local curcontext="$curcontext"
cmd="${${openvpn3_cmds[(r)$words[1]:*]%%:*}}" local cmd="${${openvpn3_cmds[(r)$words[1]:*]%%:*}}"
if (($#cmd)); then if (($#cmd)); then
if (( $+functions[_openvpn3_$cmd] )); then if (( $+functions[_openvpn3_$cmd] )); then
_openvpn3_$cmd _openvpn3_$cmd
@ -239,7 +239,7 @@ _openvpn3_command() {
} }
_arguments \ _arguments \
{-h,--help}"[that This help screen]" \ {-h,--help}"[Show help screen]" \
"*::openvpn3 commands:_openvpn3_command" \ "*::openvpn3 commands:_openvpn3_command" \
# Local Variables: # Local Variables:

View File

@ -73,7 +73,7 @@ _pm2() {
'--no-color[skip colors]' \ '--no-color[skip colors]' \
'--no-vizion[start an app without vizion feature]' \ '--no-vizion[start an app without vizion feature]' \
'--np-autorestart[start an app without automatic restart]' \ '--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-pmx[start an app without pmx]' \
'--no-automation[start an app without automation]' \ '--no-automation[start an app without automation]' \
'(--disable-trace --trace)--trace[enable transaction tracing with km]' \ '(--disable-trace --trace)--trace[enable transaction tracing with km]' \
@ -93,9 +93,9 @@ _pm2() {
(start) (start)
_arguments \ _arguments \
'--watch[watch folder for changes]' \ '--watch[watch folder for changes]' \
'--fresh[Rebuild Dockerfile]' \ '--fresh[rebuild Dockerfile]' \
'--daemon[Run container in Daemon mode(debug purposes)]' \ '--daemon[run container in daemon mode(debug purposes)]' \
'--container[Start application in container mode]' \ '--container[start application in container mode]' \
'--dist[--with-container; change local Dockerfile to containerize all files in current directory]' \ '--dist[--with-container; change local Dockerfile to containerize all files in current directory]' \
'--image-name[with --dist; set the exported image name]:name' \ '--image-name[with --dist; set the exported image name]:name' \
'--node-version[with --container, set a specific major Node.js version]:version' \ '--node-version[with --container, set a specific major Node.js version]:version' \
@ -119,7 +119,7 @@ _pm2() {
(stop|restart) (stop|restart)
_arguments \ _arguments \
'(- *)'{-h,--help}'[output usage information]' \ '(- *)'{-h,--help}'[output usage information]' \
'--watch[Stop watching folder for changes]' \ '--watch[stop watching folder for changes]' \
'*: :_pm2_id_namespace_all' \ '*: :_pm2_id_namespace_all' \
&& ret=0 && ret=0
;; ;;
@ -231,8 +231,8 @@ _pm2_subcommands() {
"stop:stop a process" "stop:stop a process"
"restart:restart a process" "restart:restart a process"
"scale:scale up/down a process in cluster mode depending on total_number param" "scale:scale up/down a process in cluster mode depending on total_number param"
"profile\:mem:Sample PM2 heap memory" "profile\:mem:sample PM2 heap memory"
"profile\:cpu:Profile PM2 cpu" "profile\:cpu:profile PM2 cpu"
"reload:reload processes (note that its for app using HTTP/HTTPS)" "reload:reload processes (note that its for app using HTTP/HTTPS)"
"id:get process id by name" "id:get process id by name"
"inspect:inspect a process" "inspect:inspect a process"
@ -244,12 +244,12 @@ _pm2_subcommands() {
"install:install or update a module and run it forever" "install:install or update a module and run it forever"
"module\: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\: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" "uninstall:stop and uninstall a module"
"module\:uninstall:stop and uninstall a module" "module\:uninstall:stop and uninstall a module"
"package:Check & Package TAR type module" "package:check & package TAR type module"
"publish:Publish the module you are currently on" "publish:publish the module you are currently on"
"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>" "set:sets the specified config <key> <value>"
"multiset:multiset eg \"key1 val1 key2 val2\"" "multiset:multiset eg \"key1 val1 key2 val2\""
"get:get value for <key>" "get:get value for <key>"
@ -263,11 +263,11 @@ _pm2_subcommands() {
"unmonitor:unmonitor target process" "unmonitor:unmonitor target process"
"open:open the pm2 monitoring dashboard" "open:open the pm2 monitoring dashboard"
"plus:enable pm2 plus" "plus:enable pm2 plus"
"login:Login to pm2 plus" "login:login to pm2 plus"
"logout:Logout from pm2 plus" "logout:logout from pm2 plus"
"dump:dump all processes for resurrecting them later" "dump:dump all processes for resurrecting them later"
"save: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>" "send:send stdin to <pm_id>"
"attach:attach stdin/stdout to application identified by <pm_id>" "attach:attach stdin/stdout to application identified by <pm_id>"
"resurrect:resurrect previously dumped processes" "resurrect:resurrect previously dumped processes"
@ -297,7 +297,7 @@ _pm2_subcommands() {
"dash:launch dashboard with monitoring and logs" "dash:launch dashboard with monitoring and logs"
"flush:flush logs" "flush:flush logs"
"reloadLogs:reload all logs" "reloadLogs:reload all logs"
"logs:stream logs file. Default stream all logs" "logs:stream logs file (default is to stream all logs)"
"kill:kill daemon" "kill:kill daemon"
"pull:updates repository for a given app" "pull:updates repository for a given app"
"forward:updates repository to the next commit for a given app" "forward:updates repository to the next commit for a given app"

View File

@ -14,12 +14,103 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_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() { _pre_commit_commands() {
local commands=( local -a commands=(
"autoupdate:Auto-update pre-commit config to the latest repos' versions" "autoupdate:Auto-update pre-commit config to the latest repos' versions"
"clean:Clean out pre-commit files" "clean:Clean out pre-commit files"
"gc:Clean unused cached repos" "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'" "init-templatedir:Install hook script in a directory intended for use with 'git config init.templateDir'"
"install:Install the pre-commit script" "install:Install the pre-commit script"
"install-hooks:Install hook environments for all environments in the config file" "install-hooks:Install hook environments for all environments in the config file"
@ -32,181 +123,47 @@ _pre_commit_commands() {
"validate-manifest:Validate .pre-commit-hooks.yaml files" "validate-manifest:Validate .pre-commit-hooks.yaml files"
"help:Show help for a specific command" "help:Show help for a specific command"
) )
_describe 'pre-commit commands' commands _describe 'pre-commit commands' commands
} }
_pre_commit_options=( _pre_commit_git_remote_branches() {
"(- : *)"{-h,--help}"[show this help message and exit]" if (( $+commands[git] )); then
"(- : *)"{-V,--version}"[show program\'s version number and exit]" 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_autoupdate_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_git_local_branches() {
{-c,--config}"[Path to alternate config file]:config:_files -g '*.yaml'" if (( $+commands[git] )); then
"--bleeding-edge[Update to the bleeding edge of 'HEAD' instead of the latest tagged version]" local -a local_branches=(${(f)"$(git branch 2>/dev/null | cut -c3-)"})
"--freeze[Store 'frozen' hashes in 'rev' instead of tag names]" _values 'branch' $local_branches
"*--repo[Only update this repository -- may be specified multiple times]:repos:" fi
{-j,--jobs}"[Number of threads to use]:jobs" }
)
_pre_commit_git_remotes() {
_pre_commit_clean_options=( if (( $+commands[git] )); then
"(- : *)"{-h,--help}"[show this help message and exit]" local -a remote_names=(${(f)"$(git remote 2>/dev/null)"})
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)" _values 'remote' $remote_names
) fi
}
_pre_commit_gc_options=(
"(- : *)"{-h,--help}"[show this help message and exit]" _pre_commit_commit_types() {
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)" local -a types=(
) '0:retrieving a file from the index'
'1:changing branches'
_pre_commit_help_options=( )
"(- : *)"{-h,--help}"[show this help message and exit]"
":Command to show help for.:" _describe 'commit types' types
) }
_pre_commit_init_templatedir_options=( _pre_commit_git_refs() {
"(- : *)"{-h,--help}"[show this help message and exit]" if (( $+commands[git] )); then
"--color[Whether to use color in output. Defaults to 'auto']:color:(auto always never)" local -a refs=(${(f)"$(git branch -a 2>/dev/null | \grep -v HEAD | cut -c3- | sed 's/^remotes\///')"})
{-c,--config}"[Path to alternate config file]:config:_files -g '*.yaml'" _values 'ref' $refs
"--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 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 "$@" _pre_commit "$@"
# Local Variables: # Local Variables:

85
src/_pwsh Normal file
View File

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

View File

@ -45,7 +45,7 @@ _rails() {
local -a runtime_options rails_options local -a runtime_options rails_options
runtime_options=( runtime_options=(
'(- *)'{-h,--help}'[Show this help message and quit]' '(- *)'{-h,--help}'[Show help message and quit]'
'(- *)'{-v,--version}'[Show Rails version and quit]' '(- *)'{-v,--version}'[Show Rails version and quit]'
) )
@ -74,14 +74,14 @@ _rails() {
;; ;;
(console|c) (console|c)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Show this help message and quit]' \ '(- *)'{-h,--help}'[Show help message and quit]' \
'(-e --environment)'{-e,--environment=}'[The environment to run "console" in]:env:(test development production)' \ '(-e --environment)'{-e,--environment=}'[The environment to run "console" in]:env:(test development production)' \
'(-s --sandbox)'{-s,--sandbox}'[Rollback database modifications on exit]' \ '(-s --sandbox)'{-s,--sandbox}'[Rollback database modifications on exit]' \
&& ret=0 && ret=0
;; ;;
(server|s) (server|s)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Show this help message and quit]' \ '(- *)'{-h,--help}'[Show help message and quit]' \
'(-e --environment)'{-e,--environment=}'[The environment to run "server" in]:env:(test development production)' \ '(-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' \ '(-p --port)'{-p,--port}'[Run Rails on the specified port]:port' \
'(-b --binding)'{-b,--binding=}'[Bind Rails to the specified IP]:binding' \ '(-b --binding)'{-b,--binding=}'[Bind Rails to the specified IP]:binding' \
@ -98,7 +98,7 @@ _rails() {
;; ;;
(dbconsole|db) (dbconsole|db)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Show this help message and quit]' \ '(- *)'{-h,--help}'[Show help message and quit]' \
'(-e --environment)'{-e,--environment=}'[The environment to run "server" in]:env:(test development production)' \ '(-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]' \ '(-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)' \ '--mode=[Automatically put the sqlite3 database in the specified mode]:mode:(html list line column)' \
@ -109,7 +109,7 @@ _rails() {
;; ;;
(test|t|test:system) (test|t|test:system)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Show this help message and quit]' \ '(- *)'{-h,--help}'[Show help message and quit]' \
'--no-plugins[Bypass minitest plugin auto-loading]' \ '--no-plugins[Bypass minitest plugin auto-loading]' \
'(-s --seed)'{-s,--seed=}'[Sets random seed]:seed' \ '(-s --seed)'{-s,--seed=}'[Sets random seed]:seed' \
'(-v --verbose -q --quiet)'{-v,--verbose}'[Show progress processing files]' \ '(-v --verbose -q --quiet)'{-v,--verbose}'[Show progress processing files]' \
@ -133,7 +133,7 @@ _rails() {
;; ;;
(runner|r) (runner|r)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Show this help message and quit]' \ '(- *)'{-h,--help}'[Show help message and quit]' \
'(-e --environment)'{-e,--environment=}'[The environment to run "runner"]:env:(test development production)' \ '(-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]' \ '(-w --skip-executor)'{-w,--skip-executor}'[Do not wrap with Rails Executor]' \
'*:: :_files -g "*.rb"' \ '*:: :_files -g "*.rb"' \
@ -147,7 +147,7 @@ _rails() {
;; ;;
(routes) (routes)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Show this help message and quit]' \ '(- *)'{-h,--help}'[Show help message and quit]' \
'(-c --controller)'{-c,--controller=}'[Filter by a specific controller]:controller' \ '(-c --controller)'{-c,--controller=}'[Filter by a specific controller]:controller' \
'(-g --grep)'{-g,--grep}'[Grep routes by a specific pattern]' \ '(-g --grep)'{-g,--grep}'[Grep routes by a specific pattern]' \
'(-E --expanded)'{-E,--expanded}'[Print routes expanded vertically with parts explained]' \ '(-E --expanded)'{-E,--expanded}'[Print routes expanded vertically with parts explained]' \
@ -353,7 +353,7 @@ _rails_generate() {
(generate) (generate)
local -a opts local -a opts
opts=( opts=(
'(- *)'{-h,--help}'[Show this help message and quit]' '(- *)'{-h,--help}'[Show help message and quit]'
$runtime_options $runtime_options
'--skip-namespace[Skip namespace]' '--skip-namespace[Skip namespace]'
'--skip-collision-check[Skip collision check]' '--skip-collision-check[Skip collision check]'

View File

@ -35,7 +35,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(- *)'{-V,--version}'[display version]' \ '(- *)'{-V,--version}'[display version]' \
'(-0 --zero)'{-0,--zero}'[use the nul character as line separator]' '(-0 --zero)'{-0,--zero}'[use the nul character as line separator]'

View File

@ -28,7 +28,7 @@
# Description # Description
# ----------- # -----------
# #
# Completion script for rubocop 1.82.1 (https://github.com/rubocop/rubocop) # Completion script for rubocop 1.86.1 (https://github.com/rubocop/rubocop)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
@ -73,6 +73,7 @@ _arguments \
'(-C --cache)'{-C,--cache}'[Use result caching or not]:flag:(true false)' \ '(-C --cache)'{-C,--cache}'[Use result caching or not]:flag:(true false)' \
'--cache-root[Set the cache root directory]:dir:_files -/' \ '--cache-root[Set the cache root directory]:dir:_files -/' \
'--lsp[Start a language server listening on STDIN]' \ '--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]' \ '--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)--restart-server[Restart server process]' \
'(--restart-server --start-server --stop-server)--start-server[Start server process]' \ '(--restart-server --start-server --stop-server)--start-server[Start server process]' \

View File

@ -93,7 +93,7 @@ _sbt() {
unfiltered/unfiltered.g8 unfiltered/unfiltered.g8
scalatra/scalatra-sbt.g8 scalatra/scalatra-sbt.g8
) )
_values 'g8_templates' $g8_templates _values 'g8_templates' $g8_templates && ret=0
;; ;;
esac esac
;; ;;

View File

@ -208,13 +208,13 @@ _scala() {
;; ;;
(*) (*)
case $service in case $service in
(scala) (scala)
_arguments $scala_options $common_options "*::filename:_files" && ret=0 _arguments $scala_options $common_options "*::filename:_files" && ret=0
;; ;;
(scalac) (scalac)
_arguments $common_options "*::filename:_files" && ret=0 _arguments $common_options "*::filename:_files" && ret=0
;; ;;
esac esac
;; ;;
esac esac

View File

@ -121,10 +121,10 @@ _setcap_capabilities() {
_setcap "$@" _setcap "$@"
# Local variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script
# sh-indentation: 2 # sh-indentation: 2
# indent-tabs-mode: nil # indent-tabs-mode: nil
# sh-basic-offset: 2 # sh-basic-offset: 2
# End: # End:
# ex: sw=2 ts=2 et filetype=sh # vim: ft=zsh sw=2 ts=2 et

View File

@ -93,8 +93,8 @@ _tmuxp() {
&& ret=0 && ret=0
;; ;;
(shell) (shell)
local sessions="$(__tmux_sessions)" local sessions="$(__tmuxp_tmux_sessions)"
local windows="$(__tmux_windows)" local windows="$(__tmuxp_tmux_windows)"
_arguments \ _arguments \
'(- *)'{-h,--help}'[show help message and exit]' \ '(- *)'{-h,--help}'[show help message and exit]' \
'-S[pass-through for tmux -S]: :_files' \ '-S[pass-through for tmux -S]: :_files' \
@ -173,21 +173,19 @@ __tmuxp_import() {
(project) (project)
if [[ $line[1] == 'tmuxinator' ]] if [[ $line[1] == 'tmuxinator' ]]
then then
_wanted tmuxinator-projects exp 'tmuxinator projects' compadd $(tmuxinator completions start) _wanted tmuxinator-projects expl 'tmuxinator projects' compadd $(tmuxinator completions start)
fi fi
;; ;;
esac esac
} }
__tmux_sessions () { __tmuxp_tmux_sessions() {
local tmux_sessions local tmux_sessions=($(_call_program tmux_sessions 'tmux ls -F "#{session_name}"'))
tmux_sessions=($(_call_program tmux_sessions 'tmux ls -F "#{session_name}"'))
echo $tmux_sessions echo $tmux_sessions
} }
__tmux_windows () { __tmuxp_tmux_windows() {
local tmux_windows local tmux_windows=($(_call_program tmux_sessions 'tmux ls -F "#{window_name}"'))
tmux_windows=($(_call_program tmux_sessions 'tmux ls -F "#{window_name}"'))
echo $tmux_windows echo $tmux_windows
} }

View File

@ -194,7 +194,7 @@ local -a opts=(
"--excludeFiles[Remove a list of files from the watch mode's processing]:files:_files" "--excludeFiles[Remove a list of files from the watch mode's processing]:files:_files"
"--libReplacement[Enable library replacement]" "--libReplacement[Enable library replacement]"
"--erasableSyntaxOnly[Ensures that runtime constructs which are not part of ECMAScript are not allowed]" "--erasableSyntaxOnly[Ensures that runtime constructs which are not part of ECMAScript are not allowed]"
'*:: :_files' \ '*:: :_files'
) )
if (( $+opt_args[--build] )); then if (( $+opt_args[--build] )); then

View File

@ -61,7 +61,7 @@ case $OSTYPE in
;; ;;
(*) (*)
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(- *)'{-V,--version}'[display version]' \ '(- *)'{-V,--version}'[display version]' \
'(-r --random)'{-r,--random}'[generate random-based uuid]' \ '(-r --random)'{-r,--random}'[generate random-based uuid]' \
'(-t --time)'{-t,--time}'[generate time-based uuid]' \ '(-t --time)'{-t,--time}'[generate time-based uuid]' \

View File

@ -35,7 +35,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(-g --group -p --passwd)'{-g,--group}'[edit group database]' \ '(-g --group -p --passwd)'{-g,--group}'[edit group database]' \
'(-g --group -p --passwd)'{-p,--passwd}'[edit passwd database]' \ '(-g --group -p --passwd)'{-p,--passwd}'[edit passwd database]' \
'(-q --quiet)'{-q,--quiet}'[quiet mode]' \ '(-q --quiet)'{-q,--quiet}'[quiet mode]' \

View File

@ -48,7 +48,7 @@ _wdctl_output_columns() {
} }
_arguments -s \ _arguments -s \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(- *)'{-V,--version}'[display version]' \ '(- *)'{-V,--version}'[display version]' \
'(-f --flags)'{-f,--flags}'[print selected flags only]:flags' \ '(-f --flags)'{-f,--flags}'[print selected flags only]:flags' \
'(-F --noflags)'{-F,--noflags}'[do not print information about flags]' \ '(-F --noflags)'{-F,--noflags}'[do not print information about flags]' \

View File

@ -23,3 +23,11 @@ local modes=('up\:"bring a wireguard interface up"'\
# 2: Complete interface with all .conf files in /etc/wireguard without the filename extension. # 2: Complete interface with all .conf files in /etc/wireguard without the filename extension.
_arguments "1:mode:((${modes}))"\ _arguments "1:mode:((${modes}))"\
'2:interface:_path_files -W /etc/wireguard -g "*.conf(^/:r)"' '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

View File

@ -345,7 +345,8 @@ _yarn_cache() {
_arguments \ _arguments \
'(- *)'{-h,--help}'[show help message and exit]' \ '(- *)'{-h,--help}'[show help message and exit]' \
'--mirror[remove the global cache files instead of the local cache files]' \ '--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]' '--all[remove both the global cache files and the local cache files of the current project]' \
&& ret=0
;; ;;
esac esac
;; ;;
@ -640,8 +641,6 @@ _yarn_plugin_subcommands() {
(( $+functions[_yarn_run] )) || (( $+functions[_yarn_run] )) ||
_yarn_run() { _yarn_run() {
local ret=1
_arguments \ _arguments \
'(- *)'{-h,--help}'[show help message and exit]' \ '(- *)'{-h,--help}'[show help message and exit]' \
'--json[format the output as an NDJSON stream]' \ '--json[format the output as an NDJSON stream]' \
@ -651,10 +650,7 @@ _yarn_run() {
'(-B --binaries-only)'{-B,--binaries-only}'[ignore any user defined scripts and only check binaries]' \ '(-B --binaries-only)'{-B,--binaries-only}'[ignore any user defined scripts and only check binaries]' \
'*--require[preload given module]:module' \ '*--require[preload given module]:module' \
'1: :_yarn_scripts' \ '1: :_yarn_scripts' \
'*:: :_files' \ '*:: :_files'
&& ret=0
return ret
} }
(( $+functions[_yarn_set] )) || (( $+functions[_yarn_set] )) ||
@ -908,7 +904,7 @@ _yarn_scripts() {
fi fi
local -a candidates=($scripts $binaries) local -a candidates=($scripts $binaries)
_values 'scripts' $candidates _wanted candidates expl 'scripts' compadd -a candidates
} }
_yarn "$@" _yarn "$@"

View File

@ -56,7 +56,7 @@ _zramctl_output_columns() {
} }
_arguments \ _arguments \
'(- *)'{-h,--help}'[display this help]' \ '(- *)'{-h,--help}'[display help]' \
'(- *)'{-V,--version}'[display version]' \ '(- *)'{-V,--version}'[display version]' \
'(-a --algorithm)'{-a,--algorithm}'[compression algorithm to use]:algorithm:(lzo lz4 lz4hc deflate 842 zstd)' \ '(-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' \ '(-b --bytes)'{-b,--bytes}'[print sizes in bytes rather than in human readable format]:bytes' \

View File

@ -296,7 +296,7 @@ _regex_arguments _cmd /$'[^\0]##\0'/ \( /$'word1(a|b|c)\0'/ ':word:first word:(w
_cmd "$@" _cmd "$@"
#+END_SRC #+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 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 followed by and a, b, or c, or a filename. word is allowed which can be word2 or word22 followed by and a, b, or c.
If this sounds too complicated a much simpler alternative is to use the _regex_words function for creating If this sounds too complicated a much simpler alternative is to use the _regex_words function for creating
specifications for _regex_arguments. specifications for _regex_arguments.