I like to generate man pages using '--help' output via help2man and txt2man. Ruby's RDoc system is very convenient, but I can't seem to configure RDoc::usage in exactly the way that I want. Here's a sample script:
#!/usr/bin/env ruby
#
# === Name
#
# foobar - Example command for StackOverflow question
#
# === Synopsis
#
# Usage: foobar [--help]
#
# === Options
#
# --help This help message
require 'rdoc/usage'
RDoc::usage('name', 'synopsis', 'options')
The output of the script looks like this:
Name
foobar - Example command for StackOverflow question
Synopsis
Usage: foobar [--help]
Options
--help This help message
But I would really like to suppress the "Name" and "Synopsis" headers for my usage output, but still mark them as sections for output to a man page.
Using the ':section:' markup works for RDoc::Rdoc, but not RDoc::usage. Is there an obvious way to mark sections for usage.rb without printing headers?