run modernize

This commit is contained in:
Kovid Goyal
2025-11-11 17:09:37 +05:30
parent 1faf786bd2
commit 6f588a0c29
30 changed files with 46 additions and 60 deletions

View File

@@ -105,7 +105,7 @@ type Delegate struct {
type Completions struct {
Groups []*MatchGroup `json:"groups,omitempty"`
Delegate Delegate `json:"delegate,omitempty"`
Delegate Delegate `json:"delegate"`
CurrentCmd *Command `json:"-"`
AllWords []string `json:"-"` // all words passed to parse_args()

View File

@@ -7,6 +7,7 @@ import (
"mime"
"os"
"path/filepath"
"slices"
"strings"
"golang.org/x/sys/unix"
@@ -185,13 +186,7 @@ func complete_by_fnmatch(prefix, cwd string, patterns []string) []string {
}
func complete_by_mimepat(prefix, cwd string, patterns []string) []string {
all_allowed := false
for _, p := range patterns {
if p == "*" {
all_allowed = true
break
}
}
all_allowed := slices.Contains(patterns, "*")
return fname_based_completer(prefix, cwd, func(name string) bool {
if all_allowed {
return true

View File

@@ -19,7 +19,7 @@ var _ = fmt.Print
type Context struct {
fmt_ctx style.Context
Cyan, Green, Blue, Magenta, Red, BrightRed, Yellow, Italic, Bold, Dim, Title, Exe, Opt, Emph, Err, Code func(args ...interface{}) string
Cyan, Green, Blue, Magenta, Red, BrightRed, Yellow, Italic, Bold, Dim, Title, Exe, Opt, Emph, Err, Code func(args ...any) string
Url func(string, string) string
}