mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
More completions, fix importing for some
This commit is contained in:
769
extensions/terminal-suggest/src/completions/upstream/adb.ts
Normal file
769
extensions/terminal-suggest/src/completions/upstream/adb.ts
Normal file
@@ -0,0 +1,769 @@
|
||||
const installOptions: Fig.Option[] = [
|
||||
{
|
||||
name: "-l",
|
||||
description: "Forward-lock the app",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description: "Replace existing application",
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description: "Allow test packages",
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description: "Allow version code downgrade (debuggable packages only)",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Install on SD card instead of internal storage",
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description: "Grant all runtime permissions",
|
||||
},
|
||||
{
|
||||
description: "Override platform's default ABI",
|
||||
name: "--abi",
|
||||
args: {
|
||||
name: "ABI",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Cause the app to be installed as an ephemeral install app",
|
||||
name: "--instant",
|
||||
},
|
||||
{
|
||||
description:
|
||||
"Always push APK to device and invoke Package Manager as separate steps",
|
||||
name: "--no-streaming",
|
||||
},
|
||||
{
|
||||
description: "Force streaming APK directly into Package Manager",
|
||||
name: "--streaming",
|
||||
},
|
||||
{
|
||||
description: "Use fast deploy",
|
||||
name: "--fastdeploy",
|
||||
},
|
||||
{
|
||||
description: "Prevent use of fast deploy",
|
||||
name: "--no-fastdeploy",
|
||||
},
|
||||
{
|
||||
description: "Force update of deployment agent when using fast deploy",
|
||||
name: "--force-agent",
|
||||
},
|
||||
{
|
||||
description:
|
||||
"Update deployment agent when local version is newer and using fast deploy",
|
||||
name: "--date-check-agent",
|
||||
},
|
||||
{
|
||||
description:
|
||||
"Update deployment agent when local version has different version code and using fast deploy",
|
||||
name: "--version-check-agent",
|
||||
},
|
||||
{
|
||||
description:
|
||||
"Locate agent files from local source build (instead of SDK location)",
|
||||
name: "--local-agent",
|
||||
},
|
||||
];
|
||||
|
||||
const compressionOptions: Fig.Option[] = [
|
||||
{
|
||||
description:
|
||||
"Enable compression with a specified algorithm (any, none, brotli)",
|
||||
name: "-z",
|
||||
args: {
|
||||
name: "ALGORITHM",
|
||||
suggestions: [
|
||||
{
|
||||
name: "any",
|
||||
},
|
||||
{
|
||||
name: "none",
|
||||
},
|
||||
{
|
||||
name: "brotli",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Disable compression",
|
||||
name: "-Z",
|
||||
},
|
||||
];
|
||||
|
||||
const forwardConnectionSuggestions: Fig.Suggestion[] = [
|
||||
{
|
||||
name: "tcp",
|
||||
insertValue: "tcp:",
|
||||
},
|
||||
{
|
||||
name: "localabstract",
|
||||
insertValue: "localabstract:",
|
||||
},
|
||||
{
|
||||
name: "localreserved",
|
||||
insertValue: "localreserved:",
|
||||
},
|
||||
{
|
||||
name: "localfilesystem",
|
||||
insertValue: "localfilesystem:",
|
||||
},
|
||||
{
|
||||
name: "dev",
|
||||
insertValue: "dev:",
|
||||
},
|
||||
{
|
||||
name: "jdwp",
|
||||
insertValue: "jdwp:",
|
||||
},
|
||||
{
|
||||
name: "acceptfd",
|
||||
insertValue: "acceptfd:",
|
||||
},
|
||||
];
|
||||
|
||||
const reverseConnectionSuggestions: Fig.Suggestion[] = [
|
||||
{
|
||||
name: "tcp",
|
||||
insertValue: "tcp:",
|
||||
},
|
||||
{
|
||||
name: "localabstract",
|
||||
insertValue: "localabstract:",
|
||||
},
|
||||
{
|
||||
name: "localreserved",
|
||||
insertValue: "localreserved:",
|
||||
},
|
||||
{
|
||||
name: "localfilesystem",
|
||||
insertValue: "localfilesystem:",
|
||||
},
|
||||
];
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "adb",
|
||||
description: "Android Debug Bridge",
|
||||
subcommands: [
|
||||
{
|
||||
name: "devices",
|
||||
description: "List connected devices",
|
||||
options: [
|
||||
{
|
||||
name: "-l",
|
||||
description: "Long output",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "help",
|
||||
description: "Show this help message",
|
||||
},
|
||||
{
|
||||
name: "get-state",
|
||||
description: "Print offline | bootloader | device",
|
||||
},
|
||||
{
|
||||
name: "get-serialno",
|
||||
description: "Print <serial-number>",
|
||||
},
|
||||
{
|
||||
name: "get-devpath",
|
||||
description: "Print <device-path>",
|
||||
},
|
||||
{
|
||||
name: "remount",
|
||||
options: [
|
||||
{
|
||||
name: "-R",
|
||||
description: "Reboot device",
|
||||
},
|
||||
],
|
||||
description:
|
||||
"Remount partitions read-write. if a reboot is required, -R will automatically reboot the device",
|
||||
},
|
||||
{
|
||||
name: "jdwp",
|
||||
description: "List pids of processes hosting a JDWP transport",
|
||||
},
|
||||
{
|
||||
name: "root",
|
||||
description: "Restart adbd with root permissions",
|
||||
},
|
||||
{
|
||||
name: "unroot",
|
||||
description: "Restart adbd without root permissions",
|
||||
},
|
||||
{
|
||||
name: "usb",
|
||||
description: "Restart adbd listening on USB",
|
||||
},
|
||||
{
|
||||
name: "sideload",
|
||||
description: "Sideload the given full OTA package",
|
||||
args: {
|
||||
name: "OTAPACKAGE",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Ensure that there is a server running",
|
||||
name: "start-server",
|
||||
},
|
||||
{
|
||||
description: "Kill the server if it is running",
|
||||
name: "kill-server",
|
||||
},
|
||||
{
|
||||
description: "Kick connection from host side to force reconnect",
|
||||
name: "reconnect",
|
||||
subcommands: [
|
||||
{
|
||||
description: "Kick connection from device side to force reconnect",
|
||||
name: "device",
|
||||
},
|
||||
{
|
||||
description: "Reset offline/unauthorized devices to force reconnect`",
|
||||
name: "offline",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "tcpip",
|
||||
description: "Restart adbd listening on TCP on PORT",
|
||||
args: {
|
||||
name: "PORT",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "reboot",
|
||||
args: {
|
||||
isOptional: true,
|
||||
name: "type",
|
||||
suggestions: [
|
||||
{
|
||||
name: "bootloader",
|
||||
},
|
||||
{
|
||||
name: "recovery",
|
||||
},
|
||||
{
|
||||
name: "sideload",
|
||||
},
|
||||
{
|
||||
name: "sideload-auto-reboot",
|
||||
},
|
||||
],
|
||||
},
|
||||
description:
|
||||
"Reboot the device; defaults to booting system image but supports bootloader and recovery too. sideload reboots into recovery and automatically starts sideload mode, sideload-auto-reboot is the same but reboots after sideloading",
|
||||
},
|
||||
{
|
||||
name: "disable-verity",
|
||||
description: "Disable dm-verity checking on userdebug builds",
|
||||
},
|
||||
{
|
||||
name: "enable-verity",
|
||||
description: "Re-enable dm-verity checking on userdebug builds",
|
||||
},
|
||||
{
|
||||
name: "wait-for-device",
|
||||
description: "Wait for state=device",
|
||||
},
|
||||
{
|
||||
name: "wait-for-recovery",
|
||||
description: "Wait for state=recovery",
|
||||
},
|
||||
{
|
||||
name: "wait-for-rescue",
|
||||
description: "Wait for state=rescue",
|
||||
},
|
||||
{
|
||||
name: "wait-for-sideload",
|
||||
description: "Wait for state=sideload",
|
||||
},
|
||||
{
|
||||
name: "wait-for-bootloader",
|
||||
description: "Wait for state=bootloader",
|
||||
},
|
||||
{
|
||||
name: "wait-for-disconnect",
|
||||
description: "Wait for state=disconnect",
|
||||
},
|
||||
{
|
||||
name: "wait-for-usb-device",
|
||||
description: "Wait for usb in state=device",
|
||||
},
|
||||
{
|
||||
name: "wait-for-usb-recovery",
|
||||
description: "Wait for usb in state=recovery",
|
||||
},
|
||||
{
|
||||
name: "wait-for-usb-rescue",
|
||||
description: "Wait for usb in state=rescue",
|
||||
},
|
||||
{
|
||||
name: "wait-for-usb-sideload",
|
||||
description: "Wait for usb in state=sideload",
|
||||
},
|
||||
{
|
||||
name: "wait-for-usb-bootloader",
|
||||
description: "Wait for usb in state=bootloader",
|
||||
},
|
||||
{
|
||||
name: "wait-for-usb-disconnect",
|
||||
description: "Wait for usb in state=disconnect",
|
||||
},
|
||||
{
|
||||
name: "wait-for-local-device",
|
||||
description: "Wait for local in state=device",
|
||||
},
|
||||
{
|
||||
name: "wait-for-local-recovery",
|
||||
description: "Wait for local in state=recovery",
|
||||
},
|
||||
{
|
||||
name: "wait-for-local-rescue",
|
||||
description: "Wait for local in state=rescue",
|
||||
},
|
||||
{
|
||||
name: "wait-for-local-sideload",
|
||||
description: "Wait for local in state=sideload",
|
||||
},
|
||||
{
|
||||
name: "wait-for-local-bootloader",
|
||||
description: "Wait for local in state=bootloader",
|
||||
},
|
||||
{
|
||||
name: "wait-for-local-disconnect",
|
||||
description: "Wait for local in state=disconnect",
|
||||
},
|
||||
{
|
||||
name: "wait-for-any-device",
|
||||
description: "Wait for any in state=device",
|
||||
},
|
||||
{
|
||||
name: "wait-for-any-recovery",
|
||||
description: "Wait for any in state=recovery",
|
||||
},
|
||||
{
|
||||
name: "wait-for-any-rescue",
|
||||
description: "Wait for any in state=rescue",
|
||||
},
|
||||
{
|
||||
name: "wait-for-any-sideload",
|
||||
description: "Wait for any in state=sideload",
|
||||
},
|
||||
{
|
||||
name: "wait-for-any-bootloader",
|
||||
description: "Wait for any in state=bootloader",
|
||||
},
|
||||
{
|
||||
name: "wait-for-any-disconnect",
|
||||
description: "Wait for any in state=disconnect",
|
||||
},
|
||||
{
|
||||
name: "keygen",
|
||||
description:
|
||||
"Generate adb public/private key; private key stored in FILE",
|
||||
args: {
|
||||
name: "FILE",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "logcat",
|
||||
description: "Show device log (logcat --help for more)",
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
description: "Show version num",
|
||||
},
|
||||
{
|
||||
name: "connect",
|
||||
description: "Connect to a device via TCP/IP [default port=5555]",
|
||||
args: {
|
||||
name: "HOST[:PORT]",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "disconnect",
|
||||
description:
|
||||
"Disconnect from given TCP/IP device [default port=5555], or all",
|
||||
args: {
|
||||
name: "HOST[:PORT]",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "uninstall",
|
||||
description: "Remove this app package from the device",
|
||||
options: [
|
||||
{
|
||||
name: "-k",
|
||||
description: "Keep the data and cache directories",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "bugreport",
|
||||
description: "Write bugreport to given PATH [default=bugreport.zip];",
|
||||
args: {
|
||||
name: "PATH",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "pair",
|
||||
description: "Pair with a device for secure TCP/IP communication",
|
||||
args: [
|
||||
{
|
||||
name: "HOST[:PORT]",
|
||||
},
|
||||
{
|
||||
name: "[PAIRING CODE]",
|
||||
isOptional: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "ppp",
|
||||
description: "Run PPP over USB",
|
||||
args: [
|
||||
{
|
||||
name: "TTY",
|
||||
},
|
||||
{
|
||||
name: "[PARAMETER...]",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "emu",
|
||||
description: "Run emulator console command",
|
||||
args: {
|
||||
name: "COMMAND",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "install",
|
||||
description: "Push a single package to the device and install it",
|
||||
args: {
|
||||
name: "PACKAGE",
|
||||
template: "filepaths",
|
||||
},
|
||||
options: installOptions,
|
||||
},
|
||||
{
|
||||
name: "install-multiple",
|
||||
description:
|
||||
"Push multiple APKs to the device for a single package and install them",
|
||||
args: {
|
||||
name: "PACKAGE",
|
||||
template: "filepaths",
|
||||
isVariadic: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-p",
|
||||
description: "Partial application install (install-multiple only)",
|
||||
},
|
||||
...installOptions,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "install-multi-package",
|
||||
description:
|
||||
"Push one or more packages to the device and install them atomically",
|
||||
args: {
|
||||
name: "PACKAGE",
|
||||
template: "filepaths",
|
||||
isVariadic: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-p",
|
||||
description: "Partial application install (install-multiple only)",
|
||||
},
|
||||
...installOptions,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "shell",
|
||||
description:
|
||||
"Run remote shell command (interactive shell if no command given)",
|
||||
options: [
|
||||
{
|
||||
name: "-e",
|
||||
description: "Choose escape character, or `none` default '~'",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Don't read from stdin",
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description: "Disable pty allocation",
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description: "Allocate a pty if on a tty",
|
||||
},
|
||||
{
|
||||
name: "-tt",
|
||||
description: "-tt: force pty allocation",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description: "Disable remote exit codes and stdout/stderr separation",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
isOptional: true,
|
||||
name: "COMMANDS ...",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "mdns",
|
||||
description: "Mdns utils",
|
||||
subcommands: [
|
||||
{
|
||||
name: "check",
|
||||
description: "Check if mdns discovery is available",
|
||||
},
|
||||
{
|
||||
name: "services",
|
||||
description: "List all discovered services",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "push",
|
||||
description: "Copy local files/directories to device",
|
||||
options: [
|
||||
{
|
||||
description:
|
||||
"Only push files that are newer on the host than the device",
|
||||
name: "--sync",
|
||||
},
|
||||
{
|
||||
description:
|
||||
"Dry run: push files to device without storing to the filesystem",
|
||||
name: "-n",
|
||||
},
|
||||
...compressionOptions,
|
||||
],
|
||||
args: [
|
||||
{
|
||||
name: "LOCAL",
|
||||
isVariadic: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
{
|
||||
name: "REMOTE",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "sync",
|
||||
description:
|
||||
"Sync a local build from $ANDROID_PRODUCT_OUT to the device (default all)",
|
||||
options: [
|
||||
{
|
||||
description:
|
||||
"Dry run: push files to device without storing to the filesystem",
|
||||
name: "-n",
|
||||
},
|
||||
{
|
||||
description: "List files that would be copied, but don't copy them",
|
||||
name: "-l",
|
||||
},
|
||||
...compressionOptions,
|
||||
],
|
||||
args: {
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
{
|
||||
name: "all",
|
||||
},
|
||||
{
|
||||
name: "data",
|
||||
},
|
||||
{
|
||||
name: "odm",
|
||||
},
|
||||
{
|
||||
name: "oem",
|
||||
},
|
||||
{
|
||||
name: "product",
|
||||
},
|
||||
{
|
||||
name: "system",
|
||||
},
|
||||
{
|
||||
name: "system_ext",
|
||||
},
|
||||
{
|
||||
name: "vendor",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "pull",
|
||||
description: "Copy files/dirs from device",
|
||||
options: [
|
||||
{
|
||||
description: "Preserve file timestamp and mode",
|
||||
name: "-a",
|
||||
},
|
||||
...compressionOptions,
|
||||
],
|
||||
args: [
|
||||
{
|
||||
name: "REMOTE",
|
||||
isVariadic: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
{
|
||||
name: "LOCAL",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "forward",
|
||||
description: "Forward connection",
|
||||
options: [
|
||||
{
|
||||
name: "--list",
|
||||
description: "List all forward socket connections",
|
||||
},
|
||||
{
|
||||
name: "--remove",
|
||||
description: "Remove specific forward socket connection",
|
||||
args: {
|
||||
name: "LOCAL",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--remove-all",
|
||||
description: "Remove all forward socket connections",
|
||||
},
|
||||
{
|
||||
name: "--no-rebind",
|
||||
description:
|
||||
"Reversal fails if the specified socket is already bound through a previous reverse command",
|
||||
},
|
||||
],
|
||||
args: [
|
||||
{
|
||||
name: "LOCAL -> port|domain|device|pid",
|
||||
suggestions: forwardConnectionSuggestions,
|
||||
},
|
||||
{
|
||||
name: "REMOTE -> port|domain|device|pid",
|
||||
suggestions: forwardConnectionSuggestions,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "reverse",
|
||||
description: "Reverse connection",
|
||||
options: [
|
||||
{
|
||||
name: "--list",
|
||||
description: "List all reverse socket connections from device",
|
||||
},
|
||||
{
|
||||
name: "--remove",
|
||||
description: "Remove specific reverse socket connection",
|
||||
args: {
|
||||
name: "REMOTE",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--remove-all",
|
||||
description: "Remove all reverse socket connections from device",
|
||||
},
|
||||
{
|
||||
name: "--no-rebind",
|
||||
description:
|
||||
"Reversal fails if the specified socket is already bound through a previous reverse command",
|
||||
},
|
||||
],
|
||||
args: [
|
||||
{
|
||||
name: "REMOTE -> port|domain|device|pid",
|
||||
suggestions: reverseConnectionSuggestions,
|
||||
},
|
||||
{
|
||||
name: "LOCAL -> port|domain|device|pid",
|
||||
suggestions: reverseConnectionSuggestions,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
description: "Listen on all network interfaces, not just localhost",
|
||||
name: "-a",
|
||||
},
|
||||
{
|
||||
description: "Use USB device (error if multiple devices connected)",
|
||||
name: "-d",
|
||||
},
|
||||
{
|
||||
description:
|
||||
"Use TCP/IP device (error if multiple TCP/IP devices available)",
|
||||
name: "-e",
|
||||
},
|
||||
{
|
||||
description: "Use device with given serial (overrides $ANDROID_SERIAL)",
|
||||
name: "-s",
|
||||
args: {
|
||||
name: "SERIAL",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Use device with given transport id",
|
||||
name: "-t",
|
||||
args: {
|
||||
name: "ID",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Name of adb server host [default=localhost]",
|
||||
name: "-H",
|
||||
args: {
|
||||
name: "host name",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Port of adb server [default=5037]",
|
||||
name: "-P",
|
||||
args: {
|
||||
name: "port",
|
||||
},
|
||||
},
|
||||
{
|
||||
description:
|
||||
"Listen on given socket for adb server [default=tcp:localhost:5037]",
|
||||
name: "-L",
|
||||
args: {
|
||||
name: "socket",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
548
extensions/terminal-suggest/src/completions/upstream/bundle.ts
Normal file
548
extensions/terminal-suggest/src/completions/upstream/bundle.ts
Normal file
@@ -0,0 +1,548 @@
|
||||
const gemfileGemsGenerator: Fig.Generator = {
|
||||
script: ["bundle", "list", "--name-only"],
|
||||
postProcess: (out) => {
|
||||
return out.split("\n").map((gem) => {
|
||||
return {
|
||||
name: gem,
|
||||
icon: "📦",
|
||||
description: "Gem",
|
||||
};
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "bundle",
|
||||
description: "Ruby Dependency Management",
|
||||
subcommands: [
|
||||
// Primary Commands
|
||||
{
|
||||
name: "install",
|
||||
description: "Install the gems specified by the Gemfile or Gemfile.lock",
|
||||
options: [
|
||||
{
|
||||
name: "--binstubs",
|
||||
args: { template: "folders" },
|
||||
description: "Create binstubs in dir",
|
||||
},
|
||||
{ name: "--clean", description: "Remove unused gems after install" },
|
||||
{ name: "--deployment", description: "For Production and CI use" },
|
||||
{
|
||||
name: ["--force", "--redownload"],
|
||||
description: "Redownload all gems",
|
||||
},
|
||||
{ name: "--frozen", description: "Do not allow lock file to update" },
|
||||
{ name: "--full-index", description: "Cache the full index locally" },
|
||||
{
|
||||
name: "--gemfile",
|
||||
args: { template: "filepaths" },
|
||||
description: "The gemfile to use",
|
||||
},
|
||||
{
|
||||
name: "--jobs",
|
||||
args: {},
|
||||
description: "Maximum number of parallel installs",
|
||||
},
|
||||
{
|
||||
name: "--local",
|
||||
description: "Use only gems already downloaded or cached",
|
||||
},
|
||||
{ name: "--no-cache", description: "Do not use vendor/cache" },
|
||||
{ name: "--no-prune", description: "Do not remove stale gems" },
|
||||
{
|
||||
name: "--path",
|
||||
args: { template: "folders" },
|
||||
description: "Path the install gems too",
|
||||
},
|
||||
{ name: "--quiet", description: "Do not print to stdout" },
|
||||
{
|
||||
name: "--retry",
|
||||
args: {},
|
||||
description: "Retry failed network requests N times",
|
||||
},
|
||||
{
|
||||
name: "--shebang",
|
||||
args: {},
|
||||
description: "Uses the specified ruby executable for binstubs",
|
||||
},
|
||||
{
|
||||
name: "--standalone",
|
||||
args: {},
|
||||
description:
|
||||
"Makes a bundle that can work without depending on Rubygems or Bundler at runtime",
|
||||
},
|
||||
{ name: "--system", description: "Use system Rubygems location" },
|
||||
{
|
||||
name: "--trust-policy",
|
||||
args: {},
|
||||
description: "Apply the Rubygems security policy",
|
||||
},
|
||||
{ name: "--with", args: {}, description: "Groups to install" },
|
||||
{ name: "--without", args: {}, description: "Groups to NOT install" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "update",
|
||||
description: "Update dependencies to their latest versions",
|
||||
args: {
|
||||
name: "gem",
|
||||
generators: gemfileGemsGenerator,
|
||||
isOptional: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "--all",
|
||||
description: "Update all gems specified in Gemfile",
|
||||
},
|
||||
{
|
||||
name: ["--group", "-g"],
|
||||
description: "Only update the gems in the specified group",
|
||||
args: {},
|
||||
},
|
||||
{
|
||||
name: "--source",
|
||||
description: "The name of a :git or :path source used in the Gemfile",
|
||||
args: {},
|
||||
},
|
||||
{
|
||||
name: "--local",
|
||||
description: "Use only gems already downloaded or cached",
|
||||
},
|
||||
{
|
||||
name: "--ruby",
|
||||
description:
|
||||
"Update the locked version of Ruby to the current version of Ruby",
|
||||
},
|
||||
{
|
||||
name: "--bundler",
|
||||
description:
|
||||
"Update the locked version of bundler to the invoked bundler version",
|
||||
},
|
||||
{
|
||||
name: "--full-index",
|
||||
description: "Fall back to using the single-file index of all gems",
|
||||
},
|
||||
{
|
||||
name: ["--jobs", "-j"],
|
||||
description:
|
||||
"Specify the number of jobs to run in parallel. The default is 1",
|
||||
args: {},
|
||||
},
|
||||
{
|
||||
name: "--retry",
|
||||
description: "Retry failed network or git requests for number times",
|
||||
args: {},
|
||||
},
|
||||
{ name: "--quiet", description: "Only output warnings and errors" },
|
||||
{
|
||||
name: ["--force", "--redownload"],
|
||||
description: "Force downloading every gem",
|
||||
},
|
||||
{
|
||||
name: "--patch",
|
||||
description: "Prefer updating only to next patch version",
|
||||
},
|
||||
{
|
||||
name: "--minor",
|
||||
description: "Prefer updating only to next minor version",
|
||||
},
|
||||
{
|
||||
name: "--major",
|
||||
description: "Prefer updating to next major version (default)",
|
||||
},
|
||||
{
|
||||
name: "--strict",
|
||||
description:
|
||||
"Do not allow any gem to be updated past latest --patch | --minor | --major",
|
||||
},
|
||||
{
|
||||
name: "--conservative",
|
||||
description: "Do not allow shared dependencies to be updated",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "package",
|
||||
description:
|
||||
"Package the .gem files required by your application into the vendor/cache directory",
|
||||
},
|
||||
{
|
||||
name: "exec",
|
||||
description: "Execute a command in the context of the bundle",
|
||||
options: [
|
||||
{
|
||||
name: "--keep-file-descriptors",
|
||||
description: "Pass all file descriptors to the new process",
|
||||
},
|
||||
],
|
||||
args: { isCommand: true },
|
||||
},
|
||||
{ name: "config", args: {} },
|
||||
{ name: "help" },
|
||||
|
||||
// Utility Commands
|
||||
{
|
||||
name: "add",
|
||||
description: "Add gem to the Gemfile and run bundle install",
|
||||
args: {},
|
||||
options: [
|
||||
{
|
||||
name: ["--version", "-v"],
|
||||
description: "Specify version requirements",
|
||||
},
|
||||
{
|
||||
name: ["--group", "-g"],
|
||||
description: "Specify the group(s) for the added gem",
|
||||
},
|
||||
{
|
||||
name: ["--source", "-s"],
|
||||
description: "Specify the source",
|
||||
},
|
||||
{
|
||||
name: "--skip-install",
|
||||
description: "Adds the gem to the Gemfile but does not install it",
|
||||
},
|
||||
{
|
||||
name: "--optimistic",
|
||||
description: "Adds optimistic declaration of version",
|
||||
},
|
||||
{
|
||||
name: "--strict",
|
||||
description: "Adds strict declaration of version",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "binstubs",
|
||||
description: "Install the binstubs of the listed gems",
|
||||
args: {},
|
||||
options: [
|
||||
{
|
||||
name: "--force",
|
||||
description: "Overwrite existing binstubs",
|
||||
},
|
||||
{
|
||||
name: "--path",
|
||||
description: "The location to install the specified binstubs to",
|
||||
},
|
||||
{
|
||||
name: "--standalone",
|
||||
description:
|
||||
"Makes binstubs that can work without depending on Rubygems or Bundler at runtime",
|
||||
},
|
||||
{
|
||||
name: "--shebang",
|
||||
description:
|
||||
"Specify a different shebang executable name than the default",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "check",
|
||||
description:
|
||||
"Determine whether the requirements for your application are installed and available to Bundler",
|
||||
options: [
|
||||
{
|
||||
name: "--dry-run",
|
||||
description: "Locks the Gemfile before running the command",
|
||||
},
|
||||
{
|
||||
name: "--gemfile",
|
||||
description: "Use the specified gemfile instead of the Gemfile",
|
||||
},
|
||||
{
|
||||
name: "--path",
|
||||
description: "Specify a different path than the system default",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "show",
|
||||
description: "Show the source location of a particular gem in the bundle",
|
||||
args: {
|
||||
name: "gem",
|
||||
generators: gemfileGemsGenerator,
|
||||
isOptional: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "--paths",
|
||||
description:
|
||||
"List the paths of all gems that are required by your Gemfile",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "outdated",
|
||||
description: "Show all of the outdated gems in the current bundle",
|
||||
options: [
|
||||
{
|
||||
name: "--local",
|
||||
description:
|
||||
"Do not attempt to fetch gems remotely and use the gem cache instead",
|
||||
},
|
||||
{ name: "--pre", description: "Check for newer pre-release gems" },
|
||||
{ name: "--source", description: "Check against a specific source" },
|
||||
{
|
||||
name: "--strict",
|
||||
description:
|
||||
"Only list newer versions allowed by your Gemfile requirements",
|
||||
},
|
||||
{
|
||||
name: ["--parseable", "--porcelain"],
|
||||
description: "Use minimal formatting for more parseable output",
|
||||
},
|
||||
{ name: "--group", description: "List gems from a specific group" },
|
||||
{ name: "--groups", description: "List gems organized by groups" },
|
||||
{
|
||||
name: "--update-strict",
|
||||
description:
|
||||
"Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor| --major",
|
||||
},
|
||||
{
|
||||
name: "--minor",
|
||||
description: "Prefer updating only to next minor version",
|
||||
},
|
||||
{
|
||||
name: "--major",
|
||||
description: "Prefer updating to next major version (default)",
|
||||
},
|
||||
{
|
||||
name: "--patch",
|
||||
description: "Prefer updating only to next patch version",
|
||||
},
|
||||
{
|
||||
name: "--filter-major",
|
||||
description: "Only list major newer versions",
|
||||
},
|
||||
{
|
||||
name: "--filter-minor",
|
||||
description: "Only list minor newer versions",
|
||||
},
|
||||
{
|
||||
name: "--filter-patch",
|
||||
description: "Only list patch newer versions",
|
||||
},
|
||||
{
|
||||
name: "--only-explicit",
|
||||
description:
|
||||
"Only list gems specified in your Gemfile, not their dependencies",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "console",
|
||||
description: "Start an IRB session in the current bundle",
|
||||
},
|
||||
{
|
||||
name: "open",
|
||||
description: "Open an installed gem in the editor",
|
||||
args: {
|
||||
name: "gem",
|
||||
generators: gemfileGemsGenerator,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "lock",
|
||||
description: "Generate a lockfile for your dependencies",
|
||||
options: [
|
||||
{
|
||||
name: "--update",
|
||||
description: "Ignores the existing lockfile",
|
||||
args: {},
|
||||
},
|
||||
{
|
||||
name: "--local",
|
||||
description: "Do not attempt to connect to rubygems.org",
|
||||
},
|
||||
{
|
||||
name: "--print",
|
||||
description:
|
||||
"Prints the lockfile to STDOUT instead of writing to the file\n system",
|
||||
},
|
||||
{
|
||||
name: "--lockfile",
|
||||
description: "The path where the lockfile should be written to",
|
||||
args: { name: "path" },
|
||||
},
|
||||
{
|
||||
name: "--full-index",
|
||||
description: "Fall back to using the single-file index of all gems",
|
||||
},
|
||||
{
|
||||
name: "--add-platform",
|
||||
description:
|
||||
"Add a new platform to the lockfile, re-resolving for the addi-\n tion of that platform",
|
||||
},
|
||||
{
|
||||
name: "--remove-platform",
|
||||
description: "Remove a platform from the lockfile",
|
||||
},
|
||||
{
|
||||
name: "--patch",
|
||||
description:
|
||||
"If updating, prefer updating only to next patch version",
|
||||
},
|
||||
{
|
||||
name: "--minor",
|
||||
description:
|
||||
"If updating, prefer updating only to next minor version",
|
||||
},
|
||||
{
|
||||
name: "--major",
|
||||
description:
|
||||
"If updating, prefer updating to next major version (default)",
|
||||
},
|
||||
{
|
||||
name: "--strict",
|
||||
description:
|
||||
"If updating, do not allow any gem to be updated past latest --patch | --minor | --major",
|
||||
},
|
||||
{
|
||||
name: "--conservative",
|
||||
description:
|
||||
"If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "viz",
|
||||
description: "Generate a visual representation of your dependencies",
|
||||
options: [
|
||||
{
|
||||
name: ["--file", "-f"],
|
||||
description:
|
||||
"The name to use for the generated file. See --format option",
|
||||
},
|
||||
{
|
||||
name: ["--format", "-F"],
|
||||
description: "This is output format option",
|
||||
},
|
||||
{
|
||||
name: ["--requirements", "-R"],
|
||||
description: "Set to show the version of each required dependency",
|
||||
},
|
||||
{
|
||||
name: ["--version", "-v"],
|
||||
description: "Set to show each gem version",
|
||||
},
|
||||
{
|
||||
name: ["--without", "-W"],
|
||||
description:
|
||||
"Exclude gems that are part of the specified named group",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "init",
|
||||
description: "Generate a simple Gemfile, placed in the current directory",
|
||||
options: [
|
||||
{
|
||||
name: "--gemspec",
|
||||
description: "Use the specified .gemspec to create the Gemfile",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "gem",
|
||||
description: "Create a simple gem, suitable for development with Bundler",
|
||||
options: [
|
||||
{
|
||||
name: ["--exe", "-b", "--bin"],
|
||||
description: "Specify that Bundler should create a binary executable",
|
||||
},
|
||||
{
|
||||
name: "--no-exe",
|
||||
description: "Do not create a binary",
|
||||
},
|
||||
{
|
||||
name: "--coc",
|
||||
description:
|
||||
"Add a CODE_OF_CONDUCT.md file to the root of the generated project",
|
||||
},
|
||||
{
|
||||
name: "--no-coc",
|
||||
description: "Do not create a CODE_OF_CONDUCT.md",
|
||||
},
|
||||
{
|
||||
name: "--ext",
|
||||
description:
|
||||
"Add boilerplate for C extension code to the generated project",
|
||||
},
|
||||
{
|
||||
name: "--no-ext",
|
||||
description: "Do not add C extension code",
|
||||
},
|
||||
{
|
||||
name: "--mit",
|
||||
description: "Add an MIT license",
|
||||
},
|
||||
{
|
||||
name: "--no-mit",
|
||||
description: "Do not create a LICENSE.txt",
|
||||
},
|
||||
{
|
||||
name: ["-t", "--test"],
|
||||
description: "Specify the test framework that Bundler should use",
|
||||
args: {},
|
||||
},
|
||||
{
|
||||
name: ["-e", "--edit"],
|
||||
description: "Open the resulting gemspec in EDITOR",
|
||||
args: {},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "platform",
|
||||
description: "Display platform compatibility information",
|
||||
options: [
|
||||
{
|
||||
name: "--ruby",
|
||||
description:
|
||||
"It will display the ruby directive information so you don't have to parse it from the Gemfile",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "clean",
|
||||
description: "Clean up unused gems in your Bundler directory",
|
||||
options: [
|
||||
{
|
||||
name: "--dry-run",
|
||||
description: "Print the changes, but do not clean the unused gems",
|
||||
},
|
||||
{
|
||||
name: "--force",
|
||||
description: "Force a clean even if --path is not set",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "doctor",
|
||||
description: "Display warnings about common problems",
|
||||
options: [
|
||||
{ name: "--quiet", description: "Only output warnings and errors" },
|
||||
{
|
||||
name: "--gemfile",
|
||||
description: "The location of the Gemfile which Bundler should use",
|
||||
args: {},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{ name: "--no-color", description: "Print all output without color" },
|
||||
{
|
||||
name: ["--retry", "-r"],
|
||||
description:
|
||||
"Specify the number of times you wish to attempt network commands",
|
||||
},
|
||||
{
|
||||
name: ["--verbose", "-V"],
|
||||
description: "Print out additional logging information",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
File diff suppressed because it is too large
Load Diff
6853
extensions/terminal-suggest/src/completions/upstream/docker.ts
Normal file
6853
extensions/terminal-suggest/src/completions/upstream/docker.ts
Normal file
File diff suppressed because it is too large
Load Diff
249
extensions/terminal-suggest/src/completions/upstream/dotnet.ts
Normal file
249
extensions/terminal-suggest/src/completions/upstream/dotnet.ts
Normal file
@@ -0,0 +1,249 @@
|
||||
import { filepaths } from '../../helpers/filepaths';
|
||||
|
||||
const DOTNET_ICON =
|
||||
"https://upload.wikimedia.org/wikipedia/commons/7/7d/Microsoft_.NET_logo.svg";
|
||||
|
||||
const commands: Fig.Subcommand[] = [
|
||||
{
|
||||
name: "new",
|
||||
loadSpec: "dotnet/dotnet-new",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "add",
|
||||
loadSpec: "dotnet/dotnet-add",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "list",
|
||||
loadSpec: "dotnet/dotnet-list",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "remove",
|
||||
loadSpec: "dotnet/dotnet-remove",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "build",
|
||||
loadSpec: "dotnet/dotnet-build",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "build-server",
|
||||
loadSpec: "dotnet/dotnet-build-server",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "clean",
|
||||
loadSpec: "dotnet/dotnet-clean",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "format",
|
||||
loadSpec: "dotnet/dotnet-format",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "migrate",
|
||||
loadSpec: "dotnet/dotnet-migrate",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "msbuild",
|
||||
loadSpec: "dotnet/dotnet-msbuild",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "nuget",
|
||||
loadSpec: "dotnet/dotnet-nuget",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "pack",
|
||||
loadSpec: "dotnet/dotnet-pack",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "publish",
|
||||
loadSpec: "dotnet/dotnet-publish",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "restore",
|
||||
loadSpec: "dotnet/dotnet-restore",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "run",
|
||||
loadSpec: "dotnet/dotnet-run",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "sln",
|
||||
loadSpec: "dotnet/dotnet-sln",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "store",
|
||||
loadSpec: "dotnet/dotnet-store",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "test",
|
||||
loadSpec: "dotnet/dotnet-test",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
{
|
||||
name: "tool",
|
||||
loadSpec: "dotnet/dotnet-tool",
|
||||
icon: DOTNET_ICON,
|
||||
},
|
||||
];
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "dotnet",
|
||||
description: "The dotnet cli",
|
||||
icon: DOTNET_ICON,
|
||||
args: {
|
||||
name: "command",
|
||||
isOptional: true,
|
||||
generators: filepaths({ extensions: ["dll"] }),
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "--version",
|
||||
description:
|
||||
"Prints out the version of the .NET SDK used by dotnet commands. Includes the effects of any global.json",
|
||||
},
|
||||
{
|
||||
name: "--info",
|
||||
description:
|
||||
"Prints out detailed information about a .NET installation and the machine environment, such as the current operating system, and commit SHA of the .NET version",
|
||||
},
|
||||
{
|
||||
name: "--list-runtimes",
|
||||
description:
|
||||
"Prints out a list of the installed .NET runtimes. An x86 version of the SDK lists only x86 runtimes, and an x64 version of the SDK lists only x64 runtimes",
|
||||
},
|
||||
{
|
||||
name: "--list-sdks",
|
||||
description: "Prints out a list of the installed .NET SDKs",
|
||||
},
|
||||
{
|
||||
name: ["-?", "-h", "--help"],
|
||||
description: "Prints out a list of available commands",
|
||||
},
|
||||
{
|
||||
name: ["-d", "--diagnostics"],
|
||||
description: "Enables diagnostic output",
|
||||
},
|
||||
{
|
||||
name: ["-v", "--verbosity"],
|
||||
description:
|
||||
"Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available",
|
||||
args: {
|
||||
name: "verbosity",
|
||||
suggestions: ["quiet", "minimal", "normal", "detailed", "diagnostic"],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--additionalprobingpath",
|
||||
description: "Path containing probing policy and assemblies to probe",
|
||||
args: {
|
||||
name: "path",
|
||||
template: "folders",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--additional-deps",
|
||||
description:
|
||||
"Path to an additional .deps.json file. A deps.json file contains a list of dependencies, compilation dependencies, and version information used to address assembly conflicts. For more information, see Runtime Configuration Files on GitHub",
|
||||
args: {
|
||||
name: "deps",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-depsfile",
|
||||
description:
|
||||
"Path to the deps.json file. A deps.json file is a configuration file that contains information about dependencies necessary to run the application. This file is generated by the .NET SDK",
|
||||
args: {
|
||||
name: "deps",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--runtimeconfig",
|
||||
description:
|
||||
"Path to a runtimeconfig.json file. A runtimeconfig.json file is a configuration file that contains run-time settings",
|
||||
args: {
|
||||
name: "path",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--roll-forward",
|
||||
description:
|
||||
"Controls how roll forward is applied to the app. The SETTING can be one of the following values. If not specified, Minor is the default",
|
||||
args: {
|
||||
name: "setting",
|
||||
suggestions: [
|
||||
"LatestPatch",
|
||||
"Minor",
|
||||
"Major",
|
||||
"LatestMinor",
|
||||
"LatestMajor",
|
||||
"Disable",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--fx-version",
|
||||
description: "Version of the .NET runtime to use to run the application",
|
||||
args: {
|
||||
name: "version",
|
||||
},
|
||||
},
|
||||
],
|
||||
subcommands: commands,
|
||||
async generateSpec(_, executeShellCommand) {
|
||||
const argRegex = /(([a-zA-Z \.\[\]#,/][^ ]{1,})+)/g;
|
||||
|
||||
const subcommands: Fig.Subcommand[] = [];
|
||||
const { stdout } = await executeShellCommand({
|
||||
command: "dotnet",
|
||||
args: ["tool", "list", "--global"],
|
||||
});
|
||||
|
||||
const lines = stdout.split("\n").slice(2);
|
||||
|
||||
for (const line of lines) {
|
||||
const [_, __, command] = line
|
||||
.match(argRegex)!
|
||||
.map((match) => match.trim());
|
||||
|
||||
const commands = command.split(",").map<Fig.Subcommand>((cmd) => {
|
||||
const value = cmd.replace("dotnet-", "");
|
||||
|
||||
return {
|
||||
name: value,
|
||||
description: cmd,
|
||||
args: {
|
||||
name: "args",
|
||||
isOptional: true,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
subcommands.push(...commands);
|
||||
}
|
||||
|
||||
return {
|
||||
name: "dotnet",
|
||||
subcommands,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
921
extensions/terminal-suggest/src/completions/upstream/go.ts
Normal file
921
extensions/terminal-suggest/src/completions/upstream/go.ts
Normal file
@@ -0,0 +1,921 @@
|
||||
const buildModeSuggestions: Fig.Suggestion[] = [
|
||||
{
|
||||
name: "archive",
|
||||
description: "Build the listed non-main packages into .a files",
|
||||
},
|
||||
{
|
||||
name: "c-archive",
|
||||
description:
|
||||
"Build the listed main package, plus all packages it imports, into a C archive file",
|
||||
},
|
||||
{
|
||||
name: "c-shared",
|
||||
description:
|
||||
"Build the listed main package, plus all packages it imports, into a C shared library",
|
||||
},
|
||||
{
|
||||
name: "default",
|
||||
description:
|
||||
"Listed main packages are built into executables and listed non-main packages are built into .a files",
|
||||
},
|
||||
{
|
||||
name: "shared",
|
||||
description:
|
||||
"Combine all the listed non-main packages into a single shared library that will be used when building with the -linkshared option",
|
||||
},
|
||||
{
|
||||
name: "exe",
|
||||
description:
|
||||
"Build the listed main packages and everything they import into executables",
|
||||
},
|
||||
{
|
||||
name: "pie",
|
||||
description:
|
||||
"Build the listed main packages and everything they import into position independent executables (PIE)",
|
||||
},
|
||||
{
|
||||
name: "plugin",
|
||||
description:
|
||||
"Build the listed main packages, plus all packages that they import, into a Go plugin",
|
||||
},
|
||||
];
|
||||
|
||||
const resolutionAndExecutionOptions: Fig.Option[] = [
|
||||
{
|
||||
name: "-n",
|
||||
description: "Print the commands but do not run them",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Print the names of packages as they are compiled",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description: "Print the commands",
|
||||
},
|
||||
{
|
||||
name: "-tags",
|
||||
description:
|
||||
"A comma-separated list of build tags to consider satisfied during the build",
|
||||
args: {
|
||||
name: "tags",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-toolexec",
|
||||
insertValue: "-toolexec '{cursor}'",
|
||||
description:
|
||||
"A program to use to invoke toolchain programs like vet and asm",
|
||||
args: {
|
||||
name: "cmd",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const globalOptions: Fig.Option[] = [
|
||||
...resolutionAndExecutionOptions,
|
||||
{
|
||||
name: "-a",
|
||||
description: "Force rebuilding of packages that are already up-to-date",
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description: "The number of programs, such as build commands or",
|
||||
args: {
|
||||
name: "programs",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-race",
|
||||
description: `Enable data race detection.
|
||||
Supported only on linux/amd64, freebsd/amd64, darwin/amd64, windows/amd64,
|
||||
linux/ppc64le and linux/arm64 (only for 48-bit VMA)`,
|
||||
},
|
||||
{
|
||||
name: "-msan",
|
||||
description: `Enable interoperation with memory sanitizer.
|
||||
Supported only on linux/amd64, linux/arm64
|
||||
and only with Clang/LLVM as the host C compiler.
|
||||
On linux/arm64, pie build mode will be used`,
|
||||
},
|
||||
{
|
||||
name: "-work",
|
||||
description: `Print the name of the temporary work directory and
|
||||
do not delete it when exiting`,
|
||||
},
|
||||
{
|
||||
name: "-asmflags",
|
||||
insertValue: "-asmflags='{cursor}'",
|
||||
description: "Arguments to pass on each go tool asm invocation",
|
||||
args: {
|
||||
name: "flag",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-buildmode",
|
||||
description: "Build mode to use. See 'go help buildmode' for more",
|
||||
args: {
|
||||
name: "mode",
|
||||
suggestions: buildModeSuggestions,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-compiler",
|
||||
description:
|
||||
"Name of compiler to use, as in runtime.Compiler (gccgo or gc)",
|
||||
args: {
|
||||
name: "name",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-gccgoflags",
|
||||
insertValue: "--gccgoflags='{cursor}'",
|
||||
description: "Arguments to pass on each gccgo compiler/linker invocation",
|
||||
args: {
|
||||
name: "flag",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-gcflags",
|
||||
insertValue: "-gcflags='{cursor}'",
|
||||
description: "Arguments to pass on each go tool compile invocation",
|
||||
args: {
|
||||
name: "flag",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-installsuffix",
|
||||
description:
|
||||
"A suffix to use in the name of the package installation directory,",
|
||||
args: {
|
||||
name: "suffix",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-ldflags",
|
||||
insertValue: "-ldflags='{cursor}'",
|
||||
description: "Arguments to pass on each go tool link invocation",
|
||||
args: {
|
||||
name: "flag",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-linkshared",
|
||||
description:
|
||||
"Build code that will be linked against shared libraries previously",
|
||||
},
|
||||
{
|
||||
name: "-mod",
|
||||
description: "Module download mode to use: readonly, vendor, or mod",
|
||||
args: {
|
||||
name: "mode",
|
||||
suggestions: [
|
||||
{
|
||||
name: "readonly",
|
||||
},
|
||||
{
|
||||
name: "vendor",
|
||||
},
|
||||
{
|
||||
name: "mod",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-modcacherw",
|
||||
description:
|
||||
"Leave newly-created directories in the module cache read-write",
|
||||
},
|
||||
{
|
||||
name: "-modfile",
|
||||
description:
|
||||
"In module aware mode, read (and possibly write) an alternate go.mod file instead of the one in the module root directory",
|
||||
args: {
|
||||
name: "file",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-overlay",
|
||||
description:
|
||||
"Read a JSON config file that provides an overlay for build operations",
|
||||
args: {
|
||||
name: "file",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-pkgdir",
|
||||
description:
|
||||
"Install and load all packages from dir instead of the usual locations",
|
||||
args: {
|
||||
name: "dir",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-trimpath",
|
||||
description: "Remove all file system paths from the resulting executable",
|
||||
},
|
||||
];
|
||||
|
||||
const packagesArg: Fig.Arg = {
|
||||
name: "packages",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
template: ["filepaths"],
|
||||
};
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "go",
|
||||
description: "Go is a tool for managing Go source code",
|
||||
parserDirectives: {
|
||||
flagsArePosixNoncompliant: true,
|
||||
},
|
||||
subcommands: [
|
||||
{
|
||||
name: "bug",
|
||||
description: "Start a bug report",
|
||||
},
|
||||
{
|
||||
name: "build",
|
||||
description: "Compile packages and dependencies",
|
||||
options: [
|
||||
...globalOptions,
|
||||
{
|
||||
name: "-o",
|
||||
description:
|
||||
"Write the resulting executable or object to the named output file or directory",
|
||||
args: {
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Install the packages that are dependencies of the target",
|
||||
},
|
||||
],
|
||||
args: packagesArg,
|
||||
},
|
||||
{
|
||||
name: "clean",
|
||||
description: "Remove object files and cached files",
|
||||
options: [
|
||||
...globalOptions,
|
||||
{
|
||||
name: "-i",
|
||||
description: "Remove the corresponding installed archive or binary",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Apply recursively to all the dependencies of the packages named by the import paths",
|
||||
},
|
||||
{
|
||||
name: "-cache",
|
||||
description: "Remove the entire go build cache",
|
||||
},
|
||||
{
|
||||
name: "-testcache",
|
||||
description: "Expire all test results in the go build cache",
|
||||
},
|
||||
{
|
||||
name: "-modcache",
|
||||
description:
|
||||
"Remove the entire module download cache, including unpacked source code of versioned dependencies",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "doc",
|
||||
description: "Show documentation for package or symbol",
|
||||
options: [
|
||||
{
|
||||
name: "-all",
|
||||
description: "Show all the documentation for the package",
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Respect case when matching symbols",
|
||||
},
|
||||
{
|
||||
name: "-cmd",
|
||||
description:
|
||||
"Treat a command (package main) like a regular package. Otherwise package main's exported symbols are hidden when showing the package's top-level documentation",
|
||||
},
|
||||
{
|
||||
name: "-short",
|
||||
description: "One-line representation for each symbol",
|
||||
},
|
||||
{
|
||||
name: "-src",
|
||||
description: "Show the full source code for the symbol",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description:
|
||||
"Show documentation for unexported as well as exported symbols, methods, and fields",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "package",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "env",
|
||||
description: "Print Go environment information",
|
||||
options: [
|
||||
{
|
||||
name: "-json",
|
||||
description:
|
||||
"Prints the environment in JSON format instead of as a shell script",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description:
|
||||
"Unset the default setting for the named environment variables",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-w",
|
||||
description:
|
||||
"Change the default settings of the named environment variables to the given values",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "fix",
|
||||
description: "Update packages to use new APIs",
|
||||
args: packagesArg,
|
||||
},
|
||||
{
|
||||
name: "fmt",
|
||||
description: "Gofmt (reformat) package sources",
|
||||
options: [
|
||||
{
|
||||
name: "-n",
|
||||
description: "Print the commands that would be executed",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description: "Print the commands as they are executed",
|
||||
},
|
||||
{
|
||||
name: "-mod",
|
||||
description: "Which module download mode to use",
|
||||
args: {
|
||||
name: "mode",
|
||||
suggestions: [
|
||||
{
|
||||
name: "readonly",
|
||||
},
|
||||
{
|
||||
name: "vendor",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
args: packagesArg,
|
||||
},
|
||||
{
|
||||
name: "generate",
|
||||
description: "Generate Go files by processing source",
|
||||
options: [
|
||||
...globalOptions,
|
||||
{
|
||||
name: "-run",
|
||||
insertValue: '-run "{cursor}"',
|
||||
description:
|
||||
"Specifies a regular expression to select directives whose full original source text matches the expression",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "get",
|
||||
description: "Add dependencies to current module and install them",
|
||||
options: [
|
||||
...globalOptions,
|
||||
{
|
||||
name: "-t",
|
||||
description:
|
||||
"Modules needed to build tests of packages specified on the command line",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description: "Update to newer minor or patch releases when available",
|
||||
args: {
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
{
|
||||
name: "patch",
|
||||
description: "Update to newer patch releases",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-insecure",
|
||||
description: "Permit fetching from insecure origins",
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Only update go.mod and download source code needed to build packages",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "url",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "install",
|
||||
description: "Compile and install packages and dependencies",
|
||||
options: [...globalOptions],
|
||||
args: {
|
||||
name: "packages",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "list",
|
||||
description: "List packages or modules",
|
||||
options: [
|
||||
...globalOptions,
|
||||
{
|
||||
name: "-compiled",
|
||||
description: "Set CompiledGoFiles to the Go source files",
|
||||
},
|
||||
{
|
||||
name: "-deps",
|
||||
description:
|
||||
"Terate over not just the named packages but also all their dependencies",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
insertValue: "-f '{cursor}'",
|
||||
description: "Specify an alternate format for the list",
|
||||
args: {
|
||||
name: "format",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Processes the erroneous packages with the usual printing",
|
||||
},
|
||||
{
|
||||
name: "-export",
|
||||
description:
|
||||
"Set the Export field to the name of a file containing up-to-date export information for the given package",
|
||||
},
|
||||
{
|
||||
name: "-find",
|
||||
description:
|
||||
"Identify the named packages but not resolve their dependencies",
|
||||
},
|
||||
{
|
||||
name: "-test",
|
||||
description: "Report test binaries",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "List modules instead of packages",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description: "Add information about available upgrades",
|
||||
},
|
||||
{
|
||||
name: "-versions",
|
||||
description:
|
||||
"Set the Module's Versions field to a list of all known versions of that module",
|
||||
},
|
||||
{
|
||||
name: "-retracted",
|
||||
description: "Eport information about retracted module versions",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "mod",
|
||||
description: "Module maintenance",
|
||||
subcommands: [
|
||||
{
|
||||
name: "download",
|
||||
description: "Download the named modules into the module cache",
|
||||
options: [
|
||||
{
|
||||
name: "-json",
|
||||
description:
|
||||
"Print a sequence of JSON objects to standard output, describing each downloaded module (or failure)",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"Print the commands download executes to standard error",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "modules",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "edit",
|
||||
description: "Edit and format go.mod files",
|
||||
options: [
|
||||
{
|
||||
name: "-module",
|
||||
description: "Change the module's path",
|
||||
},
|
||||
{
|
||||
name: "-go",
|
||||
requiresSeparator: true,
|
||||
description: "Set the expected Go language version",
|
||||
args: {
|
||||
name: "version",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-require",
|
||||
requiresSeparator: true,
|
||||
description: "Add a requirement on the given module",
|
||||
args: {
|
||||
name: "path",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-droprequire",
|
||||
requiresSeparator: true,
|
||||
description: "Drop a requirement on the given module",
|
||||
args: {
|
||||
name: "path",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-exclude",
|
||||
requiresSeparator: true,
|
||||
description: "Add an exclusion on the given module",
|
||||
args: {
|
||||
name: "path",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-dropexclude",
|
||||
requiresSeparator: true,
|
||||
description: "Drop an exclusion on the given module",
|
||||
args: {
|
||||
name: "path",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-replace",
|
||||
requiresSeparator: true,
|
||||
description:
|
||||
"Add a replacement of the given module path and version pair",
|
||||
args: {
|
||||
name: "path",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-dropreplace",
|
||||
requiresSeparator: true,
|
||||
description:
|
||||
"Drops a replacement of the given module path and version pair",
|
||||
args: {
|
||||
name: "path",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-retract",
|
||||
requiresSeparator: true,
|
||||
description: "Add a retraction for the given version",
|
||||
args: {
|
||||
name: "version",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-dropretract",
|
||||
requiresSeparator: true,
|
||||
description: "Drop a retraction for the given version",
|
||||
args: {
|
||||
name: "version",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-fmt",
|
||||
description:
|
||||
"Format the go.mod file without making other changes",
|
||||
},
|
||||
{
|
||||
name: "-print",
|
||||
description:
|
||||
"Print the final go.mod in its text format instead of writing it back to disk",
|
||||
},
|
||||
{
|
||||
name: "-json",
|
||||
description:
|
||||
"Print the final go.mod in JSON format instead of writing it back to disk in text forma",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "graph",
|
||||
description: "Print the module requirement graph",
|
||||
},
|
||||
{
|
||||
name: "init",
|
||||
description:
|
||||
"Initialize and write a new go.mod file in the current directory",
|
||||
args: {
|
||||
name: "module path",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "tidy",
|
||||
description:
|
||||
"Ensure that the go.mod file matches the source code in the module",
|
||||
options: [
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Attempt to proceed despite errors encountered while loading packages",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Print information about removed modules",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "vendor",
|
||||
description:
|
||||
"Construct a directory named vendor in the main module's root directory",
|
||||
options: [
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Attempt to proceed despite errors encountered while loading packages",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Print information about removed modules",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "verify",
|
||||
description:
|
||||
"Check that dependencies of the main module stored in the module cache have not been modified since they were downloaded",
|
||||
},
|
||||
{
|
||||
name: "why",
|
||||
description:
|
||||
"Show a shortest path in the import graph from the main module to each of the listed packages",
|
||||
options: [
|
||||
{
|
||||
name: "-m",
|
||||
description: "Treat its arguments as a list of modules",
|
||||
},
|
||||
{
|
||||
name: "-vendor",
|
||||
description:
|
||||
"Ignore imports in tests of packages outside the main module",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "packages",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "work",
|
||||
description: "Workspace maintenance",
|
||||
subcommands: [
|
||||
{
|
||||
name: "edit",
|
||||
description: "Edit go.work from tools or scripts",
|
||||
options: [
|
||||
{
|
||||
name: "-fmt",
|
||||
description:
|
||||
"The -fmt flag reformats the go.work file without making other changes. This reformatting is also implied by any other modifications that use or rewrite the go.mod file. The only time this flag is needed is if no other flags are specified, as in 'go work edit -fmt'",
|
||||
},
|
||||
{
|
||||
name: "-use",
|
||||
requiresSeparator: true,
|
||||
description:
|
||||
"The -use=path and -dropuse=path flags add and drop a use directive from the go.work file's set of module directories",
|
||||
args: {
|
||||
name: "path",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-dropuse",
|
||||
requiresSeparator: true,
|
||||
description:
|
||||
"The -use=path and -dropuse=path flags add and drop a use directive from the go.work file's set of module directories",
|
||||
args: {
|
||||
name: "path",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-replace",
|
||||
requiresSeparator: true,
|
||||
description:
|
||||
"The -replace=old[@v]=new[@v] flag adds a replacement of the given module path and version pair. If the @v in old@v is omitted, a replacement without a version on the left side is added, which applies to all versions of the old module path. If the @v in new@v is omitted, the new path should be a local module root directory, not a module path. Note that -replace overrides any redundant replacements for old[@v], so omitting @v will drop existing replacements for specific versions",
|
||||
args: {
|
||||
name: "old[@v]=new[@v]",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-dropreplace",
|
||||
requiresSeparator: true,
|
||||
description:
|
||||
"The -dropreplace=old[@v] flag drops a replacement of the given module path and version pair. If the @v is omitted, a replacement without a version on the left side is dropped",
|
||||
args: {
|
||||
name: "old[@v]",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-go",
|
||||
requiresSeparator: true,
|
||||
description: "Set the expected Go language version",
|
||||
args: {
|
||||
name: "version",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-print",
|
||||
description:
|
||||
"The -print flag prints the final go.work in its text format instead of writing it back to go.mod",
|
||||
},
|
||||
{
|
||||
name: "-json",
|
||||
description:
|
||||
"The -json flag prints the final go.work file in JSON format instead of writing it back to go.mod",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "init",
|
||||
description: "Initialize workspace file",
|
||||
args: {
|
||||
name: "moddirs",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "sync",
|
||||
description: "Sync workspace build list to modules",
|
||||
},
|
||||
{
|
||||
name: "use",
|
||||
description: "Add modules to workspace file",
|
||||
options: [
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"The -r flag searches recursively for modules in the argument directories, and the use command operates as if each of the directories were specified as arguments: namely, use directives will be added for directories that exist, and removed for directories that do not exist",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "moddirs",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "run",
|
||||
description: "Compile and run Go program",
|
||||
options: [
|
||||
...globalOptions,
|
||||
{
|
||||
name: "-exec",
|
||||
description: "Invoke the binary using xprog",
|
||||
args: {},
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "package",
|
||||
isScript: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "test",
|
||||
description: "Test packages",
|
||||
options: [
|
||||
...globalOptions,
|
||||
{
|
||||
name: "-args",
|
||||
description:
|
||||
"Pass the remainder of the command line to the test binary",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Compile the test binary to pkg.test but do not run it",
|
||||
},
|
||||
{
|
||||
name: "-exec",
|
||||
description: "Invoke the binary using xprog",
|
||||
args: {},
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description: "Install packages that are dependencies of the test",
|
||||
},
|
||||
{
|
||||
name: "-json",
|
||||
description: "Convert test output to JSON suitable",
|
||||
},
|
||||
{
|
||||
name: "-o",
|
||||
description: "Compile the test binary to the named file",
|
||||
args: {
|
||||
name: "file",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "tool",
|
||||
description: "Run specified go tool",
|
||||
options: [
|
||||
{
|
||||
name: "-n",
|
||||
description:
|
||||
"Print the command that would be executed but not execute it",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "tool",
|
||||
generators: {
|
||||
script: ["go", "tool"],
|
||||
splitOn: "\n",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
description: "Print Go version",
|
||||
options: [
|
||||
{
|
||||
name: "-m",
|
||||
description:
|
||||
"Print each executable's embedded module version information",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Report unrecognized files",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "file",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "vet",
|
||||
description: "Report likely mistakes in packages",
|
||||
options: [
|
||||
...resolutionAndExecutionOptions,
|
||||
{
|
||||
name: "-vettool",
|
||||
requiresSeparator: true,
|
||||
description:
|
||||
"Select a different analysis tool with alternative or additional checks",
|
||||
args: {
|
||||
name: "tool",
|
||||
},
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "package",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
16822
extensions/terminal-suggest/src/completions/upstream/pip.ts
Normal file
16822
extensions/terminal-suggest/src/completions/upstream/pip.ts
Normal file
File diff suppressed because it is too large
Load Diff
126
extensions/terminal-suggest/src/completions/upstream/ruby.ts
Normal file
126
extensions/terminal-suggest/src/completions/upstream/ruby.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "ruby",
|
||||
description: "Interpreted object-oriented scripting language",
|
||||
options: [
|
||||
{
|
||||
name: "--copyright",
|
||||
description: "Prints the copyright notice",
|
||||
},
|
||||
{
|
||||
name: "--version",
|
||||
description: "Prints the version of Ruby interpreter",
|
||||
},
|
||||
{
|
||||
name: "-0",
|
||||
description:
|
||||
"Specifies the input record separator ($/) as an octal number",
|
||||
args: { name: "octal" },
|
||||
},
|
||||
{
|
||||
name: "-C",
|
||||
description: "Causes Ruby to switch to the directory",
|
||||
args: { name: "directory", template: "folders" },
|
||||
},
|
||||
{
|
||||
name: "-F",
|
||||
description: "Specifies input field separator ($;)",
|
||||
args: { name: "pattern" },
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description:
|
||||
"Used to tell Ruby where to load the library scripts. Directory path will be added to the load-path variable ($:)",
|
||||
args: { name: "directory", template: "folders" },
|
||||
},
|
||||
{
|
||||
name: "-K",
|
||||
description: "Specifies KANJI (Japanese) encoding",
|
||||
args: { name: "kcode" },
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description:
|
||||
"Makes Ruby use the PATH environment variable to search for script, unless its name begins with a slash. This is used to emulate #! on machines that don't support it, in the following manner: #! /usr/local/bin/ruby # This line makes the next one a comment in Ruby \\ exec /usr/local/bin/ruby -S $0 $*",
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description: "Turns on taint checks at the specified level (default 1)",
|
||||
args: { name: "level" },
|
||||
},
|
||||
{
|
||||
name: "-a",
|
||||
description: "Turns on auto-split mode when used with -n or -p",
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description:
|
||||
"Causes Ruby to check the syntax of the script and exit without executing. If there are no syntax errors, Ruby will print “Syntax OK” to the standard output",
|
||||
},
|
||||
{
|
||||
name: ["-d", "--debug"],
|
||||
description: "Turns on debug mode. $DEBUG will be set to true",
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Specifies script from command-line while telling Ruby not to search the rest of arguments for a script file name",
|
||||
args: { name: "command" },
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Prints a summary of the options",
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Specifies in-place-edit mode. The extension, if specified, is added to old file name to make a backup copy",
|
||||
args: { name: "extension", isOptional: true },
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description:
|
||||
"Enables automatic line-ending processing, which means to firstly set $\\ to the value of $/, and secondly chops every line read using chop!",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description:
|
||||
"Causes Ruby to assume the following loop around your script",
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description: `Acts mostly same as -n switch, but print the value of variable $_ at the each end of the loop`,
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description: "Causes Ruby to load the library using require",
|
||||
args: { name: "library" },
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Enables some switch parsing for switches after script name but before any file name arguments (or before a --)",
|
||||
},
|
||||
{
|
||||
name: ["-v", "--verbose"],
|
||||
description: "Enables verbose mode",
|
||||
},
|
||||
{
|
||||
name: "-w",
|
||||
description:
|
||||
"Enables verbose mode without printing version message at the beginning. It sets the $VERBOSE variable to true",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"Tells Ruby that the script is embedded in a message. Leading garbage will be discarded until the first that starts with “#!” and contains the string, “ruby”. Any meaningful switches on that line will applied. The end of script must be specified with either EOF, ^D (control-D), ^Z (control-Z), or reserved word __END__. If the directory name is specified, Ruby will switch to that directory before executing script",
|
||||
args: { name: "directory", template: "folders" },
|
||||
},
|
||||
{
|
||||
name: ["-y", "--yydebug"],
|
||||
description:
|
||||
"Turns on compiler debug mode. Ruby will print a bunch of internal state messages during compiling scripts. You don't have to specify this switch, unless you are going to debug the Ruby interpreter",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
3049
extensions/terminal-suggest/src/completions/upstream/ruff.ts
Normal file
3049
extensions/terminal-suggest/src/completions/upstream/ruff.ts
Normal file
File diff suppressed because it is too large
Load Diff
101
extensions/terminal-suggest/src/completions/upstream/yo.ts
Normal file
101
extensions/terminal-suggest/src/completions/upstream/yo.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
function toTitleCase(str: string): string {
|
||||
return str
|
||||
.trim()
|
||||
.replace(
|
||||
/\w\S*/g,
|
||||
(txt) => txt.charAt(0).toUpperCase() + txt.slice(1).toLowerCase()
|
||||
);
|
||||
}
|
||||
|
||||
const suggestions: Fig.Suggestion[] = [
|
||||
{
|
||||
name: "doctor",
|
||||
description: "Running sanity checks on your system",
|
||||
icon: "fig://icon?type=alert",
|
||||
},
|
||||
{
|
||||
name: "completion",
|
||||
description: "To enable shell completion for the yo command",
|
||||
icon: "fig://icon?type=asterisk",
|
||||
},
|
||||
];
|
||||
|
||||
// GENERATORS
|
||||
const yeomanGeneratorList: Fig.Generator = {
|
||||
script: ["yo", "--generators"],
|
||||
postProcess: function (out) {
|
||||
try {
|
||||
return out
|
||||
.split("\n")
|
||||
.filter((item) => item.trim() && item !== "Available Generators:")
|
||||
.map(
|
||||
(item) =>
|
||||
({
|
||||
name: item.trim(),
|
||||
icon: "https://avatars.githubusercontent.com/u/1714870?v=4",
|
||||
displayName: toTitleCase(item),
|
||||
description: `${toTitleCase(item)} Generator`,
|
||||
priority: 100,
|
||||
options: [
|
||||
{
|
||||
name: "--help",
|
||||
description: `Help of "${toTitleCase(item)}" generator`,
|
||||
},
|
||||
],
|
||||
}) as Fig.Suggestion
|
||||
) as Fig.Suggestion[];
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "yo",
|
||||
description: "Yeoman generator",
|
||||
args: {
|
||||
name: "generator",
|
||||
generators: yeomanGeneratorList,
|
||||
suggestions: [...suggestions],
|
||||
isCommand: true,
|
||||
isOptional: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "--help",
|
||||
description: "Print info and generator's options and usage",
|
||||
},
|
||||
{
|
||||
name: ["-f", "--force"],
|
||||
description: "Overwrite files that already exist",
|
||||
isDangerous: true,
|
||||
},
|
||||
{
|
||||
name: "--version",
|
||||
description: "Print version",
|
||||
},
|
||||
{
|
||||
name: "--no-color",
|
||||
description: "Disable color",
|
||||
},
|
||||
{
|
||||
name: "--insight",
|
||||
description: "Enable anonymous tracking",
|
||||
},
|
||||
{
|
||||
name: "--no-insight",
|
||||
description: "Disable anonymous tracking",
|
||||
},
|
||||
{
|
||||
name: "--generators",
|
||||
description: "Print available generators",
|
||||
},
|
||||
{
|
||||
name: "--local-only",
|
||||
description: "Disable lookup of globally-installed generators",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
@@ -4,9 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export const upstreamSpecs = [
|
||||
'apt',
|
||||
'basename',
|
||||
'brew',
|
||||
'cat',
|
||||
'chmod',
|
||||
'chown',
|
||||
@@ -44,7 +42,6 @@ export const upstreamSpecs = [
|
||||
'more',
|
||||
'mount',
|
||||
'mv',
|
||||
'nano',
|
||||
'nl',
|
||||
'od',
|
||||
'passwd',
|
||||
@@ -64,7 +61,6 @@ export const upstreamSpecs = [
|
||||
'sort',
|
||||
'source',
|
||||
'split',
|
||||
'ssh',
|
||||
'stat',
|
||||
'su',
|
||||
'sudo',
|
||||
@@ -92,14 +88,47 @@ export const upstreamSpecs = [
|
||||
'xxd',
|
||||
'zip',
|
||||
|
||||
// OS package management
|
||||
'apt',
|
||||
'brew',
|
||||
|
||||
// Editors
|
||||
'nano',
|
||||
'vim',
|
||||
|
||||
// Shells
|
||||
'ssh',
|
||||
|
||||
// Android
|
||||
'adb',
|
||||
|
||||
// Docker
|
||||
'docker',
|
||||
'docker-compose',
|
||||
|
||||
// Dotnet
|
||||
'dotnet',
|
||||
|
||||
// Go
|
||||
'go',
|
||||
|
||||
// JavaScript / TypeScript
|
||||
'node',
|
||||
'npm',
|
||||
'nvm',
|
||||
'pnpm',
|
||||
'yarn',
|
||||
'yo',
|
||||
|
||||
// Python
|
||||
'pip',
|
||||
'python',
|
||||
'python3',
|
||||
'pnpm',
|
||||
'node',
|
||||
'nvm',
|
||||
'vim',
|
||||
'ruff',
|
||||
|
||||
// Ruby
|
||||
'bundle',
|
||||
'ruby',
|
||||
];
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user