cmd/torrent: Add flag for progress bar
This commit is contained in:
parent
93d34dd122
commit
fb7293a94f
|
@ -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())
|
||||
}
|
||||
if flags.Progress {
|
||||
progress.Start()
|
||||
}
|
||||
addTorrents(client)
|
||||
if client.WaitAll() {
|
||||
log.Print("downloaded ALL the torrents")
|
||||
|
|
Loading…
Reference in New Issue