-
Notifications
You must be signed in to change notification settings - Fork 61
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
[#417] Make pgagroal-admin provide JSON output #440
Conversation
@T1t4m1un thanks for the contribution, but I don't like the idea of using The aim is not to present output in brackets, it is to allow for automation, hence the output must be as complete as possible. |
OK, I will refactor it~
Could you give me some examples of the format? I don't clearly understand the format you envisioned😶🌫️ |
See https://github.com/agroal/pgagroal/blob/master/doc/CLI.md#json-output-format.
or something simpler, but the above should be for free using the |
@fluca1978 Hey Luca, I think this version is what you want~ However I'm not sure if these json manipulations should be encapsulated into a function, so I completed the functionality first. If you think encapsulation is necessary, please give me some suggestions on the name and where to place it~ I'll add this option into documentation if there's no other problems with this version~ |
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 think it is done, I would only change the assignment of subelements so to get them early in the json
structure, as I commented.
@jesperpedersen PTAL
We don't use cJSON anymore, so this has to be rebased and adapted. I'm closing this request. |
Since the output data is very simple, I directly use printf to output in JSON format in the original function.
I think my implementation is the simplest and most reliable implementation considering the complexity of the data. Of course, if you have a better idea, please tell me.
If there are other use cases that need support, please let me know ~ I will complete the documentation after completing all use cases~