From c23200971f90c80fadded9e18d10e342fe51bd27 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 06:30:35 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes (attempt 3/3) --- cli/assets/fig.ts | 257 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 256 insertions(+), 1 deletion(-) diff --git a/cli/assets/fig.ts b/cli/assets/fig.ts index 8fc3b8b..4239e9a 100644 --- a/cli/assets/fig.ts +++ b/cli/assets/fig.ts @@ -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;