cmd/torrent/main.go | 8 +++++++- diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index bf21b22b5110c328bdec31cd0d88f5276133abb1..bb614264a0bd26986e123079d55bbaee075da61a 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -2,6 +2,7 @@ // Downloads torrents from the command-line. package main import ( + "expvar" "fmt" "log" "net" @@ -11,7 +12,7 @@ "strings" "time" "github.com/anacrolix/dht" - _ "github.com/anacrolix/envpprof" + "github.com/anacrolix/envpprof" "github.com/anacrolix/tagflag" "github.com/dustin/go-humanize" "github.com/gosuri/uiprogress" @@ -139,6 +140,7 @@ Seed bool `help:"seed after download is complete"` Addr *net.TCPAddr `help:"network listen addr"` UploadRate tagflag.Bytes `help:"max piece bytes to send per second"` DownloadRate tagflag.Bytes `help:"max bytes per second down from peers"` + Debug bool tagflag.StartPos Torrent []string `arity:"+" help:"torrent file path or magnet uri"` }{ @@ -191,4 +193,8 @@ } if flags.Seed { select {} } + expvar.Do(func(kv expvar.KeyValue) { + fmt.Printf("%s: %s\n", kv.Key, kv.Value) + }) + envpprof.Stop() }