Skip to content

Commit

Permalink
bash: Fix completion for git-dotfiles and hub
Browse files Browse the repository at this point in the history
  • Loading branch information
liskin committed Feb 1, 2021
1 parent c487205 commit 6ca7aa9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .local/share/bash-completion/completions/git-dotfiles
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!bash
# shellcheck disable=SC2239

. /usr/share/bash-completion/completions/git
complete -F _git git-dotfiles
if ! declare -F __git_complete >/dev/null; then
_completion_loader git
fi

# FIXME: "git" instead of "__git_main" once https://github.com/git/git/commit/5a067ba9d04eebc92ad77f101b785219238f4f1e is released
__git_complete git-dotfiles __git_main
15 changes: 15 additions & 0 deletions .local/share/bash-completion/completions/hub
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!bash
# shellcheck disable=SC2239

# drop once https://github.com/github/hub/issues/2684 is released

if ! declare -F __git_complete >/dev/null; then
_completion_loader git
fi

function _git { __git_wrap__git_main "$@"; }

. /usr/share/bash-completion/completions/hub

__git_compute_all_commands
__git_all_commands=$({ __git_list_all_commands 2>/dev/null; echo "$__git_all_commands"; } | sort -u)

0 comments on commit 6ca7aa9

Please sign in to comment.