summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-06-11 23:04:52 -0400
committerdemo <demo@antix1>2026-06-11 23:04:52 -0400
commit3a8154d11816476fec3e74bb69f965d45f380d9c (patch)
tree96e108050642056514fb1b1189e5c7808fa277cc
parentbdf43822197f56713d0fff944501f791e7234ac0 (diff)
feat: add remaining flags and reinstate crawling logic
-rw-r--r--main.go24
1 files changed, 24 insertions, 0 deletions
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
}