CLI suggestion, multiple output formats

One thing I’ve noticed with decent CLI’s is that good ones are NOT married to one specific output format. Good ones are flexible/modular in nature and offer things like json, yaml, xml , csv/text output as options.

i…e a hammer (a tool to interact with foreman/katello) offers:
–output ADAPTER Set output format
Possible value(s): ‘base’, ‘table’, ‘silent’, ‘csv’, ‘yaml’, ‘json’
and using one versus another can be quite helpful in certain contexts, (human vs automation)

Something to consider…

1 Like

Since @billwear has drawn me into a feedback mode, this post has got me thinking. In short, YES! For another example OpenStack CLI offers -f (value,table,shell…) and --column to just select the column(s) I want.

Skipping a bit of jq use on chucking together a simple MAAS script would be most welcome.

I would add a big caveat however: Don’t add too much complexity when pipes and filters can achieve the job, because jq is perfectly useable. Although MAAS is already a bit of a black box, thankfully it is largely a combination of standard components (database, PXE, DNS, DHCP…) which can each be interrogated in a general way for troubleshooting, help and documentation. I wouldn’t like to think my feedback helped lead MAAS off this path.

1 Like

@dandruczyk, acknowledging that i’ve seen this; thanks for submitting.

@gregoryo2017, piling on certainly can’t hurt this feature’s chances! :slight_smile: thanks for your input!