diff --git a/Library/Homebrew/completions/bash.erb b/Library/Homebrew/completions/bash.erb index 8a1042b2f5..a9395d3ef3 100644 --- a/Library/Homebrew/completions/bash.erb +++ b/Library/Homebrew/completions/bash.erb @@ -81,14 +81,14 @@ __brew_complete_installed_casks() { __brew_complete_outdated_formulae() { local cur="${COMP_WORDS[COMP_CWORD]}" local outdated_formulae - outdated_formulae="$(brew outdated --formula --quiet)" + outdated_formulae="$(HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --formula --quiet)" while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${outdated_formulae}" -- "${cur}") } __brew_complete_outdated_casks() { local cur="${COMP_WORDS[COMP_CWORD]}" local outdated_casks - outdated_casks="$(brew outdated --cask --quiet 2>/dev/null)" + outdated_casks="$(HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --cask --quiet 2>/dev/null)" while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${outdated_casks}" -- "${cur}") } diff --git a/Library/Homebrew/completions/fish.erb b/Library/Homebrew/completions/fish.erb index 95976df051..383966bb8c 100644 --- a/Library/Homebrew/completions/fish.erb +++ b/Library/Homebrew/completions/fish.erb @@ -108,7 +108,7 @@ end function __fish_brew_suggest_formulae_outdated -d "List of outdated formulae with the information about potential upgrade" - brew outdated --formula --verbose \ + HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --formula --verbose 2>/dev/null \ # replace first space with tab to make the following a description in the completions list: | string replace -r '\s' '\t' end @@ -134,7 +134,7 @@ function __fish_brew_suggest_casks_installed -d "Lists installed casks" end function __fish_brew_suggest_casks_outdated -d "Lists outdated casks with the information about potential upgrade" - brew outdated --cask --verbose 2>/dev/null \ + HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --cask --verbose 2>/dev/null \ # replace first space with tab to make the following a description in the completions list: | string replace -r '\s' '\t' end @@ -157,13 +157,10 @@ function __fish_brew_suggest_diagnostic_checks -d "List available diagnostic che brew doctor --list-checks end -# TODO: any better way to list available services? function __fish_brew_suggest_services -d "Lists available services" - set -l list (brew services list) - set -e list[1] # Header - for line in $list - echo (string split ' ' $line)[1] - end + command find (brew --cellar) -mindepth 3 -maxdepth 3 -name '*.service' \ + | awk -F'homebrew.|.service' '{print $3}' \ + | sort -d end diff --git a/Library/Homebrew/completions/zsh.erb b/Library/Homebrew/completions/zsh.erb index c4c511b0e1..025ab24ea6 100644 --- a/Library/Homebrew/completions/zsh.erb +++ b/Library/Homebrew/completions/zsh.erb @@ -74,7 +74,7 @@ __brew_outdated_formulae() { [[ -prefix '-' ]] && return 0 local -a formulae - formulae=($(brew outdated --formula)) + formulae=($(HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --formula)) _describe -t formulae 'outdated formulae' formulae } @@ -106,7 +106,7 @@ __brew_outdated_casks() { [[ -prefix '-' ]] && return 0 local -a casks - casks=($(brew outdated --cask 2>/dev/null)) + casks=($(HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --cask 2>/dev/null)) _describe -t casks 'outdated casks' casks } diff --git a/completions/bash/brew b/completions/bash/brew index 2611b88a97..d3b9b955ac 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -68,14 +68,14 @@ __brew_complete_installed_casks() { __brew_complete_outdated_formulae() { local cur="${COMP_WORDS[COMP_CWORD]}" local outdated_formulae - outdated_formulae="$(brew outdated --formula --quiet)" + outdated_formulae="$(HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --formula --quiet)" while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${outdated_formulae}" -- "${cur}") } __brew_complete_outdated_casks() { local cur="${COMP_WORDS[COMP_CWORD]}" local outdated_casks - outdated_casks="$(brew outdated --cask --quiet 2>/dev/null)" + outdated_casks="$(HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --cask --quiet 2>/dev/null)" while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${outdated_casks}" -- "${cur}") } diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index 7f55a8e283..30962f4cf1 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -95,7 +95,7 @@ end function __fish_brew_suggest_formulae_outdated -d "List of outdated formulae with the information about potential upgrade" - brew outdated --formula --verbose \ + HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --formula --verbose 2>/dev/null \ # replace first space with tab to make the following a description in the completions list: | string replace -r '\s' '\t' end @@ -121,7 +121,7 @@ function __fish_brew_suggest_casks_installed -d "Lists installed casks" end function __fish_brew_suggest_casks_outdated -d "Lists outdated casks with the information about potential upgrade" - brew outdated --cask --verbose 2>/dev/null \ + HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --cask --verbose 2>/dev/null \ # replace first space with tab to make the following a description in the completions list: | string replace -r '\s' '\t' end @@ -144,13 +144,10 @@ function __fish_brew_suggest_diagnostic_checks -d "List available diagnostic che brew doctor --list-checks end -# TODO: any better way to list available services? function __fish_brew_suggest_services -d "Lists available services" - set -l list (brew services list) - set -e list[1] # Header - for line in $list - echo (string split ' ' $line)[1] - end + command find (brew --cellar) -mindepth 3 -maxdepth 3 -name '*.service' \ + | awk -F'homebrew.|.service' '{print $3}' \ + | sort -d end diff --git a/completions/zsh/_brew b/completions/zsh/_brew index d2b4dfb94a..69d5ca98ac 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -78,7 +78,7 @@ __brew_outdated_formulae() { [[ -prefix '-' ]] && return 0 local -a formulae - formulae=($(brew outdated --formula)) + formulae=($(HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --formula)) _describe -t formulae 'outdated formulae' formulae } @@ -110,7 +110,7 @@ __brew_outdated_casks() { [[ -prefix '-' ]] && return 0 local -a casks - casks=($(brew outdated --cask 2>/dev/null)) + casks=($(HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --cask 2>/dev/null)) _describe -t casks 'outdated casks' casks }