attempt to patch list

This commit is contained in:
Paul Seyfert 2020-03-02 16:37:06 +01:00
parent 65c9fd6e88
commit 49044a25a8
1 changed files with 20 additions and 11 deletions

View File

@ -43,8 +43,6 @@
#
# ------------------------------------------------------------------------------
typeset -A opt_args
__go_buildmodes() {
local -a buildmodes
buildmodes=(
@ -103,7 +101,7 @@ case $state in
'-buildmode[build mode to use]:mode:__go_buildmodes'
'-compiler[name of compiler to use]:name'
'-gccgoflags[arguments for gccgo]:args'
'-gcflags[arguments for each go tool compile invocation]:args'
'-gcflags=[arguments for each go tool compile invocation]:args'
'-installsuffix[suffix to add to package directory]:suffix'
'-ldflags[arguments to pass on each go tool link invocation.]:flags'
'-linkshared[link against shared libraries]'
@ -260,15 +258,26 @@ case $state in
;;
list)
_arguments \
'-e[changes the handling of erroneous packages]' \
'-f[specifies an alternate format for the list]:format' \
'-json[causes package data to be printed in JSON format]' \
'-compiled[set CompiledGoFiles to the Go source files presented to the compiler]' \
'-deps[iterate over named packages and their dependencies]' \
'-m[list modules instead of packages]' \
${build_flags[@]} \
# TODO: if statement does not work atm
local -a list_args
list_args=(
'-e[changes the handling of erroneous packages]'
'-f[specifies an alternate format for the list]:format'
'-json[causes package data to be printed in JSON format]'
'-compiled[set CompiledGoFiles to the Go source files presented to the compiler]'
'-deps[iterate over named packages and their dependencies]'
'-m[list modules instead of packages]'
${build_flags[@]}
${mod_flags[@]}
'*:importpaths:__go_packages'
)
if [[ -n ${opt_args[(I)-m]} ]]; then
list_args+=(
'-u[adds information about available upgrades]'
'-versions[list all known versions of modules]'
)
fi
_arguments ${list_args[@]}
;;
mod)