-
Notifications
You must be signed in to change notification settings - Fork 20
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
Commands should output valid JSON to stdout #11
Comments
nathanagood
added a commit
that referenced
this issue
Feb 20, 2020
* WIP: Adding code to generate new main.tf and use local backend. * WIP: Using local but logging still a mess. * WIP: Adding new TF to use binary instead of go module * WIP: Mostly done, just need automated testing now and some logging tweaks. * WIP: need automated tests; very nearly there now. * WIP: moved tf state file out of .cache * WIP: first unit tests and changed Fatal calls to returning error * Passing unit tests now. * Resolved issue for prompting * Fixed a bad bug that reversed file exist logic. * Fixed logging per PR suggestions and fixed nasty bug withe file exist logic reversed after code change. * WIP: Added config stuct for backend * Added changes per PR review * Resolved merge conflicts * WIP: adding abilily to supply init and apply args via CLI * WIP: put in post deploy hook and unit test to rewrite config file after sucessful completion. * Added test and fixed logic for writing back out DCE file. * WIP: added ability to pass arguments to underlying TF and to persist them in the config file. * Cleaned up unused interface * Removed unused interface * Updated changelog * Fixed order of loading vars per comments. * Added --save-options flag for saving tf options to config file, if specified * Updated save options, regenerated documentation, fixed broken test. * Added better prompter and tests for prompt * Added prompting at earlier point in process and tests to assert. * Fixed typo in prompt * Made note of potential breaking change for STDERR output * Made note of potential breaking change for STDERR output * Cleaned up references to dce.yaml. * Modified code to use STDOUT by default for non-logging output. * Updated CHANGELOG * Fixed annoying typo. * Added conflicted CHANGELOG.md
Resolved in v0.5.0 We do not yet have custom formatters, but all commands should be printing valid JSON to stdout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By default, all CLI commands should output JSON to stdout.
Currently, we have some commands that don't output valid json,
eg:
Other commands print valid JSON, but to stderr, for example,
dce leases list
I would like to see some standardization around CLI output formatting.
Ideally, we'd have support for both JSON (computer-readable) and column/text (human-readable) formats.
Users could configure the output format via a
--output=json
CLI flag, or with aoutput: json
config value in dce.ymlSee how AWS controls CLI output formatting:
https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-output.html
The text was updated successfully, but these errors were encountered: