Matt Brictson had the same complaints I did about Thor. Well, he went and fixed them all, I put them into a gem and now use it in many of my Thor CLIs.
https://github.com/mattbrictson/gem/blob/main/lib/example/thor_ext.rb
Overwrites a few Thor methods so that it behaves more like a typical CLI:
- Accepts
-hor--helpto show help - Treats unrecognized options as errors instead of ignoring them
- Prints error to
stderrin red with no stacktrace - Prints full stacktrace when setting
VERBOSEenvironment variable - Exists with a non-zero status on error
gem i thor-extgem 'thor-ext'In your Thor CLI:
class SuperAwesomeCli < Thor
extend ThorExt::Start
end