Skip to content

Convert remaining subcommands#22281

Merged
MikeMcQuaid merged 1 commit into
mainfrom
other-subcommands
May 17, 2026
Merged

Convert remaining subcommands#22281
MikeMcQuaid merged 1 commit into
mainfrom
other-subcommands

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Small state/action commands should use the same parser API.
  • Keep the legacy analytics UUID command visible but marked for removal.
  • Refresh generated manpages and completions after all conversions.

  • 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? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

OpenAI Codex 5.5 xhigh with local review and testing.


@MikeMcQuaid
MikeMcQuaid force-pushed the subcommand-parser-support branch from 7ae6c50 to 00b6e04 Compare May 14, 2026 14:00
@MikeMcQuaid
MikeMcQuaid force-pushed the subcommand-parser-support branch 2 times, most recently from ef0af09 to 4c22ef0 Compare May 15, 2026 15:33
Base automatically changed from subcommand-parser-support to main May 15, 2026 21:10
Copilot AI review requested due to automatic review settings May 16, 2026 09:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 converts remaining small state/action commands (analytics, completions, and developer) to the newer parser subcommand API and refreshes generated docs/completions.

Changes:

  • Splits command behavior into AbstractSubcommand subclasses with default state subcommands.
  • Updates command entrypoints to dispatch through subcommand metadata.
  • Regenerates tests, manpages, and shell completions for the converted commands.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Library/Homebrew/cmd/analytics.rb Delegates analytics actions to parser-defined subcommands.
Library/Homebrew/analytics/subcommand.rb Loads and dispatches analytics subcommands.
Library/Homebrew/analytics/subcommand/state.rb Adds default analytics state behavior.
Library/Homebrew/analytics/subcommand/on.rb Adds analytics enable subcommand.
Library/Homebrew/analytics/subcommand/off.rb Adds analytics disable subcommand.
Library/Homebrew/analytics/subcommand/regenerate_uuid.rb Keeps legacy UUID command as a subcommand.
Library/Homebrew/cmd/completions.rb Delegates completions actions to parser-defined subcommands.
Library/Homebrew/completions/subcommand.rb Loads and dispatches completions subcommands.
Library/Homebrew/completions/subcommand/state.rb Adds default completions state behavior.
Library/Homebrew/completions/subcommand/link.rb Adds completions link subcommand.
Library/Homebrew/completions/subcommand/unlink.rb Adds completions unlink subcommand.
Library/Homebrew/cmd/developer.rb Delegates developer mode actions to parser-defined subcommands.
Library/Homebrew/developer/subcommand.rb Loads and dispatches developer subcommands.
Library/Homebrew/developer/subcommand/state.rb Adds default developer mode state behavior.
Library/Homebrew/developer/subcommand/on.rb Adds developer mode enable subcommand.
Library/Homebrew/developer/subcommand/off.rb Adds developer mode disable subcommand.
Library/Homebrew/test/cmd/analytics_spec.rb Adds parser expectations for analytics default/extra args.
Library/Homebrew/test/cmd/completions_spec.rb Adds parser expectations for completions default/extra args.
Library/Homebrew/test/cmd/developer_spec.rb Adds parser expectations for developer default/extra args.
docs/Manpage.md Regenerates markdown manpage entries for subcommands.
manpages/brew.1 Regenerates roff manpage entries for subcommands.
completions/bash/brew Regenerates bash completions for nested subcommands.
completions/fish/brew.fish Regenerates fish completions for nested subcommands.
completions/zsh/_brew Regenerates zsh completions for nested subcommands.
Comments suppressed due to low confidence (2)

completions/zsh/_brew:842

  • This nested zsh completion omits the global/default-subcommand options at the command level, so brew completions --<TAB> stops suggesting valid flags such as --help and --debug. Please make the top-level _arguments call include the default subcommand's options (ideally in the completion generator) and regenerate the completions.
  _arguments -C \
    '1:subcommand:->subcommand' \
    '*::arg:->args'

completions/zsh/_brew:1012

  • This nested zsh completion omits valid global/default-subcommand flags before a subcommand is supplied, so brew developer --<TAB> no longer suggests options like --help or --debug. Please include the default subcommand's option specs in the top-level _arguments call (or adjust the generator) and regenerate the file.
  _arguments -C \
    '1:subcommand:->subcommand' \
    '*::arg:->args'

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread completions/zsh/_brew
@MikeMcQuaid
MikeMcQuaid force-pushed the other-subcommands branch 4 times, most recently from 9afc089 to eda8458 Compare May 16, 2026 10:55

@Rylan12 Rylan12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I didn't verify that the code moves were identical, but the structure change looks good and like a nice cleanup!

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue May 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 17, 2026
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue May 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch May 17, 2026
@MikeMcQuaid
MikeMcQuaid changed the base branch from main to bundle-subcommand May 17, 2026 14:36
- Small state/action commands should use the same parser API.
- Keep the legacy analytics UUID command visible but marked for removal.
- Refresh generated manpages and completions after all conversions.
Base automatically changed from bundle-subcommand to main May 17, 2026 15:29
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue May 17, 2026
Merged via the queue into main with commit d6527df May 17, 2026
38 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the other-subcommands branch May 17, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants