mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
Defined FErrorHandling constants
This commit is contained in:
parent
fe9ade5260
commit
5b83e8ba06
1 changed files with 9 additions and 0 deletions
|
@ -34,6 +34,15 @@ type FParseErrWhitelist flag.ParseErrorsWhitelist
|
||||||
// FErrorHandling defines how to handle flag parsing errors
|
// FErrorHandling defines how to handle flag parsing errors
|
||||||
type FErrorHandling flag.ErrorHandling
|
type FErrorHandling flag.ErrorHandling
|
||||||
|
|
||||||
|
const (
|
||||||
|
// ContinueOnError will return an err from Parse() if an error is found
|
||||||
|
ContinueOnError FErrorHandling = iota
|
||||||
|
// ExitOnError will call os.Exit(2) if an error is found when parsing
|
||||||
|
ExitOnError
|
||||||
|
// PanicOnError will panic() if an error is found when parsing flags
|
||||||
|
PanicOnError
|
||||||
|
)
|
||||||
|
|
||||||
// Command is just that, a command for your application.
|
// Command is just that, a command for your application.
|
||||||
// E.g. 'go run ...' - 'run' is the command. Cobra requires
|
// E.g. 'go run ...' - 'run' is the command. Cobra requires
|
||||||
// you to define the usage and description as part of your command
|
// you to define the usage and description as part of your command
|
||||||
|
|
Loading…
Reference in a new issue