Skip to content
Snippets Groups Projects
Unverified Commit 4f502daf authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #8234 from Homebrew/revert-8216-deprecate-global-args

Revert "Deprecate global `Homebrew.args`."
parents 8d884e7c fab1009c
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
require "compat/dependencies_helpers"
require "compat/cli/parser"
require "compat/extend/nil"
require "compat/extend/string"
require "compat/formula"
......
# 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
# 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment