add final checks on option values
This commit is contained in:
@@ -17,7 +17,7 @@ type cliParser interface {
|
||||
}
|
||||
|
||||
type cliOptionParser interface {
|
||||
parse(parser cliParser, argIndex int, valuePtr *string) (skipNextArg bool, err error)
|
||||
parse(parser cliParser, argIndex int, valuePtr *string) (skipNextArg bool, optValue string, err error)
|
||||
getTemplate() string
|
||||
getDefaultValue() string
|
||||
getBase() *cliOptionBase
|
||||
@@ -25,6 +25,7 @@ type cliOptionParser interface {
|
||||
isSet() bool
|
||||
isHidden() bool
|
||||
requiresValue() bool
|
||||
finalCheck(cliValue string) (err error)
|
||||
}
|
||||
|
||||
type OptManager interface {
|
||||
@@ -32,9 +33,11 @@ type OptManager interface {
|
||||
}
|
||||
|
||||
type SpecialValueFunc func(manager OptManager, cliValue string, currentValue any) (value any, err error)
|
||||
type FinalCheckFunc func(cliValue string, currentValue any) (err error)
|
||||
|
||||
type OptReference interface {
|
||||
AddSpecialValue(cliValue string, specialFunc SpecialValueFunc)
|
||||
OnFinalCheck(checkFunc FinalCheckFunc)
|
||||
SetHidden(hidden bool)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user