#94 Allow --json option for every command where borg accepts it

Open
opened 7 months ago by floli · 11 comments
floli commented 7 months ago

Currently, borgmatic accepts --json only for list and info. Is there any reason it is not implemented for create (borg create --json exists)?

borg prune and check do not seem to accept --json. So there is only create left.

Currently, borgmatic accepts `--json` only for `list` and `info`. Is there any reason it is not implemented for create (`borg create --json` exists)? borg `prune` and `check` do not seem to accept `--json`. So there is only create left.
floli commented 7 months ago
Poster

Maybe this would also make a less intrusive implementation of https://github.com/witten/borgmatic/pull/26 possible.

Maybe this would also make a less intrusive implementation of https://github.com/witten/borgmatic/pull/26 possible.
witten commented 7 months ago
Owner

Yup, such a feature makes sense to me. I started out with --json only for list and info because that’s where the initial need was. Do you have any initial use cases for --json on create other than the Prometheus module?

Yup, such a feature makes sense to me. I started out with `--json` only for `list` and `info` because that's where the initial need was. Do you have any initial use cases for `--json` on `create` other than the Prometheus module?
floli commented 7 months ago
Poster

Not really a concrete use case, but I think the consistency and ease of the change alone warrants it.

PR #96

Not really a concrete use case, but I think the consistency and ease of the change alone warrants it. PR #96
witten commented 7 months ago
Owner

Makes sense.

Makes sense.
witten commented 7 months ago
Owner

Released with borgmatic 1.2.3!

Released with borgmatic 1.2.3!
floli commented 6 months ago
Poster

I’m not really sure, if I got the commit traffic right…

Seems in my original commit 9aaf78b9dd I added the json=args.json parameter at the check, instead of create call. 98cb2644db fixed that by removing it. But the create command call in borgmatic.py still lacks the json parameter. Right?

I'm not really sure, if I got the commit traffic right... Seems in my original commit 9aaf78b9dd I added the `json=args.json` parameter at the check, instead of create call. 98cb2644db fixed that by removing it. But the create command call in `borgmatic.py` still lacks the json parameter. Right?
witten commented 6 months ago
Owner

Yup, your assessment appears to be correct! Let me know if you’d like to fix it or if you’d like me to.

Yup, your assessment appears to be correct! Let me know if you'd like to fix it or if you'd like me to.
floli commented 6 months ago
Poster

I will take care of it, I also screwed up the previous attempt, so give me change to screw that up, too. ;-)

Idea: Should we add an ident=2 parameter to json.dumps? Will make it look much nicer if a human happens to read the json output.

I will take care of it, I also screwed up the previous attempt, so give me change to screw that up, too. ;-) Idea: Should we add an `ident=2` parameter to `json.dumps`? Will make it look much nicer if a human happens to read the json output.
witten commented 6 months ago
Owner

That sounds fine to me. Or you could just pipe the result to something like jq.

That sounds fine to me. Or you could just pipe the result to something like [`jq`](https://stedolan.github.io/jq/).
floli commented 6 months ago
Poster

Ok, see #97. Please have a look, to make sure I didn’t screw up again.

Ok, see #97. Please have a look, to make sure I didn't screw up again.
witten added the
design finalized
label 6 months ago
witten commented 5 months ago
Owner

Tangentially related discussion: #53.

Tangentially related discussion: #53.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.