Skip to content

Commit

Permalink
Fix docs issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Dec 7, 2022
1 parent badc19f commit 659672b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions godoc-current.txt
Expand Up @@ -205,6 +205,9 @@ func ShowAppHelpAndExit(c *Context, exitCode int)
ShowAppHelpAndExit - Prints the list of subcommands for the app and exits
with exit code.

func ShowCommandCompletions(ctx *Context, command string)
ShowCommandCompletions prints the custom completions for a given command

func ShowCommandHelp(ctx *Context, command string) error
ShowCommandHelp prints help for the given command

Expand Down
13 changes: 13 additions & 0 deletions help.go
Expand Up @@ -314,6 +314,19 @@ func ShowCompletions(cCtx *Context) {
}
}

// ShowCommandCompletions prints the custom completions for a given command
func ShowCommandCompletions(ctx *Context, command string) {
c := ctx.Command.Command(command)
if c != nil {
if c.BashComplete != nil {
c.BashComplete(ctx)
} else {
DefaultCompleteWithFlags(c)(ctx)
}
}

}

// printHelpCustom is the default implementation of HelpPrinterCustom.
//
// The customFuncs map will be combined with a default template.FuncMap to
Expand Down
3 changes: 3 additions & 0 deletions testdata/godoc-v2.x.txt
Expand Up @@ -205,6 +205,9 @@ func ShowAppHelpAndExit(c *Context, exitCode int)
ShowAppHelpAndExit - Prints the list of subcommands for the app and exits
with exit code.

func ShowCommandCompletions(ctx *Context, command string)
ShowCommandCompletions prints the custom completions for a given command

func ShowCommandHelp(ctx *Context, command string) error
ShowCommandHelp prints help for the given command

Expand Down

0 comments on commit 659672b

Please sign in to comment.