Merge branch 'master' into crawshaw
This commit is contained in:
commit
a3073edb43
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue