ARGV: Replace options_only and flags_only with Homebrew.args counterparts

This commit is contained in:
Gautham Goli 2019-09-23 12:36:45 +05:30
parent d18b122272
commit 393c8dfbf1
6 changed files with 8 additions and 6 deletions

View File

@ -25,6 +25,7 @@ module Homebrew
raise "`brew cat` doesn't support multiple arguments" if args.remaining.size > 1
cd HOMEBREW_REPOSITORY
safe_system "cat", formulae.first.path, *ARGV.options_only
cat_args = Homebrew.args.options_only - CLI::Parser.global_options.values.map(&:first).flatten
safe_system "cat", formulae.first.path, *cat_args
end
end

View File

@ -70,7 +70,8 @@ module Homebrew
puts Formatter.columns(full_names)
else
ENV["CLICOLOR"] = nil
safe_system "ls", *ARGV.options_only << HOMEBREW_CELLAR
ls_args = Homebrew.args.options_only - CLI::Parser.global_options.values.map(&:first).flatten
safe_system "ls", *ls_args << HOMEBREW_CELLAR
end
elsif args.verbose? || !$stdout.tty?
system_command! "find", args: ARGV.kegs.map(&:to_s) + %w[-not -type d -print], print_stdout: true

View File

@ -57,7 +57,7 @@ module Homebrew
git -C "#{git_cd}" fetch --unshallow
EOS
end
args = ARGV.options_only
args = Homebrew.args.options_only
args += ["--follow", "--", path] unless path.nil?
system "git", "log", *args
end

View File

@ -162,7 +162,7 @@ module Homebrew
tab = Tab.for_keg(keg)
end
build_options = BuildOptions.new(Options.create(ARGV.flags_only), f.options)
build_options = BuildOptions.new(Options.create(Homebrew.args.flags_only), f.options)
options = build_options.used_options
options |= f.build.used_options
options &= f.options

View File

@ -82,7 +82,7 @@ module Homebrew
--
#{HOMEBREW_LIBRARY_PATH}/test.rb
#{f.path}
].concat(ARGV.options_only)
].concat(Homebrew.args.options_only)
if f.head?
args << "--HEAD"

View File

@ -16,7 +16,7 @@ module Homebrew
backup keg
end
build_options = BuildOptions.new(Options.create(ARGV.flags_only), f.options)
build_options = BuildOptions.new(Options.create(Homebrew.args.flags_only), f.options)
options = build_options.used_options
options |= f.build.used_options
options &= f.options