Skip to content

help: print cli/parser help message if used#6965

Merged
MikeMcQuaid merged 6 commits intoHomebrew:masterfrom
dawidd6:external-help-cli-parser
Feb 1, 2020
Merged

help: print cli/parser help message if used#6965
MikeMcQuaid merged 6 commits intoHomebrew:masterfrom
dawidd6:external-help-cli-parser

Conversation

@dawidd6
Copy link
Copy Markdown
Contributor

@dawidd6 dawidd6 commented Jan 26, 2020

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

External commands using cli/parser currently can't produce a valid help message, because brew looks for #: comments on top of the command file. With this patch, it becomes possible to get the help message normally.

Discussion on the issue here: https://github.com/Homebrew/homebrew-linux-dev/pull/137

@dawidd6 dawidd6 force-pushed the external-help-cli-parser branch from 2965581 to e9274b3 Compare January 26, 2020 17:33
@issyl0
Copy link
Copy Markdown
Member

issyl0 commented Jan 26, 2020

Thanks, Dawid! This works for me. Here's the before/after:

$ cd $(brew --repo homebrew/linux-dev)
$ hub pr checkout 137
$ brew build-bottle-pr --help
  Warning: No help text in: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-linux-dev/cmd/brew-build-bottle-pr.rb
  Example usage:
    brew search [TEXT|/REGEX/]
  [...]

$ cd $(brew --repo)
$ hub pr checkout 6965
$ brew build-bottle-pr --help
  Usage: brew build-bottle-pr [--remote=user] [--dry-run] [--verbose] [--tap-dir] [--force] Submit a pull request to build a bottle for a formula.
  [...]

Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, we should definitely do something like this.

Comment thread Library/Homebrew/help.rb Outdated
@MikeMcQuaid MikeMcQuaid self-assigned this Feb 1, 2020
@MikeMcQuaid
Copy link
Copy Markdown
Member

Thanks @dawidd6!

@MikeMcQuaid MikeMcQuaid merged commit af700b7 into Homebrew:master Feb 1, 2020
@lock lock bot added the outdated PR was locked due to age label Mar 10, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated PR was locked due to age

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants