2
0
mirror of synced 2025-02-23 14:18:13 +00:00

cmd/torrent: Add -addr flag back in

This commit is contained in:
Matt Joiner 2016-04-19 17:20:14 +10:00
parent eac0d6f8da
commit 2db45b1198

View File

@ -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 {