Introduce override hooks for suggestions

Related to https://github.com/urfave/cli/pull/1390#discussion_r871398659
This commit is contained in:
2022-05-14 08:24:44 -04:00
parent e770ee9794
commit 68bd4903fd
6 changed files with 54 additions and 31 deletions

View File

@@ -26,6 +26,10 @@ application:
VARIABLES
var (
SuggestFlag SuggestFlagFunc = suggestFlag
SuggestCommand SuggestCommandFunc = suggestCommand
)
var AppHelpTemplate = `NAME:
{{.Name}}{{if .Usage}} - {{.Usage}}{{end}}
@@ -1539,6 +1543,10 @@ func (f *StringSliceFlag) String() string
func (f *StringSliceFlag) TakesValue() bool
TakesValue returns true of the flag takes a value, otherwise false
type SuggestCommandFunc func(commands []*Command, provided string) string
type SuggestFlagFunc func(flags []Flag, provided string, hideHelp bool) string
type Timestamp struct {
// Has unexported fields.
}