cmd/torrent: Add -addr flag back in
This commit is contained in:
parent
eac0d6f8da
commit
2db45b1198
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user