davetron5000 / gli

Make awesome command-line applications the easy way
http://davetron5000.github.io/gli
Apache License 2.0
1.26k stars 102 forks source link

Removing the "error:" prefix in exception handling? #273

Closed Rylon closed 6 years ago

Rylon commented 6 years ago

Hi! I have noticed that even when providing your own custom error classes, the message that gets output to stderr is always prefixed with "error:", as a result of this method:

https://github.com/davetron5000/gli/blob/gli-2/lib/gli/app_support.rb#L284-L288

I'd like more control over the exact error message here, and therefore would like to remove this prefix, would you be open to making that configurable at all please?

Thanks!

davetron5000 commented 6 years ago

Sounds reasonable. If you'd like to look into it, I'll be faster at looking at your PR than I was this issue (sorry for the delay). The code that does it is here: https://github.com/davetron5000/gli/blob/gli-2/lib/gli/app_support.rb#L287 and it should be tested enough to give you a reference on how to make the change.

Rylon commented 6 years ago

Sorry for the delay, I never did get around to looking at this, in the end I just monkey patched that behaviour in my application. I think that will be enough for me right now, so I'm going to go ahead and close this.

Thanks!