From 27e2e8f782991178813c7db5a88ad40d2da41c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Stemmer?= Date: Fri, 4 Oct 2019 00:05:01 +0100 Subject: [PATCH] Print usage on flag error --- go-junit-report.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go-junit-report.go b/go-junit-report.go index ed801c2..1332f3b 100644 --- a/go-junit-report.go +++ b/go-junit-report.go @@ -20,7 +20,8 @@ func main() { flag.Parse() if flag.NArg() != 0 { - fmt.Println("go-junit-report does not accept positional arguments") + fmt.Fprintf(os.Stderr, "%s does not accept positional arguments\n", os.Args[0]) + flag.Usage() os.Exit(1) }