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

Closed
opened 2018-09-19 18:52:31 +00:00 by floli · 12 comments
Collaborator

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.
Author
Collaborator

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.
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?
Author
Collaborator

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
Owner

Makes sense.

Makes sense.
Owner

Released with borgmatic 1.2.3!

Released with borgmatic 1.2.3!
Author
Collaborator

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?
floli reopened this issue 2018-09-28 07:03:45 +00:00
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.
Author
Collaborator

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.
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/).
Author
Collaborator

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 2018-10-05 05:32:08 +00:00
Owner

Tangentially related discussion: #53.

Tangentially related discussion: #53.
Owner

Looks like this got fixed somewhere along the way!

Looks like this got fixed somewhere along the way!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#94
No description provided.