Skip to content

Commit 97ced9f

Browse files
committed
perf(param): ignore empty args from config
1 parent 6e7723c commit 97ced9f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/param/cli.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func ArgsToCmdResults(cmd *goNixArgParser.Command, args []string) (results []*go
265265
}
266266

267267
// append config and re-parse
268-
configs := []string{}
268+
configs := make([]string, 0, len(results))
269269
groupSeps := cmd.Options().GroupSeps()[0]
270270
hasConfig := false
271271
var stdinConfigArgs []string
@@ -292,6 +292,9 @@ func ArgsToCmdResults(cmd *goNixArgParser.Command, args []string) (results []*go
292292
stdinConfigArgs = configArgs
293293
}
294294
}
295+
if len(configArgs) == 0 {
296+
continue
297+
}
295298

296299
hasConfig = true
297300
configs = append(configs, configArgs...)

0 commit comments

Comments
 (0)