forked from withfig/autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmake.ts
831 lines (830 loc) · 23.4 KB
/
cmake.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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
const completion: Fig.Spec = {
name: "cmake",
description:
"Command-line interface of the cross-platform buildsystem generator CMake",
subcommands: [
{
name: "--build",
description:
"Project binary directory to be built and must be first. This is required unless a preset is specified",
args: {
name: "dir",
template: "folders",
isOptional: true,
},
options: [
{
name: "--preset",
description: "Use a build preset to specify build options",
args: {
name: "preset",
},
},
{
name: "--list-presets",
description:
"Lists the available presets. If no option is specified only configure presets will be listed. The current working directory must contain CMake preset files",
},
{
name: ["--parallel", "-j"],
description:
"The maximum number of concurrent processes to use when building. If <jobs> is omitted the native build tool's default number is used",
args: {
name: "jobs",
isOptional: true,
},
},
{
name: ["--target", "-t"],
description:
"Build <tgt> instead of the default target. Multiple targets may be given, separated by spaces",
args: {
name: "target",
isVariadic: true,
},
},
{
name: "--config",
description:
"For multi-configuration tools, choose configuration <cfg>",
args: {
name: "cfg",
},
},
{
name: "--clean-first",
description: "Build target clean first, then build",
},
{
name: "--use-stderr",
description: "Ignored. Behavior is default in CMake >= 3.0",
},
{
name: ["--verbose", "-v"],
description:
"Enable verbose output - if supported - including the build commands to be executed",
},
{
name: "--",
description: "Pass remaining options to the native tool",
},
],
},
{
name: "--install",
description:
"Project binary directory to install. This is required and must be first",
args: {
name: "dir",
template: "folders",
},
options: [
{
name: "--config",
description: "For multi-configuration generators",
args: {
name: "cfg",
},
},
{
name: "--component",
description:
"Component-based install. Only install component specified",
args: {
name: "cfg",
},
},
{
name: "--default-directory-permissions",
description: "Default directory install permissions",
args: {
name: "permissions",
description: "Format: <u=rwx,g=rx,o=rx>",
},
},
{
name: "--prefix",
description: "Override the installation prefix",
args: {
name: "prefix",
},
},
{
name: "--strip",
description: "Strip before installing",
},
{
name: ["--verbose", "-v"],
description: "Enable verbose output",
},
],
},
{
name: "--open",
description:
"Open the generated project in the associated application. This is only supported by some generators",
args: {
name: "dir",
template: "folders",
},
},
{
name: "-P",
description:
"Process the given cmake file as a script written in the CMake language. No configure or generate step is performed and the cache is not modified. If variables are defined using -D, this must be done before the -P argument",
args: {
name: "cmake script file",
template: "filepaths",
},
},
{
name: "-E",
description:
"CMake provides builtin command-line tools through the signature",
subcommands: [
{
name: "capabilities",
description:
"Report cmake capabilities in JSON format. The output is a JSON object with the following keys",
},
{
name: "cat",
description: "Concatenate files and print on the standard output",
args: {
name: "files",
template: "filepaths",
isVariadic: true,
},
},
{
name: "chdir",
description: "Change the current working directory and run a command",
args: [
{
name: "dir",
template: "folders",
},
{
name: "command",
},
],
},
{
name: "compare_files",
description:
"Check if file1 is the same as file2. If fails are the same, then returns 0, if not returns 1. In case of invalid arguments, it returns 2",
args: [
{
name: "file1",
template: "filepaths",
},
{
name: "file2",
template: "filepaths",
},
],
options: [
{
name: "--ignore-eol",
description:
"Implies line-wise comparison and ignores LF/CRLF differences",
},
],
},
{
name: "copy",
description:
"Copy files to <destination> (either file or directory). If multiple files are specified, the <destination> must be directory and it must exist. Wildcards are not supported. copy does follow symlinks. That means it does not copy symlinks, but the files or directories it point to",
args: [
{
name: "file",
template: "filepaths",
isVariadic: true,
},
{
name: "destination",
template: "folders",
},
],
},
{
name: "copy_directory",
description:
"Copy content of <dir>... directories to <destination> directory. If <destination> directory does not exist it will be created. copy_directory does follow symlinks",
args: [
{
name: "dir",
template: "folders",
isVariadic: true,
},
{
name: "destination",
template: "folders",
},
],
},
{
name: "copy_if_different",
description:
"Copy files to <destination> (either file or directory) if they have changed. If multiple files are specified, the <destination> must be directory and it must exist. copy_if_different does follow symlinks",
args: [
{
name: "file",
template: "filepaths",
isVariadic: true,
},
{
name: "destination",
template: "folders",
},
],
},
{
name: "create_symlink",
description: "Create a symbolic link <new> naming <old>",
args: [
{
name: "old",
},
{
name: "new",
},
],
},
{
name: "create_hardlink",
description: "Create a hard link <new> naming <old>",
args: [
{
name: "old",
},
{
name: "new",
},
],
},
{
name: "echo",
description: "Displays arguments as text",
args: {
name: "string",
isOptional: true,
},
},
{
name: "echo_append",
description: "Displays arguments as text but no new line",
args: {
name: "string",
isOptional: true,
},
},
{
name: "env",
description: "Run command in a modified environment",
args: [
{
name: "key value pair",
description: "Format: NAME=VALUE",
isOptional: true,
isVariadic: true,
},
{
name: "command",
},
],
options: [
{
name: "--unset",
args: {
name: "name",
},
},
],
},
{
name: "environment",
description: "Display the current environment variables",
},
{
name: "false",
description: "Do nothing, with an exit code of 1",
},
{
name: "make_directory",
description:
"Create <dir> directories. If necessary, create parent directories too. If a directory already exists it will be silently ignored",
args: {
name: "dir",
template: "folders",
isVariadic: true,
},
},
{
name: "md5sum",
description:
"Create MD5 checksum of files in md5sum compatible format",
args: {
name: "file",
template: "filepaths",
isVariadic: true,
},
},
{
name: "sha1sum",
description:
"Create SHA1 checksum of files in sha1sum compatible format",
args: {
name: "file",
template: "filepaths",
isVariadic: true,
},
},
{
name: "sha224sum",
description:
"Create SHA224 checksum of files in sha224sum compatible format",
args: {
name: "file",
template: "filepaths",
isVariadic: true,
},
},
{
name: "sha226sum",
description:
"Create SHA226 checksum of files in sha226sum compatible format",
args: {
name: "file",
template: "filepaths",
isVariadic: true,
},
},
{
name: "sha384sum",
description:
"Create SHA384 checksum of files in sha384sum compatible format",
args: {
name: "file",
template: "filepaths",
isVariadic: true,
},
},
{
name: "sha512sum",
description:
"Create SHA512 checksum of files in sha512sum compatible format",
args: {
name: "file",
template: "filepaths",
isVariadic: true,
},
},
{
name: "remove",
description:
"Remove the file(s). The planned behavior was that if any of the listed files already do not exist, the command returns a non-zero exit code, but no message is logged",
args: {
name: "file",
template: "filepaths",
isVariadic: true,
},
options: [
{
name: "-f",
description:
"The -f option changes the behavior to return a zero exit code (i.e. success) in such situations instead. remove does not follow symlinks. That means it remove only symlinks and not files it point to",
},
],
},
{
name: "remove_directory",
description:
"Remove <dir> directories and their contents. If a directory does not exist it will be silently ignored. If <dir> is a symlink to a directory, just the symlink will be removed. Use rm instead",
args: {
name: "dir",
template: "folders",
isVariadic: true,
},
},
{
name: "rm",
description: "Remove the files <file> or directories dir",
args: [
{
name: "file",
template: "filepaths",
isVariadic: true,
},
{
name: "dir",
template: "folders",
isVariadic: true,
},
],
options: [
{
name: ["-r", "-R"],
description:
"Use -r or -R to remove directories and their contents recursively. If any of the listed files/directories do not exist, the command returns a non-zero exit code, but no message is logged",
},
{
name: "-f",
description:
"The -f option changes the behavior to return a zero exit code (i.e. success) in such situations instead",
},
],
},
{
name: "server",
description: "Launch cmake-server(7) mode",
},
{
name: "sleep",
description: "Sleep for given number of seconds",
args: {
name: "number",
isVariadic: true,
},
},
{
name: "tar",
description: "Create or extract a tar or zip archive",
options: [
{
name: "c",
description:
"Create a new archive containing the specified files. If used, the pathname argument is mandatory",
},
{
name: "x",
description:
"Extract to disk from the archive. The <pathname>... argument could be used to extract only selected files or directories. When extracting selected files or directories, you must provide their exact names including the path, as printed by list (-t)",
},
{
name: "t",
description:
"List archive contents. The <pathname>... argument could be used to list only selected files or directories",
},
{
name: "v",
description: "Produce verbose output",
},
{
name: "z",
description: "Compres the resulting archive with gzip",
},
{
name: "j",
description: "Compress the resulting archive with bzip2",
},
{
name: "J",
description: "Compress the resulting archive with XZ",
},
{
name: "--zstd",
description: "Compress the resulting archive with Zstandard",
},
{
name: "--files-from",
description:
"Read file names from the given file, one per line. Blank lines are ignored. Lines may not start in - except for --add-file=<name> to add files whose names start in -",
args: {
name: "file",
template: "filepaths",
},
},
{
name: "--format",
description: "Specify the format of the archive to be created",
args: {
name: "format",
suggestions: ["7zip", "gnutar", "pax", "paxr", "zip"],
},
},
{
name: "--mtime",
description:
"Specify modification time recorded in tarball entries",
args: {
name: "date",
},
},
{
name: "--",
description:
"Stop interpreting options and treat all remaining arguments as file names, even if they start with -",
},
],
args: {
name: "pathname",
isOptional: true,
},
},
{
name: "time",
description: "Run command and display elapsed time",
args: {
name: "command",
isCommand: true,
},
},
{
name: "touch",
description:
"Creates <file> if file do not exist. If <file> exists, it is changing <file> access and modification times",
args: {
name: "file",
template: "filepaths",
isVariadic: true,
},
},
{
name: "touch_nocreate",
description:
"Touch a file if it exists but do not create it. If a file does not exist it will be silently ignored",
args: {
name: "file",
template: "filepaths",
isVariadic: true,
},
},
{
name: "true",
description: "Do nothing, with an exit code of 0",
},
],
},
],
options: [
{
name: "-S",
description: "Path to root directory of the CMake project to build",
args: {
name: "path-to-source",
template: "folders",
},
},
{
name: "--help",
},
{
name: "-B",
description:
"Path to directory which CMake will use as the root of build directory. If the directory doesn't already exist CMake will make it",
args: {
name: "path-to-source",
template: "folders",
},
},
{
name: "-C",
description: "Pre-load a script to populate the cache",
args: {
name: "initial-cache",
template: "filepaths",
},
},
{
name: "-D",
description: "Create or update a CMake CACHE entry",
args: {
name: "key value pair",
description: "<var>:<type>=<value> or <var>=<value>",
},
},
{
name: "-U",
description: "Remove matching entries from CMake CACHE",
args: {
name: "globbing_expr",
},
},
{
name: "-G",
description: "Specify a build system generator",
args: {
name: "generator-name",
},
},
{
name: "-T",
description: "Toolset specification for the generator, if supported",
args: {
name: "toolset-spec",
},
},
{
name: "-A",
description: "Specify platform name if supported by generator",
args: {
name: "platform-name",
},
},
{
name: "toolchain",
description:
"Specify the cross compiling toolchain file, equivalent to setting CMAKE_TOOLCHAIN_FILE variable",
args: {
name: "path-to-file",
template: "filepaths",
},
},
{
name: "--install-prefix",
description:
"Specify the installation directory, used by the CMAKE_INSTALL_PREFIX variable. Must be an absolute path",
args: {
name: "directory",
template: "folders",
},
},
{
name: "-Wno-dev",
description: "Suppress developer warnings",
},
{
name: "-Wdev",
description: "Enable developer warnings",
},
{
name: "-Werror",
description: "Enable the type of warnings",
insertValue: "-Werror={cursor}",
args: {
name: "type",
suggestions: [
{
name: "dev",
description: "Make developer warnings errors",
},
{
name: "deprecated",
description: "Make deprecated macro and function warnings errors",
},
],
},
},
{
name: "-Wno-error",
description: "Disable the type of warnings",
insertValue: "-Wno-error={cursor}",
args: {
name: "type",
suggestions: [
{
name: "dev",
description: "Make developer warnings not errors",
},
{
name: "deprecated",
description:
"Make deprecated macro and function warnings not errors",
},
],
},
},
{
name: "-Wdeprecated",
description: "Enable deprecated functionality warnings",
},
{
name: "-Wno-deprecated",
description: "Suppress deprecated functionality warnings",
},
{
name: "-L",
description: "List non-advanced cached-variables",
},
{
name: "-N",
description: "View mode only",
},
{
name: "--graphviz",
description: "Generate graphviz of dependencies",
args: {
name: "file",
template: "filepaths",
isOptional: true,
},
},
{
name: "--system-information",
description: "Dump information about this system",
args: {
name: "file",
template: "filepaths",
isOptional: true,
},
},
{
name: "--log-level",
description: "Set log-level",
args: {
name: "log-level",
suggestions: [
"ERROR",
"WARNING",
"NOTICE",
"STATUS",
"VERBOSE",
"DEBUG",
"TRACE",
],
},
},
{
name: "--log-context",
description:
"Enable the message() command outputting context attached to each message",
},
{
name: "--debug-trycompile",
description: "Do not delete the try_compile() build tree",
},
{
name: "--debug-output",
description: "Put cmake in a debug mode",
},
{
name: "--debug-find",
description: "Put cmake find commands in a debug mode",
},
{
name: "--trace",
description: "Put cmake in trace mode",
},
{
name: "--trace-expand",
description: "Put cmake in trace mode with variables expanded",
},
{
name: "--trace-format",
description: "Put cmake in trace mode and sets the trace output format",
args: {
name: "format",
suggestions: ["human", "json-v1"],
},
},
{
name: "--trace-source",
description:
"Put cmake in trace mode, but output only lines of a specified file",
args: {
name: "file",
template: "filepaths",
},
},
{
name: "--trace-redirect",
description:
"Put cmake in trace mode and redirect trace output to a file instead of stderr",
args: {
name: "file",
template: "filepaths",
},
},
{
name: "--warn-uninitialized",
description: "Warn about uninitialized values",
},
{
name: "--warn-unused-vars",
description:
"Does nothing. In CMake versions 3.2 and below this enabled warnings about unused variables. In CMake versions 3.3 through 3.18 the option was broken. In CMake 3.19 and above the option has been removed",
},
{
name: "--no-warn-unused-cli",
description:
"Don't warn about command line options. Don't find variables that are declared on the command line, but not used",
},
{
name: "--check-system-vars",
description: "Find problems with variable usage in system files",
},
{
name: "--preset",
description:
"Reads a preset from <path-to-source>/CMakePresets.json and <path-to-source>/CMakeUserPresets.json. The preset may specify the generator and the build directory, and a list of variables and other arguments to pass to CMake. The current working directory must contain CMake preset files. The CMake GUI can also recognize CMakePresets.json and CMakeUserPresets.json files",
args: {
name: "preset",
},
},
{
name: "--list-presets",
description: "Lists the available presets",
args: {
name: "type",
isOptional: true,
suggestions: ["configure", "build", "test", "all"],
},
},
],
args: {
name: "path-to-source | path-to-existing-build",
template: "folders",
},
};
export default completion;