[ANN] RDocUsage

D

Dave Thomas

Luke Kanies was talking with me about implementing rdoc2man and
rdocusage. I thought RDoc::usage would be a very cool thing to have, so
I stole the idea and implemented it while waiting at the doctors' this
morning.

Basically, if the main program file in your application has an RDoc
comment describing the program, you can use it to generate a usage
message for your users by calling

RDoc::usage( )

If you just want to display the Synopsis section (which in the RDoc
will have a heading "= Synopsis"), you'd instead say

RDoc::usage('synopsis')

To display the author and copyright sections, you'd say

RDoc::usage('author', 'copyright')

It honors the RI environment variable, so it will display using ANSI
escape sequences or backspaces if that's what the end user has asked
for. It'll also generate the usage message in HTML.

There's a page on the wiki describing it:
http://www.rubygarden.org/ruby?RDocUsage

Forgive the slightly ugly HTML example at the end: the wiki seems to be
touching about some HTML tags in its input.


RDoc::usage in the head of 1.9 and 1.8 CVS right now.


Cheers

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,155
Messages
2,570,871
Members
47,401
Latest member
CliffGrime

Latest Threads

Top