Commandable is a simple yet powerful way to add command line control your Ruby application.
With a single line of code you can turn any existing method into a command line option. You can also optionally specify:
- Required commands
- Default commands (no need to type in the method name on the command line)
- The order in which commands should run irrespective of how the user enters them
- You can even specify mutually exclusive commands
Best of all the help/usage instructions are automatically generated using the methods definitions themselves. When you change your methods the help instructions change automatically; there's no extra effort required on your part.
Keep your CLI DRY, give Commadable a try.
$ gem install commandable
by Mike Bethany
January 25, 2012