• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1const completion: Fig.Spec = {
2  name: "my-app",
3  description: "Tests completions",
4  subcommands: [
5    {
6      name: "test",
7      description: "tests things",
8      options: [
9        {
10          name: "--case",
11          description: "the case to test",
12          isRepeatable: true,
13          args: {
14            name: "case",
15            isOptional: true,
16          },
17        },
18        {
19          name: ["-h", "--help"],
20          description: "Print help",
21        },
22        {
23          name: ["-V", "--version"],
24          description: "Print version",
25        },
26      ],
27    },
28    {
29      name: "help",
30      description: "Print this message or the help of the given subcommand(s)",
31      subcommands: [
32        {
33          name: "test",
34          description: "tests things",
35        },
36        {
37          name: "help",
38          description: "Print this message or the help of the given subcommand(s)",
39        },
40      ],
41    },
42  ],
43  options: [
44    {
45      name: ["-c", "-C", "--config", "--conf"],
46      description: "some config file",
47      isRepeatable: true,
48    },
49    {
50      name: ["-h", "--help"],
51      description: "Print help",
52    },
53    {
54      name: ["-V", "--version"],
55      description: "Print version",
56    },
57  ],
58  args: [
59    {
60      name: "file",
61      isOptional: true,
62      template: "filepaths",
63    },
64    {
65      name: "choice",
66      isOptional: true,
67      suggestions: [
68        "first",
69        "second",
70      ],
71    },
72  ]
73};
74
75export default completion;
76