From: Matt Joiner Date: Mon, 18 Apr 2016 11:30:28 +0000 (+1000) Subject: cmd/torrent: Forget trying to expose the entire Client config struct to the command... X-Git-Tag: v1.0.0~776 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=2dcbe3130423cc287f23af4e378503cdf21cd7d2;p=btrtrc.git cmd/torrent: Forget trying to expose the entire Client config struct to the command-line --- diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index df67d162..e102cf83 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -109,16 +109,17 @@ func addTorrents(client *torrent.Client) { } var opts struct { - torrent.Config `name:"Client"` - Mmap bool `help:"memory-map torrent data"` - TestPeer []*net.TCPAddr `short:"p" help:"addresses of some starting peers"` - Torrent []string `type:"pos" arity:"+" help:"torrent file path or magnet uri"` + 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"` + tagflag.StartPos + Torrent []string `type:"pos" arity:"+" help:"torrent file path or magnet uri"` } func main() { log.SetFlags(log.LstdFlags | log.Lshortfile) - tagflag.Parse(&opts, tagflag.SkipBadTypes()) - clientConfig := opts.Config + tagflag.Parse(&opts) + var clientConfig torrent.Config if opts.Mmap { clientConfig.DefaultStorage = storage.NewMMap("") }