blob: 014fc03d5e7c836022ceea78ec71057fe98c1a2f (
plain)
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
|
#compdef fnm
autoload -U is-at-least
_fnm() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--multishell-path=[Where the current node version link is stored. This value will be populated automatically by evaluating `fnm env` in your shell profile. Read more about it using `fnm help env`]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
":: :_fnm_commands" \
"*::: :->fnm" \
&& ret=0
case $state in
(fnm)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:fnm-command-$line[1]:"
case $line[1] in
(ls-remote)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(list-remote)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(ls)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(install)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'--lts[Install latest LTS]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::version -- A version string. Can be a partial semver or a LTS version name by the format lts/NAME:_files' \
&& ret=0
;;
(use)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'--install-if-missing[Install the version if it isn'\''t installed yet]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::version:_files' \
&& ret=0
;;
(env)
_arguments "${_arguments_options[@]}" \
'--shell=[The shell syntax to use. Infers when missing]: :(bash zsh fish powershell)' \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'--multi[Deprecated. This is the default now]' \
'--use-on-cd[Print the script to change Node versions every directory change]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" \
'--shell=[The shell syntax to use. Infers when missing]: :(zsh bash fish powershell elvish)' \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(alias)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':to-version:_files' \
':name:_files' \
&& ret=0
;;
(default)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':version:_files' \
&& ret=0
;;
(current)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(exec)
_arguments "${_arguments_options[@]}" \
'--using=[Either an explicit version, or a filename with the version written in it]' \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'--using-file[Deprecated. This is the default now]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::arguments -- The command to run:_files' \
&& ret=0
;;
(uninstall)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::version:_files' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'--node-dist-mirror=[https://nodejs.org/dist/ mirror]' \
'--fnm-dir=[The root directory of fnm installations]' \
'--log-level=[The log level of fnm commands]' \
'--arch=[Override the architecture of the installed Node binary. Defaults to arch of fnm binary]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
esac
;;
esac
}
(( $+functions[_fnm_commands] )) ||
_fnm_commands() {
local commands; commands=(
"list-remote:List all remote Node.js versions" \
"ls-remote:List all remote Node.js versions" \
"list:List all locally installed Node.js versions" \
"ls:List all locally installed Node.js versions" \
"install:Install a new Node.js version" \
"use:Change Node.js version" \
"env:Print and set up required environment variables for fnm" \
"completions:Print shell completions to stdout" \
"alias:Alias a version to a common name" \
"default:Set a version as the default version" \
"current:Print the current Node.js version" \
"exec:Run a command within fnm context" \
"uninstall:Uninstall a Node.js version" \
"help:Prints this message or the help of the given subcommand(s)" \
)
_describe -t commands 'fnm commands' commands "$@"
}
(( $+functions[_fnm__alias_commands] )) ||
_fnm__alias_commands() {
local commands; commands=(
)
_describe -t commands 'fnm alias commands' commands "$@"
}
(( $+functions[_fnm__completions_commands] )) ||
_fnm__completions_commands() {
local commands; commands=(
)
_describe -t commands 'fnm completions commands' commands "$@"
}
(( $+functions[_fnm__current_commands] )) ||
_fnm__current_commands() {
local commands; commands=(
)
_describe -t commands 'fnm current commands' commands "$@"
}
(( $+functions[_fnm__default_commands] )) ||
_fnm__default_commands() {
local commands; commands=(
)
_describe -t commands 'fnm default commands' commands "$@"
}
(( $+functions[_fnm__env_commands] )) ||
_fnm__env_commands() {
local commands; commands=(
)
_describe -t commands 'fnm env commands' commands "$@"
}
(( $+functions[_fnm__exec_commands] )) ||
_fnm__exec_commands() {
local commands; commands=(
)
_describe -t commands 'fnm exec commands' commands "$@"
}
(( $+functions[_fnm__help_commands] )) ||
_fnm__help_commands() {
local commands; commands=(
)
_describe -t commands 'fnm help commands' commands "$@"
}
(( $+functions[_fnm__install_commands] )) ||
_fnm__install_commands() {
local commands; commands=(
)
_describe -t commands 'fnm install commands' commands "$@"
}
(( $+functions[_fnm__list_commands] )) ||
_fnm__list_commands() {
local commands; commands=(
)
_describe -t commands 'fnm list commands' commands "$@"
}
(( $+functions[_fnm__list-remote_commands] )) ||
_fnm__list-remote_commands() {
local commands; commands=(
)
_describe -t commands 'fnm list-remote commands' commands "$@"
}
(( $+functions[_fnm__ls_commands] )) ||
_fnm__ls_commands() {
local commands; commands=(
)
_describe -t commands 'fnm ls commands' commands "$@"
}
(( $+functions[_ls_commands] )) ||
_ls_commands() {
local commands; commands=(
)
_describe -t commands 'ls commands' commands "$@"
}
(( $+functions[_fnm__ls-remote_commands] )) ||
_fnm__ls-remote_commands() {
local commands; commands=(
)
_describe -t commands 'fnm ls-remote commands' commands "$@"
}
(( $+functions[_ls-remote_commands] )) ||
_ls-remote_commands() {
local commands; commands=(
)
_describe -t commands 'ls-remote commands' commands "$@"
}
(( $+functions[_fnm__uninstall_commands] )) ||
_fnm__uninstall_commands() {
local commands; commands=(
)
_describe -t commands 'fnm uninstall commands' commands "$@"
}
(( $+functions[_fnm__use_commands] )) ||
_fnm__use_commands() {
local commands; commands=(
)
_describe -t commands 'fnm use commands' commands "$@"
}
_fnm "$@"
|