Add native configuration display
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, 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
|
||||
|
||||
Reference in New Issue
Block a user