From: Robert Klemme Date: 2010-06-11T15:25:06+09:00 Subject: Re: Option parsers that support single-dash words? On 11.06.2010 07:40, Jos Backus wrote: > In order to convert some legacy Perl code that uses Getopt::Long, I'm looking > for an option parser that supports `-help' in addition to `--help'. All the > option parser libraries I have looked at only support the latter, and always > do bundling, turning `-help' into `-h -e -l -p' which is not what I want. > > Any suggestions, please? Drop your requirement. Think about it: what you require is extremely hard to do. How do you expect the option parsing to work reliably in light of ambiguity? If for example -e is also a valid option then what do you make of this? Since you likely also want to recognize -h you have the ambiguity built in right from the start. Alternatively, you could preprocess the arguments and look for "-help" yourself e.g. ARGV.map! {|arg| '-help' == arg ? '--help' : arg} Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/