From d7f14adb7654cb9bfdf54b24f7bc8fadefa92a2f Mon Sep 17 00:00:00 2001 From: edoardottt Date: Thu, 18 Aug 2022 16:57:45 +0200 Subject: [PATCH] Add ua flag --- input/flags.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/input/flags.go b/input/flags.go index 7d66f51..493b789 100644 --- a/input/flags.go +++ b/input/flags.go @@ -58,6 +58,7 @@ type Input struct { Errors bool Info bool Debug bool + UserAgent string } //ScanFlag defines all the options taken @@ -98,6 +99,8 @@ func ScanFlag() Input { debugPtr := flag.Bool("debug", false, "Print debug information while crawling.") + userAgentPtr := flag.String("ua", "", "Use a custom User Agent.") + flag.Parse() result := Input{ @@ -126,6 +129,7 @@ func ScanFlag() Input { *errorsPtr, *infoPtr, *debugPtr, + *userAgentPtr, } return result