Revert "Deprecate global Homebrew.args."

This commit is contained in:
Mike McQuaid 2020-08-06 11:09:20 +01:00 committed by GitHub
parent c761c04e26
commit fab1009c00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 51 deletions

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "compat/dependencies_helpers"
require "compat/cli/parser"
require "compat/extend/nil"
require "compat/extend/string"
require "compat/formula"

View File

@ -1,32 +0,0 @@
# frozen_string_literal: true
module Homebrew
module CLI
class Parser
module Compat
module DeprecatedArgs
def respond_to_missing?(*)
super
end
def method_missing(method, *)
if ![:debug?, :quiet?, :verbose?].include?(method) && !@printed_args_warning
odeprecated "Homebrew.args", "`args = <command>_args.parse` and pass `args` along the call chain"
@printed_args_warning = true
end
super
end
end
def parse(*)
args = super
Homebrew.args = args.dup.extend(DeprecatedArgs)
args
end
end
prepend Compat
end
end
end

View File

@ -1,17 +0,0 @@
# frozen_string_literal: true
require "cli/args"
module DependenciesHelpers
module Compat
def argv_includes_ignores(argv = nil)
unless @printed_includes_ignores_warning
odeprecated "Homebrew.argv_includes_ignores", "Homebrew.args_includes_ignores"
@printed_includes_ignores_warning = true
end
args_includes_ignores(argv ? Homebrew::CLI::Args.new : Homebrew.args)
end
end
prepend Compat
end