From 0591bb453dcbe6d8f459ba8931f2bea5fe5db594 Mon Sep 17 00:00:00 2001 From: rsteube Date: Wed, 26 Jul 2023 23:59:52 +0200 Subject: [PATCH] go: added asmflags and gcflags completion --- completers/go-tool-compile_completer/cmd/root.go | 2 ++ completers/go_completer/cmd/build.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/completers/go-tool-compile_completer/cmd/root.go b/completers/go-tool-compile_completer/cmd/root.go index bfb310b72f..8939be5428 100644 --- a/completers/go-tool-compile_completer/cmd/root.go +++ b/completers/go-tool-compile_completer/cmd/root.go @@ -2,6 +2,7 @@ package cmd import ( "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/golang" "github.com/spf13/cobra" ) @@ -93,6 +94,7 @@ func init() { "coveragecfg": carapace.ActionFiles(), "cpuprofile": carapace.ActionFiles(), "embedcfg": carapace.ActionFiles(), + "goversion": golang.ActionVersions(), "linkobj": carapace.ActionFiles(), "memprofile": carapace.ActionFiles(), "mutexprofile": carapace.ActionFiles(), diff --git a/completers/go_completer/cmd/build.go b/completers/go_completer/cmd/build.go index 0d9c28ab75..4bd6c39226 100644 --- a/completers/go_completer/cmd/build.go +++ b/completers/go_completer/cmd/build.go @@ -64,10 +64,12 @@ func addBuildFlags(cmd *cobra.Command) { carapace.Gen(cmd).FlagCompletion(carapace.ActionMap{ "C": carapace.ActionDirectories(), + "asmflags": bridge.ActionCarapaceBin("go", "tool", "asm").Split(), "buildmode": golang.ActionBuildmodes(), "buildvcs": carapace.ActionValues("true", "false", "auto").StyleF(style.ForKeyword), "compiler": carapace.ActionValues("gccgo", "gc"), "coverpkg": golang.ActionPackages().UniqueList(","), + "gcflags": bridge.ActionCarapaceBin("go", "tool", "compile").Split(), "ldflags": bridge.ActionCarapaceBin("go", "tool", "link").Split(), "mod": carapace.ActionValues("readonly", "vendor", "mod"), "modfile": carapace.ActionFiles(".mod"),