From a7254c978d9938247899ea4694aaf95089646bc5 Mon Sep 17 00:00:00 2001 From: Paul Seyfert Date: Tue, 3 Mar 2020 17:53:00 +0100 Subject: [PATCH] fix logic about go list -m --- src/_golang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_golang b/src/_golang index 28419c0..806e9df 100644 --- a/src/_golang +++ b/src/_golang @@ -101,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:_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]' @@ -258,7 +258,6 @@ case $state in ;; list) - # TODO: if statement does not work atm local -a list_args list_args=( '-e[changes the handling of erroneous packages]' @@ -271,7 +270,8 @@ case $state in ${mod_flags[@]} '*:importpaths:__go_packages' ) - if [[ -n ${opt_args[(I)-m]} ]]; then + # -u and -versions are only available if -m is present on the commandline + if (($words[(I)-m])); then list_args+=( '-u[adds information about available upgrades]' '-versions[list all known versions of modules]'