Skip to content

Commit 849d2ed

Browse files
committed
feat: added bash completion
1 parent 177fd66 commit 849d2ed

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

available/02_bash_completion.bash

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
if [ ! -e "$HOME/.local/bash_completion.d/bash.d.bash" ]; then
2+
wget -O \
3+
$HOME/.local/bash_completion.d/bash.d.bash \
4+
https://github.com/tobybatch/bashdotdee/blob/main/bash_completion.bash
5+
fi
6+
17
# anything in $HOME/.local/bash_completion.d ending .bash get included
2-
for x in "$HOME/.local/bash_completion.d/*.bash"; do
8+
for x in "$HOME"/.local/bash_completion.d/*.bash; do
39
source "$x"
410
done
511
# other environment specific scripts should not end .bash, e.g. see 87_django.bash

bash_completion.bash

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
_bashdotdee_completion() {
4+
COMPREPLY=($(ls -1 "$HOME/.bash.d/available/"))
5+
}
6+
7+
complete -F _bashdotdee_completion bash.d.sh

0 commit comments

Comments
 (0)