Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Commit

Permalink
Print help if CSV is not specified
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <[email protected]>
  • Loading branch information
teran committed Jan 7, 2020
1 parent 88cddfc commit d264a4f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/tagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ func main() {
os.Exit(1)
}

if f.GetCSVPath() == "" {
f.PrintUsageString()
os.Exit(1)
}

lookupTzFn := func(cID uint8) *time.Location {
tzname := cfg.GetTimezoneByCameraID(cID)
location, err := time.LoadLocation(tzname)
Expand All @@ -62,10 +67,6 @@ func main() {
return location
}

if f.GetCSVPath() == "" {
log.Fatal("CSV file is required to specify")
}

t, err := parser.New(f.GetCSVPath(), cfg.GetTimestampFormat().TimeLayout(), lookupTzFn)
if err != nil {
log.Fatalf("error initializing CSV parser: %s", err)
Expand Down

0 comments on commit d264a4f

Please sign in to comment.