From 60c047b5ea3817be1751c9e180ab324f9a046fea Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 23 Apr 2025 17:20:14 +0100 Subject: [PATCH] Add `HOMEBREW_BUNDLE_SERVICES` variable to `brew bundle` This allows another way to pass `--services` to `brew bundle`. --- Library/Homebrew/cmd/bundle.rb | 4 +++- completions/bash/brew | 1 + completions/fish/brew.fish | 3 ++- completions/zsh/_brew | 3 ++- docs/Manpage.md | 7 ++++++- manpages/brew.1 | 5 ++++- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/bundle.rb b/Library/Homebrew/cmd/bundle.rb index d4b71ee956..27c5ece7c8 100755 --- a/Library/Homebrew/cmd/bundle.rb +++ b/Library/Homebrew/cmd/bundle.rb @@ -87,7 +87,9 @@ module Homebrew switch "--install", description: "Run `install` before continuing to other operations e.g. `exec`." switch "--services", - description: "Temporarily start services while running the `exec` or `sh` command." + env: :bundle_services, + description: "Temporarily start services while running the `exec` or `sh` command. " \ + "This is enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set." switch "-f", "--force", description: "`install` runs with `--force`/`--overwrite`. " \ "`dump` overwrites an existing `Brewfile`. " \ diff --git a/completions/bash/brew b/completions/bash/brew index 1dbeb403f6..2894cc704c 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -508,6 +508,7 @@ _brew_bump() { case "${cur}" in -*) __brewcomp " + --bump-synced --cask --debug --eval-all diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index ea3a706122..398951e1d8 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -399,6 +399,7 @@ __fish_brew_complete_arg 'bottle' -a '(__fish_brew_suggest_formulae_installed)' __fish_brew_complete_cmd 'bump' 'Displays out-of-date packages and the latest version available' +__fish_brew_complete_arg 'bump' -l bump-synced -d 'Bump additional formulae marked as synced with the given formulae' __fish_brew_complete_arg 'bump' -l cask -d 'Check only casks' __fish_brew_complete_arg 'bump' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'bump' -l eval-all -d 'Evaluate all formulae and casks' @@ -520,7 +521,7 @@ __fish_brew_complete_arg 'bundle' -l no-restart -d '`dump` does not add `restart __fish_brew_complete_arg 'bundle' -l no-upgrade -d '`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. This is enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' __fish_brew_complete_arg 'bundle' -l no-vscode -d '`dump` without VSCode (and forks/variants) extensions. This is enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set' __fish_brew_complete_arg 'bundle' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_arg 'bundle' -l services -d 'Temporarily start services while running the `exec` or `sh` command' +__fish_brew_complete_arg 'bundle' -l services -d 'Temporarily start services while running the `exec` or `sh` command. This is enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set' __fish_brew_complete_arg 'bundle' -l tap -d '`list` or `dump` Homebrew tap dependencies' __fish_brew_complete_arg 'bundle' -l upgrade -d '`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' __fish_brew_complete_arg 'bundle' -l upgrade-formulae -d '`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 11164f1f25..ae9e11fbd4 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -534,6 +534,7 @@ _brew_bottle() { # brew bump _brew_bump() { _arguments \ + '--bump-synced[Bump additional formulae marked as synced with the given formulae]' \ '--debug[Display any debugging information]' \ '(--installed)--eval-all[Evaluate all formulae and casks]' \ '--full-name[Print formulae/casks with fully-qualified names]' \ @@ -663,7 +664,7 @@ _brew_bundle() { '--no-upgrade[`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. This is enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ '(--all --vscode)--no-vscode[`dump` without VSCode (and forks/variants) extensions. This is enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set]' \ '--quiet[Make some output more quiet]' \ - '--services[Temporarily start services while running the `exec` or `sh` command]' \ + '--services[Temporarily start services while running the `exec` or `sh` command. This is enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set]' \ '--tap[`list` or `dump` Homebrew tap dependencies]' \ '(--install)--upgrade[`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ '--upgrade-formulae[`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ diff --git a/docs/Manpage.md b/docs/Manpage.md index 12c8545e40..cb356f5878 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -258,7 +258,8 @@ flags which will help with finding keg-only dependencies like `openssl`, `--services` -: Temporarily start services while running the `exec` or `sh` command. +: Temporarily start services while running the `exec` or `sh` command. This is + enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set. `-f`, `--force` @@ -2136,6 +2137,10 @@ displays whether a pull request has been opened with the URL. : Letter or word that the list of package results should alphabetically follow. +`--bump-synced` + +: Bump additional formulae marked as synced with the given formulae. + ### `bump-cask-pr` \[*`options`*\] *`cask`* Create a pull request to update *`cask`* with a new version. diff --git a/manpages/brew.1 b/manpages/brew.1 index 532002c932..62167ec7e9 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -157,7 +157,7 @@ Read from or write to the \fBBrewfile\fP from \fB$HOMEBREW_BUNDLE_FILE_GLOBAL\fP Run \fBinstall\fP before continuing to other operations e\.g\. \fBexec\fP\&\. .TP \fB\-\-services\fP -Temporarily start services while running the \fBexec\fP or \fBsh\fP command\. +Temporarily start services while running the \fBexec\fP or \fBsh\fP command\. This is enabled by default if \fB$HOMEBREW_BUNDLE_SERVICES\fP is set\. .TP \fB\-f\fP, \fB\-\-force\fP \fBinstall\fP runs with \fB\-\-force\fP/\fB\-\-overwrite\fP\&\. \fBdump\fP overwrites an existing \fBBrewfile\fP\&\. \fBcleanup\fP actually performs its cleanup operations\. @@ -1342,6 +1342,9 @@ Open a pull request for the new version if none have been opened yet\. .TP \fB\-\-start\-with\fP Letter or word that the list of package results should alphabetically follow\. +.TP +\fB\-\-bump\-synced\fP +Bump additional formulae marked as synced with the given formulae\. .SS "\fBbump\-cask\-pr\fP \fR[\fIoptions\fP] \fIcask\fP" Create a pull request to update \fIcask\fP with a new version\. .P