diff options
| author | Mike McQuaid | 2012-08-25 11:24:13 -0700 |
|---|---|---|
| committer | Mike McQuaid | 2012-08-25 11:52:37 -0700 |
| commit | ebbc3438a1e6f9014d049c98c54182a31212b1d8 (patch) | |
| tree | 5b87b2372d379c1796b2ca94bf6739d0ceb84a26 /Library | |
| parent | 90010f46021c34024dd22a0f61790bb57cb4b5ea (diff) | |
| download | brew-ebbc3438a1e6f9014d049c98c54182a31212b1d8.tar.bz2 | |
Move used_options and unused_options to ARGV.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/tab.rb | 10 |
2 files changed, 10 insertions, 8 deletions
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index bdfb8fd52..e8a227258 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -7,6 +7,14 @@ module HomebrewArgvExtension select {|arg| arg[0..0] == '-'} end + def used_options f + f.build.as_flags & options_only + end + + def unused_options f + f.build.as_flags - options_only + end + def formulae require 'formula' @formulae ||= downcased_unique_named.map{ |name| Formula.factory name } diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 32fb5d365..1a334600d 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -9,14 +9,8 @@ require 'vendor/multi_json' # `Tab.for_install`. class Tab < OpenStruct def self.for_install f, args - # Retrieve option flags from command line. - arg_options = args.options_only - # Pick off the option flags from the formula's `options` array by - # discarding the descriptions. - formula_options = f.build.as_flags - - Tab.new :used_options => formula_options & arg_options, - :unused_options => formula_options - arg_options, + Tab.new :used_options => args.used_options(f), + :unused_options => args.unused_options(f), :tabfile => f.prefix + "INSTALL_RECEIPT.json", :built_bottle => !!args.build_bottle?, :tapped_from => f.tap |
