Add configuration source reports
This commit is contained in:
12
config.go
12
config.go
@@ -131,8 +131,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, 3)
|
||||
installed := make([]ConfigOperation, 0, 2)
|
||||
commands := make([]Command, 0, 4)
|
||||
installed := make([]ConfigOperation, 0, 3)
|
||||
if configOperationDeclared(normalized.Scopes, ConfigValidate) {
|
||||
validate, err := newConfigValidateCommand(normalized)
|
||||
if err != nil {
|
||||
@@ -149,6 +149,14 @@ func RegisterConfig[C any](app *App, suite ConfigSuite[C]) error {
|
||||
commands = append(commands, show)
|
||||
installed = append(installed, ConfigShow)
|
||||
}
|
||||
if configOperationDeclared(normalized.Scopes, ConfigSources) {
|
||||
sources, err := newConfigSourcesCommand(normalized)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
commands = append(commands, sources)
|
||||
installed = append(installed, ConfigSources)
|
||||
}
|
||||
command, err := newConfigScopesCommandWithScopes(normalized.Scopes, installed)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user