Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
Added CLI
--format
flag that allows consistent experience across all CLI commands to render different output.table
is default. As is currently used in most command as immediate output.json
is another option. Also deprecating--pjson
flag used in couple of places (still works though).Why?
This continues work towards presentation layer in CLI.
It adds a consistent way to render output in different format. Template mode is useful if command output for some specific purpose, scripting or piping output to other commands.
While it was already possible to output result as json and then use additional utilities such as
sed
orjq
for formatting, it will much easier now.It will also be more consistent. Planning to add this to all commands producing some output.
Finally, the same templating system can be used to render standard output of commands. For example, with this change I included describe domain output rendered as a default template (if none other is provided by user).
How did you test it?
Tested locally.
Potential risks
Release notes
Documentation Changes