-
Notifications
You must be signed in to change notification settings - Fork 4
/
completions.bash
111 lines (83 loc) · 3.48 KB
/
completions.bash
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# blincus completion -*- shell-script -*-
# This bash completions script was generated by
# completely (https://github.com/dannyben/completely)
# Modifying it manually is not recommended
_blincus_completions_filter() {
local words="$1"
local cur=${COMP_WORDS[COMP_CWORD]}
local result=()
if [[ "${cur:0:1}" == "-" ]]; then
echo "$words"
else
for word in $words; do
[[ "${word:0:1}" != "-" ]] && result+=("$word")
done
echo "${result[*]}"
fi
}
_blincus_completions() {
local cur=${COMP_WORDS[COMP_CWORD]}
local compwords=("${COMP_WORDS[@]:1:$COMP_CWORD-1}")
local compline="${compwords[*]}"
case "$compline" in
'template personalize'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'template list'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'template edit'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'config list'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'template l'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'config get'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'config set'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'template e'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'template p'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'config g'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'config l'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'config s'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h")" -- "$cur")
;;
'template'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h e edit l list p personalize")" -- "$cur")
;;
'config'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help -h g get l list s set")" -- "$cur")
;;
'launch'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help --template -h -t")" -- "$cur")
;;
'shell'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help --no-login --root -h -n -r")" -- "$cur")
;;
'l'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help --template -h -t")" -- "$cur")
;;
's'*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help --no-login --root -h -n -r")" -- "$cur")
;;
*)
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_blincus_completions_filter "--help --version -h -v config l launch s shell template")" -- "$cur")
;;
esac
} &&
complete -F _blincus_completions blincus
# ex: filetype=sh