diff --git a/cmd/cmd.go b/cmd/cmd.go index 71ad593..b15807f 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -67,9 +67,9 @@ func run(cmd *cobra.Command, args []string) error { return completion(cmd, conf.Completion) } - if len(args) == 0 { - cmd.SilenceUsage = true + cmd.SilenceUsage = true + if len(args) == 0 { if isatty.IsTerminal(os.Stdin.Fd()) || isatty.IsCygwinTerminal(os.Stdin.Fd()) { return cmd.Help() } @@ -88,8 +88,6 @@ func run(cmd *cobra.Command, args []string) error { } } - cmd.SilenceUsage = true - for i, p := range args { if err := openAndTemplate(conf, cmd.OutOrStdout(), p); err != nil { return err