Ensure that equals options get parsed properly

Options such as --userimg=<path> should be parsed as an option with an
equals in its name ("userimg=") and without the path argument in
Option.name

Closes Homebrew/homebrew#34219.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Elliot Saba 2014-11-15 12:03:27 -08:00 committed by Jack Nagel
parent 824e187803
commit 6a1f829cfa

View File

@ -58,7 +58,7 @@ class Options
include Enumerable include Enumerable
def self.create(array) def self.create(array)
new array.map { |e| Option.new(e[/^--(.+)$/, 1] || e) } new array.map { |e| Option.new(e[/^--([^=]+=?)(.+)?$/, 1] || e) }
end end
def initialize(*args) def initialize(*args)