-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
39 lines (31 loc) · 914 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"fmt"
"github.com/alecthomas/kong"
"github.com/rs/zerolog/log"
"github.com/eriq-augustine/comic-server/config"
"github.com/eriq-augustine/comic-server/database"
)
var args struct {
config.ConfigArgs
}
func main() {
kong.Parse(&args);
err := config.HandleConfigArgs(args.ConfigArgs);
if (err != nil) {
log.Fatal().Err(err).Msg("Could not load config options.");
}
err = database.Open();
if (err != nil) {
log.Fatal().Err(err).Msg("Could not open database.");
}
defer database.Close();
allSeries, err := database.FetchUnmatchedSeries();
if (err != nil) {
log.Fatal().Err(err).Msg("Could not fetch unmatched series.");
}
fmt.Printf("Found %d unmatched series:\n", len(allSeries));
for _, series := range allSeries {
fmt.Printf(" %d - '%s'\n", series.ID, series.Name);
}
}