Skip to content

Commit

Permalink
Merge pull request #437 from reubenmiller/fix-unintended-warning
Browse files Browse the repository at this point in the history
fix: suppress warning message when displaying help
  • Loading branch information
reubenmiller authored Feb 16, 2025
2 parents 29cb4f9 + c5b6a3f commit aad2fba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cmd/root/root.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package root

import (
"errors"
"fmt"
"io/fs"
"os"
Expand Down Expand Up @@ -194,7 +195,9 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *CmdRoot {
if cmdErr != nil {
logg, logErr := f.Logger()
if logg != nil && logErr == nil {
logg.Warnf("Check existing session failed. %s", cmdErr)
if !errors.Is(cmderrors.ErrHelp, cmdErr) {
logg.Warnf("Check existing session failed. %s", cmdErr)
}
}
}
return cmdErr
Expand Down

0 comments on commit aad2fba

Please sign in to comment.