From cef1a3a2fc85bf37104571243e48d43612005f04 Mon Sep 17 00:00:00 2001 From: r-vasquez Date: Thu, 28 Nov 2024 12:56:50 -0800 Subject: [PATCH] rpk: parse --help for byoc plugin It fixes a bug where --help didn't work along with --redpanda-is. Fixes DEVEX-56 --- src/go/rpk/pkg/cli/cloud/byoc/byoc.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/go/rpk/pkg/cli/cloud/byoc/byoc.go b/src/go/rpk/pkg/cli/cloud/byoc/byoc.go index 94449a8b77cb5..0f0351200230f 100644 --- a/src/go/rpk/pkg/cli/cloud/byoc/byoc.go +++ b/src/go/rpk/pkg/cli/cloud/byoc/byoc.go @@ -51,7 +51,10 @@ func init() { cmd.Run = func(cmd *cobra.Command, args []string) { cfg, redpandaID, pluginArgs, err := parseBYOCFlags(fs, p, cmd, args) out.MaybeDieErr(err) - + if cmd.Flags().Changed("help") { + cmd.Help() + return + } // --redpanda-id is only required in apply or destroy commands. // For validate commands we don't need the redpanda-id, instead, // we download the latest version always. @@ -168,7 +171,7 @@ and then come back to this command to complete the process. } } - if !isKnown || (redpandaID == "" && !isValidate) { + if !isKnown || (redpandaID == "" && !isValidate) || cmd.Flags().Changed("help") { cmd.Help() return }