Add GitHub CLI completion

pull/1578/head
Travis Swicegood 2020-04-27 20:02:01 -05:00 committed by phreakocious
parent 5d533a6e1c
commit 22f666f028
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
cite "about-completion"
about-completion "GitHub CLI completion"
if command -v which gh >/dev/null 2>&1; then
if command -v which brew >/dev/null 2>&1; then
BREW_PREFIX=$(brew --prefix)
if [ -f "$BREW_PREFIX"/etc/bash_completion.d/gh.sh ]; then
. "$BREW_PREFIX"/etc/bash_completion.d/gh.sh
fi
else
eval "$(gh completion --shell=bash)"
fi
fi