Compile typed command runners
This commit is contained in:
@@ -30,16 +30,15 @@ type versionDocument struct {
|
||||
}
|
||||
|
||||
func (a *App) installBuiltins() error {
|
||||
help := NewCommand(CommandSpec[helpInput]{
|
||||
help := captureCommand(CommandSpec[helpInput]{
|
||||
Name: "help",
|
||||
Summary: "Show help for commands.",
|
||||
Description: "Describe registered commands and their inputs.",
|
||||
Arguments: []Argument[helpInput]{RepeatArgument(ArgumentMeta{Name: "COMMAND", Usage: "registered command path"}, 0, -1,
|
||||
func(value string) (string, error) { return value, nil },
|
||||
func(input *helpInput, value Supplied[[]string]) { input.Targets = value })},
|
||||
Run: func(invocation Invocation, input helpInput) Outcome {
|
||||
return a.renderHelpTargets(input.Targets.Value, invocation.Streams)
|
||||
},
|
||||
}, func(current commandExecution, input helpInput) Outcome {
|
||||
return current.renderHelpTargets(input.Targets.Value)
|
||||
})
|
||||
scopeDefault := "app"
|
||||
formatDefault := "text"
|
||||
|
||||
Reference in New Issue
Block a user