mirror of
https://github.com/securego/gosec.git
synced 2024-12-24 11:35:52 +00:00
Add a new flag terse to show only the results and summary (#986)
The new flag '-terse' will only show the results and summary ignoring any logs occured during a scan. Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
This commit is contained in:
parent
36f69332a4
commit
fc570b6f1a
1 changed files with 4 additions and 1 deletions
|
@ -143,6 +143,9 @@ var (
|
||||||
// output suppression information for auditing purposes
|
// output suppression information for auditing purposes
|
||||||
flagTrackSuppressions = flag.Bool("track-suppressions", false, "Output suppression information, including its kind and justification")
|
flagTrackSuppressions = flag.Bool("track-suppressions", false, "Output suppression information, including its kind and justification")
|
||||||
|
|
||||||
|
// flagTerse shows only the summary of scan discarding all the logs
|
||||||
|
flagTerse = flag.Bool("terse", false, "Shows only the results and summary")
|
||||||
|
|
||||||
// exclude the folders from scan
|
// exclude the folders from scan
|
||||||
flagDirsExclude arrayFlags
|
flagDirsExclude arrayFlags
|
||||||
|
|
||||||
|
@ -354,7 +357,7 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if *flagQuiet {
|
if *flagQuiet || *flagTerse {
|
||||||
logger = log.New(io.Discard, "", 0)
|
logger = log.New(io.Discard, "", 0)
|
||||||
} else {
|
} else {
|
||||||
logger = log.New(logWriter, "[gosec] ", log.LstdFlags)
|
logger = log.New(logWriter, "[gosec] ", log.LstdFlags)
|
||||||
|
|
Loading…
Reference in a new issue