From: Matt Joiner Date: Tue, 19 Apr 2016 07:20:14 +0000 (+1000) Subject: cmd/torrent: Add -addr flag back in X-Git-Tag: v1.0.0~773 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=2db45b119894c03a77d967e7d9bcbb32bdc29040;p=btrtrc.git cmd/torrent: Add -addr flag back in --- diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index e102cf83..55c68c9f 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -112,6 +112,7 @@ var opts struct { Mmap bool `help:"memory-map torrent data"` TestPeer []*net.TCPAddr `short:"p" help:"addresses of some starting peers"` Seed bool `help:"seed after download is complete"` + Addr *net.TCPAddr `help:"network listen addr"` tagflag.StartPos Torrent []string `type:"pos" arity:"+" help:"torrent file path or magnet uri"` } @@ -123,6 +124,9 @@ func main() { if opts.Mmap { clientConfig.DefaultStorage = storage.NewMMap("") } + if opts.Addr != nil { + clientConfig.ListenAddr = opts.Addr.String() + } client, err := torrent.NewClient(&clientConfig) if err != nil {