Keep nested help commands with application handlers

This commit is contained in:
2026-10-09 03:03:10 +00:00
parent c3a5cae012
commit dacc743551
3 changed files with 89 additions and 8 deletions

View File

@@ -42,7 +42,7 @@ func (a *App) Execute(ctx context.Context, args []string, streams Streams) Outco
if err := command.payload.checkInput(input); err != nil {
return current.present(Usage(err), parsed.Path)
}
if command.name == "help" {
if len(parsed.Path) == 1 && parsed.Path[0] == "help" {
help, ok := input.(*helpInput)
if !ok {
return current.present(Failure(errors.New("built-in help input has an unexpected type")), parsed.Path)