-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change ipfs dag get flag name from format to output-codec #8440
Conversation
core/commands/dag/dag.go
Outdated
@@ -109,7 +109,7 @@ format. | |||
cmds.StringArg("ref", true, false, "The object to get").EnableStdin(), | |||
}, | |||
Options: []cmds.Option{ | |||
cmds.StringOption("format", "f", "Format that the object will be serialized as.").WithDefault("dag-json"), | |||
cmds.StringOption("codec", "c", "Format that the object will be encoded as.").WithDefault("dag-json"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"c" is used for the global --config
. We can either not use a shortcut or come up with a different name/leave things as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think short notation adds value here, I'm for just removing it (see #8439 (comment) for rationale)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to remove the shortcut and change to --output-codec
to clarify that the stored data is being transcoded per #8439 (comment).
6a8a51b
to
a18c9b4
Compare
a18c9b4
to
49058c2
Compare
49058c2
to
d576e53
Compare
format, _ := req.Options["format"].(string) | ||
var fCodec mc.Code | ||
if err := fCodec.Set(format); err != nil { | ||
codecStr, _ := req.Options["output-codec"].(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lack of error handling seems wrong, although this pattern is all over the commands lib usage so likely not too big a problem
Change
ipfs dag get --format
toipfs dag get --output-codec
to be closer to #8439.TODO: Merge to master after #8439