Add configuration source reports

This commit is contained in:
2026-10-07 14:05:26 +00:00
parent bbd862311e
commit 25b412ea93
8 changed files with 330 additions and 9 deletions

View File

@@ -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