-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_completion
38 lines (33 loc) · 1.22 KB
/
.bash_completion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
# Bash Auto Complete ##########################################################
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" \
-W "$(grep "^Host" ~/.ssh/config | \
grep -v "[?*]" | cut -d " " -f2- | tr ' ' '\n')" scp sftp ssh;
# AWS
if command -v aws >/dev/null 2>&1; then
complete -C aws_completer aws
fi
# Terraform
if command -v terraform >/dev/null 2>&1; then
complete -C /usr/local/bin/terraform terraform
fi
# Vault
if command -v vault >/dev/null 2>&1; then
complete -C /usr/local/bin/vault vault
fi
# OSX Only
if [[ $(uname) == Darwin ]]; then
# Docker for Mac
if [[ -d /usr/local/etc/bash_completion.d ]]; then
(
cd /usr/local/etc/bash_completion.d || true
[[ ! -L docker.bash-completion ]] && \
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion
[[ ! -L docker-machine.bash-completion ]] && \
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion
[[ ! -L docker-compose.bash-completion ]] && \
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion
)
fi
fi