From b358bb3ffd17fcb72ea654ce499abb8ebf2719ba Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Tue, 11 Nov 2014 16:32:18 -0800 Subject: [PATCH] cmd/ipfs2: Added comment to explain default encoding logic --- cmd/ipfs2/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/ipfs2/main.go b/cmd/ipfs2/main.go index 83722bbf3..b6a15be3b 100644 --- a/cmd/ipfs2/main.go +++ b/cmd/ipfs2/main.go @@ -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)