-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
feature: improve completion default shells, add :cobra format
#21293
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
Conversation
MikeMcQuaid
left a comment
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 thanks again!
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.
Pull request overview
This PR refactors the generate_completions_from_executable method to improve code maintainability and adds support for the :cobra shell completion format. The refactoring extracts the shell parameter generation logic into a private method and introduces format-specific default shell lists.
Key Changes:
- Added
:cobrashell parameter format with default shells including PowerShell - Refactored shell parameter generation logic into private
completion_shell_parametermethod - Reorganized documentation examples alphabetically by format type
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
36aa804 to
c5d7dca
Compare
|
I have noticed that the powershell change can break the current status, so keep it same as original. |
c5d7dca to
92455a0
Compare
92455a0 to
2037f08
Compare
2037f08 to
37187f0
Compare
|
The impact of changes now minimized (maybe same as before) and so we I think we can merge this. |
MikeMcQuaid
left a comment
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.
Thanks again!
|
Thanks for this @daeho-ro! Great work and glad to see all the Homebrew/core PRs adding this! |
brew lgtm(style, typechecking and tests) with your changes locally?This is based on #21287, .
While working on shell completion support, I noticed that when the same packages e.g.
cobra,clickandclap, are used across mutiple formulae, providing parameter formats with default shells makes the user experience much simpler.So the goal of this PR is to improve readability by extracting some logic into private methods, and to simplify the DSL by providing more predefined types like
:cobraand re-organize the order of shell parameter formats alphabetically.