@cryptotaxi247 / kubo / commits / b358bb3ff

cmd/ipfs2: Added comment to explain default encoding logic

Matt Bell committed Nov 11, 2014 at 16:32 UTC b358bb3ffd17fcb72ea654ce499abb8ebf2719ba
1 file changed +2
cmd/ipfs2/main.go
+2
@@ -132,6 +132,8 @@ func createRequest(args []string) (cmds.Request, *cmds.Command, error) {
132 ctx.ConfigRoot = configPath
133 ctx.Config = conf
134
135 + // if no encoding was specified by user, default to plaintext encoding
136 + // (if command doesn't support plaintext, use JSON instead)
137 if !req.Option("encoding").Found() {
138 if req.Command().Marshallers != nil && req.Command().Marshallers[cmds.Text] != nil {
139 req.SetOption("encoding", cmds.Text)