Merge pull request #1808 from NoahGorny/cleanup/brew-completions

formatted brew completion
pull/1809/head
Noah Gorny 2021-01-28 16:19:09 +02:00 committed by GitHub
commit ef110e167c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 13 deletions

View File

@ -57,6 +57,7 @@ plugins/available/xterm.plugin.bash
# completions # completions
# #
completion/available/brew.completion.bash
completion/available/cargo.completion.bash completion/available/cargo.completion.bash
completion/available/knife.completion.bash completion/available/knife.completion.bash
completion/available/packer.completion.bash completion/available/packer.completion.bash

View File

@ -1,4 +1,6 @@
#!/usr/bin/env bash # shellcheck shell=bash
cite "about-completion"
about-completion "brew completion"
# Load late to make sure `system` completion loads first # Load late to make sure `system` completion loads first
# BASH_IT_LOAD_PRIORITY: 375 # BASH_IT_LOAD_PRIORITY: 375
@ -14,14 +16,17 @@ _command_exists brew || return 0
BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)} BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]]; then if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]]; then
# shellcheck disable=1090
source "$BREW_PREFIX"/etc/bash_completion.d/brew source "$BREW_PREFIX"/etc/bash_completion.d/brew
elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]]; then elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]]; then
# shellcheck disable=1090
source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh
elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]]; then elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]]; then
# For the git-clone based installation, see here for more info: # For the git-clone based installation, see here for more info:
# https://github.com/Bash-it/bash-it/issues/1458 # https://github.com/Bash-it/bash-it/issues/1458
# https://docs.brew.sh/Shell-Completion # https://docs.brew.sh/Shell-Completion
# shellcheck disable=1090
source "$BREW_PREFIX"/completions/bash/brew source "$BREW_PREFIX"/completions/bash/brew
fi fi