mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Change checker to allow integration test coverage
* Add realMain() to allow a call with test argument redacted. * Add main_test to call realMain with arguments after `--`.
This commit is contained in:
parent
530a02742e
commit
6dada4fd14
2 changed files with 27 additions and 7 deletions
|
|
@ -126,10 +126,10 @@ func buildReporters() []reporter {
|
|||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
func realMain(args []string) {
|
||||
opts := new(options)
|
||||
|
||||
domains, err := flags.Parse(opts)
|
||||
domains, err := flags.ParseArgs(opts, args)
|
||||
errCheck(err)
|
||||
|
||||
if len(domains) == 0 {
|
||||
|
|
@ -137,11 +137,6 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
if (opts.ClientCert != nil && opts.ClientKey == nil) || (opts.ClientCert == nil && opts.ClientKey != nil) {
|
||||
log.Println("Both client-key and client-cert options must be set for the authentication.")
|
||||
return
|
||||
}
|
||||
|
||||
p := newProcessor(opts)
|
||||
|
||||
report, err := p.run(buildReporters(), domains)
|
||||
|
|
@ -149,3 +144,7 @@ func main() {
|
|||
|
||||
errCheck(writeReport(report, opts))
|
||||
}
|
||||
|
||||
func main() {
|
||||
realMain(os.Args[1:])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue