From e55041d82bc8b486cb667ba5990d7c79e859c035 Mon Sep 17 00:00:00 2001 From: horus Date: Mon, 14 May 2018 20:15:06 +0200 Subject: Adds command line support to crawl only specific shops. (crawler) --- crawler/init.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crawler/init.go') 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, ",") + } } -- cgit v1.2.3