Remove (now) unused invalid_option_names.
This is handled by `OptionParser` now instead in `cmd/install`.
This commit is contained in:
parent
fd74ce2de6
commit
24eb8e8e54
@ -99,22 +99,6 @@ class BuildOptions
|
|||||||
@options - @args
|
@options - @args
|
||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
|
||||||
def invalid_options
|
|
||||||
@args - @options - BuildOptions.formula_install_options
|
|
||||||
end
|
|
||||||
|
|
||||||
# @private
|
|
||||||
def invalid_option_names
|
|
||||||
invalid_options.map(&:flag).sort
|
|
||||||
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)
|
||||||
|
@ -390,7 +390,6 @@ module Homebrew
|
|||||||
|
|
||||||
fi = FormulaInstaller.new(f)
|
fi = FormulaInstaller.new(f)
|
||||||
fi.options = build_options.used_options
|
fi.options = build_options.used_options
|
||||||
fi.invalid_option_names = build_options.invalid_option_names
|
|
||||||
fi.ignore_deps = args.ignore_dependencies?
|
fi.ignore_deps = args.ignore_dependencies?
|
||||||
fi.only_deps = args.only_dependencies?
|
fi.only_deps = args.only_dependencies?
|
||||||
fi.build_bottle = args.build_bottle?
|
fi.build_bottle = args.build_bottle?
|
||||||
|
@ -33,7 +33,7 @@ class FormulaInstaller
|
|||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :formula
|
attr_reader :formula
|
||||||
attr_accessor :options, :build_bottle, :invalid_option_names
|
attr_accessor :options, :build_bottle
|
||||||
attr_accessor :installed_as_dependency, :installed_on_request, :link_keg
|
attr_accessor :installed_as_dependency, :installed_on_request, :link_keg
|
||||||
mode_attr_accessor :show_summary_heading, :show_header
|
mode_attr_accessor :show_summary_heading, :show_header
|
||||||
mode_attr_accessor :build_from_source, :force_bottle, :include_test
|
mode_attr_accessor :build_from_source, :force_bottle, :include_test
|
||||||
@ -58,7 +58,6 @@ class FormulaInstaller
|
|||||||
@installed_as_dependency = false
|
@installed_as_dependency = false
|
||||||
@installed_on_request = true
|
@installed_on_request = true
|
||||||
@options = Options.new
|
@options = Options.new
|
||||||
@invalid_option_names = []
|
|
||||||
@requirement_messages = []
|
@requirement_messages = []
|
||||||
@poured_bottle = false
|
@poured_bottle = false
|
||||||
@pour_failed = false
|
@pour_failed = false
|
||||||
@ -267,10 +266,6 @@ class FormulaInstaller
|
|||||||
opoo "#{formula.full_name}: #{old_flag} was deprecated; using #{new_flag} instead!"
|
opoo "#{formula.full_name}: #{old_flag} was deprecated; using #{new_flag} instead!"
|
||||||
end
|
end
|
||||||
|
|
||||||
invalid_option_names.each do |option|
|
|
||||||
opoo "#{formula.full_name}: this formula has no #{option} option so it will be ignored!"
|
|
||||||
end
|
|
||||||
|
|
||||||
options = display_options(formula)
|
options = display_options(formula)
|
||||||
if show_header?
|
if show_header?
|
||||||
oh1 "Installing #{Formatter.identifier(formula.full_name)} #{options}".strip
|
oh1 "Installing #{Formatter.identifier(formula.full_name)} #{options}".strip
|
||||||
|
@ -20,7 +20,6 @@ module Homebrew
|
|||||||
|
|
||||||
fi = FormulaInstaller.new(f)
|
fi = FormulaInstaller.new(f)
|
||||||
fi.options = options
|
fi.options = options
|
||||||
fi.invalid_option_names = build_options.invalid_option_names
|
|
||||||
fi.build_bottle = ARGV.build_bottle? || (!f.bottle_defined? && f.build.bottle?)
|
fi.build_bottle = ARGV.build_bottle? || (!f.bottle_defined? && f.build.bottle?)
|
||||||
fi.interactive = ARGV.interactive?
|
fi.interactive = ARGV.interactive?
|
||||||
fi.git = ARGV.git?
|
fi.git = ARGV.git?
|
||||||
|
@ -37,17 +37,4 @@ describe BuildOptions do
|
|||||||
specify "#unused_options" do
|
specify "#unused_options" do
|
||||||
expect(subject.unused_options).to include("--without-baz")
|
expect(subject.unused_options).to include("--without-baz")
|
||||||
end
|
end
|
||||||
|
|
||||||
specify "#invalid_options" do
|
|
||||||
expect(subject.invalid_options).to be_empty
|
|
||||||
expect(bad_build.invalid_options).to include("--without-bas")
|
|
||||||
expect(bad_build.invalid_options).to include("--without-abc")
|
|
||||||
expect(bad_build.invalid_options).not_to include("--with-foo")
|
|
||||||
expect(bad_build.invalid_options).not_to include("--with-baz")
|
|
||||||
end
|
|
||||||
|
|
||||||
specify "#invalid_option_names" do
|
|
||||||
expect(subject.invalid_option_names).to be_empty
|
|
||||||
expect(bad_build.invalid_option_names).to eq(%w[--without-abc --without-bas])
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user