From fb7293a94fb093d8e9f7c63d1aaa8d2dff733793 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 19 Jul 2019 13:01:36 +1000 Subject: [PATCH] cmd/torrent: Add flag for progress bar --- cmd/torrent/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index 570f8bfa..67b5122b 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -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") -- 2.48.1