Including a Man Page

As we’ve seen, it’s easy to document the options, arguments, and commands of a command-line app. This information, and the ability to access it from the app itself, is invaluable to repeat users of your app; they can quickly find out how to use your app the way they need to get their work done. What if we need more? Perhaps we’d like some longer examples for new users, or perhaps our app is sufficiently complex that we need more space to explain things.

Even a straightforward app like db_backup.rb can benefit from a few examples and some detailed documentation (such as an explanation of the “iteration backup” concept or why the username must be in ​first.last​ format). There isn’t enough space in the built-in help provided ...

Get Build Awesome Command-Line Applications in Ruby 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.