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
This commit is contained in:
Gautham G 2020-04-05 19:14:38 +05:30
parent b9fc765e56
commit 96e1d7e1b2

View File

@ -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