We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f23a1c0 commit 36e880dCopy full SHA for 36e880d
1 file changed
lib/arg_parser.go
@@ -9,7 +9,7 @@ import (
9
10
var reOpt = regexp.MustCompile("^--[a-z][-a-z]*|^-[a-zA-Z]$")
11
12
-func canOpt(arg string) bool {
+func inferOpt(arg string) bool {
13
return reOpt.MatchString(arg)
14
}
15
@@ -22,15 +22,15 @@ func ParseArgs(args []string) (opts, files []string) {
22
fi, err := os.Stat(arg)
23
fileNotFound := errors.Is(err, os.ErrNotExist)
24
25
- if foundOpt && !canOpt(arg) && (fileNotFound || fi.IsDir()) {
+ if foundOpt && !inferOpt(arg) && (fileNotFound || fi.IsDir()) {
26
opts = append(opts, arg)
27
foundOpt = false
28
continue
29
30
31
32
33
- if canOpt(arg) && fileNotFound {
+ if inferOpt(arg) && fileNotFound {
34
foundOpt = true
35
36
0 commit comments