Skip to content

Commit

Permalink
Fix version printer to use app stdout and stderr (#395)
Browse files Browse the repository at this point in the history
Added back in the change made in #166
  • Loading branch information
another-rex committed May 24, 2023
1 parent e194e78 commit a02dac8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/osv-scanner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ func run(args []string, stdout, stderr io.Writer) int {
var r reporter.Reporter

cli.VersionPrinter = func(ctx *cli.Context) {
r = reporter.NewTableReporter(stdout, stderr, false)
// Use the app Writer and ErrWriter since they will be the writers to keep parallel tests consistent
r = reporter.NewTableReporter(ctx.App.Writer, ctx.App.ErrWriter, false)
r.PrintText(fmt.Sprintf("osv-scanner version: %s\ncommit: %s\nbuilt at: %s\n", ctx.App.Version, commit, date))
}

Expand Down

0 comments on commit a02dac8

Please sign in to comment.