From 8ce7a55add831da7788db43f723599da0b102627 Mon Sep 17 00:00:00 2001 From: Gautham G Date: Tue, 11 Feb 2020 23:47:15 +0530 Subject: [PATCH] build.rb: Use CLI::Parser to parse args Fixes #7008 --- Library/Homebrew/build.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 5826a86430..d7e576db89 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -13,6 +13,7 @@ require "extend/ENV" require "debrew" require "fcntl" require "socket" +require "cmd/install" class Build attr_reader :formula, :deps, :reqs @@ -183,13 +184,14 @@ class Build end begin + Homebrew.install_args.parse error_pipe = UNIXSocket.open(ENV["HOMEBREW_ERROR_PIPE"], &:recv_io) error_pipe.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) trap("INT", old_trap) - formula = ARGV.formulae.first - options = Options.create(ARGV.flags_only) + formula = Homebrew.args.formulae.first + options = Options.create(Homebrew.args.flags_only) build = Build.new(formula, options) build.install rescue Exception => e # rubocop:disable Lint/RescueException