Skip to content

Commit

Permalink
Added flag -silent to not print header for imbedding webanalyze into …
Browse files Browse the repository at this point in the history
…scripts
  • Loading branch information
CasperGN committed Apr 10, 2020
1 parent e17a789 commit 6be5773
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/webanalyze/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var (
hosts string
crawlCount int
searchSubdomain bool
silent bool
)

func init() {
Expand All @@ -36,6 +37,7 @@ func init() {
flag.StringVar(&hosts, "hosts", "", "filename with hosts, one host per line.")
flag.IntVar(&crawlCount, "crawl", 0, "links to follow from the root page (default 0)")
flag.BoolVar(&searchSubdomain, "search", true, "searches all urls with same base domain (i.e. example.com and sub.example.com)")
flag.BoolVar(&silent, "silent", false, "avoid printing header (default false)")
}

func main() {
Expand Down Expand Up @@ -95,7 +97,9 @@ func main() {
log.Fatalf("initialization failed: %v", err)
}

printHeader()
if !silent {
printHeader()
}

for i := 0; i < workers; i++ {
wg.Add(1)
Expand Down

0 comments on commit 6be5773

Please sign in to comment.