1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-25 23:21:54 +08:00

commands: Refactored Command#Run function signature to (req Request, res Response)

This commit is contained in:
Matt Bell
2015-01-20 17:58:50 -08:00
parent 856d2896a7
commit 7b4de230eb
27 changed files with 426 additions and 236 deletions

View File

@ -22,10 +22,10 @@ var VersionCmd = &cmds.Command{
Options: []cmds.Option{
cmds.BoolOption("number", "n", "Only show the version number"),
},
Run: func(req cmds.Request) (interface{}, error) {
return &VersionOutput{
Run: func(req cmds.Request, res cmds.Response) {
res.SetOutput(&VersionOutput{
Version: config.CurrentVersionNumber,
}, nil
})
},
Marshalers: cmds.MarshalerMap{
cmds.Text: func(res cmds.Response) (io.Reader, error) {