2022-03-07 20:08:56 +00:00
|
|
|
const completion: Fig.Spec = {
|
|
|
|
name: "my-app",
|
|
|
|
description: "Tests completions",
|
|
|
|
subcommands: [
|
|
|
|
{
|
|
|
|
name: "test",
|
|
|
|
description: "tests things",
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: "--case",
|
|
|
|
description: "the case to test",
|
2022-07-22 18:37:18 +00:00
|
|
|
isRepeatable: true,
|
2022-03-07 20:08:56 +00:00
|
|
|
args: {
|
|
|
|
name: "case",
|
|
|
|
isOptional: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: ["-h", "--help"],
|
2023-01-03 16:49:43 +00:00
|
|
|
description: "Print help",
|
2022-03-07 20:08:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: ["-V", "--version"],
|
2023-01-03 16:49:43 +00:00
|
|
|
description: "Print version",
|
2022-03-07 20:08:56 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "some_cmd",
|
|
|
|
description: "tests other things",
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: "--config",
|
|
|
|
description: "the other case to test",
|
2022-03-17 20:35:52 +00:00
|
|
|
hidden: true,
|
2022-07-22 18:37:18 +00:00
|
|
|
isRepeatable: true,
|
2022-03-18 13:46:20 +00:00
|
|
|
requiresEquals: true,
|
2022-03-07 20:08:56 +00:00
|
|
|
args: {
|
|
|
|
name: "config",
|
|
|
|
isOptional: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: ["-h", "--help"],
|
2023-01-03 16:49:43 +00:00
|
|
|
description: "Print help",
|
2022-03-07 20:08:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: ["-V", "--version"],
|
2023-01-03 16:49:43 +00:00
|
|
|
description: "Print version",
|
2022-03-07 20:08:56 +00:00
|
|
|
},
|
|
|
|
],
|
2022-03-17 20:35:52 +00:00
|
|
|
args: {
|
|
|
|
name: "path",
|
2022-06-07 18:48:48 +00:00
|
|
|
isVariadic: true,
|
2022-03-17 20:35:52 +00:00
|
|
|
isOptional: true,
|
|
|
|
},
|
2022-03-07 20:08:56 +00:00
|
|
|
},
|
|
|
|
{
|
2022-03-20 20:06:19 +00:00
|
|
|
name: ["some-cmd-with-hyphens", "hyphen"],
|
2022-03-07 20:08:56 +00:00
|
|
|
options: [
|
|
|
|
{
|
2022-03-17 20:35:52 +00:00
|
|
|
name: ["-h", "--help"],
|
2023-01-03 16:49:43 +00:00
|
|
|
description: "Print help",
|
2022-03-17 20:35:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: ["-V", "--version"],
|
2023-01-03 16:49:43 +00:00
|
|
|
description: "Print version",
|
2022-03-17 20:35:52 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "some-hidden-cmd",
|
|
|
|
hidden: true,
|
|
|
|
options: [
|
|
|
|
{
|
2022-03-07 20:08:56 +00:00
|
|
|
name: ["-h", "--help"],
|
2023-01-03 16:49:43 +00:00
|
|
|
description: "Print help",
|
2022-03-07 20:08:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: ["-V", "--version"],
|
2023-01-03 16:49:43 +00:00
|
|
|
description: "Print version",
|
2022-03-07 20:08:56 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "help",
|
|
|
|
description: "Print this message or the help of the given subcommand(s)",
|
2022-08-25 05:44:07 +00:00
|
|
|
subcommands: [
|
|
|
|
{
|
|
|
|
name: "test",
|
|
|
|
description: "tests things",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "some_cmd",
|
|
|
|
description: "tests other things",
|
|
|
|
},
|
|
|
|
{
|
2022-08-25 22:23:04 +00:00
|
|
|
name: "some-cmd-with-hyphens",
|
2022-08-25 05:44:07 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "some-hidden-cmd",
|
2022-08-26 19:57:10 +00:00
|
|
|
hidden: true,
|
2022-08-25 05:44:07 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "help",
|
|
|
|
description: "Print this message or the help of the given subcommand(s)",
|
|
|
|
},
|
|
|
|
],
|
2022-03-07 20:08:56 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
options: [
|
2022-08-08 21:08:47 +00:00
|
|
|
{
|
|
|
|
name: ["-c", "-C", "--config", "--conf"],
|
|
|
|
description: "some config file",
|
|
|
|
isRepeatable: true,
|
|
|
|
},
|
2022-03-07 20:08:56 +00:00
|
|
|
{
|
|
|
|
name: ["-h", "--help"],
|
2023-01-03 16:49:43 +00:00
|
|
|
description: "Print help",
|
2022-03-07 20:08:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: ["-V", "--version"],
|
2023-01-03 16:49:43 +00:00
|
|
|
description: "Print version",
|
2022-03-07 20:08:56 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
args: [
|
2022-03-17 20:32:28 +00:00
|
|
|
{
|
|
|
|
name: "file",
|
|
|
|
isOptional: true,
|
|
|
|
template: "filepaths",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "choice",
|
|
|
|
isOptional: true,
|
|
|
|
suggestions: [
|
|
|
|
"first",
|
|
|
|
"second",
|
|
|
|
],
|
|
|
|
},
|
2022-03-07 20:08:56 +00:00
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
export default completion;
|