Skip to content

Commit

Permalink
yajsv: Lets call this version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
neilpa committed Jan 24, 2020
1 parent 1f07049 commit 1d1f659
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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)
Expand Down

0 comments on commit 1d1f659

Please sign in to comment.