summaryrefslogtreecommitdiffstats
path: root/cmd/crawl.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/crawl.go')
-rw-r--r--cmd/crawl.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/cmd/crawl.go b/cmd/crawl.go
index 2c9b719..5c5f78f 100644
--- a/cmd/crawl.go
+++ b/cmd/crawl.go
@@ -11,7 +11,7 @@ var crawlCmd = &cobra.Command{
Aliases: []string{"cw"},
Short: "Crawl domain",
Long: `Resolves a domain using httpx and crawls it using katana. Returns discovered links as plain text, one per line, streamed in real-time. Supports both http:// and https:// URLs.`,
- Args: cobra.ExactArgs(1),
+ Args: argsOrStdin(1),
RunE: runCrawl,
}
@@ -28,14 +28,10 @@ func runCrawl(cmd *cobra.Command, args []string) error {
return err
}
- err = c.CrawlDomain(args[0], subdomains, func(line string) error {
- fmt.Println(line)
- return nil
+ return forEachQuery(args, func(domain string) error {
+ return c.CrawlDomain(domain, subdomains, func(line string) error {
+ fmt.Println(line)
+ return nil
+ })
})
-
- if err != nil {
- return err
- }
-
- return nil
}