Skip to content
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

Option to display results as ASCII text #8

Merged

Conversation

itowlson
Copy link
Contributor

@itowlson itowlson commented Mar 1, 2019

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.

Copy link
Owner

@corneliusweig corneliusweig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! One iteration and that should be it.

Also formatting is perfect. I usually use goimports instead of go fmt.

I do like your idea of a more generic CLI option. Initially I was also thinking in the direction of --display-mode, but as you said: it will be much more in-line with other k8s tools, if we use a -o option. That will leave the door open for json/yaml output in the future. Do you think -output icons and -output ascii is descriptive enough?

@corneliusweig
Copy link
Owner

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

@itowlson
Copy link
Contributor Author

itowlson commented Mar 3, 2019

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

@corneliusweig
Copy link
Owner

Thanks for your contribution! LGTM

@corneliusweig corneliusweig merged commit 0d17fc1 into corneliusweig:master Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants