diff options
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, ",") + } } |
