Add stub Ruby commands for all Bash commands.

This gets us pretty similar (but easier to manage) manpage output but
much nicer completions etc. for all these commands.
This commit is contained in:
Mike McQuaid 2024-07-14 16:18:26 -04:00 committed by Ruoyu Zhong
parent 07564ed848
commit 5987c5c1d0
No known key found for this signature in database
26 changed files with 554 additions and 74 deletions

View File

@ -32,6 +32,12 @@ module Homebrew
.delete_suffix("-cmd") .delete_suffix("-cmd")
end end
sig { void }
def raise_sh_command_error!
raise StandardError, "This command is just here for completions generation. " \
"It's actually defined in `cmd/#{command_name}` instead."
end
# @return the AbstractCommand subclass associated with the brew CLI command name. # @return the AbstractCommand subclass associated with the brew CLI command name.
sig { params(name: String).returns(T.nilable(T.class_of(AbstractCommand))) } sig { params(name: String).returns(T.nilable(T.class_of(AbstractCommand))) }
def command(name) = subclasses.find { _1.command_name == name } def command(name) = subclasses.find { _1.command_name == name }

View File

@ -3,9 +3,6 @@
require "abstract_command" require "abstract_command"
# This Ruby command exists to allow generation of completions for the Bash
# version.
# It is not meant to be run.
module Homebrew module Homebrew
module Cmd module Cmd
class Repository < AbstractCommand class Repository < AbstractCommand
@ -20,16 +17,10 @@ module Homebrew
EOS EOS
named_args :tap named_args :tap
hide_from_man_page!
end end
sig { override.void } sig { override.void }
def run def run = raise_sh_command_error!
raise StandardError,
"This command is just here for completions generation. " \
"It's actually defined in `cmd/--repository.sh` instead."
end
end end
end end
end end

View File

@ -1,8 +1,4 @@
#: * `--repository`, `--repo` [<tap> ...] # Documentation defined in Library/Homebrew/cmd/--repository.rb
#:
#: Display where Homebrew's Git repository is located.
#:
#: If <user>`/`<repo> are provided, display where tap <user>`/`<repo>'s directory is located.
# HOMEBREW_REPOSITORY, HOMEBREW_LIBRARY are set by brew.sh # HOMEBREW_REPOSITORY, HOMEBREW_LIBRARY are set by brew.sh
# shellcheck disable=SC2154 # shellcheck disable=SC2154

View File

@ -0,0 +1,23 @@
# typed: strict
# frozen_string_literal: true
require "abstract_command"
module Homebrew
module Cmd
class Version < AbstractCommand
sig { override.returns(String) }
def self.command_name = "--version"
cmd_args do
description <<~EOS
Print the version numbers of Homebrew, Homebrew/homebrew-core and
Homebrew/homebrew-cask (if tapped) to standard output.
EOS
end
sig { override.void }
def run = raise_sh_command_error!
end
end
end

View File

@ -1,6 +1,4 @@
#: * `--version`, `-v` # Documentation defined in Library/Homebrew/cmd/--version.rb
#:
#: Print the version numbers of Homebrew, Homebrew/homebrew-core and Homebrew/homebrew-cask (if tapped) to standard output.
# HOMEBREW_CORE_REPOSITORY, HOMEBREW_CASK_REPOSITORY, HOMEBREW_VERSION are set by brew.sh # HOMEBREW_CORE_REPOSITORY, HOMEBREW_CASK_REPOSITORY, HOMEBREW_VERSION are set by brew.sh
# shellcheck disable=SC2154 # shellcheck disable=SC2154

View File

@ -0,0 +1,19 @@
# typed: strict
# frozen_string_literal: true
require "abstract_command"
# This Ruby command exists to allow generation of completions for the Bash
# version. It is not meant to be run.
module Homebrew
module Cmd
class Casks < AbstractCommand
cmd_args do
description "List all locally installable casks including short names."
end
sig { override.void }
def run = raise_sh_command_error!
end
end
end

View File

@ -1,7 +1,4 @@
#: * `casks` # Documentation defined in Library/Homebrew/cmd/casks.rb
#:
#: List all locally installable casks including short names.
#:
# HOMEBREW_LIBRARY is set in bin/brew # HOMEBREW_LIBRARY is set in bin/brew
# shellcheck disable=SC2154 # shellcheck disable=SC2154

View File

@ -0,0 +1,17 @@
# typed: strict
# frozen_string_literal: true
require "abstract_command"
module Homebrew
module Cmd
class Formulae < AbstractCommand
cmd_args do
description "List all locally installable formulae including short names."
end
sig { override.void }
def run = raise_sh_command_error!
end
end
end

View File

@ -1,7 +1,4 @@
#: * `formulae` # Documentation defined in Library/Homebrew/cmd/formulae.rb
#:
#: List all locally installable formulae including short names.
#:
# HOMEBREW_LIBRARY is set by bin/brew # HOMEBREW_LIBRARY is set by bin/brew
# shellcheck disable=SC2154 # shellcheck disable=SC2154

