Skip to content

Commit

Permalink
Add -version flag to print current version
Browse files Browse the repository at this point in the history
  • Loading branch information
jstemmer committed Feb 19, 2022
1 parent 984a47c commit b2b06e7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions go-junit-report.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,28 @@ import (
"github.com/jstemmer/go-junit-report/parser"
)

var (
Version = "v0.9.1-dev"
Revision = "HEAD"
BuildTime string
)

var (
noXMLHeader = flag.Bool("no-xml-header", false, "do not print xml header")
packageName = flag.String("package-name", "", "specify a package name (compiled test have no package name in output)")
goVersionFlag = flag.String("go-version", "", "specify the value to use for the go.version property in the generated XML")
setExitCode = flag.Bool("set-exit-code", false, "set exit code to 1 if tests failed")
version = flag.Bool("version", false, "print version")
)

func main() {
flag.Parse()

if *version {
fmt.Printf("go-junit-report %s %s (%s)\n", Version, BuildTime, Revision)
return
}

if flag.NArg() != 0 {
fmt.Fprintf(os.Stderr, "%s does not accept positional arguments\n", os.Args[0])
flag.Usage()
Expand Down

0 comments on commit b2b06e7

Please sign in to comment.