From fd1c2d911c1b45ceb6705fa1bb7c978dceeae9c3 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Fri, 26 Jul 2024 03:36:57 -0500 Subject: [PATCH] chore: Remove duplicate `cmd.SilenceUsage` line --- cmd/cmd.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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