node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.
http://nodegh.io
Other
1.71k stars 217 forks source link

PR List: replace special characters with string which can be parsed #532

Closed ojacques closed 6 years ago

ojacques commented 6 years ago

when issuing gh pr --list, I could not easily parse PR test status because of special characters that were used. I understand this is probably an issue with my terminal. Yet, with this PR, I can programmatically parse the status, looking for OK / NOK strings.

Before: image

With the change: image

It still looks nice thanks to the coloring.

protoEvangelion commented 6 years ago

@ojacques Thanks for opening this PR looking into this now :+1:

zenorocha commented 6 years ago

@protoEvangelion this is a good alternative: https://github.com/sindresorhus/figures

protoEvangelion commented 6 years ago

@zenorocha Thanks for the tip!

@ojacques can you test these unicode alternatives?

checkmark: \u2714 xmark: \u2718

If they work you can add those to this PR and I will merge.

By the way, are you on Windows? If the above doesn't work we can try the figures library :wink:

ojacques commented 6 years ago

@protoEvangelion - I tried with the unicodes you indicated, same result. I can try to add figures as a dependency and see how it goes.

In my opinion, because gh is a command line, using unicodes chars to display info is not ideal. Those can display wrong, and are hard to parse.

protoEvangelion commented 6 years ago

@ojacques Thanks for checking.Please let me know if figures works and I would be happy to merge that :+1:

protoEvangelion commented 6 years ago

@ojacques Any update on this?

ojacques commented 6 years ago

@protoEvangelion - I am not on Windows, yet I had trouble parsing the output. Now, I will close this as I was finally able to parse the unicode output.

Thank you!