completion: Lint github-cli completion and use completion_exists

This commit is contained in:
Noah Gorny
2021-01-16 22:57:30 +02:00
parent 2b66100c47
commit adc77bb622
2 changed files with 5 additions and 3 deletions

View File

@@ -1,8 +1,9 @@
#!/usr/bin/env bash
# shellcheck shell=bash
cite "about-completion"
about-completion "GitHub CLI completion"
if _binary_exists gh; then
complete -p gh &> /dev/null || return
eval "$(gh completion --shell=bash)"
# If gh already completed, stop
_completion_exists gh && return
eval "$(gh completion --shell=bash)"
fi