diff options
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/build.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/software_spec.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_ARGV.rb | 5 |
4 files changed, 11 insertions, 2 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index c7211f032..90f2fc199 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -186,7 +186,7 @@ begin trap("INT", old_trap) formula = ARGV.formulae.first - options = Options.create(ARGV.options_only) + options = Options.create(ARGV.flags_only) build = Build.new(formula, options) build.install rescue Exception => e diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 1bb0b9701..dd695e4cb 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -7,6 +7,10 @@ module HomebrewArgvExtension select { |arg| arg.start_with?("-") } end + def flags_only + select { |arg| arg.start_with?("--") } + end + def formulae require "formula" @formulae ||= downcased_unique_named.map { |name| Formulary.factory(name, spec) } diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index bce6c7d84..3dbcc0cc5 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -36,7 +36,7 @@ class SoftwareSpec @bottle_specification = BottleSpecification.new @patches = [] @options = Options.new - @build = BuildOptions.new(Options.create(ARGV.options_only), options) + @build = BuildOptions.new(Options.create(ARGV.flags_only), options) @compiler_failures = [] end diff --git a/Library/Homebrew/test/test_ARGV.rb b/Library/Homebrew/test/test_ARGV.rb index 7403acf7c..fe50621cd 100644 --- a/Library/Homebrew/test/test_ARGV.rb +++ b/Library/Homebrew/test/test_ARGV.rb @@ -30,6 +30,11 @@ class ArgvExtensionTests < Homebrew::TestCase assert_equal %w[--foo -vds], @argv.options_only end + def test_flags_only + @argv << "--foo" << "-vds" << "a" << "b" << "cdefg" + assert_equal %w[--foo], @argv.flags_only + end + def test_empty_argv assert_empty @argv.named assert_empty @argv.kegs |
