Require configuration selectors only for applicable scopes
This commit is contained in:
@@ -74,6 +74,7 @@ type ConfigScope[C any] struct {
|
||||
}
|
||||
|
||||
// Selector binds one typed command flag to selected configuration scopes.
|
||||
// A required binding is required only when a selected scope uses it.
|
||||
type Selector[C any] struct {
|
||||
Binding Flag[C]
|
||||
Scopes []string
|
||||
@@ -101,6 +102,8 @@ type configScopesInput struct {
|
||||
}
|
||||
|
||||
type selectorState[C any] struct {
|
||||
name string
|
||||
required bool
|
||||
scopes []string
|
||||
supplied bool
|
||||
apply func(*C)
|
||||
|
||||
Reference in New Issue
Block a user