Thanks for the answers. I decided to take an approach similar to
building my own parser, but keeping my two steps approach:
- first:
ARGV.each_with_index do |s, i|
plugin=args[i+1] if s=='-p' or s=='--plugin' or s=~/-\w*p/
end
(this should take care of the three possible formats: short option, long
option and several short options together, such as -abp plugin
- load the plugin
- use OptionParser to rescan the options
I'm still working on how to communicate the options recognized by the
plugin to the main program.
Stefano
--
Posted via http://www.ruby-forum.com/.