How do I add a --version
option to my Ruby Thor command line interface application.
For example I want to be able to run
$ thor_app --version
> thor_app version 1.0.0
This question is related to Run a CLI Thor app without arguments or task name, but specifically to add a --version
option which does not require a task.
Note
This was written following the self-answer format. Addition answers and updates are encouraged
bundler version
too (because why not?) github.com/bundler/bundler/blob/… – Factorize