-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
35 lines (28 loc) · 784 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
package main
import (
"flag"
"fmt"
"log"
"os"
"github.com/aaaasmile/crawler/crawler"
"github.com/aaaasmile/crawler/idl"
)
func main() {
var ver = flag.Bool("ver", false, "Prints the current version")
var simulate = flag.Bool("simulate", false, "Simulate email send (build the message without sending it)")
var configfile = flag.String("config", "config.toml", "Configuration file path")
var resendmail = flag.Bool("resendmail", false, "Resend email using the last data download")
flag.Parse()
if *ver {
fmt.Printf("%s version %s", idl.Appname, idl.Buildnr)
os.Exit(0)
}
crw := crawler.CrawlerOfChart{
Simulate: *simulate,
ResendEmail: *resendmail,
}
if err := crw.Start(*configfile); err != nil {
panic(err)
}
log.Println("That's all folks.")
}