feat(cmd): improves error messaging for globs
This commit is contained in:
parent
20294a9279
commit
3d4cd40a17
8 changed files with 20 additions and 14 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/gobwas/glob"
|
||||
|
|
@ -52,3 +53,11 @@ func globMatch(matchers []glob.Glob, key string) bool {
|
|||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func formatGlobPatterns(patterns []string) string {
|
||||
quoted := make([]string, 0, len(patterns))
|
||||
for _, pattern := range patterns {
|
||||
quoted = append(quoted, fmt.Sprintf("'%s'", pattern))
|
||||
}
|
||||
return strings.Join(quoted, ", ")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue