Compare commits
18 Commits
93813bd144
...
d8f4a714cd
| Author | SHA1 | Date |
|---|---|---|
|
|
d8f4a714cd | |
|
|
fd4a16961f | |
|
|
012017166b | |
|
|
109a9c809d | |
|
|
64487c7f40 | |
|
|
47d0792461 | |
|
|
748efd8af7 | |
|
|
519f6d6cee | |
|
|
748d11083a | |
|
|
a5d34d3aef | |
|
|
b1ffb771c9 | |
|
|
77ec5ecd6b | |
|
|
118705c01a | |
|
|
6879291030 | |
|
|
e118561a37 | |
|
|
2fdd13ab92 | |
|
|
5993fc38e7 | |
|
|
e4006dea72 |
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -72,7 +72,7 @@ _gist() {
|
|||
_gist_cache_policy() {
|
||||
# rebuild if cache is more than a day old
|
||||
local -a oldp
|
||||
oldp=( "$1"(mh+1) )
|
||||
oldp=( "$1"(m+1) )
|
||||
(( $#oldp ))
|
||||
}
|
||||
|
||||
|
|
|
|||
76
src/_golang
76
src/_golang
|
|
@ -44,7 +44,7 @@
|
|||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
__go_buildmodes() {
|
||||
__golang_buildmodes() {
|
||||
local -a buildmodes=(
|
||||
'archive[non-main packages into .a files]'
|
||||
'c-archive[main package, plus all packages it imports, into a C archive file]'
|
||||
|
|
@ -59,7 +59,7 @@ __go_buildmodes() {
|
|||
_values 'mode' $buildmodes
|
||||
}
|
||||
|
||||
__go_runtimedebug() {
|
||||
__golang_runtimedebug() {
|
||||
local -a vars=(
|
||||
'allocfreetrace[profile allocations]:boolean:(1 0)'
|
||||
'clobberfree[clobber memory after free]:boolean:(1 0)'
|
||||
|
|
@ -84,7 +84,7 @@ __go_runtimedebug() {
|
|||
_values -s ',' -S '=' "runtime debug behavior" $vars[@]
|
||||
}
|
||||
|
||||
__go_gcdebugflags() {
|
||||
__golang_gcdebugflags() {
|
||||
_values -s , -S = 'debug flag' \
|
||||
'append[print information about append compilation]' \
|
||||
'checkptr[instrument unsafe pointer conversions]:pointer conversion checks:((0\:"instrumentation disabled" 1\:"conversions involving unsafe.Pointer are instrumented" 2\:"conversions to unsafe.Pointer force heap allocation"))' \
|
||||
|
|
@ -109,7 +109,7 @@ __go_gcdebugflags() {
|
|||
'ssa/help[print help about SSA debugging]'
|
||||
}
|
||||
|
||||
__go_gcflags() {
|
||||
__golang_gcflags() {
|
||||
_arguments \
|
||||
'-%[debug non-static initializers]' \
|
||||
'-c=[concurrency during compilation]:int' \
|
||||
|
|
@ -131,7 +131,7 @@ __go_gcflags() {
|
|||
'-buildid=[record id as the build id in the export metadata]:id' \
|
||||
'-complete[compiling complete package (no C or assembly)]' \
|
||||
'-cpuprofile=[write cpu profile to file]:file' \
|
||||
'-d=[print debug information about items in list; try -d help]:list: __go_gcdebugflags' \
|
||||
'-d=[print debug information about items in list; try -d help]:list: __golang_gcdebugflags' \
|
||||
'-dwarf[generate DWARF symbols (default true)]' \
|
||||
'-dwarfbasentries[use base address selection entries in DWARF (default true)]' \
|
||||
'-dwarflocationlists[add location lists to DWARF in optimized mode (default true)]' \
|
||||
|
|
@ -173,7 +173,7 @@ __go_gcflags() {
|
|||
'-wb[enable write barrier (default true)]'
|
||||
}
|
||||
|
||||
__go_pgo() {
|
||||
__golang_pgo() {
|
||||
_alternative \
|
||||
"name:name:(auto off)" \
|
||||
"file:file:_files"
|
||||
|
|
@ -203,9 +203,9 @@ local -a commands=(
|
|||
'help:get more information about a command'
|
||||
)
|
||||
|
||||
__go_envvarvals() {
|
||||
# if __go_envvarvals is called for -value-, I use the function argument to
|
||||
# decide which variable to go to. if $1 is not set, then __go_envvarvals is
|
||||
__golang_envvarvals() {
|
||||
# if __golang_envvarvals is called for -value-, I use the function argument to
|
||||
# decide which variable to go to. if $1 is not set, then __golang_envvarvals is
|
||||
# called from the `go env` completion and the current word (with all after
|
||||
# the first '=' removed) is the current variable.
|
||||
local env_variable=${1-${words[$CURRENT]%%=*}}
|
||||
|
|
@ -276,7 +276,7 @@ __go_envvarvals() {
|
|||
_dispatch $service -value-,${variable#CGO_},-default-
|
||||
;;
|
||||
(GODEBUG)
|
||||
__go_runtimedebug
|
||||
__golang_runtimedebug
|
||||
;;
|
||||
(GOFLAGS)
|
||||
# not implemented, sorry
|
||||
|
|
@ -294,7 +294,7 @@ __go_envvarvals() {
|
|||
esac
|
||||
}
|
||||
|
||||
__go_packages() {
|
||||
__golang_packages() {
|
||||
local -a gopaths=("${(s/:/)$(go env GOPATH)}")
|
||||
gopaths+=("$(go env GOROOT)")
|
||||
for p in $gopaths; do
|
||||
|
|
@ -312,7 +312,7 @@ __go_packages() {
|
|||
fi
|
||||
}
|
||||
|
||||
__go_fix_analyzers() {
|
||||
__golang_fix_analyzers() {
|
||||
local -a fix_analyzers=(
|
||||
"any[replace interface{} with any]"
|
||||
"buildtag[check //go:build and // +build directives]"
|
||||
|
|
@ -341,7 +341,7 @@ __go_fix_analyzers() {
|
|||
_values 'analyzer' $fix_analyzers
|
||||
}
|
||||
|
||||
__go_pprof_symbolize_types() {
|
||||
__golang_pprof_symbolize_types() {
|
||||
local -a symbolize_types=(
|
||||
"none[Do not attempt symbolization]"
|
||||
"local[Examine only local binaries]"
|
||||
|
|
@ -360,7 +360,7 @@ if [[ "$service" = -value-* ]]; then
|
|||
if (($blacklist[(I)$env_variable])); then
|
||||
return
|
||||
fi
|
||||
__go_envvarvals $env_variable
|
||||
__golang_envvarvals $env_variable
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
@ -382,16 +382,16 @@ case $state in
|
|||
'-work[print temporary work directory and keep it]'
|
||||
'-x[print the commands]'
|
||||
'-asmflags[arguments for each go tool asm invocation]:flags'
|
||||
'-buildmode[build mode to use]:mode:__go_buildmodes'
|
||||
'-buildmode[build mode to use]:mode:__golang_buildmodes'
|
||||
'-buildvcs[stamp binaries with version control information]:mode:(internal external auto)'
|
||||
'-compiler[name of compiler to use]:name'
|
||||
'-gccgoflags[arguments for gccgo]:args'
|
||||
'*-gcflags=[arguments for each go tool compile invocation]:args:__go_gcflags'
|
||||
'*-gcflags=[arguments for each go tool compile invocation]:args:__golang_gcflags'
|
||||
'-installsuffix[suffix to add to package directory]:suffix'
|
||||
'-ldflags[arguments to pass on each go tool link invocation.]:flags'
|
||||
'-linkshared[link against shared libraries]'
|
||||
'-overlay[read a JSON config file that provides an overlay for build operations]:file:_files -g "*.json"'
|
||||
'-pgo[specify the file path of a profile for profile-guided optimization]:file_or_profile:__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'
|
||||
'-tags[list of build tags to consider satisfied]:tags'
|
||||
'-trimpath[remove all file system paths from the resulting executable]'
|
||||
|
|
@ -425,7 +425,7 @@ case $state in
|
|||
'help:get more information about a command'
|
||||
)
|
||||
local -a fix_flags=(
|
||||
'-fixtool=[specify fix analyzer]:analyzer:__go_fix_analyzers'
|
||||
'-fixtool=[specify fix analyzer]:analyzer:__golang_fix_analyzers'
|
||||
'-diff[display diffs instead of rewriting files]'
|
||||
'-fixtool=[select analysis tool]:analyzer:'
|
||||
'(- *)-V[print version and exit]'
|
||||
|
|
@ -464,7 +464,7 @@ case $state in
|
|||
'-json[emit build output in JSON suitable for automated processing]' \
|
||||
${build_flags[@]} \
|
||||
${mod_flags[@]} \
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
;;
|
||||
|
||||
(clean)
|
||||
|
|
@ -477,7 +477,7 @@ case $state in
|
|||
'-fuzzcache[remove files stored in the Go build cache for fuzz testing]' \
|
||||
${build_flags[@]} \
|
||||
${mod_flags[@]} \
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
;;
|
||||
|
||||
(doc)
|
||||
|
|
@ -489,7 +489,7 @@ case $state in
|
|||
'-short[one-line representation for each symbol]' \
|
||||
'-src[show the full source code for the symbol]' \
|
||||
'-u[show docs for unexported and exported symbols and methods]' \
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
;;
|
||||
|
||||
(env)
|
||||
|
|
@ -569,12 +569,12 @@ case $state in
|
|||
)
|
||||
local -a exclude_from_w=(GOENV)
|
||||
|
||||
__go_list_env_vars() {
|
||||
__golang_list_env_vars() {
|
||||
# the parameter expansion strops off everything after the first [
|
||||
_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*
|
||||
[[ $words[2] != '-w' ]] && _arguments \
|
||||
'-C[change to directory before running the command]: :_files -/' \
|
||||
|
|
@ -582,15 +582,15 @@ case $state in
|
|||
'-changed[prints only those settings whose effective value differs from the default value]' \
|
||||
'-u[unset environment variables]' \
|
||||
'-w[change the default setting of environment variables]' \
|
||||
'*:[show environment variable]: __go_list_env_vars' || _values \
|
||||
-s ' ' -S "=" -w 'environment variable' ${^goenvvars:#GOENV*}": __go_envvarvals"
|
||||
'*:[show environment variable]: __golang_list_env_vars' || _values \
|
||||
-s ' ' -S "=" -w 'environment variable' ${^goenvvars:#GOENV*}": __golang_envvarvals"
|
||||
;;
|
||||
|
||||
(fix)
|
||||
_arguments \
|
||||
'-C[change to directory before running the command]: :_files -/' \
|
||||
$fix_flags[@] \
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
;;
|
||||
|
||||
(fmt)
|
||||
|
|
@ -599,7 +599,7 @@ case $state in
|
|||
'-n[print commands that would be executed]' \
|
||||
'-x[print commands as they are executed]' \
|
||||
'-mod=[set which download mode to use]:mode:(readonly vendor)' \
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
;;
|
||||
|
||||
(generate)
|
||||
|
|
@ -610,7 +610,7 @@ case $state in
|
|||
'-n[print the commands but do not run them]' \
|
||||
'-v[print the names of packages as they are compiled]' \
|
||||
${build_flags[@]} \
|
||||
"*:args:{ _alternative ':importpaths:__go_packages' _files }"
|
||||
"*:args:{ _alternative ':importpaths:__golang_packages' _files }"
|
||||
;;
|
||||
|
||||
(get)
|
||||
|
|
@ -620,13 +620,13 @@ case $state in
|
|||
'-u[use the network to update the named packages]' \
|
||||
'-tool[instructs go to add a matching tool line to go.mod for each listed package]' \
|
||||
${build_flags[@]} \
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
;;
|
||||
|
||||
(install)
|
||||
_arguments \
|
||||
${build_flags[@]} \
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
;;
|
||||
|
||||
(list)
|
||||
|
|
@ -642,7 +642,7 @@ case $state in
|
|||
'-m[list modules instead of packages]'
|
||||
${build_flags[@]}
|
||||
${mod_flags[@]}
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
)
|
||||
# -u and -versions are only available if -m is present on the commandline
|
||||
if (($words[(I)-m])); then
|
||||
|
|
@ -684,7 +684,7 @@ case $state in
|
|||
(init)
|
||||
# Use go packages as module name suggestion
|
||||
_arguments \
|
||||
'*:module:__go_packages'
|
||||
'*:module:__golang_packages'
|
||||
;;
|
||||
(tidy)
|
||||
_arguments \
|
||||
|
|
@ -705,7 +705,7 @@ case $state in
|
|||
_arguments \
|
||||
'-m[treats the arguments as a list of modules]' \
|
||||
'-vendor[exclude tests of dependencies]' \
|
||||
'*:module:__go_packages'
|
||||
'*:module:__golang_packages'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
|
@ -716,7 +716,7 @@ case $state in
|
|||
_arguments \
|
||||
${build_flags[@]} \
|
||||
'-exec[invoke the binary using xprog]:xporg' \
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
;;
|
||||
|
||||
(telemetry)
|
||||
|
|
@ -803,7 +803,7 @@ case $state in
|
|||
${build_flags[@]} \
|
||||
'-exec[run test binary using xprog]:xprog' \
|
||||
'-o[compile test binary to named file]:file:_files' \
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
fi
|
||||
;;
|
||||
|
||||
|
|
@ -963,7 +963,7 @@ case $state in
|
|||
|
||||
(fix)
|
||||
if [[ $words[2] == "help" ]]; then
|
||||
__go_fix_analyzers
|
||||
__golang_fix_analyzers
|
||||
else
|
||||
_arguments \
|
||||
"*:args:{ _alternative ':subcommand:(help)' _files }"
|
||||
|
|
@ -1119,7 +1119,7 @@ case $state in
|
|||
'-add_comment=[free-form annotation to add to the profile]:comment' \
|
||||
'-diff_base=[source of base profile for comparison]:source:_files' \
|
||||
'-base[show delta from this profile]:profile' \
|
||||
'-symbolize=[controls source of symbol information]:source:__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_key=[TLS private key file for fetching profile and symbols]:file:_files' \
|
||||
'-tls_ca=[TLS CA certs file for fetching profile and symbols]:file:_files' \
|
||||
|
|
@ -1215,7 +1215,7 @@ case $state in
|
|||
'-x[prints commands as they are executed]' \
|
||||
'-vettool[set a different analysis tool with alternative or additional checks]:prog:_files' \
|
||||
${build_flags[@]} \
|
||||
'*:importpaths:__go_packages'
|
||||
'*:importpaths:__golang_packages'
|
||||
;;
|
||||
|
||||
(work)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ _inxi() {
|
|||
local curcontext="$curcontext"
|
||||
local ret=1
|
||||
|
||||
local colors=($(seq 0 42))
|
||||
local -a colors=({0..42})
|
||||
|
||||
_arguments -C -s \
|
||||
'(-A --audio)'{-A,--audio}"[Show Audio/sound card(s) information]" \
|
||||
|
|
|
|||
79
src/_mvn
79
src/_mvn
|
|
@ -266,14 +266,19 @@ _mvn_groupIds() {
|
|||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_groupIds_caching_policy
|
||||
|
||||
if [[ -d $repository_location ]]; then
|
||||
unset _groupIds
|
||||
if ( [[ ${+_groupIds} -eq 0 ]] || _cache_invalid "mvn/repositories/${repository_location}/groupIds" ) && ! _retrieve_cache "mvn/repositories/${repository_location}/groupIds"; then
|
||||
_groupIds=($repository_location/**/)
|
||||
_groupIds=(${${${(u)_groupIds:h:h}#"$repository_location/"}//\//.})
|
||||
[[ $#_groupIds -gt 0 ]] && _store_cache "mvn/repositories/${repository_location}/groupIds" _groupIds
|
||||
local -a groupIds
|
||||
local cache_key="mvn/repositories/${repository_location}/groupIds"
|
||||
if ( _cache_invalid $cache_key ) && ! _retrieve_cache $cache_key; then
|
||||
groupIds=($repository_location/**/)
|
||||
groupIds=(${${${(u)_groupIds:h:h}#"$repository_location/"}//\//.})
|
||||
if (( $#groupIds > 0 )); then
|
||||
_store_cache $cache_key groupIds
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ $#_groupIds -gt 0 ]] && _multi_parts $@ . _groupIds && ret=0
|
||||
if (( $#groupIds > 0 )); then
|
||||
_multi_parts $@ . groupIds && ret=0
|
||||
fi
|
||||
fi
|
||||
|
||||
return ret
|
||||
|
|
@ -310,14 +315,19 @@ _mvn_plugin_goals() {
|
|||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_goals_caching_policy
|
||||
|
||||
unset _goals
|
||||
if ( [[ ${+_goals} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin}" ) && ! _retrieve_cache "mvn/plugins/${plugin}"; then
|
||||
local -a goals
|
||||
local cache_key="mvn/plugins/${plugin}"
|
||||
if _cache_invalid $cache_key && ! _retrieve_cache $cache_key; then
|
||||
setopt localoptions extendedglob
|
||||
_goals=(${(s:,,,:)${${${(f)${${${(f)${${${${(F)${(S)${(f)"$(_call_program goals $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=$plugin)"}//#$(__mvn_get_plugin_prefix $plugin):/,,,}}:#*BUILD FAILURE*}#*This plugin has*goals#:}%For more information, run \'mvn help:describe*}}//:/\\:}}}// ##/ }// Description\\: /:}})
|
||||
[[ $#_goals -gt 0 ]] && _store_cache "mvn/plugins/${plugin}" _goals
|
||||
if (( $#goals > 0 )); then
|
||||
_store_cache "mvn/plugins/${plugin}" goals
|
||||
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
|
||||
}
|
||||
|
|
@ -338,44 +348,52 @@ _mvn_profiles() {
|
|||
|
||||
# Resolve profiles from settings.xml
|
||||
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
|
||||
if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then
|
||||
_profiles=()
|
||||
if _cache_invalid "$cache_name" && ! _retrieve_cache "$cache_name"; then
|
||||
profiles=()
|
||||
profiles_section="${(M)${(f)$(<$settings_file)}:#*<profiles>*}"
|
||||
if [[ -n "$profiles_section" ]]; then
|
||||
for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*<profile>}%</profile>*}//<repositories>*<\/repositories>}//<pluginRepositories>*<\/pluginRepositories>}//<build>*<\/build>}//<\/id>*<id>/,,,}##*<id>}%%</id>*}}; do
|
||||
[[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in settings file"']')
|
||||
[[ -z ${(M)profiles:#"$profile"*} ]] && profiles+=("$profile"'['"in settings file"']')
|
||||
done
|
||||
fi
|
||||
[[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
|
||||
|
||||
if (( $#profiles > 0 )); then
|
||||
_store_cache "$cache_name" profiles
|
||||
fi
|
||||
profs+=($_profiles)
|
||||
fi
|
||||
profs+=($profiles)
|
||||
fi
|
||||
|
||||
# Resolve project profiles
|
||||
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
|
||||
if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then
|
||||
_profiles=()
|
||||
if _cache_invalid "$cache_name" && ! _retrieve_cache "$cache_name"; then
|
||||
profiles=()
|
||||
setopt localoptions extendedglob
|
||||
for file in ${parent_pom_file:h}/**/pom.xml~*target\/*; do # FIXME project.build.directory is not always target/
|
||||
profiles_section="${(M)${(f)$(<$file)}:#*<profiles>*}"
|
||||
if [[ -n "$profiles_section" ]]; then
|
||||
for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*<profile>}%</profile>*}//<repositories>*<\/repositories>}//<pluginRepositories>*<\/pluginRepositories>}//<build>*<\/build>}//<\/id>*<id>/,,,}##*<id>}%%</id>*}}; do
|
||||
[[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in ${file#${parent_pom_file:h}\/}"']')
|
||||
[[ -z ${(M)profiles:#"$profile"*} ]] && profiles+=("$profile"'['"in ${file#${parent_pom_file:h}\/}"']')
|
||||
done
|
||||
fi
|
||||
done
|
||||
[[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles
|
||||
|
||||
if (( $#profiles > 0)); then
|
||||
_store_cache "$cache_name" profiles
|
||||
fi
|
||||
profs+=($_profiles)
|
||||
fi
|
||||
profs+=($profiles)
|
||||
fi
|
||||
|
||||
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
|
||||
}
|
||||
|
|
@ -437,16 +455,21 @@ _mvn_plugin_goal_property_names() {
|
|||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||
[[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_properties_caching_policy
|
||||
|
||||
unset _properties
|
||||
if ( [[ ${+_properties} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin_colon_goal}" ) && ! _retrieve_cache "mvn/plugins/${plugin_colon_goal}"; then
|
||||
local -a properties
|
||||
local cache_key="mvn/plugins/${plugin_colon_goal}"
|
||||
if _cache_invalid $cache_key && ! _retrieve_cache $cache_key; then
|
||||
# FIXME Does not work for:
|
||||
# android:apk (new line before expression)
|
||||
# ear:ear (unknown cause)
|
||||
_properties=(${(M)${(ps:,,,:)${${${${(pj: :)${${${(f)${"$(_call_program properties $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=${plugin_colon_goal%:*} -Dgoal=${plugin_colon_goal##*:} -Ddetail)"#*Available parameters:}%%\[INFO\]*}//# [a-z]*/,,,}##*Expression: \$\{}}//\}[[:space:]]##/:}//[[:space:]]##/ }//[[:space:]]#,,,[[:space:]]#/,,,}}:#[a-zA-Z]##:*})
|
||||
[[ $#_properties -gt 0 ]] && _store_cache "mvn/plugins/${plugin_colon_goal}" _properties
|
||||
properties=(${(M)${(ps:,,,:)${${${${(pj: :)${${${(f)${"$(_call_program properties $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=${plugin_colon_goal%:*} -Dgoal=${plugin_colon_goal##*:} -Ddetail)"#*Available parameters:}%%\[INFO\]*}//# [a-z]*/,,,}##*Expression: \$\{}}//\}[[:space:]]##/:}//[[:space:]]##/ }//[[:space:]]#,,,[[:space:]]#/,,,}}:#[a-zA-Z]##:*})
|
||||
if (( $#properties > 0 )); then
|
||||
_store_cache $cache_key properties
|
||||
fi
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue