Skip to content
This repository has been archived by the owner on Jul 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #29 from dty1er/dty1er/fix_help
Browse files Browse the repository at this point in the history
use helpPrinter when no args are passed
  • Loading branch information
hidetatz committed Oct 20, 2020
2 parents 73cb26e + 5cfee88 commit 236798e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions command/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ func Run(args []string) error {
shouldColorize = true
}

if !subcommandFound {
subcommandInfo.Help = true
shouldColorize = true
}

kubectlCmd := "kubectl"
if kc := os.Getenv("KUBECTL_COMMAND"); kc != "" {
kubectlCmd = kc
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ require (
github.com/MakeNowJust/heredoc v1.0.0
github.com/google/go-cmp v0.5.2
github.com/mattn/go-colorable v0.1.8
golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7 // indirect
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPM
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7 h1:XtNJkfEjb4zR3q20BBBcYUykVOEMgZeIUOpBPfNYgxg=
golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13 h1:5jaG59Zhd+8ZXe8C+lgiAGqkOaZBruqrWclLkgAww34=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

0 comments on commit 236798e

Please sign in to comment.