From 9557afbaa7e7f94421628e1a8602d32432ea9a2a Mon Sep 17 00:00:00 2001 From: gene-redpanda <123959009+gene-redpanda@users.noreply.github.com> Date: Thu, 4 May 2023 12:40:10 -0400 Subject: [PATCH] adds rpk version to cobra's Version field Setting this field enables use of --version without clobbering version or doing other weird stuff. --- src/go/rpk/pkg/cli/root.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/go/rpk/pkg/cli/root.go b/src/go/rpk/pkg/cli/root.go index 95f11868eda3f..71318bb268d13 100644 --- a/src/go/rpk/pkg/cli/root.go +++ b/src/go/rpk/pkg/cli/root.go @@ -92,6 +92,7 @@ func Execute() { return opts, cobra.ShellCompDirectiveNoSpace }) + root.Version = version.Pretty() root.AddCommand( acl.NewCommand(fs, p), cloud.NewCommand(fs, osExec),