-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add option to parse output to json #18
Comments
Also dynamic date values / time values (such as Start = 12:00 AM vs. Start = 22/10/2020) could be addressed, so the input is always in the same format |
The current We're probably talking an overhaul for how all functions return data and how they log helpful messages. |
@Pectojin So you're saying it just outputs what it gets as soon as it gets it? This would make it hard to parse one json obj. Is the conversion of timestamps e.g. if backup was done today it displays 12:00 AM instead of 01/11/2020 done by duplicati-client or duplicate itself? |
A lot of the timestamps are internally converted to the short form. I have an internal parameter to use the precise format instead, but that isn't available to the user. I've gone ahead and added a config option for using precise time.
The relevant changes are here: 5dbd54f I'll update the release when I get a chance one of the coming days. I'm keeping the issue open to track the JSON output enhancement. I'm not entirely sure how to accomplish that, but maybe it'll come to me at some point. |
I added --output=json to commands that writes YAML and now they can write in json. But other commands return only texts as before. |
I've released 0.6.3 with @avmaksimov's changes so now it's possible to get json output on a lot of the commands. https://github.com/Pectojin/duplicati-client/releases/tag/0.6.3_beta Still missing some places, so keeping the issue open as an area for enhancement. |
What do you mean about a lot of commands? Because I added to places where was output to yaml. But many commands have only text output, for example: login. So do you wanna add json or yaml to all commands? And about date-time command I think that easier to convert from another script that add date-time format to this simple, but useful program (I see it as script automatization helper). |
As title says, would make it easier to reuse the result in any script / api.
Thanks for the awesome tool @Pectojin !
The text was updated successfully, but these errors were encountered: