mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-24 03:47:45 +08:00
cmd/ipfs2: Added comment to explain default encoding logic
This commit is contained in:
parent
aea2fce987
commit
b358bb3ffd
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user