-
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
JSON output for get and list commands #394
Conversation
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
In the light of cirruslabs/tart#394
|
Without Use of JSON can also be an indicator that the intended recipient is inhuman
This sounds like a great excuse for a flag/parameter and a new issue+PR
Lets not forget YAML or real ASCII tables ( not pretend TSV's ), why not a WP CLI uses an optional wp post list # the default, same as table
wp post list --format=table
wp post list --format=json
wp post list --format=yaml It also allows for This is possible because there's a separation between doing things and generating output, with dedicated utilities just for formatting raw data into presentable text https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-format-items/ |
Docker for instance provides pretty-printed JSON when using |
178e139
to
f1dbe3e
Compare
Thank you all for the feedback. I've addressed all of it except human readable disk size for the @edigaryev I've also reverted |
Co-authored-by: Nikolay Edigaryev <[email protected]>
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 thelist
command to output a single JSON list. Notably removed--quite
flag since it seemed unnecessary.Fixes #297