]> Sergey Matveev's repositories - btrtrc.git/commitdiff
cmd/torrent: Forget trying to expose the entire Client config struct to the command...
authorMatt Joiner <anacrolix@gmail.com>
Mon, 18 Apr 2016 11:30:28 +0000 (21:30 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 18 Apr 2016 11:30:28 +0000 (21:30 +1000)
cmd/torrent/main.go

index df67d16275488d74f442a01f3ede864564bd25be..e102cf83bdc9ca91d87d738c40ebd45dcc121fae 100644 (file)
@@ -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("")
        }