Skip to content

Commit

Permalink
Show usage if the user does not provide any argument
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinvaneyk committed Jan 17, 2020
1 parent c5aa752 commit 209d687
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ import (

var (
tapExample = `
# tap deployment foo to trigger reevaluation of the deployment controller.
# Tap deployment foo
%[1]s deployment/foo
# Tap all pods in namespace bar
%[1]s --namespace bar pods --all
`
defaultTapKey = "tapped"
)
Expand Down Expand Up @@ -56,6 +59,9 @@ func NewCmdTap(streams genericclioptions.IOStreams, version version.Info) *cobra
Example: fmt.Sprintf(tapExample, "kubectl"),
SilenceUsage: true,
RunE: func(c *cobra.Command, args []string) error {
if len(args) == 0 {
return c.Usage()
}
if err := o.Complete(c, args); err != nil {
return err
}
Expand Down

0 comments on commit 209d687

Please sign in to comment.