Revert "Deprecate global Homebrew.args."
This commit is contained in:
parent
c761c04e26
commit
fab1009c00
@ -1,7 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "compat/dependencies_helpers"
|
|
||||||
require "compat/cli/parser"
|
|
||||||
require "compat/extend/nil"
|
require "compat/extend/nil"
|
||||||
require "compat/extend/string"
|
require "compat/extend/string"
|
||||||
require "compat/formula"
|
require "compat/formula"
|
||||||
|
|||||||
@ -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
|
|
||||||
@ -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
|
|
||||||
Loading…
x
Reference in New Issue
Block a user