-
Notifications
You must be signed in to change notification settings - Fork 113
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
Machine friendly output #297
Comments
Do you have particular commands that need machine readable output? There are couple of services that already integrated Tart as is since the outputs are already pretty simple. For example, |
+1 This commit c9caeab#diff-6279a63c53e5ce2ed8800fb80676147b5c5976824b5bc982640295a32eb3a683R51 broke our (GitLab) parsing of A JSON output format would really help here. |
Sorry to hear that @josephburnett! It seems overtime there was a need for JSON output only for It seems this issue can be addressed by a |
@fkorotkov is that in an upcoming release? |
No big deal. If tart was written in golang I would send you a pull request instead of an issue ;) A more standard way to implement |
@tomjn @josephburnett with a single value it can even be pretty printed for human eyes. 🤔 |
@fkorotkov ok but if it is implemented, the entire response should be a single JSON response for example this: [
{ ... },
{ ... }
] Not this: { ... }
{ ... } Doing that immediately eliminates CLI commands such as Ideally, Tart internally would return data that can then be printed either as JSON or XML or human readable text, rather than printing it directly as it figures it out.
This also makes unit tests possible |
I'd also suggest an |
In the light of the upcoming `1.0.0` release and stabilizing of the API, let's introduce some breaking changes for the good. Removed all the `--cpu`, `--memory`, `--disk` and `--display` flags and replaced with a single `--json` flag for machine-readable output. Added `--json` option to the `list` command to output a single JSON list. Notably removed `--quite` flag since it seemed unnecessary. Fixes #297
Tarts CLI commands output human friendly text, but for automation and integrations it's better to print in a machine readable format such as JSON or XML.
To this end the addition of a general
--json
parameter for all CLI commands would be a great helpThe text was updated successfully, but these errors were encountered: