include formula/cask args in brew info --github suggestion

This commit is contained in:
Wes Higbee 2023-03-06 13:30:06 -06:00
parent 1e95de4757
commit 12d93c480f
No known key found for this signature in database
GPG Key ID: 5183AB5EB611EDB6
2 changed files with 10 additions and 1 deletions

View File

@ -54,7 +54,7 @@ module Homebrew
if Homebrew.failed?
$stderr.puts "The name may be wrong, or the tap hasn't been tapped."
$stderr.puts "Consider using `brew info --github formula|cask [...]` instead."
$stderr.puts "Consider using `brew info --github #{args.named.join(" ")}` instead."
return
end

View File

@ -15,4 +15,13 @@ describe "brew cat" do
.and not_to_output.to_stderr
.and be_a_success
end
describe "when a source file isn't found" do
it "prints a suggestion to use brew info --github" , :integration_test do
expect { brew "cat", "asdf", "bogus"}
.to output(/Consider using `brew info --github asdf bogus` instead/).to_stderr
.and be_a_failure
end
end
end