From: Stephan Wehner Date: 2009-05-25T15:42:04+09:00 Subject: Re: OptionParser: unexpected behaviour with -help Brian Candler wrote: > Look at the source - /usr/lib/ruby/1.8/optparse.rb or somewhere similar > on your system. > > # if no short options match, try completion with long > # options. > sw, = complete(:long, opt) > > So it looks that if you stub out 'complete' you can get the behaviour > you require: that is, I think you want -h to be treated as an error > instead of as a shortcut for --headers, and ditto -e as an error instead > of a shortcut for --ex > > Alternatively, if only '-help' is a problem, you could just handle this > special case: > > ARGV.each { |a| a.replace('--help') if a == '-help' } Well, thanks a lot for that. I feel the guessing game should be avoided -- there's too much potential for confusion. Stephan -- Posted via http://www.ruby-forum.com/.