diff options
Diffstat (limited to 'internal/cli')
| -rw-r--r-- | internal/cli/cli.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 5beb989..b38d0d9 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -56,7 +56,13 @@ func (a *App) Route() error { return fmt.Errorf("no command provided") } - switch a.Args[1] { + firstArg := a.Args[1] + if firstArg == "-h" || firstArg == "--help" || firstArg == "-help" { + a.printUsage() + return nil + } + + switch firstArg { case "show-config": return a.showConfig() case "profile": @@ -71,7 +77,7 @@ func (a *App) Route() error { return a.testLifecycle() default: a.printUsage() - return fmt.Errorf("unknown command: %s", a.Args[1]) + return fmt.Errorf("unknown command: %s", firstArg) } } |
