Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes (attempt 3/3)
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Jan 3, 2025
1 parent 39bc28e commit c232009
Showing 1 changed file with 256 additions and 1 deletion.
257 changes: 256 additions & 1 deletion cli/assets/fig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,262 @@ const completionGeneratorTemplate = (
};

const completionSpec: Fig.Spec = {
name: "",
name: "usage",
subcommands: [
{
name: "bash",
description: "Executes a bash script",
options: [
{
name: "-h",
description: "Show help",
isRepeatable: false,
},
{
name: "--help",
description: "Show help",
isRepeatable: false,
},
],
args: [
{
name: "script",
},
{
name: "args",
description: "Arguments to pass to script",
isOptional: true,
isVariadic: true,
},
],
},
{
name: ["complete-word", "cw"],
options: [
{
name: "--shell",
isRepeatable: false,
args: {
name: "shell",
suggestions: ["bash", "fish", "zsh"],
},
},
{
name: ["-f", "--file"],
description: "Usage spec file or script with usage shebang",
isRepeatable: false,
args: {
name: "file",
template: "filepaths",
},
},
{
name: ["-s", "--spec"],
description: "Raw string spec input",
isRepeatable: false,
args: {
name: "spec",
},
},
{
name: "--cword",
description: "Current word index",
isRepeatable: false,
args: {
name: "cword",
},
},
],
args: {
name: "words",
description: "User's input from the command line",
isOptional: true,
isVariadic: true,
},
},
{
name: ["generate", "g"],
subcommands: [
{
name: ["completion", "c"],
options: [
{
name: "--cache-key",
description:
"A cache key to use for storing the results of calling the CLI with --usage-cmd",
isRepeatable: false,
args: {
name: "cache_key",
},
},
{
name: ["-f", "--file"],
description:
"A .usage.kdl spec file to use for generating completions",
isRepeatable: false,
args: {
name: "file",
template: "filepaths",
},
},
{
name: "--usage-bin",
description:
"Override the bin used for calling back to usage-cli",
isRepeatable: false,
args: {
name: "usage_bin",
},
},
{
name: "--usage-cmd",
description:
'A command which generates a usage spec e.g.: `mycli --usage` or `mycli completion usage` Defaults to "$bin --usage"',
isRepeatable: false,
args: {
name: "usage_cmd",
},
},
{
name: "--include-bash-completion-lib",
description: "Include https://github.com/scop/bash-completion",
isRepeatable: false,
},
],
args: [
{
name: "shell",
suggestions: ["bash", "fish", "zsh"],
},
{
name: "bin",
description: "The CLI which we're generates completions for",
},
],
},
{
name: "fig",
options: [
{
name: ["-f", "--file"],
description: "A usage spec taken in as a file",
isRepeatable: false,
args: {
name: "file",
template: "filepaths",
},
},
{
name: "--spec",
description: "Raw string spec input",
isRepeatable: false,
args: {
name: "spec",
},
},
{
name: "--out-file",
description: "File on where to save the generated Fig spec",
isRepeatable: false,
args: {
name: "out_file",
template: "filepaths",
},
},
],
},
{
name: "json",
description: "Outputs a usage spec in json format",
options: [
{
name: ["-f", "--file"],
description: "A usage spec taken in as a file",
isRepeatable: false,
args: {
name: "file",
template: "filepaths",
},
},
{
name: "--spec",
description: "Raw string spec input",
isRepeatable: false,
args: {
name: "spec",
},
},
],
},
{
name: ["markdown", "md"],
options: [
{
name: ["-f", "--file"],
description: "A usage spec taken in as a file",
isRepeatable: false,
args: {
name: "file",
template: "filepaths",
},
},
{
name: ["-m", "--multi"],
description: "Render each subcommand as a separate markdown file",
isRepeatable: false,
},
{
name: "--url-prefix",
description: "Prefix to add to all URLs",
isRepeatable: false,
args: {
name: "url_prefix",
},
},
{
name: "--html-encode",
description: "Escape HTML in markdown",
isRepeatable: false,
},
{
name: "--replace-pre-with-code-fences",
isRepeatable: false,
},
{
name: "--out-dir",
description: "Output markdown files to this directory",
isRepeatable: false,
args: {
name: "out_dir",
template: "folders",
},
},
{
name: "--out-file",
isRepeatable: false,
args: {
name: "out_file",
template: "filepaths",
},
},
],
},
],
},
],
options: [
{
name: "--usage-spec",
description: "Outputs a `usage.kdl` spec for this CLI itself",
isRepeatable: false,
},
],
args: {
name: "completions",
description:
"Outputs completions for the specified shell for completing the `usage` CLI itself",
isOptional: true,
},
};

export default completionSpec;

0 comments on commit c232009

Please sign in to comment.