New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when brew cat
fails, suggest brew info --github
#14902
when brew cat
fails, suggest brew info --github
#14902
Conversation
Library/Homebrew/dev-cmd/cat.rb
Outdated
$stderr.puts "The name may be wrong, or the tap hasn't been tapped." | ||
$stderr.puts "Consider using `brew info --github formula|cask [...]` instead." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$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 "The name may be wrong, or the tap hasn't been tapped. Instead try:" | |
$stderr.puts " brew info --github" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, thanks for the PR! A formatting suggestion.
Is it possiboe to add the cask Name - so that the suggested command is just read for copy paste? |
Yes, let me try adding that.
On Mon, Mar 6, 2023 at 11:06 AM Muescha ***@***.***> wrote:
Is it possiboe to add the cask Name - so that the suggested command is
just read for copy paste?
—
Reply to this email directly, view it on GitHub
<#14902 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABL7XMIJJSSMGUJJ7VKCUDW2YKSNANCNFSM6AAAAAAVRFDKZ4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Wes Higbee
|
@MikeMcQuaid formatting change adopted |
brew cat
fails, suggest brew info --github
Great. Thx :) It is possible to check if the option |
@@ -15,4 +15,12 @@ | |||
.and not_to_output.to_stderr | |||
.and be_a_success | |||
end | |||
|
|||
describe "when a source file isn't found" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in this case we shouldn't add an entire integration test just for this change. They're really slow and since this is just a messaging issue I think it's fine for it to be missed by tests.
Thanks for writing it, though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go once this test is removed.
Thanks so much for your first contribution (hopefully of many)! Without people like you submitting PRs we couldn't run this project. You rock, @g0t4! |
My pleasure!
About the test, I mostly wrote it to test drive the test fwk so I can
handle the more advanced case of using the API to get the source.
Thanks for the help too
On Tue, Mar 7, 2023 at 3:29 AM Mike McQuaid ***@***.***> wrote:
Merged #14902 <#14902> into master.
—
Reply to this email directly, view it on GitHub
<#14902 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABL7XIRZV5XYGOQ57TGA3TW235W5ANCNFSM6AAAAAAVRFDKZ4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Wes Higbee
|
$ brew cat docker
Error: docker's source doesn't exist on disk.
The name may be wrong, or the tap hasn't been tapped. Instead try:
brew info --github docker
$ brew cat --cask docker
Error: docker's source doesn't exist on disk.
The name may be wrong, or the tap hasn't been tapped. Instead try:
brew info --github docker $ brew info --github docker
Warning: Treating docker as a formula. For the cask, use homebrew/cask/docker opened https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/docker.rb $ brew info --github --cask docker opened https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/docker.rb |
@muescha, yeah that was my fear with showing the args! darn edge cases |
@MikeMcQuaid hey I have another change as suggested by @muescha, should I open a new PR? it's right on top of the change you made to nuke the test, same branch in my repo. I've never reopened a merged+closed PR before, so I'm not sure if that's doable? @muescha if you wanna give feedback on it, here it is... it was a quick hack just to test it out :) |
@muescha oh and I just have to ask... will there be flame wars over suggesting |
the PR is already merged - so you have to create a new PR |
but i see at your link there is a green button to create a new pull request the man page says
so there is no |
@muescha looks like man pages are out of date! $ brew cat --help
Usage: brew cat [--formula] [--cask] formula|cask [...]
Display the source of a formula or cask.
--formula, --formulae Treat all named arguments as formulae.
--cask, --casks Treat all named arguments as casks.
-d, --debug Display any debugging information.
-q, --quiet Make some output more quiet.
-v, --verbose Make some output more verbose.
-h, --help Show this message. Completions also don't have --casks/--formulae, which IMO is a good thing to avoid wondering if the arg is different when it's just an alias! |
When
brew cat formula|cask
fails, add suggestion to usebrew info --github formula|cask
instead. This gives a workaround for API users that don't have taps locally forhomebrew/core
andhomebrew/cask
.This builds on changes from #14824 which addressed #14815