From 3a8154d11816476fec3e74bb69f965d45f380d9c Mon Sep 17 00:00:00 2001 From: demo Date: Thu, 11 Jun 2026 23:04:52 -0400 Subject: feat: add remaining flags and reinstate crawling logic --- main.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/main.go b/main.go index e19a971..2b072b3 100644 --- a/main.go +++ b/main.go @@ -50,6 +50,28 @@ func main() { }, }, }, + Flags: []cli.Flag{ + &cli.IntFlag{ + Name: "concurrency", + Aliases: []string{"c"}, + Usage: "Allowable number of concurrent URL fetches", + + // Default concurrency setting is 1. + Value: 1, + }, + &cli.IntFlag{ + Name: "maxurls", + Aliases: []string{"m"}, + Usage: "Maximum number of URLs to collect", + DefaultText: "no limit", + }, + &cli.IntFlag{ + Name: "depth", + Aliases: []string{"d"}, + Usage: "Maximum URL depth", + DefaultText: "no limit", + }, + }, Action: func(ctx context.Context, cmd *cli.Command) error { if shortcode := cmd.String("shortcode"); shortcode != "" { // FIXME: shortcode filename is hardcoded for now. @@ -64,6 +86,7 @@ func main() { } fmt.Printf("URL: %s\n", &u) + classic(u, cmd.Int("concurrency"), cmd.Int("maxurls"), cmd.Int("depth")) return nil } @@ -74,6 +97,7 @@ func main() { } fmt.Printf("URL: %s\n", &u) + classic(u, cmd.Int("concurrency"), cmd.Int("maxurls"), cmd.Int("depth")) return nil } -- cgit v1.2.3