Merge pull request #1396 from urfave/suggestion-pluggability

Introduce override hooks for suggestions
This commit is contained in:
2022-05-22 11:14:46 -04:00
committed by GitHub
6 changed files with 62 additions and 36 deletions
+1 -1
View File
@@ -221,7 +221,7 @@ func ShowCommandHelp(ctx *Context, command string) error {
if ctx.App.CommandNotFound == nil {
errMsg := fmt.Sprintf("No help topic for '%v'", command)
if ctx.App.Suggest {
if suggestion := suggestCommand(ctx.App.Commands, command); suggestion != "" {
if suggestion := SuggestCommand(ctx.App.Commands, command); suggestion != "" {
errMsg += ". " + suggestion
}
}