corneliusweig / rakkess

Review Access - kubectl plugin to show an access matrix for k8s server resources
Apache License 2.0
1.3k stars 56 forks source link

Option to display results as ASCII text #8

Closed itowlson closed 5 years ago

itowlson commented 5 years ago

This adds a new --display-mode command line argument, with possible values icons (displays the tick and cross icons, coloured if outputting to a terminal) and ascii (displays the words yes and no, never coloured). The ascii mode is intended to be easier to consume programmatically e.g. from scripts.

I'd very much welcome feedback on the whether the CLI option feels right - I wondered whether a -o/--output option might be more aligned with other tools, and would be more reusable if you later wanted to add e.g. JSON? It should be easy for me to change, and better to get it right now than to have to make a breaking change later. Let me know your thoughts!

Finally, I believe this is formatted correctly etc., but I'm still a bit of a Go newbie especially as regards style, so please, be kind to my mistakes!

Fixes #5.

corneliusweig commented 5 years ago

Even if #9 fixes color output on PowerShell, I think a monochrome ASCII mode makes more sense than with colors.

itowlson commented 5 years ago

Thanks for the feedback. I think this covers everything - please take a look.

corneliusweig commented 5 years ago

Thanks for your contribution! LGTM