Ensure auto-generated entries such as --help are present for completion by calling Validate()

This commit is contained in:
Kovid Goyal
2022-11-16 18:05:27 +05:30
parent 81916d0f02
commit e31587ec1e
3 changed files with 4 additions and 0 deletions

View File

@@ -88,6 +88,7 @@ func GenerateCompletions(args []string) error {
re(root)
}
root.Validate()
all_completions := make([]*Completions, 0, 1)
for _, argv := range all_argv {
all_completions = append(all_completions, root.GetCompletions(argv, init_completions[output_type]))