You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running an unknown subcommand of an rpk subcommand, rpk won't return an "unknown command" error and exit with an error code 0:
$ rpk cluster foobar
Interact with a Redpanda cluster
Usage:
rpk cluster [flags]
rpk cluster [command]
Available Commands:
config Interact with cluster configuration properties
[...]
Use "rpk cluster [command] --help" for more information about a command.
$ echo $?
0
What should have happened instead?
To return 1, and an error:
Error: unknown command "foobar" for "rpk cluster"
How to reproduce the issue?
Steps above.
Additional information
This is a known behavior in Cobra: spf13/cobra#706 the fix is to add a Cobra.NoArg to every subcommand with child commands.
Version & Environment
Redpanda version: (use
rpk version
): v24.1.2What went wrong?
When running an unknown subcommand of an rpk subcommand, rpk won't return an "unknown command" error and exit with an error code 0:
What should have happened instead?
To return 1, and an error:
How to reproduce the issue?
Additional information
This is a known behavior in Cobra: spf13/cobra#706 the fix is to add a
Cobra.NoArg
to every subcommand with child commands.JIRA Link: CORE-3065
The text was updated successfully, but these errors were encountered: