Skip to content

Commit 36e880d

Browse files
committed
Rename a function
1 parent f23a1c0 commit 36e880d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/arg_parser.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
var reOpt = regexp.MustCompile("^--[a-z][-a-z]*|^-[a-zA-Z]$")
1111

12-
func canOpt(arg string) bool {
12+
func inferOpt(arg string) bool {
1313
return reOpt.MatchString(arg)
1414
}
1515

@@ -22,15 +22,15 @@ func ParseArgs(args []string) (opts, files []string) {
2222
fi, err := os.Stat(arg)
2323
fileNotFound := errors.Is(err, os.ErrNotExist)
2424

25-
if foundOpt && !canOpt(arg) && (fileNotFound || fi.IsDir()) {
25+
if foundOpt && !inferOpt(arg) && (fileNotFound || fi.IsDir()) {
2626
opts = append(opts, arg)
2727
foundOpt = false
2828
continue
2929
}
3030

3131
foundOpt = false
3232

33-
if canOpt(arg) && fileNotFound {
33+
if inferOpt(arg) && fileNotFound {
3434
foundOpt = true
3535
opts = append(opts, arg)
3636
continue

0 commit comments

Comments
 (0)