Skip to content

Commit

Permalink
Merge pull request #27 from CasperGN/optional_header
Browse files Browse the repository at this point in the history
Added flag to avoid printing header
  • Loading branch information
rverton committed Apr 11, 2020
2 parents e17a789 + 838f9f9 commit 92f42cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ If you want to build for yourself:
output format (stdout|csv|json) (default "stdout")
-search
searches all urls with same base domain (i.e. example.com and sub.example.com) (default true)
-silent
avoid printing header (default false)
-update
update apps file
-worker int
Expand Down
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 92f42cc

Please sign in to comment.