Make bundle upgrade an alias#22348
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 upgradeas an alias ofinstalland remove the dedicatedUpgradeSubcommand. - Add
alias_optionstoCLI::Parsersubcommands 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.
- 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.
d93a190 to
adaee6e
Compare
daeho-ro
approved these changes
May 20, 2026
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 bundle upgradeas aninstallalias so install-only switches like--forceremain valid.alias_optionsto imply--upgradewithout keeping a separateUpgradeSubcommandpath.brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review and tweaking.