Add native configuration display

This commit is contained in:
2026-10-07 13:55:43 +00:00
parent 3945f1c33a
commit bbd862311e
9 changed files with 351 additions and 10 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, 2)
installed := make([]ConfigOperation, 0, 1)
commands := make([]Command, 0, 3)
installed := make([]ConfigOperation, 0, 2)
if configOperationDeclared(normalized.Scopes, ConfigValidate) {
validate, err := newConfigValidateCommand(normalized)
if err != nil {
@@ -141,6 +141,14 @@ func RegisterConfig[C any](app *App, suite ConfigSuite[C]) error {
commands = append(commands, validate)
installed = append(installed, ConfigValidate)
}
if configOperationDeclared(normalized.Scopes, ConfigShow) {
show, err := newConfigShowCommand(normalized)
if err != nil {
return err
}
commands = append(commands, show)
installed = append(installed, ConfigShow)
}
command, err := newConfigScopesCommandWithScopes(normalized.Scopes, installed)
if err != nil {
return err