Skip to content

Commit

Permalink
Output version for brew test
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthHater committed Feb 1, 2019
1 parent 5c7d8da commit 0ddc013
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ import (
"os"
)

const AppVersion = "0.0.1"

var noColorPtr *bool
var path string

func main() {
args := os.Args[1:]

noColorPtr = flag.Bool("noColor", false, "indicate output should not be colorized")
version := flag.Bool("version", false, "prints current nancy version")

flag.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: nancy [options] <Gopkg.lock>\n\nOptions:\n")
Expand All @@ -46,6 +49,11 @@ func main() {
// Parse flags from the command line output
flag.Parse()

if *version {
fmt.Println(AppVersion)
os.Exit(0)
}

path = args[len(args)-1]

// Currently only checks Dep, can eventually check for go mod, etc...
Expand Down

0 comments on commit 0ddc013

Please sign in to comment.