Merge pull request #928 from zsh-users/update-cap

Update Capistrano completion
This commit is contained in:
Shohei YOSHIDA 2022-11-17 08:27:16 +09:00 committed by GitHub
commit dd7a1378d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 25 deletions

View File

@ -28,13 +28,14 @@
# Description # Description
# ----------- # -----------
# #
# Completion script for Capistrano (http://capify.org). # Completion script for Capistrano 3.17.1 (https://capistranorb.com/)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
# ------- # -------
# #
# * Bruno Michel (https://github.com/nono) # * Bruno Michel (https://github.com/nono)
# * Shohei Yoshida (https://github.com/syohex)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -42,32 +43,43 @@
local curcontext="$curcontext" state line cmds ret=1 local curcontext="$curcontext" state line cmds ret=1
_arguments -C \ _arguments -C \
{-d,--debug}'[Prompts before each remote command execution]' \ '--backtrace=[Enable full backtrace]: :(stderr stdout)' \
{-e,--explain}'[Displays help (if available) for the task]:task' \ '--comments[Show commented tasks only]' \
{-F,--default-config}'[Always use default config, even with -f]' \ '--job-stats[Display job statistics]:level' \
{-f,--file}'[A recipe file to load. May be given more than once]:file:_files' \ '--suppress-backtrace[Suppress backtrace lines matching regexp PATTERN]:pattern' \
{-H,--long-help}'[Explain these options and environment variables]' \ '(-A --all)'{-A,--all}'[Show all tasks, even uncommented ones]' \
{-h,--help}'[Display this help message]' \ '(-B --build-all)'{-B,--build-all}'[Build all prerequisites, including those which are up-to-date]' \
{-l,--logger}'[Choose logger method. STDERR used by default]:file:_files' \ '(-C --directory)'{-C,--directory}'[Change to DIRECTORY before doing anything]: :_files -/' \
{-n,--dry-run}'[Prints out commands without running them]' \ '(-D --describe)'{-D,--describe}'[Describe the tasks, then exit]:pattern' \
{-p,--password}'[Immediately prompt for the password]' \ '(-E --execute-continue)'{-E,--execute-continue}'[Execute Ruby code and exit]:code' \
{-q,--quiet}'[Make the output as quiet as possible]' \ '(-f --rakefile)'{-f,--rakefile}'[Use FILENAME as the rakefile to search for]: :_files' \
{-r,--preserve-roles}'[Preserve task roles]' \ '(-G --no-system --nosystem)'{-G,--no-system,--nosystem}'[Use standard project Rakefile search paths, ignore system wide rakefiles]' \
{-S,--set-before}'[Set a variable before the recipes are loaded]:variable' \ '(-g --system)'{-g,--system}'[Using system wide rakefiles]' \
{-s,--set}'[Set a variable after the recipes are loaded]:variable' \ '(-I --libdir)'\*{-I,--libdir}'[Include LIBDIR in the search path for required modules]: :_files -/' \
{-T,--tasks}'[List all tasks (matching optional PATTERN) in the loaded recipe files]:pattern' \ '(-j --jobs)'{-j,--jobs}'[Specifies the maximum number of tasks to execute in parallel]:num' \
{-t,--tool}'[Abbreviates the output of -T for tool integration]' \ '(-m --multitask)'{-m,--multitask}'[Treat all tasks as multitasks]' \
{-V,--version}'[Display the Capistrano version, and exit]' \ '(-N --no-search --nosearch)'{-N,--no-search,--nosearch}'[Do not search parent directories for the Rakefile]' \
{-v,--verbose}'[Be more verbose. May be given more than once]' \ '(-P --prereqs)'{-P,--prereqs}'[Display the tasks and dependencies, then exit]' \
{-X,--skip-system-config}'[Do not load the system config file (capistrano.conf)]' \ '--execute-print[Execute some Ruby code, print the result, then exit]:code' \
{-x,--skip-user-config}'[Do not load the user config file (.caprc)]' \ '--require[Require MODULE before executing rakefile]:module' \
'*: :->cmds' && ret=0 '(-R --rakelibdir --rakelib)'{-R,--rakelibdir,--rakelib}'[Auto-import any .rake files in RAKELIBDIR]: :_files -/' \
'(-t --trace)'{-t,--trace}'[Turn on invoke/execute tracing, enable full backtrace]: :(stderr stdout)' \
'(-T --tasks)'{-T,--tasks}'[Display the tasks with descriptions]::pattern' \
'(-W --where)'{-W,--where}'[Describe the tasks then exit]::pattern' \
'(-X --no-deprecation-warnings)'{-X,--no-deprecation-warnings}'[Disable the deprecation warnings]' \
'(- *)'{-V,--version}'[Display the program version]' \
'(-n --dry-run)'{-n,--dry-run}'[Do a dry run without executing actions]' \
'(-r --roles)'{-r,--roles}'[Run SSH commands only on hosts matching these roles]:roles' \
'(-z --hosts)'{-z,--hosts}'[Run SSH commands only on matching hosts]:hosts' \
'(-p --print-config-variables)'{-p,--print-config-variables}'[Display the defined config variables before starting the deployment tasks]' \
'(- *)'{-h,-H,--help}'[Display help message]' \
'*: :->cmds' && ret=0
case $state in case $state in
cmds) cmds)
cmds=( ${(f)"$(_call_program commands cap -T 2> /dev/null | sed -e '/ # /!d; s/:/\\:/g; s/cap \([A-Za-z0-9\\:_-]*\) .*# /\1:/')"} ) cmds=( ${(f)"$(_call_program commands cap -T 2>/dev/null | sed -e '/ # /!d; s/:/\\:/g; s/cap \([A-Za-z0-9\\:_-]*\) .*# /\1:/')"} )
_describe -t commands 'cap command' cmds && ret=0 _describe -t commands 'cap command' cmds && ret=0
;; ;;
esac esac
return ret return ret