-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bash_completions
60 lines (46 loc) · 1.93 KB
/
.bash_completions
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
export BASH_COMPLETION_USER_DIR="${BASH_COMPLETION_USER_DIR:-"${HOME}/.bash_completion.d"}"
export BASH_COMPLETION_COMPAT_DIR="/usr/local/etc/bash_completion.d"
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
[ -f /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
[ -f /etc/bash_completion ] && . /etc/bash_completion
# Marks Completion (see .bash_functions)
_completemarks() {
local curw=${COMP_WORDS[COMP_CWORD]}
local wordlist=$(find $MARKPATH -type l -exec basename {} \;)
COMPREPLY=($(compgen -W '${wordlist[@]}' -- "$curw"))
return 0
}
complete -F _completemarks j um
# node Completion
node --completion-bash > $BASH_COMPLETION_USER_DIR/node
# nvm Completion
[ -s "${NVM_DIR}/etc/bash_completion" ] && . "${NVM_DIR}/etc/bash_completion"
[ -s "${NVM_INSTALL_DIR}/etc/bash_completion.d/nvm" ] && . "${NVM_INSTALL_DIR}/etc/bash_completion.d/nvm"
# NPM Completion
npm completion > $BASH_COMPLETION_USER_DIR/npm
# Lerna autocompletion.
# https://github.com/Bash-it/bash-it/blob/master/completion/available/lerna.completion.bash
function __lerna_completion() {
local cur compls
# The currently-being-completed word.
cur="${COMP_WORDS[COMP_CWORD]}"
# Options
compls="add bootstrap changed clean create diff exec \
import init link list publish run version \
--loglevel --concurrency --reject-cycles \
--progress --sort --no-sort --help \
--version"
# Tell complete what stuff to show.
# shellcheck disable=2207
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
}
complete -o default -F __lerna_completion lerna
for bcfile in $BASH_COMPLETION_USER_DIR/* ; do
[ -f "$bcfile" ] && . $bcfile
done
# AWS CLI Completion
complete -C aws_completer aws
# Kubernetes (kubectl) Completion
kubectl completion bash > /usr/local/etc/bash_completion.d/kubectl
complete -F __start_kubectl kcs
export COMP_WORDBREAKS=${COMP_WORDBREAKS//:}