From 228b9f8ad34ab4d3fb41ac19e8b26b01f52f221e Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Mon, 15 Jun 2026 15:00:21 +0000 Subject: [PATCH] Expand globs in args --- main.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index b3630d950..f9f625deb 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "os" + "path/filepath" "runtime" "slices" "strings" @@ -108,7 +109,17 @@ func main() { scc --report=out.html --report-title "myrepo" --report-skip cocomo`, Version: processor.Version, Run: func(cmd *cobra.Command, args []string) { - processor.DirFilePaths = args + filepaths := make([]string, 0) + for _, arg := range args { + matches, err := filepath.Glob(arg) + if err != nil { + // Invalid pattern for glob, assume the arg is a literal filename + filepaths = append(filepaths, arg) + } else { + filepaths = append(filepaths, matches...) + } + } + processor.DirFilePaths = filepaths processor.ConfigureGc() processor.ConfigureLazy(true)