aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2012-08-25 11:24:13 -0700
committerMike McQuaid2012-08-25 11:52:37 -0700
commitebbc3438a1e6f9014d049c98c54182a31212b1d8 (patch)
tree5b87b2372d379c1796b2ca94bf6739d0ceb84a26 /Library
parent90010f46021c34024dd22a0f61790bb57cb4b5ea (diff)
downloadbrew-ebbc3438a1e6f9014d049c98c54182a31212b1d8.tar.bz2
Move used_options and unused_options to ARGV.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ARGV.rb8
-rw-r--r--Library/Homebrew/tab.rb10
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