diff options
| author | horus | 2018-02-16 18:07:54 +0100 |
|---|---|---|
| committer | horus | 2018-02-16 18:07:54 +0100 |
| commit | 6ff74852ebb70aa7cc24da89390e2607bac58369 (patch) | |
| tree | 3da082963b0a914d0128008ba096e494c2e232bf /crawler/main.go | |
| parent | bf5f6b98a1d933d5f0ffb7fe965428f4dab5e3b0 (diff) | |
| download | alkobote-6ff74852ebb70aa7cc24da89390e2607bac58369.tar.gz | |
Pass the config file via command line flag. (crawler)
Diffstat (limited to 'crawler/main.go')
| -rw-r--r-- | crawler/main.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crawler/main.go b/crawler/main.go index 11dfd4d..69f9638 100644 --- a/crawler/main.go +++ b/crawler/main.go @@ -2,14 +2,15 @@ package main import ( "encoding/json" + "flag" "fmt" - log "github.com/Sirupsen/logrus" "time" _ "database/sql" _ "github.com/go-sql-driver/mysql" //_ "github.com/mattn/go-sqlite3" + log "github.com/Sirupsen/logrus" "github.com/jmoiron/sqlx" ) @@ -53,8 +54,11 @@ func main() { var err error + configFile := flag.String("config", "", "path to config file") + flag.Parse() + app := App{Config: &Config{}} - app.Config.parseConfig("") + app.Config.parseConfig(*configFile) app.Now = time.Now().Unix() |
