You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/gosec/main.go
+13-4
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,9 @@ var (
133
133
// print the text report with color, this is enabled by default
134
134
flagColor=flag.Bool("color", true, "Prints the text format report with colorization when it goes in the stdout")
135
135
136
+
// append ./... to the target dir.
137
+
flagRecursive=flag.Bool("r", false, "Appends \"./...\" to the target dir.")
138
+
136
139
// overrides the output format when stdout the results while saving them in the output file
137
140
flagVerbose=flag.String("verbose", "", "Overrides the output format when stdout the results while saving them in the output file.\nValid options are: json, yaml, csv, junit-xml, html, sonarqube, golint, sarif or text")
138
141
@@ -319,9 +322,9 @@ func main() {
319
322
os.Exit(0)
320
323
}
321
324
322
-
// Ensure at least one file was specified
323
-
ifflag.NArg() ==0 {
324
-
fmt.Fprintf(os.Stderr, "\nError: FILE [FILE...] or './...' expected\n") //#nosec
325
+
// Ensure at least one file was specified or that the recursive -r flag was set.
326
+
ifflag.NArg() ==0&&!*flagRecursive{
327
+
fmt.Fprintf(os.Stderr, "\nError: FILE [FILE...] or './...' or -r expected\n") //#nosec
0 commit comments