Skip to content

Make bundle upgrade an alias#22348

Merged
MikeMcQuaid merged 1 commit into
mainfrom
bundle-upgrade-shorthand
May 20, 2026
Merged

Make bundle upgrade an alias#22348
MikeMcQuaid merged 1 commit into
mainfrom
bundle-upgrade-shorthand

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • Treat brew bundle upgrade as an install alias so install-only switches like --force remain valid.
  • Use alias_options to imply --upgrade without keeping a separate UpgradeSubcommand path.
  • Regenerate completions and manpages so docs match parser behaviour.

  • 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 tweaking.


Copilot AI review requested due to automatic review settings May 19, 2026 18:54
@MikeMcQuaid MikeMcQuaid enabled auto-merge May 19, 2026 18:54
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 brew bundle upgrade to behave as an alias of brew bundle install --upgrade, so install-only flags (e.g., --force) remain valid while avoiding a separate upgrade subcommand implementation path. It introduces a new alias_options mechanism in the CLI parser to allow subcommand aliases to imply options, and regenerates manpages/docs/completions to match the updated parser behavior.

Changes:

  • Treat brew bundle upgrade as an alias of install and remove the dedicated UpgradeSubcommand.
  • Add alias_options to CLI::Parser subcommands and apply implied options during parsing.
  • Update tests + regenerate manpage/docs and shell completions for the new alias behavior.

Reviewed changes

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

Show a summary per file
File Description
manpages/brew.1 Updates manpage text so bundle upgrade is documented as an alias of install --upgrade.
docs/Manpage.md Mirrors manpage changes in docs.
Library/Homebrew/cli/parser.rb Adds alias_options to subcommands and applies implied options when parsing alias subcommands.
Library/Homebrew/abstract_subcommand.rb Plumbs alias_options from AbstractSubcommand into the CLI parser.
Library/Homebrew/bundle/subcommand/install.rb Declares upgrade as an alias (with implied --upgrade) for the install subcommand and updates usage text.
Library/Homebrew/bundle/subcommand.rb Simplifies no_upgrade determination to rely on args.upgrade? now that the alias implies --upgrade.
Library/Homebrew/bundle/subcommand/upgrade.rb Removes the dedicated upgrade subcommand implementation.
Library/Homebrew/test/cmd/bundle_spec.rb Adds coverage asserting upgrade behaves like install --upgrade and that options are described correctly.
Library/Homebrew/test/cli/parser_spec.rb Adds coverage for implied options from subcommand aliases.
completions/zsh/_brew Regenerates zsh completions to reflect upgrade as an alias of install.
completions/fish/brew.fish Regenerates fish completions to reflect upgrade as an alias of install.
completions/bash/brew Regenerates bash completions to treat `install

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

Comment thread Library/Homebrew/bundle/subcommand/install.rb Outdated
- Treat `brew bundle upgrade` as an `install` alias so install-only
  switches like `--force` remain valid.
- Use `alias_options` to imply `--upgrade` without keeping a separate
  `UpgradeSubcommand` path.
- Regenerate completions and manpages so docs match parser behaviour.
@MikeMcQuaid MikeMcQuaid force-pushed the bundle-upgrade-shorthand branch from d93a190 to adaee6e Compare May 20, 2026 06:50
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit 53f3a89 May 20, 2026
37 checks passed
@MikeMcQuaid MikeMcQuaid deleted the bundle-upgrade-shorthand branch May 20, 2026 13:46
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