Skip to content

Commit 04ba268

Browse files
committed
Update completion rules to use original complete-alias
relates to cykerway/complete-alias#34 and lu0/dotfiles_linuxMint#7
1 parent f85062a commit 04ba268

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ Check if your current completion rules autocomplete `git` after installing
6161
the wrapper script. Try `git checko` + <kbd>TAB</kbd>
6262

6363
If your git commands are no longer autocompleted, install
64-
[my modified fork of complete_alias](https://github.com/lu0/complete-alias).
64+
[complete_alias@3fc67e8](https://github.com/cykerway/complete-alias/tree/3fc67e8).
6565

6666
```sh
6767
sudo apt install bash-completion
68-
git clone https://github.com/lu0/complete-alias
69-
cd complete-alias/
70-
echo ". $PWD/complete_alias" >> ~/.bash_completion
68+
git clone https://github.com/cykerway/complete-alias ~/.complete-alias
69+
cd ~/.complete-alias
70+
git checkout 3fc67e8
71+
echo ". ${PWD}/complete_alias" >> ~/.bash_completion
7172
```
7273

7374
Inherit `git`'s completion rules by pasting the following in your `~/.bashrc` or
@@ -76,8 +77,17 @@ Inherit `git`'s completion rules by pasting the following in your `~/.bashrc` or
7677
```sh
7778
alias git="source git-worktree-wrapper"
7879
complete -F _complete_alias git
79-
_complete_alias_overrides() {
80-
echo git git
80+
81+
__compal__get_alias_body() {
82+
local cmd="$1"
83+
local body; body="$(alias "$cmd")"
84+
85+
# Overrides
86+
case "$cmd" in
87+
"git") body="git"
88+
esac
89+
90+
echo "${body#*=}" | command xargs
8191
}
8292
```
8393

0 commit comments

Comments
 (0)