Skip to content

Add GitHub CLI completion #1574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions completion/available/github-cli.completion.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
cite "about-completion"
about-completion "GitHub CLI completion"

if _command_exists gh; then
if _command_exists brew; then
echo "You don't need github-cli completion enabled if you have system completion enabled"
fi
eval "$(gh completion --shell=bash)"
fi
2 changes: 1 addition & 1 deletion test/lib/search.bats
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function local_teardown {
run _bash-it-search 'git' --no-color
assert_line -n 0 ' aliases: git gitsvn '
assert_line -n 1 ' plugins: autojump git git-subrepo jgitflow jump '
assert_line -n 2 ' completions: git git_flow git_flow_avh '
assert_line -n 2 ' completions: git git_flow git_flow_avh github-cli '
}

@test "search: ruby gem bundle rake rails" {
Expand Down