Move used_options and unused_options to ARGV.
This commit is contained in:
parent
90010f4602
commit
ebbc3438a1
@ -7,6 +7,14 @@ module HomebrewArgvExtension
|
|||||||
select {|arg| arg[0..0] == '-'}
|
select {|arg| arg[0..0] == '-'}
|
||||||
end
|
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
|
def formulae
|
||||||
require 'formula'
|
require 'formula'
|
||||||
@formulae ||= downcased_unique_named.map{ |name| Formula.factory name }
|
@formulae ||= downcased_unique_named.map{ |name| Formula.factory name }
|
||||||
|
|||||||
@ -9,14 +9,8 @@ require 'vendor/multi_json'
|
|||||||
# `Tab.for_install`.
|
# `Tab.for_install`.
|
||||||
class Tab < OpenStruct
|
class Tab < OpenStruct
|
||||||
def self.for_install f, args
|
def self.for_install f, args
|
||||||
# Retrieve option flags from command line.
|
Tab.new :used_options => args.used_options(f),
|
||||||
arg_options = args.options_only
|
:unused_options => args.unused_options(f),
|
||||||
# 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,
|
|
||||||
:tabfile => f.prefix + "INSTALL_RECEIPT.json",
|
:tabfile => f.prefix + "INSTALL_RECEIPT.json",
|
||||||
:built_bottle => !!args.build_bottle?,
|
:built_bottle => !!args.build_bottle?,
|
||||||
:tapped_from => f.tap
|
:tapped_from => f.tap
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user