parent
b84298351a
commit
ad5d5bc350
|
@ -20,13 +20,17 @@ var (
|
||||||
func main() {
|
func main() {
|
||||||
log.SetFlags(log.Flags() | log.Lshortfile)
|
log.SetFlags(log.Flags() | log.Lshortfile)
|
||||||
var args struct {
|
var args struct {
|
||||||
|
AnnonceList []string `name:"a" help:"add annonce server"`
|
||||||
tagflag.StartPos
|
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{
|
mi := metainfo.MetaInfo{
|
||||||
AnnounceList: builtinAnnounceList,
|
AnnounceList: builtinAnnounceList,
|
||||||
}
|
}
|
||||||
|
for _, a := range args.AnnonceList {
|
||||||
|
mi.AnnounceList = append(mi.AnnounceList, []string{a})
|
||||||
|
}
|
||||||
mi.SetDefaults()
|
mi.SetDefaults()
|
||||||
err := mi.Info.BuildFromFilePath(args.Root)
|
err := mi.Info.BuildFromFilePath(args.Root)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue