lib/methadone/main.rb in methadone-0.3.2 vs lib/methadone/main.rb in methadone-0.3.3

- old
+ new

@@ -247,11 +247,14 @@ if block @option_parser.on(*args,&block) else opt_names = option_names(*args) @option_parser.on(*args) do |value| - opt_names.each { |name| @options[name] = value } + opt_names.each do |name| + @options[name] = value + @options[name.to_s] = value + end end end set_banner end @@ -314,14 +317,14 @@ end end def option_names(*opts_on_args,&block) opts_on_args.map { |arg| - if arg =~ /^--\[no-\]([^-\s]*)/ + if arg =~ /^--\[no-\]([^-\s][^\s]*)/ $1.to_sym - elsif arg =~ /^--([^-\s]*)/ + elsif arg =~ /^--([^-\s][^\s]*)/ $1.to_sym - elsif arg =~ /^-([^-\s]*)/ + elsif arg =~ /^-([^-\s][^\s]*)/ $1.to_sym else nil end }.reject(&:nil?)