diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/options.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_options.rb | 6 |
2 files changed, 2 insertions, 8 deletions
diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb index 6978b553b..e43dc3a5a 100644 --- a/Library/Homebrew/options.rb +++ b/Library/Homebrew/options.rb @@ -38,8 +38,6 @@ class Option [name, "-#{name}"] when /^-[a-zA-Z]$/ [name[1..1], name] - when /^--(.+)$/ - [$1, name] else [name, "--#{name}"] end @@ -55,6 +53,8 @@ class Options case e when /^-[^-]+$/ e[1..-1].split(//).each { |o| options << Option.new(o) } + when /^--(.+)$/ + options << Option.new($1) else options << Option.new(e) end diff --git a/Library/Homebrew/test/test_options.rb b/Library/Homebrew/test/test_options.rb index 25049ded5..917ad590c 100644 --- a/Library/Homebrew/test/test_options.rb +++ b/Library/Homebrew/test/test_options.rb @@ -19,12 +19,6 @@ class OptionTests < Homebrew::TestCase refute_eql @option, bar end - def test_strips_leading_dashes - option = Option.new("--foo") - assert_equal "foo", option.name - assert_equal "--foo", option.flag - end - def test_description assert_empty @option.description assert_equal "foo", Option.new("foo", "foo").description |
