Install command batches through one path

This commit is contained in:
2026-10-11 01:22:47 +00:00
parent 74f6bdeade
commit 24e8cd8629
8 changed files with 87 additions and 46 deletions

View File

@@ -29,7 +29,7 @@ type versionDocument struct {
Revision string `yaml:"revision"`
}
func (a *App) installBuiltins() error {
func (a *App) builtinCommands() []Command {
help := captureCommand(CommandSpec[helpInput]{
Name: "help",
Summary: "Show help for commands.",
@@ -61,9 +61,7 @@ func (a *App) installBuiltins() error {
return renderVersionOutcome(identity, input.Format, invocation.Streams)
},
})
a.commands["help"] = &commandNode{command: help, reserved: true}
a.commands["version"] = &commandNode{command: version, reserved: true}
return nil
return []Command{help, version}
}
func parseVersionScope(value string) (string, error) {