Merge branch 'master' into crawshaw

This commit is contained in:
Matt Joiner 2022-03-09 20:58:06 +11:00
commit a3073edb43
No known key found for this signature in database
GPG Key ID: 6B990B8185E7F782
2 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package bencode
import (
"errors"
"fmt"
)
type Bytes []byte
@ -23,3 +24,7 @@ func (me Bytes) MarshalBencode() ([]byte, error) {
}
return me, nil
}
func (me Bytes) GoString() string {
return fmt.Sprintf("bencode.Bytes(%q)", []byte(me))
}

View File

@ -20,6 +20,7 @@ type pprintMetainfoFlags struct {
func metainfoCmd(ctx args.SubCmdCtx) (err error) {
var metainfoPath string
var mi *metainfo.MetaInfo
// TODO: Treat no subcommand as a failure.
return ctx.NewParser().AddParams(
args.Pos("torrent file", &metainfoPath, args.AfterParse(func() (err error) {
mi, err = metainfo.LoadFromFile(metainfoPath)