parent
b84298351a
commit
ad5d5bc350
|
@ -20,13 +20,17 @@ var (
|
|||
func main() {
|
||||
log.SetFlags(log.Flags() | log.Lshortfile)
|
||||
var args struct {
|
||||
AnnonceList []string `name:"a" help:"add annonce server"`
|
||||
tagflag.StartPos
|
||||
Root string
|
||||
Root string `help:"Creates a torrent metainfo for the file system rooted at ROOT, and outputs it to stdout."`
|
||||
}
|
||||
tagflag.Parse(&args, tagflag.Description("Creates a torrent metainfo for the file system rooted at ROOT, and outputs it to stdout."))
|
||||
tagflag.Parse(&args)
|
||||
mi := metainfo.MetaInfo{
|
||||
AnnounceList: builtinAnnounceList,
|
||||
}
|
||||
for _, a := range args.AnnonceList {
|
||||
mi.AnnounceList = append(mi.AnnounceList, []string{a})
|
||||
}
|
||||
mi.SetDefaults()
|
||||
err := mi.Info.BuildFromFilePath(args.Root)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue