1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

Fix csaf_provider integration test

* Move to using a custom argument list in main for the provider,
   now that we have argument handling.
This commit is contained in:
Bernhard Reiter 2022-04-13 17:31:36 +02:00
parent 7a1d26e3fd
commit b2ac115ee4
No known key found for this signature in database
GPG key ID: 2B7BA3BF9BC3A554
2 changed files with 9 additions and 5 deletions

View file

@ -12,6 +12,7 @@ import (
"fmt"
"log"
"net/http/cgi"
"os"
"github.com/csaf-poc/csaf_distribution/util"
"github.com/jessevdk/go-flags"
@ -21,7 +22,7 @@ type options struct {
Version bool `long:"version" description:"Display version of the binary"`
}
func main() {
func realMain(args []string) {
cfg, err := loadConfig()
if err != nil {
log.Fatalf("error: %v\n", err)
@ -29,7 +30,7 @@ func main() {
var opts options
parser := flags.NewParser(&opts, flags.Default)
parser.Parse()
parser.ParseArgs(args)
if opts.Version {
fmt.Println(util.SemVersion)
return
@ -46,3 +47,7 @@ func main() {
log.Fatalf("error: %v\n", err)
}
}
func main() {
realMain(os.Args[1:])
}