Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpk/cli: show help for incorrect number or invalid arguments #3733

Merged
merged 1 commit into from Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/go/rpk/pkg/cli/cmd/acl.go
Expand Up @@ -38,11 +38,10 @@ func NewACLCommand(fs afero.Fs, mgr config.Manager) *cobra.Command {
helpOperations bool
)
command := &cobra.Command{
Use: "acl",
Short: "Manage ACLs and SASL users.",
Long: helpACLs,
SilenceUsage: true,
Args: cobra.ExactArgs(0),
Use: "acl",
Short: "Manage ACLs and SASL users.",
Long: helpACLs,
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, _ []string) {
if helpOperations {
fmt.Println(helpACLOperations)
Expand Down
1 change: 0 additions & 1 deletion src/go/rpk/pkg/cli/cmd/debug/bundle.go
Expand Up @@ -255,7 +255,6 @@ The following are the data sources that are bundled in the compressed file:
- dmidecode: The DMI table contents. Only included if this command is run
as root.
`,
SilenceUsage: true,
Run: func(cmd *cobra.Command, args []string) {
p := config.ParamsFromCommand(cmd)
cfg, err := p.Load(fs)
Expand Down
5 changes: 2 additions & 3 deletions src/go/rpk/pkg/cli/cmd/redpanda/check.go
Expand Up @@ -32,9 +32,8 @@ func NewCheckCommand(fs afero.Fs, mgr config.Manager) *cobra.Command {
timeout time.Duration
)
command := &cobra.Command{
Use: "check",
Short: "Check if system meets redpanda requirements.",
SilenceUsage: true,
Use: "check",
Short: "Check if system meets redpanda requirements.",
RunE: func(ccmd *cobra.Command, args []string) error {
return executeCheck(fs, mgr, configFile, timeout)
},
Expand Down
1 change: 0 additions & 1 deletion src/go/rpk/pkg/cli/cmd/redpanda/stop.go
Expand Up @@ -38,7 +38,6 @@ func NewStopCommand(fs afero.Fs, mgr config.Manager) *cobra.Command {
first sends SIGINT, and waits for the specified timeout. Then, if redpanda
hasn't stopped, it sends SIGTERM. Lastly, it sends SIGKILL if it's still
running.`,
SilenceUsage: true,
RunE: func(ccmd *cobra.Command, args []string) error {
return executeStop(fs, mgr, configFile, timeout)
},
Expand Down
1 change: 0 additions & 1 deletion src/go/rpk/pkg/cli/cmd/root.go
Expand Up @@ -59,7 +59,6 @@ func Execute() {
Short: "rpk is the Redpanda CLI & toolbox.",
Long: "",
}
rootCmd.SilenceUsage = true
rootCmd.PersistentFlags().BoolVarP(&verbose, config.FlagVerbose,
"v", false, "Enable verbose logging (default: false).")

Expand Down
7 changes: 3 additions & 4 deletions src/go/rpk/pkg/cli/cmd/version.go
Expand Up @@ -18,10 +18,9 @@ import (

func NewVersionCommand() *cobra.Command {
command := &cobra.Command{
Use: "version",
Short: "Check the current version.",
Long: "",
SilenceUsage: true,
Use: "version",
Short: "Check the current version.",
Long: "",
Run: func(_ *cobra.Command, _ []string) {
log.SetFormatter(cli.NewNoopFormatter())
log.Infof("%s\n", version.Pretty())
Expand Down
7 changes: 3 additions & 4 deletions src/go/rpk/pkg/cli/cmd/wasm/generate.go
Expand Up @@ -31,10 +31,9 @@ func NewGenerateCommand(fs afero.Fs) *cobra.Command {
skipVersion bool
)
cmd := &cobra.Command{
Use: "generate [PROJECT DIRECTORY]",
Short: "Create an npm template project for inline WASM engine.",
SilenceUsage: true,
Args: cobra.ExactArgs(1),
Use: "generate [PROJECT DIRECTORY]",
Short: "Create an npm template project for inline WASM engine.",
Args: cobra.ExactArgs(1),
Run: func(_ *cobra.Command, args []string) {
path, err := filepath.Abs(args[0])
out.MaybeDie(err, "unable to get absolute path for %q: %v", args[0], err)
Expand Down