-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
Thanks for the library! This issue is really a feature request.
Request
It would be useful to me and potentially others to not have the default completer completely overriden once a non-nil completer is provided. This is because I'd still like to use original flag and sub-command completion if the parent command has a custom completer.
Proposal
I propose that the decision in the completion function here is modified to:
if cmd.Completer != nil {
words = cmd.Completer(prefix, rest)
for _, w := range words {
suggestions = append(suggestions, []rune(strings.TrimPrefix(w, prefix)))
}
if cmd.OverrideCompleter {
return suggestions, len(prefix)
}
}This means that grumble.Command would have a new field like OverrideCompleter (which could be set to 'true' by default to preserve original behaviour). If I'm not mistaken, the following change would mean that the custom completion results as well as the default completion results would be suggested when TAB is hit.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels