From be8c6987e095362731b80531cb43a55322c00739 Mon Sep 17 00:00:00 2001 From: "Stefan J. Betz" Date: Mon, 30 Sep 2024 18:35:52 +0200 Subject: [PATCH] add commandline parameters --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 9552ef6..c1da725 100644 --- a/main.go +++ b/main.go @@ -3,13 +3,13 @@ package main import ( "encoding/csv" "errors" + "flag" "fmt" "os" "strings" "time" ) -const FILENAME = "index.txt" const TIMEFORMAT_SHORT = "060102150405Z" const TIMEFORMAT_LONG = "20060102150405Z" @@ -121,7 +121,9 @@ func (c *Certificates) print_expired() { } func main() { - file, err := os.Open(FILENAME) + filename := flag.String("filename", "index.txt", "Path to our OpenSSL index file") + flag.Parse() + file, err := os.Open(*filename) if err != nil { panic(err) }