View File

@ -0,0 +1,21 @@
# typed: strict
# frozen_string_literal: true
require "abstract_command"
module Homebrew
module Cmd
class SetupRuby < AbstractCommand
cmd_args do
description <<~EOS
Installs and configures Homebrew's Ruby. If `command` is passed, it will only run Bundler if necessary for that command.
EOS
named_args :command
end
sig { override.void }
def run = raise_sh_command_error!
end
end
end

View File

@ -1,9 +1,4 @@
#: * `setup-ruby [command]` # Documentation defined in Library/Homebrew/cmd/setup-ruby.rb
#:
#: Installs and configures Homebrew's Ruby.
#: If `command` is passed, it will only run Bundler if necessary for that
#: command.
#:
# HOMEBREW_LIBRARY is set by brew.sh # HOMEBREW_LIBRARY is set by brew.sh
# HOMEBREW_BREW_FILE is set by extend/ENV/super.rb # HOMEBREW_BREW_FILE is set by extend/ENV/super.rb

View File

@ -0,0 +1,29 @@
# typed: strict
# frozen_string_literal: true
require "abstract_command"
module Homebrew
module Cmd
class Shellenv < AbstractCommand
cmd_args do
description <<~EOS
Valid shells: bash|csh|fish|pwsh|sh|tcsh|zsh
Print export statements. When run in a shell, this installation of Homebrew will be added to your `PATH`, `MANPATH`, and `INFOPATH`.
The variables `HOMEBREW_PREFIX`, `HOMEBREW_CELLAR` and `HOMEBREW_REPOSITORY` are also exported to avoid querying them multiple times.
To help guarantee idempotence, this command produces no output when Homebrew's `bin` and `sbin` directories are first and second
respectively in your `PATH`. Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.bash_profile` or
`~/.zprofile` on macOS and `~/.bashrc` or `~/.zshrc` on Linux) with: `eval "$(brew shellenv)"`
The shell can be specified explicitly with a supported shell name parameter. Unknown shells will output POSIX exports.
EOS
named_args :shell
end
sig { override.void }
def run = raise_sh_command_error!
end
end
end

View File

@ -1,13 +1,4 @@
#: * `shellenv [bash|csh|fish|pwsh|sh|tcsh|zsh]` # Documentation defined in Library/Homebrew/cmd/shellenv.rb
#:
#: Print export statements. When run in a shell, this installation of Homebrew will be added to your `PATH`, `MANPATH`, and `INFOPATH`.
#:
#: The variables `HOMEBREW_PREFIX`, `HOMEBREW_CELLAR` and `HOMEBREW_REPOSITORY` are also exported to avoid querying them multiple times.
#: To help guarantee idempotence, this command produces no output when Homebrew's `bin` and `sbin` directories are first and second
#: respectively in your `PATH`. Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.bash_profile` or
#: `~/.zprofile` on macOS and `~/.bashrc` or `~/.zshrc` on Linux) with: `eval "$(brew shellenv)"`
#:
#: The shell can be specified explicitly with a supported shell name parameter. Unknown shells will output POSIX exports.
# HOMEBREW_CELLAR and HOMEBREW_PREFIX are set by extend/ENV/super.rb # HOMEBREW_CELLAR and HOMEBREW_PREFIX are set by extend/ENV/super.rb
# HOMEBREW_REPOSITORY is set by bin/brew # HOMEBREW_REPOSITORY is set by bin/brew

View File

@ -0,0 +1,23 @@
# typed: strict
# frozen_string_literal: true
require "abstract_command"
module Homebrew
module Cmd
class UpdateReset < AbstractCommand
cmd_args do
description <<~EOS
Fetch and reset Homebrew and all tap repositories (or any specified <repository>) using `git`(1) to their latest `origin/HEAD`.
*Note:* this will destroy all your uncommitted or committed changes.
EOS
named_args :tap
end
sig { override.void }
def run = raise_sh_command_error!
end
end
end

View File

@ -1,8 +1,4 @@
#: * `update-reset` [<path-to-tap-repository> ...] # Documentation defined in Library/Homebrew/cmd/update-reset.rb
#:
#: Fetch and reset Homebrew and all tap repositories (or any specified <repository>) using `git`(1) to their latest `origin/HEAD`.
#:
#: *Note:* this will destroy all your uncommitted or committed changes.
# Replaces the function in Library/Homebrew/brew.sh to cache the Git executable to provide # Replaces the function in Library/Homebrew/brew.sh to cache the Git executable to provide
# speedup when using Git repeatedly and prevent errors if the shim changes mid-update. # speedup when using Git repeatedly and prevent errors if the shim changes mid-update.

View File

