-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_completion
210 lines (160 loc) · 5.25 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# pip bash completion start
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
PIP_AUTO_COMPLETE=1 $1 2>/dev/null ) )
}
complete -o default -F _pip_completion pip
# pip bash completion end
_poetry_0c1d51702c0313b5_complete()
{
local cur script coms opts com
COMPREPLY=()
_get_comp_words_by_ref -n : cur words
# for an alias, get the real script behind it
if [[ $(type -t ${words[0]}) == "alias" ]]; then
script=$(alias ${words[0]} | sed -E "s/alias ${words[0]}='(.*)'/\1/")
else
script=${words[0]}
fi
# lookup for command
for word in ${words[@]:1}; do
if [[ $word != -* ]]; then
com=$word
break
fi
done
# completing for an option
if [[ ${cur} == --* ]] ; then
opts="--ansi --directory --help --no-ansi --no-cache --no-interaction --no-plugins --quiet --verbose --version"
case "$com" in
(about)
opts="${opts} "
;;
(add)
opts="${opts} --allow-prereleases --dev --dry-run --editable --extras --group --lock --optional --platform --python --source"
;;
(build)
opts="${opts} --format"
;;
('cache clear')
opts="${opts} --all"
;;
('cache list')
opts="${opts} "
;;
(check)
opts="${opts} "
;;
(config)
opts="${opts} --list --local --unset"
;;
('debug info')
opts="${opts} "
;;
('debug resolve')
opts="${opts} --extras --install --python --tree"
;;
('env info')
opts="${opts} --path"
;;
('env list')
opts="${opts} --full-path"
;;
('env remove')
opts="${opts} --all"
;;
('env use')
opts="${opts} "
;;
(export)
opts="${opts} --dev --extras --format --only --output --with --with-credentials --without --without-hashes --without-urls"
;;
(help)
opts="${opts} "
;;
(init)
opts="${opts} --author --dependency --description --dev-dependency --license --name --python"
;;
(install)
opts="${opts} --all-extras --dry-run --extras --no-dev --no-root --only --only-root --remove-untracked --sync --with --without"
;;
(list)
opts="${opts} "
;;
(lock)
opts="${opts} --check --no-update"
;;
(new)
opts="${opts} --name --readme --src"
;;
(publish)
opts="${opts} --build --cert --client-cert --dry-run --password --repository --skip-existing --username"
;;
(remove)
opts="${opts} --dev --dry-run --group"
;;
(run)
opts="${opts} "
;;
(search)
opts="${opts} "
;;
('self add')
opts="${opts} --allow-prereleases --dry-run --editable --extras --source"
;;
('self install')
opts="${opts} --dry-run --sync"
;;
('self lock')
opts="${opts} --check --no-update"
;;
('self remove')
opts="${opts} --dry-run"
;;
('self show')
opts="${opts} --addons --latest --outdated --tree"
;;
('self show plugins')
opts="${opts} "
;;
('self update')
opts="${opts} --dry-run --preview"
;;
(shell)
opts="${opts} "
;;
(show)
opts="${opts} --all --latest --no-dev --only --outdated --tree --why --with --without"
;;
('source add')
opts="${opts} --default --secondary"
;;
('source remove')
opts="${opts} "
;;
('source show')
opts="${opts} "
;;
(update)
opts="${opts} --dry-run --lock --no-dev --only --with --without"
;;
(version)
opts="${opts} --dry-run --short"
;;
esac
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
__ltrim_colon_completions "$cur"
return 0;
fi
# completing for a command
if [[ $cur == $com ]]; then
coms="about add build 'cache clear' 'cache list' check config 'debug info' 'debug resolve' 'env info' 'env list' 'env remove' 'env use' export help init install list lock new publish remove run search 'self add' 'self install' 'self lock' 'self remove' 'self show' 'self show plugins' 'self update' shell show 'source add' 'source remove' 'source show' update version"
COMPREPLY=($(compgen -W "${coms}" -- ${cur}))
__ltrim_colon_completions "$cur"
return 0
fi
}
complete -o default -F _poetry_0c1d51702c0313b5_complete poetry
complete -o default -F _poetry_0c1d51702c0313b5_complete /opt/homebrew/bin/poetry