Skip to content

Commit

Permalink
Show usage on invalid command line invocation. (#11174)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tener committed Mar 22, 2022
1 parent ebc3406 commit 21b3e32
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions tool/tbot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func Run(args []string) error {

command, err := app.Parse(args)
if err != nil {
app.Usage(args)
return trace.Wrap(err)
}

Expand Down
1 change: 1 addition & 0 deletions tool/tctl/common/tctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func Run(commands []CLICommand) {
// parse CLI commands+flags:
selectedCmd, err := app.Parse(os.Args[1:])
if err != nil {
app.Usage(os.Args[1:])
utils.FatalError(err)
}

Expand Down
1 change: 1 addition & 0 deletions tool/teleport/common/teleport.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ func Run(options Options) (app *kingpin.Application, executedCommand string, con
// parse CLI commands+flags:
command, err := app.Parse(options.Args)
if err != nil {
app.Usage(options.Args)
utils.FatalError(err)
}

Expand Down
1 change: 1 addition & 0 deletions tool/tsh/tsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ func Run(args []string, opts ...cliOption) error {
// parse CLI commands+flags:
command, err := app.Parse(args)
if err != nil {
app.Usage(args)
return trace.Wrap(err)
}

Expand Down

0 comments on commit 21b3e32

Please sign in to comment.