diff options
| author | horus | 2018-05-14 20:15:06 +0200 |
|---|---|---|
| committer | horus | 2018-05-14 20:15:06 +0200 |
| commit | e55041d82bc8b486cb667ba5990d7c79e859c035 (patch) | |
| tree | 94a72db0800a2ee6e3a0c8e331f0e404adb67c6f /crawler/init.go | |
| parent | ad0d5d2211fe1db2d58a2a2ae084403f73f9dfdb (diff) | |
| download | alkobote-e55041d82bc8b486cb667ba5990d7c79e859c035.tar.gz | |
Adds command line support to crawl only specific shops. (crawler)
Diffstat (limited to 'crawler/init.go')
| -rw-r--r-- | crawler/init.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crawler/init.go b/crawler/init.go index f23dd9b..8786db6 100644 --- a/crawler/init.go +++ b/crawler/init.go @@ -18,6 +18,7 @@ func init() { silent := flag.BoolP("silent", "s", false, "suppress outputs except warnings") loglevel_f := flag.StringP("loglevel", "l", "Warn", `sets log level, can be "Warn", "Info" or "Debug"`) flag.Bool("shops", false, `list all crawlable shops`) + shoplist_f := flag.String("shop-list", "", `comma separated list of shop ids to crawl only these`) flag.Parse() loglevel := strings.ToLower(*loglevel_f) @@ -39,4 +40,8 @@ func init() { if _conf.Debug && !*silent { log.SetLevel(log.DebugLevel) } + + if "" != *shoplist_f { + _conf.ShopIDs = strings.Split(*shoplist_f, ",") + } } |
