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

cmd/ipfs2: Added comment to explain default encoding logic

parent aea2fce9
......@@ -132,6 +132,8 @@ func createRequest(args []string) (cmds.Request, *cmds.Command, error) {
ctx.ConfigRoot = configPath
ctx.Config = conf
// if no encoding was specified by user, default to plaintext encoding
// (if command doesn't support plaintext, use JSON instead)
if !req.Option("encoding").Found() {
if req.Command().Marshallers != nil && req.Command().Marshallers[cmds.Text] != nil {
req.SetOption("encoding", cmds.Text)
......
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