2010/6/20 R.. Kumar <sentinel1879 / gmail.com>:
> R.. Kumar wrote:
>> Robert Klemme wrote:
>>
>>>
>>> I would modify that approach because it has the drawback of wasting CPU
>>> cycles creating all the unnecessary OptionParsers for subcommands that
>>> are not found in ARGV.   ɧ  
>>>
>
> Robert,
> I have updated my gist to make it lazy
>
> http://gist.github.com/446014
>
> However, there is one issue. When typing help on the main program such
> as
>
>  ruby prog help
> ...
>  
>
>    >    >
> I was being shown the subcommands and their descriptions, since I had
> parsed all the optionparsers. Now that I only parse if a particular
> command is called, i cannot get the description of the command. (search
> XXX in source).
>
> Is there any way of doing this ?

Well, either you revert back to creating all sub OptionParsers or you
store the description in some other place.

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/