@ -0,0 +1,31 @@
# typed: strict
# frozen_string_literal: true
require "abstract_command"
module Homebrew
module Cmd
class Update < AbstractCommand
cmd_args do
description <<~EOS
Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1) and perform any necessary migrations.
EOS
switch "--merge",
description: "Use `git merge` to apply updates (rather than `git rebase`)."
switch "--auto-update",
description: "Run on auto-updates (e.g. before `brew install`). Skips some slower steps."
switch "-f", "--force",
description: "Always do a slower, full update check (even if unnecessary)."
switch "-q", "--quiet",
description: "Make some output more quiet."
switch "-v", "--verbose",
description: "Print the directories checked and `git` operations performed."
switch "-d", "--debug",
description: "Display a trace of all shell commands as they are executed."
end
sig { override.void }
def run = raise_sh_command_error!
end
end
end

View File

@ -1,14 +1,4 @@
#: * `update` [<options>] # Documentation defined in Library/Homebrew/cmd/update.rb
#:
#: Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1) and perform any necessary migrations.
#:
#: --merge Use `git merge` to apply updates (rather than `git rebase`).
#: --auto-update Run on auto-updates (e.g. before `brew install`). Skips some slower steps.
#: -f, --force Always do a slower, full update check (even if unnecessary).
#: -q, --quiet Make some output more quiet.
#: -v, --verbose Print the directories checked and `git` operations performed.
#: -d, --debug Display a trace of all shell commands as they are executed.
#: -h, --help Show this message.
# HOMEBREW_CURLRC, HOMEBREW_DEVELOPER, HOMEBREW_GIT_EMAIL, HOMEBREW_GIT_NAME # HOMEBREW_CURLRC, HOMEBREW_DEVELOPER, HOMEBREW_GIT_EMAIL, HOMEBREW_GIT_NAME
# HOMEBREW_UPDATE_CLEANUP, HOMEBREW_UPDATE_TO_TAG are from the user environment # HOMEBREW_UPDATE_CLEANUP, HOMEBREW_UPDATE_TO_TAG are from the user environment

View File

@ -0,0 +1,23 @@
# typed: strict
# frozen_string_literal: true
require "abstract_command"
module Homebrew
module Cmd
class VendorInstall < AbstractCommand
cmd_args do
description <<~EOS
Install Homebrew's portable Ruby.
EOS
named_args :target
hide_from_man_page!
end
sig { override.void }
def run = raise_sh_command_error!
end
end
end

View File

@ -1,7 +1,4 @@
#: @hide_from_man_page # Documentation defined in Library/Homebrew/cmd/vendor-install.rb
#: * `vendor-install` [<target>]
#:
#: Install Homebrew's portable Ruby.
# HOMEBREW_CURLRC, HOMEBREW_LIBRARY is from the user environment # HOMEBREW_CURLRC, HOMEBREW_LIBRARY is from the user environment
# HOMEBREW_CACHE, HOMEBREW_CURL, HOMEBREW_LINUX, HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION, HOMEBREW_MACOS, # HOMEBREW_CACHE, HOMEBREW_CURL, HOMEBREW_LINUX, HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION, HOMEBREW_MACOS,

View File

@ -0,0 +1,19 @@
# typed: strict
# frozen_string_literal: true
require "abstract_command"
module Homebrew
module Cmd
class Rubocop < AbstractCommand
cmd_args do
description <<~EOS
Installs, configures and runs Homebrew's `rubocop`.
EOS
end
sig { override.void }
def run = raise_sh_command_error!
end
end
end

View File

@ -1,6 +1,4 @@
#: * `rubocop` # Documentation defined in Library/Homebrew/dev-cmd/rubocop.rb
#:
#: Installs, configures and runs Homebrew's `rubocop`.
# HOMEBREW_LIBRARY is from the user environment. # HOMEBREW_LIBRARY is from the user environment.
# HOMEBREW_RUBY_PATH is set by utils/ruby.sh # HOMEBREW_RUBY_PATH is set by utils/ruby.sh

View File

@ -267,6 +267,22 @@ _brew___repository() {
__brew_complete_tapped __brew_complete_tapped
} }
_brew___version() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in
-*)
__brewcomp "
--debug
--help
--quiet
--verbose
"
return
;;
*) ;;
esac
}
_brew__s() { _brew__s() {
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in case "${cur}" in
@ -298,6 +314,22 @@ _brew__s() {
esac esac
} }
_brew__v() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in
-*)
__brewcomp "
--debug
--help
--quiet
--verbose
"
return
;;
*) ;;
esac
}
_brew_abv() { _brew_abv() {
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in case "${cur}" in
@ -572,6 +604,22 @@ _brew_bump_unversioned_casks() {
__brew_complete_tapped __brew_complete_tapped
} }
_brew_casks() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in
-*)
__brewcomp "
--debug
--help
--quiet
--verbose
"
return
;;
*) ;;
esac
}
_brew_cat() { _brew_cat() {
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in case "${cur}" in
@ -1027,6 +1075,22 @@ _brew_formula() {
__brew_complete_formulae __brew_complete_formulae
} }
_brew_formulae() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in
-*)
__brewcomp "
--debug
--help
--quiet
--verbose
"
return
;;
*) ;;
esac
}
_brew_generate_cask_api() { _brew_generate_cask_api() {
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in case "${cur}" in
@ -1997,6 +2061,22 @@ _brew_rm() {
__brew_complete_installed_casks __brew_complete_installed_casks
} }
_brew_rubocop() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in
-*)
__brewcomp "
--debug
--help
--quiet
--verbose
"
return
;;
*) ;;
esac
}
_brew_ruby() { _brew_ruby() {
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in case "${cur}" in
@ -2065,6 +2145,23 @@ _brew_search() {
esac esac
} }
_brew_setup_ruby() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in
-*)
__brewcomp "
--debug
--help
--quiet
--verbose
"
return
;;
*) ;;
esac
__brew_complete_commands
}
_brew_sh() { _brew_sh() {
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in case "${cur}" in
@ -2084,6 +2181,22 @@ _brew_sh() {
__brew_complete_files __brew_complete_files
} }
_brew_shellenv() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in
-*)
__brewcomp "
--debug
--help
--quiet
--verbose
"
return
;;
*) ;;
esac
}
_brew_style() { _brew_style() {
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in case "${cur}" in
@ -2539,6 +2652,23 @@ _brew_update_report() {
esac esac
} }
_brew_update_reset() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in
-*)
__brewcomp "
--debug
--help
--quiet
--verbose
"
return
;;
*) ;;
esac
__brew_complete_tapped
}
_brew_update_sponsors() { _brew_update_sponsors() {
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in case "${cur}" in
@ -2675,6 +2805,22 @@ _brew_vendor_gems() {
esac esac
} }
_brew_vendor_install() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "${cur}" in
-*)
__brewcomp "
--debug
--help
--quiet
--verbose
"
return
;;
*) ;;
esac
}
_brew() { _brew() {
local i=1 cmd local i=1 cmd
@ -2713,7 +2859,9 @@ _brew() {
--prefix) _brew___prefix ;; --prefix) _brew___prefix ;;
--repo) _brew___repo ;; --repo) _brew___repo ;;
--repository) _brew___repository ;; --repository) _brew___repository ;;
--version) _brew___version ;;
-S) _brew__s ;; -S) _brew__s ;;
-v) _brew__v ;;
abv) _brew_abv ;; abv) _brew_abv ;;
analytics) _brew_analytics ;; analytics) _brew_analytics ;;
audit) _brew_audit ;; audit) _brew_audit ;;
@ -2724,6 +2872,7 @@ _brew() {
bump-formula-pr) _brew_bump_formula_pr ;; bump-formula-pr) _brew_bump_formula_pr ;;
bump-revision) _brew_bump_revision ;; bump-revision) _brew_bump_revision ;;
bump-unversioned-casks) _brew_bump_unversioned_casks ;; bump-unversioned-casks) _brew_bump_unversioned_casks ;;
casks) _brew_casks ;;
cat) _brew_cat ;; cat) _brew_cat ;;
cleanup) _brew_cleanup ;; cleanup) _brew_cleanup ;;
command) _brew_command ;; command) _brew_command ;;
@ -2745,6 +2894,7 @@ _brew() {
extract) _brew_extract ;; extract) _brew_extract ;;
fetch) _brew_fetch ;; fetch) _brew_fetch ;;
formula) _brew_formula ;; formula) _brew_formula ;;
formulae) _brew_formulae ;;
generate-cask-api) _brew_generate_cask_api ;; generate-cask-api) _brew_generate_cask_api ;;
generate-formula-api) _brew_generate_formula_api ;; generate-formula-api) _brew_generate_formula_api ;;
generate-man-completions) _brew_generate_man_completions ;; generate-man-completions) _brew_generate_man_completions ;;
@ -2785,10 +2935,13 @@ _brew() {
release) _brew_release ;; release) _brew_release ;;
remove) _brew_remove ;; remove) _brew_remove ;;
rm) _brew_rm ;; rm) _brew_rm ;;
rubocop) _brew_rubocop ;;
ruby) _brew_ruby ;; ruby) _brew_ruby ;;
rubydoc) _brew_rubydoc ;; rubydoc) _brew_rubydoc ;;
search) _brew_search ;; search) _brew_search ;;
setup-ruby) _brew_setup_ruby ;;
sh) _brew_sh ;; sh) _brew_sh ;;
shellenv) _brew_shellenv ;;
style) _brew_style ;; style) _brew_style ;;
tab) _brew_tab ;; tab) _brew_tab ;;
tap) _brew_tap ;; tap) _brew_tap ;;
@ -2811,11 +2964,13 @@ _brew() {
update-maintainers) _brew_update_maintainers ;; update-maintainers) _brew_update_maintainers ;;
update-python-resources) _brew_update_python_resources ;; update-python-resources) _brew_update_python_resources ;;
update-report) _brew_update_report ;; update-report) _brew_update_report ;;
update-reset) _brew_update_reset ;;
update-sponsors) _brew_update_sponsors ;; update-sponsors) _brew_update_sponsors ;;
update-test) _brew_update_test ;; update-test) _brew_update_test ;;
upgrade) _brew_upgrade ;; upgrade) _brew_upgrade ;;
uses) _brew_uses ;; uses) _brew_uses ;;
vendor-gems) _brew_vendor_gems ;; vendor-gems) _brew_vendor_gems ;;
vendor-install) _brew_vendor_install ;;
*) ;; *) ;;
esac esac
} }

View File

@ -263,6 +263,13 @@ __fish_brew_complete_arg '--repository' -l verbose -d 'Make some output more ver
__fish_brew_complete_arg '--repository' -a '(__fish_brew_suggest_taps_installed)' __fish_brew_complete_arg '--repository' -a '(__fish_brew_suggest_taps_installed)'
__fish_brew_complete_cmd '--version' 'Print the version numbers of Homebrew, Homebrew/homebrew-core and Homebrew/homebrew-cask (if tapped) to standard output'
__fish_brew_complete_arg '--version' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg '--version' -l help -d 'Show this message'
__fish_brew_complete_arg '--version' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg '--version' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd '-S' 'Perform a substring search of cask tokens and formula names for text' __fish_brew_complete_cmd '-S' 'Perform a substring search of cask tokens and formula names for text'
__fish_brew_complete_arg '-S' -l archlinux -d 'Search for text in the given database' __fish_brew_complete_arg '-S' -l archlinux -d 'Search for text in the given database'
__fish_brew_complete_arg '-S' -l cask -d 'Search for casks' __fish_brew_complete_arg '-S' -l cask -d 'Search for casks'
@ -285,6 +292,13 @@ __fish_brew_complete_arg '-S' -l ubuntu -d 'Search for text in the given databas
__fish_brew_complete_arg '-S' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg '-S' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd '-v' 'Print the version numbers of Homebrew, Homebrew/homebrew-core and Homebrew/homebrew-cask (if tapped) to standard output'
__fish_brew_complete_arg '-v' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg '-v' -l help -d 'Show this message'
__fish_brew_complete_arg '-v' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg '-v' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'abv' 'Display brief statistics for your Homebrew installation' __fish_brew_complete_cmd 'abv' 'Display brief statistics for your Homebrew installation'
__fish_brew_complete_arg 'abv' -l analytics -d 'List global Homebrew analytics data or, if specified, installation and build error data for formula (provided neither `HOMEBREW_NO_ANALYTICS` nor `HOMEBREW_NO_GITHUB_API` are set)' __fish_brew_complete_arg 'abv' -l analytics -d 'List global Homebrew analytics data or, if specified, installation and build error data for formula (provided neither `HOMEBREW_NO_ANALYTICS` nor `HOMEBREW_NO_GITHUB_API` are set)'
__fish_brew_complete_arg 'abv' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'abv' -l cask -d 'Treat all named arguments as casks'
@ -471,6 +485,13 @@ __fish_brew_complete_arg 'bump-unversioned-casks' -a '(__fish_brew_suggest_casks
__fish_brew_complete_arg 'bump-unversioned-casks' -a '(__fish_brew_suggest_taps_installed)' __fish_brew_complete_arg 'bump-unversioned-casks' -a '(__fish_brew_suggest_taps_installed)'
__fish_brew_complete_cmd 'casks' 'List all locally installable casks including short names'
__fish_brew_complete_arg 'casks' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'casks' -l help -d 'Show this message'
__fish_brew_complete_arg 'casks' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'casks' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'cat' 'Display the source of a formula or cask' __fish_brew_complete_cmd 'cat' 'Display the source of a formula or cask'
__fish_brew_complete_arg 'cat' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'cat' -l cask -d 'Treat all named arguments as casks'
__fish_brew_complete_arg 'cat' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'cat' -l debug -d 'Display any debugging information'
@ -741,6 +762,13 @@ __fish_brew_complete_arg 'formula' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_arg 'formula' -a '(__fish_brew_suggest_formulae_all)' __fish_brew_complete_arg 'formula' -a '(__fish_brew_suggest_formulae_all)'
__fish_brew_complete_cmd 'formulae' 'List all locally installable formulae including short names'
__fish_brew_complete_arg 'formulae' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'formulae' -l help -d 'Show this message'
__fish_brew_complete_arg 'formulae' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'formulae' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'generate-cask-api' 'Generate `homebrew/cask` API data files for https://formulae.brew.sh' __fish_brew_complete_cmd 'generate-cask-api' 'Generate `homebrew/cask` API data files for https://formulae.brew.sh'
__fish_brew_complete_arg 'generate-cask-api' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'generate-cask-api' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'generate-cask-api' -l dry-run -d 'Generate API data without writing it to files' __fish_brew_complete_arg 'generate-cask-api' -l dry-run -d 'Generate API data without writing it to files'
@ -1351,6 +1379,13 @@ __fish_brew_complete_arg 'rm; and not __fish_seen_argument -l cask -l casks' -a
__fish_brew_complete_arg 'rm; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_installed)' __fish_brew_complete_arg 'rm; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_installed)'
__fish_brew_complete_cmd 'rubocop' 'Installs, configures and runs Homebrew\'s `rubocop`'
__fish_brew_complete_arg 'rubocop' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'rubocop' -l help -d 'Show this message'
__fish_brew_complete_arg 'rubocop' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'rubocop' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'ruby' 'Run a Ruby instance with Homebrew\'s libraries loaded' __fish_brew_complete_cmd 'ruby' 'Run a Ruby instance with Homebrew\'s libraries loaded'
__fish_brew_complete_arg 'ruby' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'ruby' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'ruby' -l help -d 'Show this message' __fish_brew_complete_arg 'ruby' -l help -d 'Show this message'
@ -1391,6 +1426,14 @@ __fish_brew_complete_arg 'search' -l ubuntu -d 'Search for text in the given dat
__fish_brew_complete_arg 'search' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'search' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'setup-ruby' 'Installs and configures Homebrew\'s Ruby'
__fish_brew_complete_arg 'setup-ruby' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'setup-ruby' -l help -d 'Show this message'
__fish_brew_complete_arg 'setup-ruby' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'setup-ruby' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_arg 'setup-ruby' -a '(__fish_brew_suggest_commands)'
__fish_brew_complete_cmd 'sh' 'Enter an interactive shell for Homebrew\'s build environment' __fish_brew_complete_cmd 'sh' 'Enter an interactive shell for Homebrew\'s build environment'
__fish_brew_complete_arg 'sh' -l cmd -d 'Execute commands in a non-interactive shell' __fish_brew_complete_arg 'sh' -l cmd -d 'Execute commands in a non-interactive shell'
__fish_brew_complete_arg 'sh' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'sh' -l debug -d 'Display any debugging information'
@ -1400,6 +1443,13 @@ __fish_brew_complete_arg 'sh' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'sh' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'sh' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'shellenv' 'Valid shells: bash|csh|fish|pwsh|sh|tcsh|zsh Print export statements'
__fish_brew_complete_arg 'shellenv' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'shellenv' -l help -d 'Show this message'
__fish_brew_complete_arg 'shellenv' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'shellenv' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'style' 'Check formulae or files for conformance to Homebrew style guidelines' __fish_brew_complete_cmd 'style' 'Check formulae or files for conformance to Homebrew style guidelines'
__fish_brew_complete_arg 'style' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'style' -l cask -d 'Treat all named arguments as casks'
__fish_brew_complete_arg 'style' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'style' -l debug -d 'Display any debugging information'
@ -1656,6 +1706,14 @@ __fish_brew_complete_arg 'update-report' -l quiet -d 'Make some output more quie
__fish_brew_complete_arg 'update-report' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'update-report' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'update-reset' 'Fetch and reset Homebrew and all tap repositories (or any specified repository) using `git`(1) to their latest `origin/HEAD`'
__fish_brew_complete_arg 'update-reset' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'update-reset' -l help -d 'Show this message'
__fish_brew_complete_arg 'update-reset' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'update-reset' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_arg 'update-reset' -a '(__fish_brew_suggest_taps_installed)'
__fish_brew_complete_cmd 'update-sponsors' 'Update the list of GitHub Sponsors in the `Homebrew/brew` README' __fish_brew_complete_cmd 'update-sponsors' 'Update the list of GitHub Sponsors in the `Homebrew/brew` README'
__fish_brew_complete_arg 'update-sponsors' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'update-sponsors' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'update-sponsors' -l help -d 'Show this message' __fish_brew_complete_arg 'update-sponsors' -l help -d 'Show this message'
@ -1747,6 +1805,13 @@ __fish_brew_complete_arg 'vendor-gems' -l update -d 'Update the specified list o
__fish_brew_complete_arg 'vendor-gems' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'vendor-gems' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'vendor-install' 'Install Homebrew\'s portable Ruby'
__fish_brew_complete_arg 'vendor-install' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'vendor-install' -l help -d 'Show this message'
__fish_brew_complete_arg 'vendor-install' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'vendor-install' -l verbose -d 'Make some output more verbose'
################################ ################################
## OFFICIAL EXTERNAL COMMANDS ## ## OFFICIAL EXTERNAL COMMANDS ##

View File

@ -208,7 +208,7 @@ __brew_internal_commands() {
'search:Perform a substring search of cask tokens and formula names for text' 'search:Perform a substring search of cask tokens and formula names for text'
'setup-ruby:Installs and configures Homebrew'\''s Ruby' 'setup-ruby:Installs and configures Homebrew'\''s Ruby'
'sh:Enter an interactive shell for Homebrew'\''s build environment' 'sh:Enter an interactive shell for Homebrew'\''s build environment'
'shellenv:Print export statements' 'shellenv:Valid shells: bash|csh|fish|pwsh|sh|tcsh|zsh Print export statements'
'style:Check formulae or files for conformance to Homebrew style guidelines' 'style:Check formulae or files for conformance to Homebrew style guidelines'
'tab:Edit tab information for installed formulae or casks' 'tab:Edit tab information for installed formulae or casks'
'tap:Tap a formula repository' 'tap:Tap a formula repository'
@ -363,6 +363,15 @@ _brew___repository() {
'*::tap:__brew_any_tap' '*::tap:__brew_any_tap'
} }
# brew --version
_brew___version() {
_arguments \
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]'
}
# brew -S # brew -S
_brew__s() { _brew__s() {
_arguments \ _arguments \
@ -387,6 +396,15 @@ _brew__s() {
'--verbose[Make some output more verbose]' '--verbose[Make some output more verbose]'
} }
# brew -v
_brew__v() {
_arguments \
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]'
}
# brew abv # brew abv
_brew_abv() { _brew_abv() {
_arguments \ _arguments \
@ -605,6 +623,15 @@ _brew_bump_unversioned_casks() {
'*::tap:__brew_any_tap' '*::tap:__brew_any_tap'
} }
# brew casks
_brew_casks() {
_arguments \
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]'
}
# brew cat # brew cat
_brew_cat() { _brew_cat() {
_arguments \ _arguments \
@ -936,6 +963,15 @@ _brew_formula() {
'*::formula:__brew_formulae' '*::formula:__brew_formulae'
} }
# brew formulae
_brew_formulae() {
_arguments \
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]'
}
# brew generate-cask-api # brew generate-cask-api
_brew_generate_cask_api() { _brew_generate_cask_api() {
_arguments \ _arguments \
@ -1667,6 +1703,15 @@ _brew_rm() {
'*::installed_cask:__brew_installed_casks' '*::installed_cask:__brew_installed_casks'
} }
# brew rubocop
_brew_rubocop() {
_arguments \
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]'
}
# brew ruby # brew ruby
_brew_ruby() { _brew_ruby() {
_arguments \ _arguments \
@ -1715,6 +1760,17 @@ _brew_search() {
'--verbose[Make some output more verbose]' '--verbose[Make some output more verbose]'
} }
# brew setup-ruby
_brew_setup_ruby() {
_arguments \
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]' \
- command \
'*::command:__brew_commands'
}
# brew sh # brew sh
_brew_sh() { _brew_sh() {
_arguments \ _arguments \
@ -1728,6 +1784,15 @@ _brew_sh() {
'*::file:__brew_formulae_or_ruby_files' '*::file:__brew_formulae_or_ruby_files'
} }
# brew shellenv
_brew_shellenv() {
_arguments \
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]'
}
# brew style # brew style
_brew_style() { _brew_style() {
_arguments \ _arguments \
@ -2049,6 +2114,17 @@ _brew_update_report() {
'--verbose[Make some output more verbose]' '--verbose[Make some output more verbose]'
} }
# brew update-reset
_brew_update_reset() {
_arguments \
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]' \
- tap \
'*::tap:__brew_any_tap'
}
# brew update-sponsors # brew update-sponsors
_brew_update_sponsors() { _brew_update_sponsors() {
_arguments \ _arguments \
@ -2153,6 +2229,15 @@ _brew_vendor_gems() {
'--verbose[Make some output more verbose]' '--verbose[Make some output more verbose]'
} }
# brew vendor-install
_brew_vendor_install() {
_arguments \
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]'
}
# The main completion function # The main completion function
_brew() { _brew() {
local curcontext="$curcontext" state state_descr line expl local curcontext="$curcontext" state state_descr line expl

View File

@ -1141,12 +1141,14 @@ Perform a substring search of cask tokens and formula names for *`text`*. If
: Search for *`text`* in the given database. : Search for *`text`* in the given database.
### `setup-ruby [command]` ### `setup-ruby` \[*`command`* ...\]
Installs and configures Homebrew's Ruby. If `command` is passed, it will only Installs and configures Homebrew's Ruby. If `command` is passed, it will only
run Bundler if necessary for that command. run Bundler if necessary for that command.
### `shellenv [bash|csh|fish|pwsh|sh|tcsh|zsh]` ### `shellenv` \[*`shell`* ...\]
Valid shells: bash\|csh\|fish\|pwsh\|sh\|tcsh\|zsh
Print export statements. When run in a shell, this installation of Homebrew will Print export statements. When run in a shell, this installation of Homebrew will
be added to your `PATH`, `MANPATH`, and `INFOPATH`. be added to your `PATH`, `MANPATH`, and `INFOPATH`.
@ -1284,7 +1286,7 @@ Remove a tapped formula repository.
: Untap even if formulae or casks from this tap are currently installed. : Untap even if formulae or casks from this tap are currently installed.
### `update` \[*`options`*\] ### `update`, `up` \[*`options`*\]
Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1) Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1)
and perform any necessary migrations. and perform any necessary migrations.
@ -1301,7 +1303,15 @@ and perform any necessary migrations.
: Always do a slower, full update check (even if unnecessary). : Always do a slower, full update check (even if unnecessary).
### `update-reset` \[*`path-to-tap-repository`* ...\] `-v`, `--verbose`
: Print the directories checked and `git` operations performed.
`-d`, `--debug`
: Display a trace of all shell commands as they are executed.
### `update-reset` \[*`tap`* ...\]
Fetch and reset Homebrew and all tap repositories (or any specified Fetch and reset Homebrew and all tap repositories (or any specified
*`repository`*) using `git`(1) to their latest `origin/HEAD`. *`repository`*) using `git`(1) to their latest `origin/HEAD`.

View File

@ -719,9 +719,11 @@ Search for \fItext\fP in the given database\.
.TP .TP
\fB\-\-ubuntu\fP \fB\-\-ubuntu\fP
Search for \fItext\fP in the given database\. Search for \fItext\fP in the given database\.
.SS "\fBsetup\-ruby \fR[command]\fP" .SS "\fBsetup\-ruby\fP \fR[\fIcommand\fP \.\.\.]"
Installs and configures Homebrew\[u2019]s Ruby\. If \fBcommand\fP is passed, it will only run Bundler if necessary for that command\. Installs and configures Homebrew\[u2019]s Ruby\. If \fBcommand\fP is passed, it will only run Bundler if necessary for that command\.
.SS "\fBshellenv \fR[bash|csh|fish|pwsh|sh|tcsh|zsh]\fP" .SS "\fBshellenv\fP \fR[\fIshell\fP \.\.\.]"
Valid shells: bash|csh|fish|pwsh|sh|tcsh|zsh
.P
Print export statements\. When run in a shell, this installation of Homebrew will be added to your \fBPATH\fP, \fBMANPATH\fP, and \fBINFOPATH\fP\&\. Print export statements\. When run in a shell, this installation of Homebrew will be added to your \fBPATH\fP, \fBMANPATH\fP, and \fBINFOPATH\fP\&\.
.P .P
The variables \fBHOMEBREW_PREFIX\fP, \fBHOMEBREW_CELLAR\fP and \fBHOMEBREW_REPOSITORY\fP are also exported to avoid querying them multiple times\. To help guarantee idempotence, this command produces no output when Homebrew\[u2019]s \fBbin\fP and \fBsbin\fP directories are first and second respectively in your \fBPATH\fP\&\. Consider adding evaluation of this command\[u2019]s output to your dotfiles (e\.g\. \fB~/\.bash_profile\fP or \fB~/\.zprofile\fP on macOS and \fB~/\.bashrc\fP or \fB~/\.zshrc\fP on Linux) with: \fBeval "$(brew shellenv)"\fP The variables \fBHOMEBREW_PREFIX\fP, \fBHOMEBREW_CELLAR\fP and \fBHOMEBREW_REPOSITORY\fP are also exported to avoid querying them multiple times\. To help guarantee idempotence, this command produces no output when Homebrew\[u2019]s \fBbin\fP and \fBsbin\fP directories are first and second respectively in your \fBPATH\fP\&\. Consider adding evaluation of this command\[u2019]s output to your dotfiles (e\.g\. \fB~/\.bash_profile\fP or \fB~/\.zprofile\fP on macOS and \fB~/\.bashrc\fP or \fB~/\.zshrc\fP on Linux) with: \fBeval "$(brew shellenv)"\fP
@ -800,7 +802,7 @@ Remove a tapped formula repository\.
.TP .TP
\fB\-f\fP, \fB\-\-force\fP \fB\-f\fP, \fB\-\-force\fP
Untap even if formulae or casks from this tap are currently installed\. Untap even if formulae or casks from this tap are currently installed\.
.SS "\fBupdate\fP \fR[\fIoptions\fP]" .SS "\fBupdate\fP, \fBup\fP \fR[\fIoptions\fP]"
Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\fP(1) and perform any necessary migrations\. Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\fP(1) and perform any necessary migrations\.
.TP .TP
\fB\-\-merge\fP \fB\-\-merge\fP
@ -811,7 +813,13 @@ Run on auto\-updates (e\.g\. before \fBbrew install\fP)\. Skips some slower step
.TP .TP
\fB\-f\fP, \fB\-\-force\fP \fB\-f\fP, \fB\-\-force\fP
Always do a slower, full update check (even if unnecessary)\. Always do a slower, full update check (even if unnecessary)\.
.SS "\fBupdate\-reset\fP \fR[\fIpath\-to\-tap\-repository\fP \.\.\.]" .TP
\fB\-v\fP, \fB\-\-verbose\fP
Print the directories checked and \fBgit\fP operations performed\.
.TP
\fB\-d\fP, \fB\-\-debug\fP
Display a trace of all shell commands as they are executed\.
.SS "\fBupdate\-reset\fP \fR[\fItap\fP \.\.\.]"
Fetch and reset Homebrew and all tap repositories (or any specified \fIrepository\fP) using \fBgit\fP(1) to their latest \fBorigin/HEAD\fP\&\. Fetch and reset Homebrew and all tap repositories (or any specified \fIrepository\fP) using \fBgit\fP(1) to their latest \fBorigin/HEAD\fP\&\.
.P .P
\fINote:\fP this will destroy all your uncommitted or committed changes\. \fINote:\fP this will destroy all your uncommitted or committed changes\.