Compare commits

..

1 Commits

Author SHA1 Message Date
F.B. d8f4a714cd
Merge 5359bbf0e7 into fd4a16961f 2026-03-27 11:08:17 +00:00
3 changed files with 60 additions and 259 deletions

View File

@ -1,103 +0,0 @@
#compdef cpanm
# ------------------------------------------------------------------------------
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for cpanm 1.7049 (https://github.com/miyagawa/cpanminus)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
_arguments -n -C -s \
'(-i --install)'{-i,--install}'[Install the modules]' \
'--self-upgrade[Upgrades itself]' \
'--info[Displays the distribution information in "AUTHOR/Dist-Name-ver.tar.gz" format in the stdout]' \
"--installdeps[Installs the dependencies of the target distribution but won't build itself]" \
'--look[Download and unpack the distribution and then open the directory with your shell]' \
'(- *)'{-h,--help}'[Display the help message]' \
'(- *)'{-V,--version}'[Display the version number]' \
'(-f --force)'{-f,--force}'[Force install modules even when testing failed]' \
'(-n --notest)'{-n,--notest}'[Skip the testing of modules]' \
'--test-only[Run the tests only]' \
'(-S --sudo)'{-S,--sudo}'[Switch to the root user with "sudo" when installing modules]' \
'(-v --verbose)'{-v,--verbose}'[Makes the output verbose]' \
'(-q --quiet)'{-q,--quiet}'[Makes the output even more quiet than the default]' \
'(-l --local-lib)'{-l,--local-lib}'[Sets the local::lib compatible path to install modules to]' \
'(-L --local-lib-contained)'{-L,--local-lib-contained}'[Same with "--local-lib" but with --self-contained set]' \
'--self-contained[When examining the dependencies, assume no non-core modules are installed on the system]' \
"--exclude-vendor[Don't include module installed under the 'vendor' paths]" \
'--mirror=[Specifies the base URL for the CPAN mirror to use]:mirror' \
"--mirror-only[Download the mirror's index file instead of querying the CPAN Meta DB]" \
'(-M --from)'{-M,--from}='[Use the given mirror URL and its index as the only source to search and download modules from]' \
'--mirror-index[Specifies the file path to "02packages.details.txt" for module search index]' \
'--cpanmetadb[Specifies an alternate URI for CPAN MetaDB index lookups]' \
'--metacpan[Prefers MetaCPAN API over CPAN MetaDB]' \
'--cpanfile=[Specified an alternate path for cpanfile]: :_files' \
"--prompt[Prompts when a test fails so that you can skip, force install, retry or look what's going wrong]" \
'--dev[Search for a newer developer release as well]' \
'--reinstall[Reinstall even if your locally installed version is latest]' \
'--interactive[Makes the configuration interactive]' \
'(--pp --pureperl)'{--pp,--pureperl}'[Prefer Pure perl build of modules]' \
'--with-recommends[Installs dependencies declared as "recommends"]' \
'--with-suggests[Installs dependencies declared as "suggests"]' \
'--with-develop[Install develop phase dependencies in "cpanfile"]' \
'--with-configure[Installs configure phase dependencies in "cpanfile"]' \
'--with-feature=[Specifies the feature to enable]::feature' \
'--without-feature=[Not specifies the feature to enable]::feature' \
'--with-all-feature[Specifies the all features to enable]' \
'--configure-timeout=[Specify the timeout length to wait for the configure]' \
'--build-timeout=[Specify the timeout length to wait for the build]' \
'--test-timeout=[Specify the timeout length to wait for the test]' \
'--configure-args=[Pass arguments for configure]:args' \
'--build-args=[Pass arguments for build]:args' \
'--test-args=[Pass arguments for test]:args' \
'--install-args=[Pass arguments for install]:args' \
'--scandeps[Scans the dependencies of given modules and output the tree in a text format]' \
'--format=[Determines what format to display the scanned dependency tree]:fmt:(tree json yaml dists)' \
'--save-dist=[Specifies the optional directory path to copy downloaded tarballs]: :_files -/' \
'(-U --uninstall)'{-U,--uninstall}'[Uninstalls a module from the library path]' \
'--cascade-search[Specifies whether to cascade search when you specify multiple mirrors]' \
'--skip-installed[Skip install if specified module is already installed]' \
'--skip-satisfies[Skip install if specified module and version is already installed]' \
'--verify[Verify the integrity of distribution files]' \
'--report-perl-version[Report perl version as port of User-Agent]' \
'--auto-cleanup[Specifies the number of days in which cpanm work directories expire]::days' \
'--man-pages[Generate man pages for executables(man1) and libraries(man3)]' \
'--lwp[Uses LWP module to download stuff over HTTP]' \
'--wget[Uses GNU Wget(if available) to download stuff]' \
'--curl[Uses cURL(if available) to download stuff]' \
&& return 0
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

121
src/_cpm
View File

@ -1,121 +0,0 @@
#compdef cpm
# ------------------------------------------------------------------------------
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for cpm 0.998003 (https://github.com/skaji/cpm)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
_cpm() {
typeset -A opt_args
local context state line
local curcontext="$curcontext"
local ret=1
_arguments -C \
'(- *)'{-h,--help}'[Show help message]' \
'(- *)--version[Show version and exit]' \
'(-v --verbose)'{-v,--verbose}'[Enable debug mode]' \
'1: :_cpm_subcommands' \
'*::arg:->args' && ret=0
case $state in
(args)
case $words[1] in
(install)
_arguments \
'(-w --workers)'{-w,--workers=}'[number of workers(default=5)]:num' \
'(-L --local-lib-contained)'{-L,--local-lib-contained=}'[directory to install module into, default=local/]: :_files -/' \
'(-g --global)'{-g,--global}'[install modules into current @INC instead of local/]' \
'(-v --verbose)'{-v,--verbose}'[verbose mode]' \
'(--prebuilt --no-prebuilt)--prebuilt[save builds for CPAN distributions and later install the prebuilts if available]' \
'(--prebuilt --no-prebuilt)--no-prebuilt[no prebuilt]' \
'--target-perl=[install modules as if version is your perl is VERSION]:version' \
'--mirror[base URL for the CPAN mirror to use]:url' \
'(--pp --pureperl-only)'{--pp,--pureperl-only}'[prefer pureperl only build]' \
'(--static-install --no-static-install)--static-install[enable the static install]' \
'(--static-install --no-static-install)--no-static-install[disable the static install]' \
\*{-r,--resolver=}'[specify resolvers]:resolver' \
'--no-defult-resolvers[Use default resolvers if you specify --resolver option]' \
'--reinstall[reinstall the distribution even if you already have the latest version installed]' \
'--dev[resolve TRIAL distributions too]' \
'(--color --no-color)--color[turn on color output]' \
'(--color --no-color)--no-color[turn off color output]' \
'(--test --no-test)--test[run test cases]' \
'(--test --no-test)--no-test[do not run test cases]' \
'--man-pages[generate man pages]' \
'(--retry --no-retry)--retry[retry configure/build/test/install if fails]' \
'(--retry --no-retry)--no-retry[do not retry]' \
'--show-build-log-on-failure[show build.log on failure]' \
'--configure-timeout=[specify configure timeout second]:sec' \
'--build-timeout=[specify build timeout second]:sec' \
'--test-timeout=[specify test timeout second]:sec' \
'(--show-progress --no-show-progress)--show-progress[show progress]' \
'(--show-progress --no-show-progress)--no-show-progress[do not show progress]' \
'--cpmfile=[specify cpmfile path]: :_files' \
'--cpanfile=[specify cpanfile path]: :_files' \
'--metafile=[specify META file path]: :_files' \
'--snapshot=[specify cpanfile.snapshot path]: :_files' \
'(- *)'{-V,--version}'[show version]' \
'(- *)'{-h,--help}'[show help message]' \
'*--feature=[specify the feature to enable in cpanfile]:feature' \
'*:modules' \
&& ret=0
;;
(*)
ret=0
;;
esac
esac
return ret
}
(( $+functions[_cpm_subcommands] )) ||
_cpm_subcommands() {
local -a commands=(
"install:Install modules"
"help:Show help"
"version:Show version"
)
_describe -t subcommands "subcommands" commands
}
_cpm "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

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