From 9e9b0abdd523b0b6b8c740665f023911ba3a1e6c Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Sun, 5 Feb 2023 16:58:06 +0000 Subject: [PATCH] Update manpage and completions. Autogenerated by the [sponsors-maintainers-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sponsors-maintainers-man-completions.yml) workflow. --- completions/bash/brew | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/completions/bash/brew b/completions/bash/brew index de47e2843b..76ad9a2023 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -100,24 +100,18 @@ __brew_complete_tapped() { } __brew_complete_commands() { - # Auto-complete Homebrew commands - # Do NOT auto-complete "*instal" aliases for "*install" commands - local cur="${COMP_WORDS[COMP_CWORD]}" local cmds - - if [[ -n ${__HOMEBREW_COMMANDS} ]] - then - cmds=${__HOMEBREW_COMMANDS} - elif [[ -n ${HOMEBREW_CACHE:-} && -f ${HOMEBREW_CACHE}/all_commands_list.txt ]] + HOMEBREW_CACHE=$(brew --cache) + HOMEBREW_REPOSITORY=$(brew --repo) + # Do not auto-complete "*instal" or "*uninstal" aliases for "*install" commands. + if [[ -f "${HOMEBREW_CACHE}/all_commands_list.txt" ]] then cmds="$(< "${HOMEBREW_CACHE}/all_commands_list.txt" \grep -v instal$)" - elif [[ -n ${HOMEBREW_REPOSITORY:-} && -f ${HOMEBREW_REPOSITORY}/completions/internal_commands_list.txt ]] - then + else cmds="$(< "${HOMEBREW_REPOSITORY}/completions/internal_commands_list.txt" \grep -v instal$)" fi while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${cmds}" -- "${cur}") - export __HOMEBREW_COMMANDS=${cmds} } # compopt is only available in newer versions of bash