Commit edb632a6 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

core/commands: Added a Format function for the 'beep' command

parent b3ff407d
......@@ -48,6 +48,12 @@ Use "ipfs help <command>" for more information about a command.
v := TestOutput{"hello, world", 1337}
res.SetValue(v)
},
Format: func(res cmds.Response) (string, error) {
v := res.Value().(TestOutput)
s := fmt.Sprintf("Foo: %s\n", v.Foo)
s += fmt.Sprintf("Bar: %v\n", v.Bar)
return s, nil
},
},
"boop": &cmds.Command{
Run: func(req cmds.Request, res cmds.Response) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment