Files
releases/cmd/errors.go
T
Torin Sandall 9b743d527f Refactor error limit flag
Avoid duplicating the flag description in each command that requires it.
2017-09-07 11:40:22 -07:00

15 lines
447 B
Go

// Copyright 2017 The OPA Authors. All rights reserved.
// Use of this source code is governed by an Apache2
// license that can be found in the LICENSE file.
package cmd
import (
"github.com/open-policy-agent/opa/ast"
"github.com/spf13/pflag"
)
func setMaxErrors(fs *pflag.FlagSet, errLimit *int) {
fs.IntVarP(errLimit, "max-errors", "m", ast.CompileErrorLimitDefault, "set the number of errors to allow before compilation fails early")
}