mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Factor command line parsing into an internal package for reuse.
This commit is contained in:
parent
27ec66353c
commit
95bd705036
6 changed files with 281 additions and 272 deletions
|
|
@ -14,6 +14,8 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/csaf-poc/csaf_distribution/v2/internal/options"
|
||||
)
|
||||
|
||||
func run(cfg *config, domains []string) error {
|
||||
|
|
@ -34,13 +36,13 @@ func run(cfg *config, domains []string) error {
|
|||
func main() {
|
||||
|
||||
domains, cfg, err := parseArgsConfig()
|
||||
errCheck(err)
|
||||
errCheck(cfg.prepare())
|
||||
options.ErrorCheck(err)
|
||||
options.ErrorCheck(cfg.prepare())
|
||||
|
||||
if len(domains) == 0 {
|
||||
log.Println("No domains given.")
|
||||
return
|
||||
}
|
||||
|
||||
errCheck(run(cfg, domains))
|
||||
options.ErrorCheck(run(cfg, domains))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue