From 1d1f6599e79c52e7810cdcede1b9395e59cd2d7b Mon Sep 17 00:00:00 2001 From: Neil Pankey Date: Fri, 24 Jan 2020 15:18:07 -0800 Subject: [PATCH] yajsv: Lets call this version 1 --- main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index db5eaac..9b6e83e 100644 --- a/main.go +++ b/main.go @@ -16,10 +16,16 @@ import ( "github.com/xeipuuv/gojsonschema" ) +const ( + version = "v1.0.0" +) + var ( schemaFlag = flag.String("s", "", "primary JSON schema to validate against, required") - refFlags stringFlags quietFlag = flag.Bool("q", false, "quiet, only print validation failures and errors") + versionFlag = flag.Bool("v", false, "print version and exit") + + refFlags stringFlags ) func init() { @@ -30,6 +36,10 @@ func init() { func main() { log.SetFlags(0) flag.Parse() + if *versionFlag { + fmt.Println(version) + os.Exit(0) + } if *schemaFlag == "" || flag.NArg() == 0 { printUsage() os.Exit(2)