]> Sergey Matveev's repositories - btrtrc.git/commitdiff
cmd/torrent: Add flag for progress bar
authorMatt Joiner <anacrolix@gmail.com>
Fri, 19 Jul 2019 03:01:36 +0000 (13:01 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 19 Jul 2019 03:01:36 +0000 (13:01 +1000)
cmd/torrent/main.go

index 570f8bfac3853aa1740b38fbb562738d49ee9908..67b5122bbff75eb653f00fe44d1a94199ef5feee 100644 (file)
@@ -132,11 +132,13 @@ var flags = struct {
        PackedBlocklist string
        Stats           *bool
        PublicIP        net.IP
+       Progress        bool
        tagflag.StartPos
        Torrent []string `arity:"+" help:"torrent file path or magnet uri"`
 }{
        UploadRate:   -1,
        DownloadRate: -1,
+       Progress:     true,
 }
 
 func stdoutAndStderrAreSameFile() bool {
@@ -207,7 +209,9 @@ func main() {
        if stdoutAndStderrAreSameFile() {
                log.SetOutput(progress.Bypass())
        }
-       progress.Start()
+       if flags.Progress {
+               progress.Start()
+       }
        addTorrents(client)
        if client.WaitAll() {
                log.Print("downloaded ALL the torrents")