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
Init command JSON output #3132
Init command JSON output #3132
Conversation
ffe5ed8
to
53f94b1
Compare
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've added a few minor comments to the PR. However, there's one point which requires discussion: All other places in restic just return the standard error message when an error happens and don't encode those as JSON. It might for now be better to stay consistent with the other commands.
So my rationale here is that it would benefit us to output errors as a JSON object because if a wrapper script is expecting JSON output, the script will not be able to easily handle non-JSON output errors. Of course, it could just panic and alert the user, but in some cases, issues that cause failure could be automatically solved by a wrapper script. I'm okay with staying consistent with other commands for now. Maybe roll those error handling changes into another PR if we decide we want that, down the line. |
ce70a54
to
5ecddd1
Compare
I'm ready to merge this. Can I get another review on this? |
5ecddd1
to
1ca2cf4
Compare
I totally forgot about this PR. It's now rebased and slightly cleaned up. The The remaining part is to decide on a |
1ca2cf4
to
eb308d5
Compare
eb308d5
to
364a396
Compare
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.
LGTM.
What does this PR change? What problem does it solve?
Enablement of JSON output on the init command.
Was the change discussed in an issue or in the forum before?
Fixes #3124
Checklist
changelog/unreleased/
that describes the changes for our users (template here)gofmt
on the code in all commits