-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathstack.ts
451 lines (451 loc) · 14.4 KB
/
stack.ts
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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
const completionSpec: Fig.Spec = {
name: "stack",
description: "The Haskell Tool Stack",
options: [
{
name: ["--help", "-h"],
description: "Show help for stack",
},
{
name: "--version",
description: "Show version for stack",
},
{
name: "--numeric-version",
description: "Show only the numeric version for stack",
},
{
name: "--hpack-numeric-version",
description: "Show only hpack's version number",
},
{
name: "--verbosity",
description: "Verbosity: silent, error, warn, info, debug",
},
{
name: ["--verbose", "-v"],
description: 'Enable verbose mode: verbosity level "debug"',
},
{
name: "--silent",
description: 'Enable silent mode: verbosity level "silent"',
},
{
name: "--stack-root",
description:
"Absolute path to the global stack root directory (Overrides any STACK_ROOT environment variable)",
},
{
name: "--work-dir",
description:
"Relative path of work directory (Overrides any STACK_WORK environment variable, default is '.stack-work')",
},
{
name: "--system-ghc",
description:
"Enable using the system installed GHC (on the PATH) if it is available and its version matches. Disabled by default",
},
{
name: "--no-system-ghc",
description:
"Disable using the system installed GHC (on the PATH) if it is available and its version matches. Disabled by default",
exclusiveOn: ["--system-ghc"],
},
{
name: "--install-ghc",
description:
"Enable downloading and installing GHC if necessary (can be done manually with stack setup). Enabled by default)",
},
{
name: "--no-install-ghc",
description:
"Disable downloading and installing GHC if necessary (can be done manually with stack setup). Enabled by default",
exclusiveOn: ["--install-ghc"],
},
{
name: "--ghc-variant",
description:
"Specialized GHC variant, e.g. integersimple (incompatible with --system-ghc)",
},
{
name: "--ghc-build",
description:
"Specialized GHC build, e.g. 'gmp4' or 'standard' (usually auto-detected)",
},
{
name: ["--jobs", "-j"],
description:
"Number of concurrent jobs to run. Should be provied as ARGS",
},
{
name: "--extra-include-dirs",
description: "Extra directories to check for C header files",
},
{
name: "--extra-lib-dir",
description: "Extra directories to check for libraries",
},
{
name: "--custom-preprocessor-extensions",
description: "Extensions used for custom preprocessors",
},
{
name: ["--color", "--colour"],
description: "Specify when to use color in output",
args: {
name: "WHEN",
suggestions: ["always", "never", "auto"],
default: "never",
description:
"WHEN is 'always', 'never', or 'auto'. On Windows versions before Windows 10, for terminals that do not support color codes, the default is 'never'; color may work on terminals that support color codes",
},
},
{
name: "--compiler",
description: "Use the specified compiler",
args: {
name: "COMPILER",
},
},
{
name: "--terminal",
description:
"Enable overriding terminal detection in the case of running in a false terminal",
},
{
name: "--no-terminal",
description:
"Disable overriding terminal detection in the case of running in a false terminal",
exclusiveOn: ["--teminal"],
},
{
name: ["--stack-colors", "--stack-colours"],
description: "Specify stack's output styles",
args: {
name: "STYLE",
description:
"It a colon-delimited sequence of key=value, where 'key' is a style name and 'value' is a semicolon-delimited list of 'ANSI' SGR (Select Graphic Rendition) control codes (in decimal). Use 'stack ls stack-colors --basic' to see the current sequence. In shells where a semicolon is a command separator, enclose STYLES in quotes",
},
},
{
name: "--terminal-width",
description:
"Specify the width of the terminal, used for pretty-print messages",
args: {
name: "INT",
},
},
{
name: "--stack-yaml",
description:
"Override project stack.yaml file (overrides any STACK_YAML environment variable)",
args: {
name: "STACK-YAML",
},
},
{
name: "--lock-file",
description: "Specify how to interact with lock files",
args: {
name: "ARG",
description:
"Default: read/write. If resolver is overridden: read-only",
},
},
],
subcommands: [
{
name: "build",
description:
"Build the package(s) in the current directory/configuration",
options: [
{
name: "--resolver",
description: "Override resolver in project file",
args: {
name: "RESOLVER",
},
},
{
name: "--bench",
description: "Override resolver in project file",
},
{
name: "--test",
description: "Run complete test suite",
},
{
name: "--copy-bins",
description:
"Enable copying any generated executables to the local bin path (default: disabled)",
},
{
name: "--no-copy-bins",
description:
"Disable copying any generated executables to the local bin path (default: disabled)",
exclusiveOn: ["--no-copy-bins"],
},
{
name: "--haddock",
description:
"Enable generating Haddocks the package(s) in this directory/configuration (default: disabled)",
},
{
name: "--no-haddock",
description:
"Disable generating Haddocks the package(s) in this directory/configuration (default: disabled)",
exclusiveOn: ["--no-haddock"],
},
{ name: "--open", description: "Enable opening the local Haddock" },
{ name: "--no-open", description: "Disable opening the local Haddock" },
{
name: "--haddock-deps",
description:
"Enable building Haddocks for dependencies (default: true if building Haddocks, false otherwise)",
},
{
name: "--no-haddock-deps",
description:
"Disable building Haddocks for dependencies (default: true if building Haddocks, false otherwise)",
exclusiveOn: ["--haddock-deps"],
},
{
name: "--pedantic",
description: "Turn on all warnings(-Wall) and errors(-Werror)",
},
{
name: "--only-locals",
description:
"Only build packages in the local database, fail if the build plan includes the snapshot database",
},
{
name: "--file-watch",
description:
"Watch for changes in the files used to build the project, and kick off a new build when new changes are saved",
},
{
name: "--watch-all",
description: "Watch all local files not taking targets into account",
},
{
name: "-file-watch-poll",
description:
"Like --file-watch, but polling the filesystem instead of using events",
},
{
name: "--only-snapshot",
description:
"Only build packages for the snapshot database, not the local database",
},
{
name: "--only-configure",
description:
"Only perform the configure step, not any builds. Intended for tool usage, may break when used on multiple packages at once!",
},
{
name: "--trace",
description:
"Enable profiling in libraries, executables, etc. for all expressions and generate a backtrace on exception",
},
{
name: "--profile",
description:
"Runs profiling in libraries, executables, etc. for all expressions and generate a profiling report in tests or benchmarks",
},
{
name: "--no-strip",
description:
"Disable DWARF debugging symbol stripping in libraries, executables, etc. for all expressions, producing larger executables but allowing the use of standard debuggers/profiling tools/other utilities that use debugging symbols",
},
{
name: "--library-profiling",
description:
"Enable library profiling for TARGETs and all its dependencies (default: disabled)",
},
{
name: "--no-library-profiling",
description:
"Disable library profiling for TARGETs and all its dependencies (default: disabled)",
},
{
name: "--executable-profiling",
description:
"Enable executable profiling for TARGETs and all its dependencies (default: disabled)",
},
{
name: "--no-executable-profiling",
description:
"Disable executable profiling for TARGETs and all its dependencies (default: disabled)",
exclusiveOn: ["--executable-profiling"],
},
{
name: "--library-stripping",
description:
"Enable library stripping for TARGETs and all its dependencies (default: enabled",
},
{
name: "--no-library-stripping",
description:
"Disable library stripping for TARGETs and all its dependencies (default: enabled",
exclusiveOn: ["--library-stripping"],
},
{
name: "--executable-stripping",
description:
"Enable executable stripping for TARGETs and all its dependencies (default: enabled)",
},
{
name: "--no-executable-stripping",
description:
"Disable executable stripping for TARGETs and all its dependencies (default: enabled)",
exclusiveOn: ["--executable-stripping"],
},
{
name: "--ghc-options",
description:
"Specify additional options passed to GHC for all local targets. Does not affect extra-dep and snapshot packages at all",
args: {},
},
],
},
{
name: "install",
description:
"Builds the package in current directory and copies it as an executable for system wide usage. Shortcut for 'build --copy-bins",
},
{
name: "test",
description: "Shortcut for 'build --test'",
},
{
name: "bench",
description: "Shortcut for 'build --bench'",
},
{
name: "haddock",
description: "Shortcut for 'build --haddock'",
},
{
name: "new",
description:
"Create a new project from a template. Run `stack templates' to see available templates. Note: you can also specify a local file or a remote URL as a template",
},
{
name: "templates",
description:
"Show how to find templates available for `stack new'. `stack new' can accept a template from a remote repository (default: github), local file or remote URL. Note: this downloads the help file",
},
{
name: "init",
description:
"Create stack project config from cabal or hpack package specifications'",
},
{
name: "setup",
description: "Get the appropriate GHC for your project",
},
{
name: "path",
description: "Print out handy path information",
},
{
name: "ls",
description:
"List command. Supports snapshots, dependencies and stack's styles",
},
{
name: "unpack",
description: "Unpack one or more packages locally",
},
{
name: "update",
description: "Update the package index",
},
{
name: "upgrade",
description: "Upgrade to the latest stack version",
},
{
name: "upload",
description: "Upload a package to Hackage",
},
{
name: "sdist",
description: "Create source distribution tarballs",
},
{
name: "dot",
description:
"Visualize your project's dependency graph using Graphviz dot",
},
{
name: "hoogle",
description:
"Run hoogle, the Haskell API search engine. Use the '-- ARGUMENT(S)' syntax to pass Hoogle arguments, e.g. stack hoogle -- --count=20, or stack hoogle --server --local",
},
{
name: "exec",
description:
"Execute a command. If the command is absent, the first of any arguments is taken as the command",
options: [
{
name: "--snapshot-location-base",
description: "The base location of LTS/Nightly snapshots",
args: {
name: "URL",
},
},
{
name: "--cwd",
description:
"Sets the working directory before executing the command",
args: {
name: "DIR",
},
},
{
name: "--setup-info-yaml",
description:
"Alternate URL or relative / absolute path for stack dependencies",
args: {
name: "URL",
},
},
{
name: "--ghc-package-path",
description:
"Enable setting the GHC_PACKAGE_PATH variable for the subprocess (default: enabled)",
},
{
name: "--no-ghc-package-path",
description:
"Disable setting the GHC_PACKAGE_PATH variable for the subprocess (default: enabled)",
},
{
name: "--package",
description: "Additional package(s) that must be installed",
args: {
name: "PACKAGE(S)",
},
},
{
name: "--stack-exe",
description:
"Enable setting the STACK_EXE environment variable to the path for the stack executable (default: enabled)",
},
{
name: "--no-stack-exe",
description:
"Disable setting the STACK_EXE environment variable to the path for the stack executable (default: enabled)",
},
],
},
{
name: "run",
description:
"Build and run an executable. Defaults to the first available executable if none is provided as the first argument",
},
{ name: "repl", description: "Load a REPL" },
],
};
export default completionSpec;