-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.go
More file actions
59 lines (48 loc) · 1.42 KB
/
Copy pathcli.go
File metadata and controls
59 lines (48 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// cli.go
package main
import (
"flag"
"fmt"
"os"
"runtime"
"github.com/keltia/cryptcheck"
"github.com/keltia/observatory"
"github.com/keltia/ssllabs"
)
var (
fDebug bool
fJobs int
fType string
fOutput string
fSummary string
fSiteName string
fIgnoreImirhil bool
fIgnoreMozilla bool
fVerbose bool
fCmdWild bool
)
const (
cliUsage = `%s version %s - Imirhil/%s SSLLabs/%s Mozilla/%s
Usage: %s [-hvDIM] [-j n] [-t text|csv|html] [-s file] [-S site] [-o file] file[.json]
%s [-vD] -wild file[.json]
`
)
// Usage string override.
var Usage = func() {
fmt.Fprintf(os.Stderr, cliUsage, MyName,
MyVersion, cryptcheck.MyVersion, ssllabs.MyVersion, observatory.MyVersion,
MyName, MyName)
flag.PrintDefaults()
}
func init() {
flag.IntVar(&fJobs, "j", runtime.NumCPU(), "# of parallel jobs")
flag.StringVar(&fOutput, "o", "-", "Save into file (default stdout)")
flag.StringVar(&fSummary, "s", "summaries", "Save summary there")
flag.StringVar(&fType, "t", "csv", "Type of report")
flag.StringVar(&fSiteName, "S", "", "Display that site")
flag.BoolVar(&fIgnoreImirhil, "I", false, "Do not fetch tls.imirhil.fr grade")
flag.BoolVar(&fIgnoreMozilla, "M", false, "Do not fetch Mozilla Observatory data")
flag.BoolVar(&fDebug, "D", false, "Debug mode")
flag.BoolVar(&fVerbose, "v", false, "Verbose mode")
flag.BoolVar(&fCmdWild, "wild", false, "Display wildcards")
}