Skip to content

Commit

Permalink
jsonschema: Exit on fs.Parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
tsenart committed Jul 7, 2018
1 parent 2e261e6 commit 4911bc1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/cmd/jsonschema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ func main() {

valid := strings.Join(keys(types), ", ")

fs := flag.NewFlagSet("jsonschema", flag.ExitOnError)
fs := flag.NewFlagSet("jsonschema", flag.ContinueOnError)
typ := fs.String("type", "", fmt.Sprintf("Vegeta type to generate a JSON schema for [%s]", valid))
out := fs.String("output", "stdout", "Output file")

fs.Parse(os.Args[1:])
if err := fs.Parse(os.Args[1:]); err != nil {
die("%s", err)
}

t, ok := types[*typ]
if !ok {
Expand Down

0 comments on commit 4911bc1

Please sign in to comment.