Skip to content

Commit

Permalink
chore: Remove duplicate cmd.SilenceUsage line
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Jul 26, 2024
1 parent a71a143 commit fd1c2d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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
Expand Down

0 comments on commit fd1c2d9

Please sign in to comment.