mirror of
https://github.com/clap-rs/clap
synced 2024-12-15 07:12:32 +00:00
36bc641648
This is an intermediate solution for #4408. As there were no agreeed upon goals, I went with what I felt read well and that I saw commonly used on non-clap commands. - "information" isn't really a necessary word. - I originally favored `Print this help` but realied that doesn't read correctly in completions. - Besides being shorter, the reason for the flipped short/long hint is it gives people the context they need for scanning, emphasizing "summary" and "more". Fixes #4409
133 lines
2.3 KiB
JavaScript
133 lines
2.3 KiB
JavaScript
const completion: Fig.Spec = {
|
|
name: "my-app",
|
|
description: "",
|
|
options: [
|
|
{
|
|
name: "--choice",
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "choice",
|
|
isOptional: true,
|
|
suggestions: [
|
|
"bash",
|
|
"fish",
|
|
"zsh",
|
|
],
|
|
},
|
|
},
|
|
{
|
|
name: "--unknown",
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "unknown",
|
|
isOptional: true,
|
|
},
|
|
},
|
|
{
|
|
name: "--other",
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "other",
|
|
isOptional: true,
|
|
},
|
|
},
|
|
{
|
|
name: ["-p", "--path"],
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "path",
|
|
isOptional: true,
|
|
template: "filepaths",
|
|
},
|
|
},
|
|
{
|
|
name: ["-f", "--file"],
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "file",
|
|
isOptional: true,
|
|
template: "filepaths",
|
|
},
|
|
},
|
|
{
|
|
name: ["-d", "--dir"],
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "dir",
|
|
isOptional: true,
|
|
template: "folders",
|
|
},
|
|
},
|
|
{
|
|
name: ["-e", "--exe"],
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "exe",
|
|
isOptional: true,
|
|
template: "filepaths",
|
|
},
|
|
},
|
|
{
|
|
name: "--cmd-name",
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "cmd_name",
|
|
isOptional: true,
|
|
isCommand: true,
|
|
},
|
|
},
|
|
{
|
|
name: ["-c", "--cmd"],
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "cmd",
|
|
isOptional: true,
|
|
isCommand: true,
|
|
},
|
|
},
|
|
{
|
|
name: ["-u", "--user"],
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "user",
|
|
isOptional: true,
|
|
},
|
|
},
|
|
{
|
|
name: ["-H", "--host"],
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "host",
|
|
isOptional: true,
|
|
},
|
|
},
|
|
{
|
|
name: "--url",
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "url",
|
|
isOptional: true,
|
|
},
|
|
},
|
|
{
|
|
name: "--email",
|
|
isRepeatable: true,
|
|
args: {
|
|
name: "email",
|
|
isOptional: true,
|
|
},
|
|
},
|
|
{
|
|
name: ["-h", "--help"],
|
|
description: "Print help",
|
|
},
|
|
],
|
|
args: {
|
|
name: "command_with_args",
|
|
isVariadic: true,
|
|
isOptional: true,
|
|
isCommand: true,
|
|
},
|
|
};
|
|
|
|
export default completion;
|