Skip to content

Commit

Permalink
Fix minor bug when passing in unknown flags (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
another-rex authored Dec 13, 2022
1 parent 0014eb0 commit c6ed0fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/osv-scanner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ func run(args []string, stdout, stderr io.Writer) int {
}

if err := app.Run(args); err != nil {
if r == nil {
r = output.NewReporter(stdout, stderr, false)
}
if errors.Is(err, osvscanner.NoPackagesFoundErr) {
r.PrintError(fmt.Sprintf("No package sources found, --help for usage information.\n"))
return 128
Expand Down

0 comments on commit c6ed0fa

Please sign in to comment.