Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "argv: move flags_only to cli/args" #6450

Merged
merged 1 commit into from Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions Library/Homebrew/cli/args.rb
Expand Up @@ -28,14 +28,6 @@ def options_only
.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
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/upgrade.rb
Expand Up @@ -162,7 +162,7 @@ def upgrade_formula(f)
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
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/reinstall.rb
Expand Up @@ -16,7 +16,7 @@ def reinstall_formula(f, build_from_source: false)
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
Expand Down
5 changes: 0 additions & 5 deletions Library/Homebrew/test/cli/parser_spec.rb
Expand Up @@ -225,10 +225,5 @@
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