From 96e1d7e1b2279cea8e6b39a760b9df5192c331f0 Mon Sep 17 00:00:00 2001 From: Gautham G Date: Sun, 5 Apr 2020 19:14:38 +0530 Subject: [PATCH] Initialize Homebrew.args with CLI::Args instance If we initialize it with OpenStruct, then methods defined in CLI::Args cannot be called and they would always return nil leading to bugs --- Library/Homebrew/global.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index f865d01ca8..97eeba275b 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -28,6 +28,7 @@ end require "config" require "os" require "extend/ARGV" +require "cli/args" require "messages" require "system_command" @@ -83,7 +84,7 @@ module Homebrew end def args - @args ||= OpenStruct.new + @args ||= CLI::Args.new(argv: ARGV) end def messages