Skip to content
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

Commands starting with '-' can appear to be options and need quoting #110

Closed
wscott opened this issue Jul 21, 2022 · 1 comment · Fixed by #111
Closed

Commands starting with '-' can appear to be options and need quoting #110

wscott opened this issue Jul 21, 2022 · 1 comment · Fixed by #111
Labels

Comments

@wscott
Copy link

wscott commented Jul 21, 2022

$  -h
Usage: brew which-formula [--explain] command [...]

Prints the formula(e) which provides the given command.

      --explain                    Output explanation of how to get 'cmd' by
                                   installing one of the providing formulae.
  -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.

Clearly we are running "brew which-formula $BADCMD" and -h gets passed to brew.

I tried this test:

$ brew which-formula -- -h

but that command appears to just hang so there are so other changes needed and it fell below the threshold where I have time to try putting together a patch.

But I figured I should at least make a bug report.

@Rylan12
Copy link
Member

Rylan12 commented Jul 24, 2022

Thanks for reporting. You're exactly right about what's happening, here. I think the proper thing to do in this case is to not even try to pass to brew which-formula and just fail with the standard "not found" message.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants