Skip to content
Merged
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
12 changes: 12 additions & 0 deletions cmd/osv-scanner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,23 @@ import (
"github.com/urfave/cli/v2"
)

var (
version = "dev"
commit = "n/a"
date = "n/a"
)

func run(args []string, stdout, stderr io.Writer) int {
var r *output.Reporter

cli.VersionPrinter = func(ctx *cli.Context) {
r = output.NewReporter(stdout, stderr, false)
r.PrintText(fmt.Sprintf("osv-scanner version: %s\ncommit: %s\nbuilt at: %s\n", ctx.App.Version, commit, date))
}

app := &cli.App{
Name: "osv-scanner",
Version: version,
Usage: "scans various mediums for dependencies and matches it against the OSV database",
Suggest: true,
Writer: stdout,
Expand Down