]> Sergey Matveev's repositories - btrtrc.git/blobdiff - cmd/torrent/main.go
Add scrape subcommand to cmd/torrent
[btrtrc.git] / cmd / torrent / main.go
index 4f83762a2b16aabb7172a139cd4a6f88fc350fd0..b8318abf6d072f90005294091ca57ad9dd7118df 100644 (file)
@@ -41,6 +41,16 @@ func mainErr() error {
                        }
                        return announceErr(cmd)
                }),
+               args.Subcommand("scrape", func(p args.SubCmdCtx) error {
+                       var cmd ScrapeCmd
+                       err := p.NewParser().AddParams(
+                               args.Pos("tracker", &cmd.Tracker),
+                               args.Pos("infohash", &cmd.InfoHashes, args.Arity('+'))).Parse()
+                       if err != nil {
+                               return err
+                       }
+                       return scrape(cmd)
+               }),
                args.Subcommand("download", func(p args.SubCmdCtx) error {
                        var dlc DownloadCmd
                        err := p.NewParser().AddParams(