Open tdviet opened 2 years ago
Thanks for splitting the original issue. The formatters as "pluggable" components is a good idea.
Some ideas for the discussion, in case you can take them into consideration:
-f table
-f json -o myfile.json
/fedcloudclient/formatters/
| table
| json
| yaml
| terraform
An idea is: when using -f terraform
the unformatted output is sent to the formatter with name "formatters/terraform" for formatting.
fedcloud client already provides output in different formats: text, JSON, YAML. However, there are requests to provide different output formats, e.g. bash shell, CSV, Terraform. Developing and maintaining all formatters in the main code of fedcloud client is not feasible, therefore, it would be better to make the formatter pluggable.
The design is as follows:
--output-formatter fedcloud.terraform