From de13213492ce02464c5ecd8544ea5ae6b33fa712 Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Thu, 20 Jun 2019 15:47:04 +0200 Subject: Make output about ignored robots.txt optional --- cmd/gopherproxy/main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cmd') diff --git a/cmd/gopherproxy/main.go b/cmd/gopherproxy/main.go index aced41b..e9dea18 100644 --- a/cmd/gopherproxy/main.go +++ b/cmd/gopherproxy/main.go @@ -10,14 +10,15 @@ import ( var ( // TODO: Allow config file and environment vars // (opt -> env -> config -> default) - bind = flag.String("bind", "0.0.0.0:8000", "[int]:port to bind to") - robotsfile = flag.String("robots-file", "robots.txt", "robots.txt file") - uri = flag.String("uri", "floodgap.com", ":[port] to proxy to") + bind = flag.String("bind", "0.0.0.0:8000", "[int]:port to bind to") + robotsfile = flag.String("robots-file", "robots.txt", "robots.txt file") + robotsdebug = flag.Bool("robots-debug", false, "print output about ignored robots.txt") + uri = flag.String("uri", "floodgap.com", ":[port] to proxy to") ) func main() { flag.Parse() // Use a config struct - log.Fatal(gopherproxy.ListenAndServe(*bind, *robotsfile, *uri)) + log.Fatal(gopherproxy.ListenAndServe(*bind, *robotsfile, *robotsdebug, *uri)) } -- cgit v1.2.3-70-g09d2