Don't warn about unused brew install arguments.
This is a step closer to better argument handling but for now just fixes the issue in #1217 where it starts complaining about options like `--build-from-source` being used.
This commit is contained in:
parent
5294b99d6f
commit
cc3bf7bcb5
@ -103,7 +103,7 @@ class BuildOptions
|
|||||||
|
|
||||||
# @private
|
# @private
|
||||||
def invalid_options
|
def invalid_options
|
||||||
@args - @options
|
@args - @options - BuildOptions.formula_install_options
|
||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
@ -111,6 +111,12 @@ class BuildOptions
|
|||||||
invalid_options.map(&:flag).sort
|
invalid_options.map(&:flag).sort
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.formula_install_options
|
||||||
|
@formula_install_options ||= ARGV.formula_install_option_names.map do |option_name|
|
||||||
|
Option.new option_name[2..-1]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def option_defined?(name)
|
def option_defined?(name)
|
||||||
|
|||||||
@ -1,4 +1,29 @@
|
|||||||
module HomebrewArgvExtension
|
module HomebrewArgvExtension
|
||||||
|
def formula_install_option_names
|
||||||
|
%w[
|
||||||
|
--debug
|
||||||
|
--env=
|
||||||
|
--ignore-dependencies
|
||||||
|
--cc=
|
||||||
|
--build-from-source
|
||||||
|
--devel
|
||||||
|
--HEAD
|
||||||
|
--keep-tmp
|
||||||
|
--interactive
|
||||||
|
--git
|
||||||
|
--sandbox
|
||||||
|
--no-sandbox
|
||||||
|
--build-bottle
|
||||||
|
--force-bottle
|
||||||
|
--verbose
|
||||||
|
-i
|
||||||
|
-v
|
||||||
|
-d
|
||||||
|
-g
|
||||||
|
-s
|
||||||
|
].freeze
|
||||||
|
end
|
||||||
|
|
||||||
def named
|
def named
|
||||||
@named ||= self - options_only
|
@named ||= self - options_only
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user