Update vendor directory

This commit is contained in:
Nicholas Thompson
2021-04-23 22:14:34 +02:00
parent 321d19c5c2
commit e201779341
726 changed files with 124438 additions and 104379 deletions

View File

@@ -2,6 +2,7 @@ package flags
import (
"fmt"
"os"
"path/filepath"
"reflect"
"sort"
@@ -62,6 +63,11 @@ func completionsWithoutDescriptions(items []string) []Completion {
// prefix.
func (f *Filename) Complete(match string) []Completion {
ret, _ := filepath.Glob(match + "*")
if len(ret) == 1 {
if info, err := os.Stat(ret[0]); err == nil && info.IsDir() {
ret[0] = ret[0] + "/"
}
}
return completionsWithoutDescriptions(ret)
}
@@ -76,7 +82,7 @@ func (c *completion) skipPositional(s *parseState, n int) {
func (c *completion) completeOptionNames(s *parseState, prefix string, match string, short bool) []Completion {
if short && len(match) != 0 {
return []Completion{
Completion{
{
Item: prefix + match,
},
}
@@ -124,7 +130,7 @@ func (c *completion) completeCommands(s *parseState, match string) []Completion
n := make([]Completion, 0, len(s.command.commands))
for _, cmd := range s.command.commands {
if cmd.data != c && strings.HasPrefix(cmd.Name, match) {
if cmd.data != c && !cmd.Hidden && strings.HasPrefix(cmd.Name, match) {
n = append(n, Completion{
Item: cmd.Name,
Description: cmd.ShortDescription,