Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added flag to avoid printing header #27

Merged
merged 2 commits into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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