Skip to content

Commit

Permalink
-a option (#86)
Browse files Browse the repository at this point in the history
* add -a option

* name
  • Loading branch information
axet authored and anacrolix committed Jun 15, 2016
1 parent b842983 commit ad5d5bc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/torrent-create/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ad5d5bc

Please sign in to comment.