We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee80733 commit 9d9098fCopy full SHA for 9d9098f
cmd/gosec/main.go
@@ -104,6 +104,9 @@ var (
104
// scan tests files
105
flagScanTests = flag.Bool("tests", false, "Scan tests files")
106
107
+ // print version and quit with exit code 0
108
+ flagVersion = flag.Bool("version", false, "Print version and quit with exit code 0")
109
+
110
logger *log.Logger
111
)
112
@@ -219,6 +222,11 @@ func main() {
219
222
// Parse command line arguments
220
223
flag.Parse()
221
224
225
+ if *flagVersion {
226
+ fmt.Printf("Version: %s\nGit tag: %s\nBuild date: %s\n", Version, GitTag, BuildDate)
227
+ os.Exit(0)
228
+ }
229
230
// Ensure at least one file was specified
231
if flag.NArg() == 0 {
232
fmt.Fprintf(os.Stderr, "\nError: FILE [FILE...] or './...' expected\n") // #nosec
0 commit comments