diff --git a/Library/Homebrew/cli/args.rb b/Library/Homebrew/cli/args.rb index 522b2e550c..2a7b81517e 100644 --- a/Library/Homebrew/cli/args.rb +++ b/Library/Homebrew/cli/args.rb @@ -28,14 +28,6 @@ module Homebrew .map(&method(:to_cli_option)) .select { |arg| arg.start_with?("-") } end - - def flags_only - to_h.keys - .map(&:to_s) - .reject { |name| %w[argv remaining].include?(name) } - .map(&method(:to_cli_option)) - .select { |arg| arg.start_with?("--") } - end end end end diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 3a3e78e3c4..7ebd0b477e 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -162,7 +162,7 @@ module Homebrew tab = Tab.for_keg(keg) end - build_options = BuildOptions.new(Options.create(Homebrew.args.flags_only), f.options) + build_options = BuildOptions.new(Options.create(ARGV.flags_only), f.options) options = build_options.used_options options |= f.build.used_options options &= f.options diff --git a/Library/Homebrew/reinstall.rb b/Library/Homebrew/reinstall.rb index 067d8b38e8..51862302a1 100644 --- a/Library/Homebrew/reinstall.rb +++ b/Library/Homebrew/reinstall.rb @@ -16,7 +16,7 @@ module Homebrew backup keg end - build_options = BuildOptions.new(Options.create(Homebrew.args.flags_only), f.options) + build_options = BuildOptions.new(Options.create(ARGV.flags_only), f.options) options = build_options.used_options options |= f.build.used_options options &= f.options diff --git a/Library/Homebrew/test/cli/parser_spec.rb b/Library/Homebrew/test/cli/parser_spec.rb index 9e27eca43e..4fd34553bb 100644 --- a/Library/Homebrew/test/cli/parser_spec.rb +++ b/Library/Homebrew/test/cli/parser_spec.rb @@ -225,10 +225,5 @@ describe Homebrew::CLI::Parser do parser.parse(["--foo", "-vds", "a", "b", "cdefg"]) expect(Homebrew.args.options_only).to eq %w[--foo -v -d -s] end - - it "#flags_only" do - parser.parse(["--foo", "-vds", "a", "b", "cdefg"]) - expect(Homebrew.args.flags_only).to eq %w[--foo] - end end end