feature: improve completion default shells, add :cobra format#21293
Merged
MikeMcQuaid merged 1 commit intomainfrom Dec 23, 2025
Merged
feature: improve completion default shells, add :cobra format#21293MikeMcQuaid merged 1 commit intomainfrom
:cobra format#21293MikeMcQuaid merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
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
Member
Author
|
I have noticed that the powershell change can break the current status, so keep it same as original. |
c5d7dca to
92455a0
Compare
MikeMcQuaid
reviewed
Dec 21, 2025
92455a0 to
2037f08
Compare
2037f08 to
37187f0
Compare
Member
Author
|
The impact of changes now minimized (maybe same as before) and so we I think we can merge this. |
Member
|
Thanks for this @daeho-ro! Great work and glad to see all the Homebrew/core PRs adding this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.