Skip to content

Commit

Permalink
rpk: parse --help for byoc plugin
Browse files Browse the repository at this point in the history
It fixes a bug where --help didn't work along
with --redpanda-is.

Fixes DEVEX-56
  • Loading branch information
r-vasquez committed Nov 28, 2024
1 parent 3746d36 commit cef1a3a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/go/rpk/pkg/cli/cloud/byoc/byoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit cef1a3a

Please sign in to comment.