Dont show hidden sub-commands during completion

This commit is contained in:
Kovid Goyal
2023-10-10 05:33:04 +05:30
parent 5d0dabe51c
commit 455d0a6048
2 changed files with 2 additions and 3 deletions

View File

@@ -104,7 +104,7 @@ func complete_word(word string, completions *Completions, only_args_allowed bool
group.Title = "Sub-commands"
}
for _, sc := range cg.SubCommands {
if strings.HasPrefix(sc.Name, word) {
if !sc.Hidden && strings.HasPrefix(sc.Name, word) {
t := sc.ShortDescription
if t == "" {
t = sc.HelpText