Skip to content

Commit

Permalink
fix: parse flags properly
Browse files Browse the repository at this point in the history
  • Loading branch information
savely-krasovsky committed Jun 30, 2023
1 parent 30d38de commit ef61af3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/filegenerator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ func main() {
output string
)

flag.StringVar(&output, "output", "", "Output file name")
generator := geosite_antizapret.NewGenerator()
flag.StringVar(&output, "output", "", "Output path")
flag.Parse()

if output == "" {
fmt.Println("Provide a name of file!")
fmt.Println("Provide path to file!")
return
}

generator := geosite_antizapret.NewGenerator()

if err := generator.GenerateAndWrite(output); err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit ef61af3

Please sign in to comment.