<commit_before>require "formula_installer"

module Homebrew
  def reinstall
    ARGV.formulae.each { |f| reinstall_formula(f) }
  end

  def reinstall_formula f
    tab = Tab.for_formula(f)
    options = tab.used_options | f.build.used_options

    notice  = "Reinstalling #{f.name}"
    notice += " with #{options * ", "}" unless options.empty?
    oh1 notice

    if f.opt_prefix.directory?
      keg = Keg.new(f.opt_prefix.resolved_path)
      backup keg
    end
<commit_msg>reinstall: use ARGV.resolved_formulae<commit_after>require "formula_installer"

module Homebrew
  def reinstall
    ARGV.resolved_formulae.each { |f| reinstall_formula(f) }
  end

  def reinstall_formula f
    tab = Tab.for_formula(f)
    options = tab.used_options | f.build.used_options

    notice  = "Reinstalling #{f.name}"
    notice += " with #{options * ", "}" unless options.empty?
    oh1 notice

    if f.opt_prefix.directory?
      keg = Keg.new(f.opt_prefix.resolved_path)
      backup keg
    end

{'fraction_non_alphanumeric': 0.1051567239635996, 'fraction_numerical': 0.0020222446916076846, 'mean_word_length': 3.230769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4870804', 'n_tokens_mistral': 357, 'n_tokens_neox': 339, 'n_words': 72}