Add configuration path explanations
This commit is contained in:
13
config.go
13
config.go
@@ -111,6 +111,7 @@ type configInput[C any] struct {
|
||||
Selection Selection
|
||||
Scope string
|
||||
Format string
|
||||
Path Supplied[string]
|
||||
SelectorContext C
|
||||
selectors []selectorState[C]
|
||||
}
|
||||
@@ -131,8 +132,8 @@ func RegisterConfig[C any](app *App, suite ConfigSuite[C]) error {
|
||||
return fmt.Errorf("command path %q is already registered", "config")
|
||||
}
|
||||
|
||||
commands := make([]Command, 0, 4)
|
||||
installed := make([]ConfigOperation, 0, 3)
|
||||
commands := make([]Command, 0, 5)
|
||||
installed := make([]ConfigOperation, 0, 4)
|
||||
if configOperationDeclared(normalized.Scopes, ConfigValidate) {
|
||||
validate, err := newConfigValidateCommand(normalized)
|
||||
if err != nil {
|
||||
@@ -157,6 +158,14 @@ func RegisterConfig[C any](app *App, suite ConfigSuite[C]) error {
|
||||
commands = append(commands, sources)
|
||||
installed = append(installed, ConfigSources)
|
||||
}
|
||||
if configOperationDeclared(normalized.Scopes, ConfigExplain) {
|
||||
explain, err := newConfigExplainCommand(normalized)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
commands = append(commands, explain)
|
||||
installed = append(installed, ConfigExplain)
|
||||
}
|
||||
command, err := newConfigScopesCommandWithScopes(normalized.Scopes, installed)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user