Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ func exitIfError(err error) {
if err != nil {
switch e := err.(type) {
case *wrappers.AstError:
fmt.Println(e.Err)
fmt.Fprintln(os.Stderr, e.Err)
os.Exit(e.Code)
default:
fmt.Println(e)
fmt.Fprintln(os.Stderr, e)
os.Exit(failureExitCode)
}
}
Expand Down
2 changes: 2 additions & 0 deletions internal/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ func NewAstCLI(
)

rootCmd.SilenceUsage = true
// Avoid Cobra printing the error in addition to our own handling in main
rootCmd.SilenceErrors = true
return rootCmd
}

Expand Down
Loading