diff --git a/Library/Homebrew/cmd/home.rb b/Library/Homebrew/cmd/home.rb index 318c7ffb02197220e30a65af2d2578b7388fafd7..cce7a1439ba93042e322d681ee3f249b1446fcd0 100644 --- a/Library/Homebrew/cmd/home.rb +++ b/Library/Homebrew/cmd/home.rb @@ -25,7 +25,10 @@ module Homebrew end homepages = args.formulae_and_casks.map do |formula_or_cask| - puts "Opening homepage for #{name_of(formula_or_cask)}" + disclaimer = disclaimers(formula_or_cask) + disclaimer = " (#{disclaimer})" if disclaimer.present? + + puts "Opening homepage for #{name_of(formula_or_cask)}#{disclaimer}" formula_or_cask.homepage end @@ -39,4 +42,15 @@ module Homebrew "Cask #{formula_or_cask.token}" end end + + def disclaimers(formula_or_cask) + return unless formula_or_cask.is_a? Formula + + begin + cask = Cask::CaskLoader.load formula_or_cask.name + "for the cask, use #{cask.tap.name}/#{cask.token}" + rescue Cask::CaskUnavailableError + nil + end + end end