From 5b83e8ba06dd8f6b6afd247b008860059bd2ed7a Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Mon, 11 Apr 2022 11:55:30 -0700 Subject: [PATCH] Defined FErrorHandling constants --- command.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/command.go b/command.go index 26341359..a27b0f78 100644 --- a/command.go +++ b/command.go @@ -34,6 +34,15 @@ type FParseErrWhitelist flag.ParseErrorsWhitelist // FErrorHandling defines how to handle flag parsing errors 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. // E.g. 'go run ...' - 'run' is the command. Cobra requires // you to define the usage and description as part of your command