mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-04-05 21:18:08 -05:00
32 lines
470 B
Go
32 lines
470 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
var noXmlHeader bool
|
|
|
|
func init() {
|
|
flag.BoolVar(&noXmlHeader, "no-xml-header", false, "do not print xml header")
|
|
}
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
// Read input
|
|
report, err := Parse(os.Stdin)
|
|
if err != nil {
|
|
fmt.Printf("Error reading input: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
// Write xml
|
|
err = JUnitReportXML(report, noXmlHeader, os.Stdout)
|
|
if err != nil {
|
|
fmt.Printf("Error writing XML: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|