Skip to content

Commit be8c698

Browse files
committed
add commandline parameters
1 parent 5897ea9 commit be8c698

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package main
33
import (
44
"encoding/csv"
55
"errors"
6+
"flag"
67
"fmt"
78
"os"
89
"strings"
910
"time"
1011
)
1112

12-
const FILENAME = "index.txt"
1313
const TIMEFORMAT_SHORT = "060102150405Z"
1414
const TIMEFORMAT_LONG = "20060102150405Z"
1515

@@ -121,7 +121,9 @@ func (c *Certificates) print_expired() {
121121
}
122122

123123
func main() {
124-
file, err := os.Open(FILENAME)
124+
filename := flag.String("filename", "index.txt", "Path to our OpenSSL index file")
125+
flag.Parse()
126+
file, err := os.Open(*filename)
125127
if err != nil {
126128
panic(err)
127129
}

0 commit comments

Comments
 (0)