mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Started with main of checker.
This commit is contained in:
parent
8c64e03507
commit
6692e45644
2 changed files with 46 additions and 0 deletions
30
cmd/csaf_checker/main.go
Normal file
30
cmd/csaf_checker/main.go
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/jessevdk/go-flags"
|
||||||
|
)
|
||||||
|
|
||||||
|
type options struct {
|
||||||
|
Output string `short:"o" long:"output" description:"File name of the generated report" value-name:"REPORT-FILE"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func checkParser(err error) {
|
||||||
|
if err != nil {
|
||||||
|
if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrHelp {
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var opts options
|
||||||
|
|
||||||
|
args, err := flags.Parse(&opts)
|
||||||
|
checkParser(err)
|
||||||
|
|
||||||
|
_ = args
|
||||||
|
|
||||||
|
}
|
||||||
16
cmd/csaf_checker/report.go
Normal file
16
cmd/csaf_checker/report.go
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
type Requirement struct {
|
||||||
|
Num int
|
||||||
|
Description string
|
||||||
|
Messages []string
|
||||||
|
}
|
||||||
|
|
||||||
|
type domain struct {
|
||||||
|
Name string
|
||||||
|
Requirements []Requirement
|
||||||
|
}
|
||||||
|
|
||||||
|
type report struct {
|
||||||
|
Domains []domain
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue