mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
Fix indentation mapping
This commit is contained in:
@@ -16,7 +16,7 @@ const replaceStrings = [
|
||||
'import { filepaths } from \'../../helpers/filepaths\';'
|
||||
],
|
||||
];
|
||||
const indentSearch = [20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1].map(e => new RegExp('^' + ' '.repeat(e * 2), 'g'));
|
||||
const indentSearch = [20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1].map(e => new RegExp('^' + ' '.repeat(e * 2), 'gm'));
|
||||
const indentReplaceValue = [20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1].map(e => '\t'.repeat(e));
|
||||
|
||||
const specSpecificReplaceStrings = new Map([
|
||||
|
||||
@@ -1,355 +1,355 @@
|
||||
import { filepaths } from '../../helpers/filepaths';
|
||||
|
||||
const packages: Fig.Generator = {
|
||||
// only trigger when the token length transitions to or from 0
|
||||
trigger: (current, previous) =>
|
||||
current.length === 0 || (previous.length === 0 && current.length > 0),
|
||||
// only trigger when the token length transitions to or from 0
|
||||
trigger: (current, previous) =>
|
||||
current.length === 0 || (previous.length === 0 && current.length > 0),
|
||||
|
||||
// have to use `custom` to skip running the script when length is 0
|
||||
custom: async (tokens, executeShellCommand) => {
|
||||
const finalToken = tokens[tokens.length - 1];
|
||||
if (finalToken.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const { stdout } = await executeShellCommand({
|
||||
command: "apt",
|
||||
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
|
||||
args: ["list"],
|
||||
});
|
||||
// have to use `custom` to skip running the script when length is 0
|
||||
custom: async (tokens, executeShellCommand) => {
|
||||
const finalToken = tokens[tokens.length - 1];
|
||||
if (finalToken.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const { stdout } = await executeShellCommand({
|
||||
command: "apt",
|
||||
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
|
||||
args: ["list"],
|
||||
});
|
||||
|
||||
// Only lines matching the first character, delete characters after '/'
|
||||
return stdout
|
||||
.trim()
|
||||
.split("\n")
|
||||
.filter((name) => name.startsWith(finalToken))
|
||||
.map((name) => name.replace(/\/.*/, ""))
|
||||
.map((name) => ({
|
||||
name,
|
||||
description: "Package",
|
||||
icon: "📦",
|
||||
// make the suggestions... actually show up
|
||||
// see https://github.com/withfig/autocomplete/pull/1429#discussion_r950688126
|
||||
priority: 50,
|
||||
}));
|
||||
},
|
||||
// Only lines matching the first character, delete characters after '/'
|
||||
return stdout
|
||||
.trim()
|
||||
.split("\n")
|
||||
.filter((name) => name.startsWith(finalToken))
|
||||
.map((name) => name.replace(/\/.*/, ""))
|
||||
.map((name) => ({
|
||||
name,
|
||||
description: "Package",
|
||||
icon: "📦",
|
||||
// make the suggestions... actually show up
|
||||
// see https://github.com/withfig/autocomplete/pull/1429#discussion_r950688126
|
||||
priority: 50,
|
||||
}));
|
||||
},
|
||||
};
|
||||
|
||||
const installedPackages: Fig.Generator = {
|
||||
script: ["apt", "list", "--installed"],
|
||||
postProcess: function (a) {
|
||||
return a
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((b) => {
|
||||
return {
|
||||
name: b.substring(0, b.indexOf("/")),
|
||||
description: "Package",
|
||||
icon: "📦",
|
||||
};
|
||||
});
|
||||
},
|
||||
script: ["apt", "list", "--installed"],
|
||||
postProcess: function (a) {
|
||||
return a
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((b) => {
|
||||
return {
|
||||
name: b.substring(0, b.indexOf("/")),
|
||||
description: "Package",
|
||||
icon: "📦",
|
||||
};
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
const upgradablePackages: Fig.Generator = {
|
||||
script: ["apt", "list", "--upgradable"],
|
||||
postProcess: function (a) {
|
||||
return a
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((b) => {
|
||||
return {
|
||||
name: b.substring(0, b.indexOf("/")),
|
||||
description: "Package",
|
||||
icon: "📦",
|
||||
};
|
||||
});
|
||||
},
|
||||
script: ["apt", "list", "--upgradable"],
|
||||
postProcess: function (a) {
|
||||
return a
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((b) => {
|
||||
return {
|
||||
name: b.substring(0, b.indexOf("/")),
|
||||
description: "Package",
|
||||
icon: "📦",
|
||||
};
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
const yesNoOptions: Fig.Option[] = [
|
||||
{
|
||||
name: "-y",
|
||||
description: "Assume yes to all prompts",
|
||||
exclusiveOn: ["--assume-no"],
|
||||
},
|
||||
{
|
||||
name: "--assume-no",
|
||||
description: "Assume no to all prompts",
|
||||
exclusiveOn: ["-y"],
|
||||
},
|
||||
{
|
||||
name: "-y",
|
||||
description: "Assume yes to all prompts",
|
||||
exclusiveOn: ["--assume-no"],
|
||||
},
|
||||
{
|
||||
name: "--assume-no",
|
||||
description: "Assume no to all prompts",
|
||||
exclusiveOn: ["-y"],
|
||||
},
|
||||
];
|
||||
|
||||
const installationOptions: Fig.Option[] = [
|
||||
{
|
||||
name: ["-d", "--download-only"],
|
||||
description:
|
||||
"For any operation that would download packages, download them, but do nothing else",
|
||||
},
|
||||
{
|
||||
name: "--no-download",
|
||||
description:
|
||||
"Do not download packages, attempt to use already downloaded packages",
|
||||
},
|
||||
{
|
||||
name: ["-d", "--download-only"],
|
||||
description:
|
||||
"For any operation that would download packages, download them, but do nothing else",
|
||||
},
|
||||
{
|
||||
name: "--no-download",
|
||||
description:
|
||||
"Do not download packages, attempt to use already downloaded packages",
|
||||
},
|
||||
];
|
||||
|
||||
const simulate: Fig.Option[] = [
|
||||
{
|
||||
name: ["-s", "--simulate"],
|
||||
description:
|
||||
"Simulate running this command and show it's output, without actually changing anything",
|
||||
},
|
||||
{
|
||||
name: ["-s", "--simulate"],
|
||||
description:
|
||||
"Simulate running this command and show it's output, without actually changing anything",
|
||||
},
|
||||
];
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "apt",
|
||||
description: "Package manager for Debian-based Linux distributions",
|
||||
subcommands: [
|
||||
{
|
||||
name: "update",
|
||||
description: "Update the package database",
|
||||
options: [...yesNoOptions],
|
||||
},
|
||||
{
|
||||
name: "upgrade",
|
||||
description: "Install all available upgrades",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "Package(s) to upgrade",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
generators: upgradablePackages,
|
||||
},
|
||||
options: [...installationOptions, ...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "full-upgrade",
|
||||
description:
|
||||
"Install available upgrades, removing currently installed packages if needed to upgrade the system as a whole",
|
||||
options: [...installationOptions, ...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "install",
|
||||
description: "Install package(s)",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to install",
|
||||
isVariadic: true,
|
||||
generators: [packages, filepaths({ extensions: ["deb"] })],
|
||||
},
|
||||
options: [
|
||||
...installationOptions,
|
||||
...yesNoOptions,
|
||||
...simulate,
|
||||
{
|
||||
name: "--reinstall",
|
||||
description: "Reinstall the package if it is already installed",
|
||||
},
|
||||
{
|
||||
name: ["-f", "--fix-broken"],
|
||||
description: "Attempt to fix broken packages",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "reinstall",
|
||||
description: "Reinstall package(s)",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to reinstall",
|
||||
isVariadic: true,
|
||||
generators: installedPackages,
|
||||
},
|
||||
options: [...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "remove",
|
||||
description: "Remove package(s)",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to remove",
|
||||
isVariadic: true,
|
||||
generators: installedPackages,
|
||||
},
|
||||
options: [
|
||||
...yesNoOptions,
|
||||
...simulate,
|
||||
{
|
||||
name: ["-f", "--fix-broken"],
|
||||
description: "Attempt to fix broken packages",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "purge",
|
||||
description: "Remove package(s) and their configuration files",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to purge",
|
||||
isVariadic: true,
|
||||
generators: installedPackages,
|
||||
},
|
||||
options: [...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: ["autoremove", "auto-remove"],
|
||||
description: "Remove unused packages",
|
||||
options: [...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "list",
|
||||
description: "List packages",
|
||||
options: [
|
||||
{
|
||||
name: "--installed",
|
||||
description: "List installed packages",
|
||||
},
|
||||
{
|
||||
name: "--upgradable",
|
||||
description: "List upgradable packages",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "search",
|
||||
description: "Search for packages",
|
||||
args: {
|
||||
name: "query",
|
||||
description: "The query to search for",
|
||||
},
|
||||
options: [...yesNoOptions],
|
||||
},
|
||||
{
|
||||
name: "show",
|
||||
description: "Show package details",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to show",
|
||||
generators: packages,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "satisfy",
|
||||
description: "Satisfy package dependencies",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to satisfy",
|
||||
isVariadic: true,
|
||||
generators: packages,
|
||||
},
|
||||
options: [...installationOptions, ...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "clean",
|
||||
description: "Remove downloaded package files",
|
||||
options: [...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "edit-sources",
|
||||
description: "Edit the list of package sources",
|
||||
options: [...yesNoOptions],
|
||||
},
|
||||
{
|
||||
// docs for this weren't the greatest, some descriptions might be slightly (or very) wrong.
|
||||
name: "source",
|
||||
description: "Fetch package source files",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to get source files for",
|
||||
isVariadic: true,
|
||||
generators: packages,
|
||||
},
|
||||
options: [
|
||||
...installationOptions,
|
||||
...yesNoOptions,
|
||||
...simulate,
|
||||
{
|
||||
name: "--compile",
|
||||
description:
|
||||
"Compile the package to a binary using dpkg-buildpackage",
|
||||
},
|
||||
{
|
||||
name: "--only-source",
|
||||
// no idea how this works
|
||||
},
|
||||
{
|
||||
name: "--host-architecture",
|
||||
description: "The architecture to build for",
|
||||
args: {
|
||||
name: "architecture",
|
||||
description: "The architecture to build for",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
// I don't understand this either
|
||||
name: "build-dep",
|
||||
description:
|
||||
"Install/remove packages in an attempt to satisfy the build dependencies for a source package",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to build dependencies for",
|
||||
generators: packages,
|
||||
},
|
||||
options: [
|
||||
...installationOptions,
|
||||
...yesNoOptions,
|
||||
...simulate,
|
||||
{
|
||||
name: "--host-architecture",
|
||||
description: "The architecture to build for",
|
||||
args: {
|
||||
name: "architecture",
|
||||
description: "The architecture to build for",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--only-source",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "download",
|
||||
description: "Download package binary into the current directory",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to download",
|
||||
generators: packages,
|
||||
},
|
||||
options: [...installationOptions, ...yesNoOptions],
|
||||
},
|
||||
{
|
||||
name: ["autoclean", "auto-clean"],
|
||||
description:
|
||||
"Like clean, but only removes package files that can no longer be downloaded",
|
||||
options: [...installationOptions, ...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "changelog",
|
||||
description: "Show the changelog for a package",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to show the changelog for",
|
||||
generators: packages,
|
||||
isVariadic: true,
|
||||
},
|
||||
options: [...installationOptions, ...yesNoOptions],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help message and exit",
|
||||
isPersistent: true,
|
||||
priority: 40,
|
||||
},
|
||||
{
|
||||
name: ["-v", "--version"],
|
||||
description: "Print version information and exit",
|
||||
isPersistent: true,
|
||||
priority: 40,
|
||||
},
|
||||
],
|
||||
name: "apt",
|
||||
description: "Package manager for Debian-based Linux distributions",
|
||||
subcommands: [
|
||||
{
|
||||
name: "update",
|
||||
description: "Update the package database",
|
||||
options: [...yesNoOptions],
|
||||
},
|
||||
{
|
||||
name: "upgrade",
|
||||
description: "Install all available upgrades",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "Package(s) to upgrade",
|
||||
isVariadic: true,
|
||||
isOptional: true,
|
||||
generators: upgradablePackages,
|
||||
},
|
||||
options: [...installationOptions, ...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "full-upgrade",
|
||||
description:
|
||||
"Install available upgrades, removing currently installed packages if needed to upgrade the system as a whole",
|
||||
options: [...installationOptions, ...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "install",
|
||||
description: "Install package(s)",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to install",
|
||||
isVariadic: true,
|
||||
generators: [packages, filepaths({ extensions: ["deb"] })],
|
||||
},
|
||||
options: [
|
||||
...installationOptions,
|
||||
...yesNoOptions,
|
||||
...simulate,
|
||||
{
|
||||
name: "--reinstall",
|
||||
description: "Reinstall the package if it is already installed",
|
||||
},
|
||||
{
|
||||
name: ["-f", "--fix-broken"],
|
||||
description: "Attempt to fix broken packages",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "reinstall",
|
||||
description: "Reinstall package(s)",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to reinstall",
|
||||
isVariadic: true,
|
||||
generators: installedPackages,
|
||||
},
|
||||
options: [...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "remove",
|
||||
description: "Remove package(s)",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to remove",
|
||||
isVariadic: true,
|
||||
generators: installedPackages,
|
||||
},
|
||||
options: [
|
||||
...yesNoOptions,
|
||||
...simulate,
|
||||
{
|
||||
name: ["-f", "--fix-broken"],
|
||||
description: "Attempt to fix broken packages",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "purge",
|
||||
description: "Remove package(s) and their configuration files",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to purge",
|
||||
isVariadic: true,
|
||||
generators: installedPackages,
|
||||
},
|
||||
options: [...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: ["autoremove", "auto-remove"],
|
||||
description: "Remove unused packages",
|
||||
options: [...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "list",
|
||||
description: "List packages",
|
||||
options: [
|
||||
{
|
||||
name: "--installed",
|
||||
description: "List installed packages",
|
||||
},
|
||||
{
|
||||
name: "--upgradable",
|
||||
description: "List upgradable packages",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "search",
|
||||
description: "Search for packages",
|
||||
args: {
|
||||
name: "query",
|
||||
description: "The query to search for",
|
||||
},
|
||||
options: [...yesNoOptions],
|
||||
},
|
||||
{
|
||||
name: "show",
|
||||
description: "Show package details",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to show",
|
||||
generators: packages,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "satisfy",
|
||||
description: "Satisfy package dependencies",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to satisfy",
|
||||
isVariadic: true,
|
||||
generators: packages,
|
||||
},
|
||||
options: [...installationOptions, ...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "clean",
|
||||
description: "Remove downloaded package files",
|
||||
options: [...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "edit-sources",
|
||||
description: "Edit the list of package sources",
|
||||
options: [...yesNoOptions],
|
||||
},
|
||||
{
|
||||
// docs for this weren't the greatest, some descriptions might be slightly (or very) wrong.
|
||||
name: "source",
|
||||
description: "Fetch package source files",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to get source files for",
|
||||
isVariadic: true,
|
||||
generators: packages,
|
||||
},
|
||||
options: [
|
||||
...installationOptions,
|
||||
...yesNoOptions,
|
||||
...simulate,
|
||||
{
|
||||
name: "--compile",
|
||||
description:
|
||||
"Compile the package to a binary using dpkg-buildpackage",
|
||||
},
|
||||
{
|
||||
name: "--only-source",
|
||||
// no idea how this works
|
||||
},
|
||||
{
|
||||
name: "--host-architecture",
|
||||
description: "The architecture to build for",
|
||||
args: {
|
||||
name: "architecture",
|
||||
description: "The architecture to build for",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
// I don't understand this either
|
||||
name: "build-dep",
|
||||
description:
|
||||
"Install/remove packages in an attempt to satisfy the build dependencies for a source package",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to build dependencies for",
|
||||
generators: packages,
|
||||
},
|
||||
options: [
|
||||
...installationOptions,
|
||||
...yesNoOptions,
|
||||
...simulate,
|
||||
{
|
||||
name: "--host-architecture",
|
||||
description: "The architecture to build for",
|
||||
args: {
|
||||
name: "architecture",
|
||||
description: "The architecture to build for",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--only-source",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "download",
|
||||
description: "Download package binary into the current directory",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to download",
|
||||
generators: packages,
|
||||
},
|
||||
options: [...installationOptions, ...yesNoOptions],
|
||||
},
|
||||
{
|
||||
name: ["autoclean", "auto-clean"],
|
||||
description:
|
||||
"Like clean, but only removes package files that can no longer be downloaded",
|
||||
options: [...installationOptions, ...yesNoOptions, ...simulate],
|
||||
},
|
||||
{
|
||||
name: "changelog",
|
||||
description: "Show the changelog for a package",
|
||||
args: {
|
||||
name: "package",
|
||||
description: "The package you want to show the changelog for",
|
||||
generators: packages,
|
||||
isVariadic: true,
|
||||
},
|
||||
options: [...installationOptions, ...yesNoOptions],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help message and exit",
|
||||
isPersistent: true,
|
||||
priority: 40,
|
||||
},
|
||||
{
|
||||
name: ["-v", "--version"],
|
||||
description: "Print version information and exit",
|
||||
isPersistent: true,
|
||||
priority: 40,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,50 +1,50 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "cat",
|
||||
description: "Concatenate and print files",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-b",
|
||||
description: "Number the non-blank output lines, starting at 1",
|
||||
},
|
||||
name: "cat",
|
||||
description: "Concatenate and print files",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-b",
|
||||
description: "Number the non-blank output lines, starting at 1",
|
||||
},
|
||||
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Display non-printing characters (see the -v option), and display a dollar sign (‘$’) at the end of each line",
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Display non-printing characters (see the -v option), and display a dollar sign (‘$’) at the end of each line",
|
||||
},
|
||||
|
||||
{
|
||||
name: "-l",
|
||||
description:
|
||||
"Set an exclusive advisory lock on the standard output file descriptor. This lock is set using fcntl(2) with the F_SETLKW command. If the output file is already locked, cat will block until the lock is acquired",
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description:
|
||||
"Set an exclusive advisory lock on the standard output file descriptor. This lock is set using fcntl(2) with the F_SETLKW command. If the output file is already locked, cat will block until the lock is acquired",
|
||||
},
|
||||
|
||||
{ name: "-n", description: "Number the output lines, starting at 1" },
|
||||
{ name: "-n", description: "Number the output lines, starting at 1" },
|
||||
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Squeeze multiple adjacent empty lines, causing the output to be single spaced",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Squeeze multiple adjacent empty lines, causing the output to be single spaced",
|
||||
},
|
||||
|
||||
{
|
||||
name: "-t",
|
||||
description:
|
||||
"Display non-printing characters (see the -v option), and display tab characters as ‘^I’",
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description:
|
||||
"Display non-printing characters (see the -v option), and display tab characters as ‘^I’",
|
||||
},
|
||||
|
||||
{ name: "-u", description: "Disable output buffering" },
|
||||
{ name: "-u", description: "Disable output buffering" },
|
||||
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Display non-printing characters so they are visible. Control characters print as ‘^X’ for control-X; the delete character (octal 0177) prints as ‘^?’. Non-ASCII characters (with the high bit set) are printed as ‘M-’ (for meta) followed by the character for the low 7 bits",
|
||||
},
|
||||
],
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Display non-printing characters so they are visible. Control characters print as ‘^X’ for control-X; the delete character (octal 0177) prints as ‘^?’. Non-ASCII characters (with the high bit set) are printed as ‘M-’ (for meta) followed by the character for the low 7 bits",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,88 +1,88 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "chmod",
|
||||
description: "Change file modes or Access Control Lists",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
suggestions: [
|
||||
// Some of the most common chmod's (non-exhaustive)
|
||||
{
|
||||
name: "u+x",
|
||||
type: "arg",
|
||||
description: "Give execute permission for the user",
|
||||
icon: "🔐",
|
||||
},
|
||||
{
|
||||
name: "a+rx",
|
||||
type: "arg",
|
||||
description: "Adds read and execute permissions for all classes",
|
||||
icon: "🔐",
|
||||
},
|
||||
{
|
||||
name: "744",
|
||||
type: "arg",
|
||||
description:
|
||||
"Sets read, write, and execute permissions for user, and sets read permission for Group and Others",
|
||||
icon: "🔐",
|
||||
},
|
||||
{
|
||||
name: "664",
|
||||
type: "arg",
|
||||
description:
|
||||
"Sets read and write permissions for user and Group, and provides read to Others",
|
||||
icon: "🔐",
|
||||
},
|
||||
{
|
||||
name: "777",
|
||||
type: "arg",
|
||||
description: "⚠️ allows all actions for all users",
|
||||
icon: "🔐",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
// Modifying
|
||||
template: "filepaths",
|
||||
},
|
||||
],
|
||||
name: "chmod",
|
||||
description: "Change file modes or Access Control Lists",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
suggestions: [
|
||||
// Some of the most common chmod's (non-exhaustive)
|
||||
{
|
||||
name: "u+x",
|
||||
type: "arg",
|
||||
description: "Give execute permission for the user",
|
||||
icon: "🔐",
|
||||
},
|
||||
{
|
||||
name: "a+rx",
|
||||
type: "arg",
|
||||
description: "Adds read and execute permissions for all classes",
|
||||
icon: "🔐",
|
||||
},
|
||||
{
|
||||
name: "744",
|
||||
type: "arg",
|
||||
description:
|
||||
"Sets read, write, and execute permissions for user, and sets read permission for Group and Others",
|
||||
icon: "🔐",
|
||||
},
|
||||
{
|
||||
name: "664",
|
||||
type: "arg",
|
||||
description:
|
||||
"Sets read and write permissions for user and Group, and provides read to Others",
|
||||
icon: "🔐",
|
||||
},
|
||||
{
|
||||
name: "777",
|
||||
type: "arg",
|
||||
description: "⚠️ allows all actions for all users",
|
||||
icon: "🔐",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
// Modifying
|
||||
template: "filepaths",
|
||||
},
|
||||
],
|
||||
|
||||
options: [
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"Do not display a diagnostic message if chmod could not modify the mode for file, nor modify the exit status to reflect such failures",
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"If the -R option is specified, symbolic links on the command line are followed and hence unaffected by the command. (Symbolic links encountered during tree traversal are not followed.)",
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description:
|
||||
"If the file is a symbolic link, change the mode of the link itself rather than the file that the link points to",
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"If the -R option is specified, all symbolic links are followed",
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description:
|
||||
"If the -R option is specified, no symbolic links are followed. This is the default",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"Change the modes of the file hierarchies rooted in the files, instead of just the files themselves. Beware of unintentionally matching the ``..'' hard link to the parent directory when using wildcards like ``.*''",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Cause chmod to be verbose, showing filenames as the mode is modified. If the -v flag is specified more than once, the old and new modes of the file will also be printed, in both octal and symbolic notation",
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"Do not display a diagnostic message if chmod could not modify the mode for file, nor modify the exit status to reflect such failures",
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"If the -R option is specified, symbolic links on the command line are followed and hence unaffected by the command. (Symbolic links encountered during tree traversal are not followed.)",
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description:
|
||||
"If the file is a symbolic link, change the mode of the link itself rather than the file that the link points to",
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"If the -R option is specified, all symbolic links are followed",
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description:
|
||||
"If the -R option is specified, no symbolic links are followed. This is the default",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"Change the modes of the file hierarchies rooted in the files, instead of just the files themselves. Beware of unintentionally matching the ``..'' hard link to the parent directory when using wildcards like ``.*''",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Cause chmod to be verbose, showing filenames as the mode is modified. If the -v flag is specified more than once, the old and new modes of the file will also be printed, in both octal and symbolic notation",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,117 +1,117 @@
|
||||
export const existingUsersandGroups: Fig.Generator = {
|
||||
custom: async function (tokens, executeShellCommand) {
|
||||
const colonAdded = tokens.find((token) => token.includes(":"));
|
||||
const nFlagUsed = tokens.find((token) => /^-.*n.*/.test(token));
|
||||
custom: async function (tokens, executeShellCommand) {
|
||||
const colonAdded = tokens.find((token) => token.includes(":"));
|
||||
const nFlagUsed = tokens.find((token) => /^-.*n.*/.test(token));
|
||||
|
||||
let shell: string;
|
||||
// Using `:` as a trigger, check to see if a colon is added
|
||||
// in the current command. If it is, get the system groups
|
||||
// else retrieve the list of system users
|
||||
if (colonAdded) {
|
||||
const { stdout } = await executeShellCommand({
|
||||
command: "bash",
|
||||
args: [
|
||||
"-c",
|
||||
"dscl . -list /Groups PrimaryGroupID | tr -s ' '| sort -r",
|
||||
],
|
||||
});
|
||||
shell = stdout;
|
||||
} else {
|
||||
const { stdout } = await executeShellCommand({
|
||||
command: "bash",
|
||||
args: ["-c", "dscl . -list /Users UniqueID | tr -s ' '| sort -r"],
|
||||
});
|
||||
shell = stdout;
|
||||
}
|
||||
let shell: string;
|
||||
// Using `:` as a trigger, check to see if a colon is added
|
||||
// in the current command. If it is, get the system groups
|
||||
// else retrieve the list of system users
|
||||
if (colonAdded) {
|
||||
const { stdout } = await executeShellCommand({
|
||||
command: "bash",
|
||||
args: [
|
||||
"-c",
|
||||
"dscl . -list /Groups PrimaryGroupID | tr -s ' '| sort -r",
|
||||
],
|
||||
});
|
||||
shell = stdout;
|
||||
} else {
|
||||
const { stdout } = await executeShellCommand({
|
||||
command: "bash",
|
||||
args: ["-c", "dscl . -list /Users UniqueID | tr -s ' '| sort -r"],
|
||||
});
|
||||
shell = stdout;
|
||||
}
|
||||
|
||||
return (
|
||||
shell
|
||||
.split("\n")
|
||||
// The shell command retrieves a table
|
||||
// with rows that look like `user uid`
|
||||
// so each row is split again to get the
|
||||
// user/group and uid/gid
|
||||
.map((line) => line.split(" "))
|
||||
.map((value) => {
|
||||
return {
|
||||
// If the user has entered the option n
|
||||
// suggest the uid/gid instead of user/group
|
||||
name: nFlagUsed ? value[1] : value[0],
|
||||
description: colonAdded
|
||||
? `Group - ${nFlagUsed ? value[0] : `gid: ${value[1]}`}`
|
||||
: `User - ${nFlagUsed ? value[0] : `uid: ${value[1]}`}`,
|
||||
icon: colonAdded ? "👥" : "👤",
|
||||
priority: 90,
|
||||
};
|
||||
})
|
||||
);
|
||||
},
|
||||
trigger: ":",
|
||||
getQueryTerm: ":",
|
||||
return (
|
||||
shell
|
||||
.split("\n")
|
||||
// The shell command retrieves a table
|
||||
// with rows that look like `user uid`
|
||||
// so each row is split again to get the
|
||||
// user/group and uid/gid
|
||||
.map((line) => line.split(" "))
|
||||
.map((value) => {
|
||||
return {
|
||||
// If the user has entered the option n
|
||||
// suggest the uid/gid instead of user/group
|
||||
name: nFlagUsed ? value[1] : value[0],
|
||||
description: colonAdded
|
||||
? `Group - ${nFlagUsed ? value[0] : `gid: ${value[1]}`}`
|
||||
: `User - ${nFlagUsed ? value[0] : `uid: ${value[1]}`}`,
|
||||
icon: colonAdded ? "👥" : "👤",
|
||||
priority: 90,
|
||||
};
|
||||
})
|
||||
);
|
||||
},
|
||||
trigger: ":",
|
||||
getQueryTerm: ":",
|
||||
};
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "chown",
|
||||
description:
|
||||
"Change the user and/or group ownership of a given file, directory, or symbolic link",
|
||||
args: [
|
||||
{
|
||||
name: "owner[:group] or :group",
|
||||
generators: existingUsersandGroups,
|
||||
},
|
||||
{
|
||||
name: "file/directory",
|
||||
isVariadic: true,
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"Don't report any failure to change file owner or group, nor modify the exit status to reflect such failures",
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description:
|
||||
"If the file is a symbolic link, change the user ID and/or the group ID of the link itself",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description:
|
||||
"Interpret user ID and group ID as numeric, avoiding name lookups",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Cause chown to be verbose, showing files as the owner is modified",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"Change the user ID and/or the group ID for the file hierarchies rooted in the files instead of just the files themselves",
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"If the -R option is specified, symbolic links on the command line are followed",
|
||||
exclusiveOn: ["-L", "-P"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"If the -R option is specified, all symbolic links are followed",
|
||||
exclusiveOn: ["-H", "-P"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description:
|
||||
"If the -R option is specified, no symbolic links are followed",
|
||||
exclusiveOn: ["-H", "-L"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
],
|
||||
name: "chown",
|
||||
description:
|
||||
"Change the user and/or group ownership of a given file, directory, or symbolic link",
|
||||
args: [
|
||||
{
|
||||
name: "owner[:group] or :group",
|
||||
generators: existingUsersandGroups,
|
||||
},
|
||||
{
|
||||
name: "file/directory",
|
||||
isVariadic: true,
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"Don't report any failure to change file owner or group, nor modify the exit status to reflect such failures",
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description:
|
||||
"If the file is a symbolic link, change the user ID and/or the group ID of the link itself",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description:
|
||||
"Interpret user ID and group ID as numeric, avoiding name lookups",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Cause chown to be verbose, showing files as the owner is modified",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"Change the user ID and/or the group ID for the file hierarchies rooted in the files instead of just the files themselves",
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"If the -R option is specified, symbolic links on the command line are followed",
|
||||
exclusiveOn: ["-L", "-P"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"If the -R option is specified, all symbolic links are followed",
|
||||
exclusiveOn: ["-H", "-P"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description:
|
||||
"If the -R option is specified, no symbolic links are followed",
|
||||
exclusiveOn: ["-H", "-L"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
],
|
||||
};
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,79 +1,79 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "cp",
|
||||
description: "Copy files and directories",
|
||||
args: [
|
||||
{
|
||||
name: "source",
|
||||
template: ["filepaths", "folders"],
|
||||
isVariadic: true,
|
||||
},
|
||||
{
|
||||
name: "target",
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-a",
|
||||
description:
|
||||
"Preserves structure and attributes of files but not directory structure",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"If the destination file cannot be opened, remove it and create a new file, without prompting for confirmation",
|
||||
exclusiveOn: ["-n"],
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"If the -R option is specified, symbolic links on the command line are followed",
|
||||
exclusiveOn: ["-L", "-P"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Cause cp to write a prompt to the standard error output before copying a file that would overwrite an existing file",
|
||||
exclusiveOn: ["-n"],
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"If the -R option is specified, all symbolic links are followed",
|
||||
exclusiveOn: ["-H", "-P"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Do not overwrite an existing file",
|
||||
exclusiveOn: ["-f", "-i"],
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description:
|
||||
"If the -R option is specified, no symbolic links are followed",
|
||||
exclusiveOn: ["-H", "-L"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"If source designates a directory, cp copies the directory and the entire subtree connected at that point. If source ends in a /, the contents of the directory are copied rather than the directory itself",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Cause cp to be verbose, showing files as they are copied",
|
||||
},
|
||||
{
|
||||
name: "-X",
|
||||
description: "Do not copy Extended Attributes (EAs) or resource forks",
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Copy files using clonefile",
|
||||
},
|
||||
],
|
||||
name: "cp",
|
||||
description: "Copy files and directories",
|
||||
args: [
|
||||
{
|
||||
name: "source",
|
||||
template: ["filepaths", "folders"],
|
||||
isVariadic: true,
|
||||
},
|
||||
{
|
||||
name: "target",
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-a",
|
||||
description:
|
||||
"Preserves structure and attributes of files but not directory structure",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"If the destination file cannot be opened, remove it and create a new file, without prompting for confirmation",
|
||||
exclusiveOn: ["-n"],
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"If the -R option is specified, symbolic links on the command line are followed",
|
||||
exclusiveOn: ["-L", "-P"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Cause cp to write a prompt to the standard error output before copying a file that would overwrite an existing file",
|
||||
exclusiveOn: ["-n"],
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"If the -R option is specified, all symbolic links are followed",
|
||||
exclusiveOn: ["-H", "-P"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Do not overwrite an existing file",
|
||||
exclusiveOn: ["-f", "-i"],
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description:
|
||||
"If the -R option is specified, no symbolic links are followed",
|
||||
exclusiveOn: ["-H", "-L"],
|
||||
dependsOn: ["-R"],
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"If source designates a directory, cp copies the directory and the entire subtree connected at that point. If source ends in a /, the contents of the directory are copied rather than the directory itself",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Cause cp to be verbose, showing files as they are copied",
|
||||
},
|
||||
{
|
||||
name: "-X",
|
||||
description: "Do not copy Extended Attributes (EAs) or resource forks",
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Copy files using clonefile",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,65 +1,65 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "df",
|
||||
description: "Display free disk space",
|
||||
args: {
|
||||
name: "file or filesystem",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-a",
|
||||
description: "Show all mount points",
|
||||
},
|
||||
{
|
||||
name: ["-b", "-P"],
|
||||
description: "Use 512-byte blocks (default)",
|
||||
exclusiveOn: ["-g", "-k", "-m"],
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description: "Use 1073741824-byte (1-Gbyte) blocks",
|
||||
exclusiveOn: ["-b", "-P", "-m", "-k"],
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Use 1048576-byte (1-Mbyte) blocks",
|
||||
exclusiveOn: ["-b", "-P", "-g", "-k"],
|
||||
},
|
||||
{
|
||||
name: "-k",
|
||||
description: "Use 1024-byte (1-Kbyte) blocks",
|
||||
exclusiveOn: ["-b", "-P", "-g", "-m"],
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description: '"Human-readable" output, uses base 10 unit suffixes',
|
||||
exclusiveOn: ["-h"],
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description: '"Human-readable" output, uses base 2 unit suffixes',
|
||||
exclusiveOn: ["-H"],
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description: "Include the number of free inodes",
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description: "Only display information about locally-mounted filesystems",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Print out the previously obtained statistics",
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description:
|
||||
"Only print out statistics for filesystems of the specified types (comma separated)",
|
||||
args: {
|
||||
name: "filesystem",
|
||||
},
|
||||
},
|
||||
],
|
||||
name: "df",
|
||||
description: "Display free disk space",
|
||||
args: {
|
||||
name: "file or filesystem",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-a",
|
||||
description: "Show all mount points",
|
||||
},
|
||||
{
|
||||
name: ["-b", "-P"],
|
||||
description: "Use 512-byte blocks (default)",
|
||||
exclusiveOn: ["-g", "-k", "-m"],
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description: "Use 1073741824-byte (1-Gbyte) blocks",
|
||||
exclusiveOn: ["-b", "-P", "-m", "-k"],
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Use 1048576-byte (1-Mbyte) blocks",
|
||||
exclusiveOn: ["-b", "-P", "-g", "-k"],
|
||||
},
|
||||
{
|
||||
name: "-k",
|
||||
description: "Use 1024-byte (1-Kbyte) blocks",
|
||||
exclusiveOn: ["-b", "-P", "-g", "-m"],
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description: '"Human-readable" output, uses base 10 unit suffixes',
|
||||
exclusiveOn: ["-h"],
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description: '"Human-readable" output, uses base 2 unit suffixes',
|
||||
exclusiveOn: ["-H"],
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description: "Include the number of free inodes",
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description: "Only display information about locally-mounted filesystems",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Print out the previously obtained statistics",
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description:
|
||||
"Only print out statistics for filesystems of the specified types (comma separated)",
|
||||
args: {
|
||||
name: "filesystem",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,93 +1,93 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "du",
|
||||
description: "Display disk usage statistics",
|
||||
options: [
|
||||
{
|
||||
name: "-a",
|
||||
description: "Display an entry for each file in a file hierarchy",
|
||||
exclusiveOn: ["-s", "-d"],
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Display a grand total",
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"Symbolic links on the command line are followed, symbolic links in file hierarchies are not followed",
|
||||
exclusiveOn: ["-L", "-P"],
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description:
|
||||
'"Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte',
|
||||
exclusiveOn: ["-k", "-m", "-g"],
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description: "Display block counts in 1073741824-byte (1-Gbyte) blocks",
|
||||
exclusiveOn: ["-k", "-m", "-h"],
|
||||
},
|
||||
{
|
||||
name: "-k",
|
||||
description: "Display block counts in 1024-byte (1-Kbyte) blocks",
|
||||
exclusiveOn: ["-g", "-m", "-h"],
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Display block counts in 1048576-byte (1-Mbyte) blocks",
|
||||
exclusiveOn: ["-g", "-k", "-h"],
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description: "Ignore files and directories matching the specified mask",
|
||||
args: {
|
||||
name: "mask",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"Symbolic links on the command line and in file hierarchies are followed",
|
||||
exclusiveOn: ["-H", "-P"],
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Generate messages about directories that cannot be read, files that cannot be opened, and so on. This is the default case. This option exists solely for conformance with X/Open Portability Guide Issue 4 (``XPG4'')",
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description: "No symbolic links are followed. This is the default",
|
||||
exclusiveOn: ["-H", "-L"],
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Display an entry for all files and directories depth directories deep",
|
||||
exclusiveOn: ["-a", "-s"],
|
||||
args: {
|
||||
name: "depth",
|
||||
suggestions: ["0", "1", "2"],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Display an entry for each specified file. (Equivalent to -d 0)",
|
||||
exclusiveOn: ["-a", "-d"],
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"Display an entry for each specified file. (Equivalent to -d 0)",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
isOptional: true,
|
||||
name: "files",
|
||||
isVariadic: true,
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
name: "du",
|
||||
description: "Display disk usage statistics",
|
||||
options: [
|
||||
{
|
||||
name: "-a",
|
||||
description: "Display an entry for each file in a file hierarchy",
|
||||
exclusiveOn: ["-s", "-d"],
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Display a grand total",
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"Symbolic links on the command line are followed, symbolic links in file hierarchies are not followed",
|
||||
exclusiveOn: ["-L", "-P"],
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description:
|
||||
'"Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte',
|
||||
exclusiveOn: ["-k", "-m", "-g"],
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description: "Display block counts in 1073741824-byte (1-Gbyte) blocks",
|
||||
exclusiveOn: ["-k", "-m", "-h"],
|
||||
},
|
||||
{
|
||||
name: "-k",
|
||||
description: "Display block counts in 1024-byte (1-Kbyte) blocks",
|
||||
exclusiveOn: ["-g", "-m", "-h"],
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Display block counts in 1048576-byte (1-Mbyte) blocks",
|
||||
exclusiveOn: ["-g", "-k", "-h"],
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description: "Ignore files and directories matching the specified mask",
|
||||
args: {
|
||||
name: "mask",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"Symbolic links on the command line and in file hierarchies are followed",
|
||||
exclusiveOn: ["-H", "-P"],
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Generate messages about directories that cannot be read, files that cannot be opened, and so on. This is the default case. This option exists solely for conformance with X/Open Portability Guide Issue 4 (``XPG4'')",
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description: "No symbolic links are followed. This is the default",
|
||||
exclusiveOn: ["-H", "-L"],
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Display an entry for all files and directories depth directories deep",
|
||||
exclusiveOn: ["-a", "-s"],
|
||||
args: {
|
||||
name: "depth",
|
||||
suggestions: ["0", "1", "2"],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Display an entry for each specified file. (Equivalent to -d 0)",
|
||||
exclusiveOn: ["-a", "-d"],
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"Display an entry for each specified file. (Equivalent to -d 0)",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
isOptional: true,
|
||||
name: "files",
|
||||
isVariadic: true,
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
};
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
const environmentVariableGenerator: Fig.Generator = {
|
||||
custom: async (tokens, _, context) => {
|
||||
if (tokens.length < 3 || tokens[tokens.length - 1].startsWith("$")) {
|
||||
return Object.keys(context.environmentVariables).map((suggestion) => ({
|
||||
name: `$${suggestion}`,
|
||||
type: "arg",
|
||||
description: "Environment Variable",
|
||||
}));
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
trigger: "$",
|
||||
custom: async (tokens, _, context) => {
|
||||
if (tokens.length < 3 || tokens[tokens.length - 1].startsWith("$")) {
|
||||
return Object.keys(context.environmentVariables).map((suggestion) => ({
|
||||
name: `$${suggestion}`,
|
||||
type: "arg",
|
||||
description: "Environment Variable",
|
||||
}));
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
trigger: "$",
|
||||
};
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "echo",
|
||||
description: "Write arguments to the standard output",
|
||||
args: {
|
||||
name: "string",
|
||||
isVariadic: true,
|
||||
optionsCanBreakVariadicArg: false,
|
||||
suggestCurrentToken: true,
|
||||
generators: environmentVariableGenerator,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-n",
|
||||
description: "Do not print the trailing newline character",
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description: "Interpret escape sequences",
|
||||
},
|
||||
{
|
||||
name: "-E",
|
||||
description: "Disable escape sequences",
|
||||
},
|
||||
],
|
||||
name: "echo",
|
||||
description: "Write arguments to the standard output",
|
||||
args: {
|
||||
name: "string",
|
||||
isVariadic: true,
|
||||
optionsCanBreakVariadicArg: false,
|
||||
suggestCurrentToken: true,
|
||||
generators: environmentVariableGenerator,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-n",
|
||||
description: "Do not print the trailing newline character",
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description: "Interpret escape sequences",
|
||||
},
|
||||
{
|
||||
name: "-E",
|
||||
description: "Disable escape sequences",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,71 +1,71 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "find",
|
||||
description: "Walk a file hierarchy",
|
||||
args: [
|
||||
{
|
||||
name: "path",
|
||||
isOptional: true,
|
||||
isVariadic: true,
|
||||
template: ["folders"],
|
||||
},
|
||||
{
|
||||
// TODO Suggestions for primaries and operands. See `man find`
|
||||
name: "expression",
|
||||
description: "Composition of primaries and operands",
|
||||
isOptional: true,
|
||||
isVariadic: true,
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-E",
|
||||
description:
|
||||
"Interpret regular expressions followed by -regex and -iregex primaries as extended",
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"Cause the file information and file type returned for each symbolic link specified to be those referenced by the link",
|
||||
exclusiveOn: ["-L", "-P"],
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"Cause the file information and file type returned for each symbolic link to be those of the file referenced by the link",
|
||||
exclusiveOn: ["-H", "-P"],
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description:
|
||||
"Cause the file information and file type returned for each symbolic link to be those for the link itself",
|
||||
exclusiveOn: ["-H", "-L"],
|
||||
},
|
||||
{
|
||||
name: "-X",
|
||||
description: "Permit find to be safely used in conjunction with xargs",
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description: "Cause find to perform a depth-first traversal",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description: "Specify a file hierarch for find to traverse",
|
||||
args: {
|
||||
name: "path",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Cause find to traverse the file hierarchies in lexicographical order",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"Prevent find from descending into directories that have a device number different than that of the file from which the descent began",
|
||||
},
|
||||
],
|
||||
name: "find",
|
||||
description: "Walk a file hierarchy",
|
||||
args: [
|
||||
{
|
||||
name: "path",
|
||||
isOptional: true,
|
||||
isVariadic: true,
|
||||
template: ["folders"],
|
||||
},
|
||||
{
|
||||
// TODO Suggestions for primaries and operands. See `man find`
|
||||
name: "expression",
|
||||
description: "Composition of primaries and operands",
|
||||
isOptional: true,
|
||||
isVariadic: true,
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-E",
|
||||
description:
|
||||
"Interpret regular expressions followed by -regex and -iregex primaries as extended",
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"Cause the file information and file type returned for each symbolic link specified to be those referenced by the link",
|
||||
exclusiveOn: ["-L", "-P"],
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"Cause the file information and file type returned for each symbolic link to be those of the file referenced by the link",
|
||||
exclusiveOn: ["-H", "-P"],
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description:
|
||||
"Cause the file information and file type returned for each symbolic link to be those for the link itself",
|
||||
exclusiveOn: ["-H", "-L"],
|
||||
},
|
||||
{
|
||||
name: "-X",
|
||||
description: "Permit find to be safely used in conjunction with xargs",
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description: "Cause find to perform a depth-first traversal",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description: "Specify a file hierarch for find to traverse",
|
||||
args: {
|
||||
name: "path",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Cause find to traverse the file hierarchies in lexicographical order",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"Prevent find from descending into directories that have a device number different than that of the file from which the descent began",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,344 +1,344 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "grep",
|
||||
description:
|
||||
"Matches patterns in input text. Supports simple patterns and regular expressions",
|
||||
args: [
|
||||
{
|
||||
name: "search pattern",
|
||||
suggestCurrentToken: true,
|
||||
},
|
||||
{
|
||||
name: "file",
|
||||
template: "filepaths",
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "--help",
|
||||
description:
|
||||
"Print a usage message briefly summarizing these command-line options and the bug-reporting address, then exit",
|
||||
},
|
||||
{
|
||||
name: ["-E", "--extended-regexp"],
|
||||
description:
|
||||
"Interpret PATTERN as an extended regular expression (-E is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-F", "--fixed-string"],
|
||||
description:
|
||||
"Interpret PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched. (-F is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-G", "--basic-regexp"],
|
||||
description:
|
||||
"Interpret PATTERN as a basic regular expression (BRE, see below). This is the default",
|
||||
},
|
||||
{
|
||||
name: ["-e", "--regexp"],
|
||||
description:
|
||||
"Use PATTERN as the pattern. This can be used to specify multiple search patterns, or to protect a pattern beginning with a hyphen (-). (-e is specified by POSIX.)",
|
||||
args: {
|
||||
name: "pattern",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-i", "--ignore-case", "-y"],
|
||||
description:
|
||||
"Ignore case distinctions in both the PATTERN and the input files. (-i is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-v", "--invert-match"],
|
||||
description:
|
||||
"Invert the sense of matching, to select non-matching lines. (-v is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-w", "--word-regexp"],
|
||||
description:
|
||||
"Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore",
|
||||
},
|
||||
{
|
||||
name: ["-x", "--line-regexp"],
|
||||
description:
|
||||
"Select only those matches that exactly match the whole line. (-x is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-c", "--count"],
|
||||
description:
|
||||
"Suppress normal output; instead print a count of matching lines for each input file. With the -v, --invert-match option, count non-matching lines. (-c is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: "--color",
|
||||
description:
|
||||
"Surround the matched (non-empty) strings, matching lines, context lines, file names, line numbers, byte offsets, and separators (for fields and groups of context lines) with escape sequences to display them in color on the terminal. The colors are defined by the environment variable GREP_COLORS. The deprecated environment variable GREP_COLOR is still supported, but its setting does not have priority",
|
||||
args: {
|
||||
name: "WHEN",
|
||||
default: "auto",
|
||||
suggestions: ["never", "always", "auto"],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-L", "--files-without-match"],
|
||||
exclusiveOn: ["-l", "--files-with-matches"],
|
||||
description:
|
||||
"Suppress normal output; instead print the name of each input file from which no output would normally have been printed. The scanning will stop on the first match",
|
||||
},
|
||||
{
|
||||
name: ["-l", "--files-with-matches"],
|
||||
exclusiveOn: ["-L", "--files-without-match"],
|
||||
description:
|
||||
"Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match. (-l is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-m", "--max-count"],
|
||||
description:
|
||||
"Stop reading a file after NUM matching lines. If the input is standard input from a regular file, and NUM matching lines are output, grep ensures that the standard input is positioned to just after the last matching line before exiting, regardless of the presence of trailing context lines. This enables a calling process to resume a search. When grep stops after NUM matching lines, it outputs any trailing context lines. When the -c or --count option is also used, grep does not output a count greater than NUM. When the -v or --invert-match option is also used, grep stops after outputting NUM non-matching lines",
|
||||
args: {
|
||||
name: "NUM",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-o", "--only-matching"],
|
||||
description:
|
||||
"Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line",
|
||||
},
|
||||
{
|
||||
name: ["-q", "--quiet", "--silent"],
|
||||
description:
|
||||
"Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the -s or --no-messages option. (-q is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-s", "--no-messages"],
|
||||
description:
|
||||
"Suppress error messages about nonexistent or unreadable files. Portability note: unlike GNU grep, 7th Edition Unix grep did not conform to POSIX, because it lacked -q and its -s option behaved like GNU grep's -q option. USG -style grep also lacked -q but its -s option behaved like GNU grep. Portable shell scripts should avoid both -q and -s and should redirect standard and error output to /dev/null instead. (-s is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-b", "--byte-offset"],
|
||||
description:
|
||||
"Print the 0-based byte offset within the input file before each line of output. If -o (--only-matching) is specified, print the offset of the matching part itself",
|
||||
},
|
||||
{
|
||||
name: ["-H", "--with-filename"],
|
||||
description:
|
||||
"Print the file name for each match. This is the default when there is more than one file to search",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--no-filename"],
|
||||
description:
|
||||
"Suppress the prefixing of file names on output. This is the default when there is only one file (or only standard input) to search",
|
||||
},
|
||||
{
|
||||
name: "--label",
|
||||
description:
|
||||
"Display input actually coming from standard input as input coming from file LABEL. This is especially useful when implementing tools like zgrep, e.g., gzip -cd foo.gz | grep --label=foo -H something",
|
||||
args: {
|
||||
name: "LABEL",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-n", "--line-number"],
|
||||
description:
|
||||
"Prefix each line of output with the 1-based line number within its input file. (-n is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-T", "--initial-tab"],
|
||||
description:
|
||||
"Make sure that the first character of actual line content lies on a tab stop, so that the alignment of tabs looks normal. This is useful with options that prefix their output to the actual content: -H,-n, and -b. In order to improve the probability that lines from a single file will all start at the same column, this also causes the line number and byte offset (if present) to be printed in a minimum size field width",
|
||||
},
|
||||
{
|
||||
name: ["-u", "--unix-byte-offsets"],
|
||||
description:
|
||||
"Report Unix-style byte offsets. This switch causes grep to report byte offsets as if the file were a Unix-style text file, i.e., with CR characters stripped off. This will produce results identical to running grep on a Unix machine. This option has no effect unless -b option is also used; it has no effect on platforms other than MS-DOS and MS -Windows",
|
||||
},
|
||||
{
|
||||
name: "--null",
|
||||
description:
|
||||
"Output a zero byte (the ASCII NUL character) instead of the character that normally follows a file name. For example, grep -lZ outputs a zero byte after each file name instead of the usual newline. This option makes the output unambiguous, even in the presence of file names containing unusual characters like newlines. This option can be used with commands like find -print0, perl -0, sort -z, and xargs -0 to process arbitrary file names, even those that contain newline characters",
|
||||
},
|
||||
{
|
||||
name: ["-A", "--after-context"],
|
||||
description: "Print num lines of trailing context after each match",
|
||||
args: {
|
||||
name: "NUM",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-B", "--before-context"],
|
||||
description:
|
||||
"Print num lines of leading context before each match. See also the -A and -C options",
|
||||
args: {
|
||||
name: "NUM",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-C", "--context"],
|
||||
description:
|
||||
"Print NUM lines of output context. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given",
|
||||
args: {
|
||||
name: "NUM",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-a", "--text"],
|
||||
description:
|
||||
"Treat all files as ASCII text. Normally grep will simply print ``Binary file ... matches'' if files contain binary characters. Use of this option forces grep to output lines matching the specified pattern",
|
||||
},
|
||||
{
|
||||
name: "--binary-files",
|
||||
description: "Controls searching and printing of binary files",
|
||||
args: {
|
||||
name: "value",
|
||||
default: "binary",
|
||||
suggestions: [
|
||||
{
|
||||
name: "binary",
|
||||
description: "Search binary files but do not print them",
|
||||
},
|
||||
{
|
||||
name: "without-match",
|
||||
description: "Do not search binary files",
|
||||
},
|
||||
{
|
||||
name: "text",
|
||||
description: "Treat all files as text",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-D", "--devices"],
|
||||
description: "Specify the demanded action for devices, FIFOs and sockets",
|
||||
args: {
|
||||
name: "action",
|
||||
default: "read",
|
||||
suggestions: [
|
||||
{
|
||||
name: "read",
|
||||
description: "Read as if they were normal files",
|
||||
},
|
||||
{
|
||||
name: "skip",
|
||||
description: "Devices will be silently skipped",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-d", "--directories"],
|
||||
description: "Specify the demanded action for directories",
|
||||
args: {
|
||||
name: "action",
|
||||
default: "read",
|
||||
suggestions: [
|
||||
{
|
||||
name: "read",
|
||||
description:
|
||||
"Directories are read in the same manner as normal files",
|
||||
},
|
||||
{
|
||||
name: "skip",
|
||||
description: "Silently ignore the directories",
|
||||
},
|
||||
{
|
||||
name: "recurse",
|
||||
description: "Read directories recursively",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--exclude",
|
||||
description:
|
||||
"Note that --exclude patterns take priority over --include patterns, and if no --include pattern is specified, all files are searched that are not excluded. Patterns are matched to the full path specified, not only to the filename component",
|
||||
args: {
|
||||
name: "GLOB",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--exclude-dir",
|
||||
description:
|
||||
"If -R is specified, only directories matching the given filename pattern are searched. Note that --exclude-dir patterns take priority over --include-dir patterns",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "dir",
|
||||
template: "folders",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description:
|
||||
"Ignore binary files. This option is equivalent to --binary-file=without-match option",
|
||||
},
|
||||
{
|
||||
name: "--include",
|
||||
description:
|
||||
"If specified, only files matching the given filename pattern are searched. Note that --exclude patterns take priority over --include patterns. Patterns are matched to the full path specified, not only to the filename component",
|
||||
args: {
|
||||
name: "GLOB",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--include-dir",
|
||||
description:
|
||||
"If -R is specified, only directories matching the given filename pattern are searched. Note that --exclude-dir patterns take priority over --include-dir patterns",
|
||||
args: {
|
||||
name: "dir",
|
||||
template: "folders",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-R", "-r", "--recursive"],
|
||||
description: "Recursively search subdirectories listed",
|
||||
},
|
||||
{
|
||||
name: "--line-buffered",
|
||||
description:
|
||||
"Force output to be line buffered. By default, output is line buffered when standard output is a terminal and block buffered otherwise",
|
||||
},
|
||||
{
|
||||
name: ["-U", "--binary"],
|
||||
description: "Search binary files, but do not attempt to print them",
|
||||
},
|
||||
{
|
||||
name: ["-J", "-bz2decompress"],
|
||||
description:
|
||||
"Decompress the bzip2(1) compressed file before looking for the text",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version number of grep to the standard output stream",
|
||||
},
|
||||
{
|
||||
name: ["-P", "--perl-regexp"],
|
||||
description: "Interpret pattern as a Perl regular expression",
|
||||
},
|
||||
{
|
||||
name: ["-f", "--file"],
|
||||
description:
|
||||
"Obtain patterns from FILE, one per line. The empty file contains zero patterns, and therefore matches nothing. (-f is specified by POSIX.)",
|
||||
args: {
|
||||
name: "FILE",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
],
|
||||
additionalSuggestions: [
|
||||
{
|
||||
name: "-RIn",
|
||||
description:
|
||||
"Search for a pattern [R]ecursively in the current directory, showing matching line [n]umbers, [I]gnoring non-text files",
|
||||
insertValue: "-RI{cursor}",
|
||||
},
|
||||
{
|
||||
name: "-Hn",
|
||||
description:
|
||||
"Print file name with the corresponding line number (n) for each match",
|
||||
insertValue: "-H{cursor}",
|
||||
},
|
||||
],
|
||||
name: "grep",
|
||||
description:
|
||||
"Matches patterns in input text. Supports simple patterns and regular expressions",
|
||||
args: [
|
||||
{
|
||||
name: "search pattern",
|
||||
suggestCurrentToken: true,
|
||||
},
|
||||
{
|
||||
name: "file",
|
||||
template: "filepaths",
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "--help",
|
||||
description:
|
||||
"Print a usage message briefly summarizing these command-line options and the bug-reporting address, then exit",
|
||||
},
|
||||
{
|
||||
name: ["-E", "--extended-regexp"],
|
||||
description:
|
||||
"Interpret PATTERN as an extended regular expression (-E is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-F", "--fixed-string"],
|
||||
description:
|
||||
"Interpret PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched. (-F is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-G", "--basic-regexp"],
|
||||
description:
|
||||
"Interpret PATTERN as a basic regular expression (BRE, see below). This is the default",
|
||||
},
|
||||
{
|
||||
name: ["-e", "--regexp"],
|
||||
description:
|
||||
"Use PATTERN as the pattern. This can be used to specify multiple search patterns, or to protect a pattern beginning with a hyphen (-). (-e is specified by POSIX.)",
|
||||
args: {
|
||||
name: "pattern",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-i", "--ignore-case", "-y"],
|
||||
description:
|
||||
"Ignore case distinctions in both the PATTERN and the input files. (-i is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-v", "--invert-match"],
|
||||
description:
|
||||
"Invert the sense of matching, to select non-matching lines. (-v is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-w", "--word-regexp"],
|
||||
description:
|
||||
"Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore",
|
||||
},
|
||||
{
|
||||
name: ["-x", "--line-regexp"],
|
||||
description:
|
||||
"Select only those matches that exactly match the whole line. (-x is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-c", "--count"],
|
||||
description:
|
||||
"Suppress normal output; instead print a count of matching lines for each input file. With the -v, --invert-match option, count non-matching lines. (-c is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: "--color",
|
||||
description:
|
||||
"Surround the matched (non-empty) strings, matching lines, context lines, file names, line numbers, byte offsets, and separators (for fields and groups of context lines) with escape sequences to display them in color on the terminal. The colors are defined by the environment variable GREP_COLORS. The deprecated environment variable GREP_COLOR is still supported, but its setting does not have priority",
|
||||
args: {
|
||||
name: "WHEN",
|
||||
default: "auto",
|
||||
suggestions: ["never", "always", "auto"],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-L", "--files-without-match"],
|
||||
exclusiveOn: ["-l", "--files-with-matches"],
|
||||
description:
|
||||
"Suppress normal output; instead print the name of each input file from which no output would normally have been printed. The scanning will stop on the first match",
|
||||
},
|
||||
{
|
||||
name: ["-l", "--files-with-matches"],
|
||||
exclusiveOn: ["-L", "--files-without-match"],
|
||||
description:
|
||||
"Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match. (-l is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-m", "--max-count"],
|
||||
description:
|
||||
"Stop reading a file after NUM matching lines. If the input is standard input from a regular file, and NUM matching lines are output, grep ensures that the standard input is positioned to just after the last matching line before exiting, regardless of the presence of trailing context lines. This enables a calling process to resume a search. When grep stops after NUM matching lines, it outputs any trailing context lines. When the -c or --count option is also used, grep does not output a count greater than NUM. When the -v or --invert-match option is also used, grep stops after outputting NUM non-matching lines",
|
||||
args: {
|
||||
name: "NUM",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-o", "--only-matching"],
|
||||
description:
|
||||
"Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line",
|
||||
},
|
||||
{
|
||||
name: ["-q", "--quiet", "--silent"],
|
||||
description:
|
||||
"Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the -s or --no-messages option. (-q is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-s", "--no-messages"],
|
||||
description:
|
||||
"Suppress error messages about nonexistent or unreadable files. Portability note: unlike GNU grep, 7th Edition Unix grep did not conform to POSIX, because it lacked -q and its -s option behaved like GNU grep's -q option. USG -style grep also lacked -q but its -s option behaved like GNU grep. Portable shell scripts should avoid both -q and -s and should redirect standard and error output to /dev/null instead. (-s is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-b", "--byte-offset"],
|
||||
description:
|
||||
"Print the 0-based byte offset within the input file before each line of output. If -o (--only-matching) is specified, print the offset of the matching part itself",
|
||||
},
|
||||
{
|
||||
name: ["-H", "--with-filename"],
|
||||
description:
|
||||
"Print the file name for each match. This is the default when there is more than one file to search",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--no-filename"],
|
||||
description:
|
||||
"Suppress the prefixing of file names on output. This is the default when there is only one file (or only standard input) to search",
|
||||
},
|
||||
{
|
||||
name: "--label",
|
||||
description:
|
||||
"Display input actually coming from standard input as input coming from file LABEL. This is especially useful when implementing tools like zgrep, e.g., gzip -cd foo.gz | grep --label=foo -H something",
|
||||
args: {
|
||||
name: "LABEL",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-n", "--line-number"],
|
||||
description:
|
||||
"Prefix each line of output with the 1-based line number within its input file. (-n is specified by POSIX.)",
|
||||
},
|
||||
{
|
||||
name: ["-T", "--initial-tab"],
|
||||
description:
|
||||
"Make sure that the first character of actual line content lies on a tab stop, so that the alignment of tabs looks normal. This is useful with options that prefix their output to the actual content: -H,-n, and -b. In order to improve the probability that lines from a single file will all start at the same column, this also causes the line number and byte offset (if present) to be printed in a minimum size field width",
|
||||
},
|
||||
{
|
||||
name: ["-u", "--unix-byte-offsets"],
|
||||
description:
|
||||
"Report Unix-style byte offsets. This switch causes grep to report byte offsets as if the file were a Unix-style text file, i.e., with CR characters stripped off. This will produce results identical to running grep on a Unix machine. This option has no effect unless -b option is also used; it has no effect on platforms other than MS-DOS and MS -Windows",
|
||||
},
|
||||
{
|
||||
name: "--null",
|
||||
description:
|
||||
"Output a zero byte (the ASCII NUL character) instead of the character that normally follows a file name. For example, grep -lZ outputs a zero byte after each file name instead of the usual newline. This option makes the output unambiguous, even in the presence of file names containing unusual characters like newlines. This option can be used with commands like find -print0, perl -0, sort -z, and xargs -0 to process arbitrary file names, even those that contain newline characters",
|
||||
},
|
||||
{
|
||||
name: ["-A", "--after-context"],
|
||||
description: "Print num lines of trailing context after each match",
|
||||
args: {
|
||||
name: "NUM",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-B", "--before-context"],
|
||||
description:
|
||||
"Print num lines of leading context before each match. See also the -A and -C options",
|
||||
args: {
|
||||
name: "NUM",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-C", "--context"],
|
||||
description:
|
||||
"Print NUM lines of output context. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given",
|
||||
args: {
|
||||
name: "NUM",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-a", "--text"],
|
||||
description:
|
||||
"Treat all files as ASCII text. Normally grep will simply print ``Binary file ... matches'' if files contain binary characters. Use of this option forces grep to output lines matching the specified pattern",
|
||||
},
|
||||
{
|
||||
name: "--binary-files",
|
||||
description: "Controls searching and printing of binary files",
|
||||
args: {
|
||||
name: "value",
|
||||
default: "binary",
|
||||
suggestions: [
|
||||
{
|
||||
name: "binary",
|
||||
description: "Search binary files but do not print them",
|
||||
},
|
||||
{
|
||||
name: "without-match",
|
||||
description: "Do not search binary files",
|
||||
},
|
||||
{
|
||||
name: "text",
|
||||
description: "Treat all files as text",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-D", "--devices"],
|
||||
description: "Specify the demanded action for devices, FIFOs and sockets",
|
||||
args: {
|
||||
name: "action",
|
||||
default: "read",
|
||||
suggestions: [
|
||||
{
|
||||
name: "read",
|
||||
description: "Read as if they were normal files",
|
||||
},
|
||||
{
|
||||
name: "skip",
|
||||
description: "Devices will be silently skipped",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-d", "--directories"],
|
||||
description: "Specify the demanded action for directories",
|
||||
args: {
|
||||
name: "action",
|
||||
default: "read",
|
||||
suggestions: [
|
||||
{
|
||||
name: "read",
|
||||
description:
|
||||
"Directories are read in the same manner as normal files",
|
||||
},
|
||||
{
|
||||
name: "skip",
|
||||
description: "Silently ignore the directories",
|
||||
},
|
||||
{
|
||||
name: "recurse",
|
||||
description: "Read directories recursively",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--exclude",
|
||||
description:
|
||||
"Note that --exclude patterns take priority over --include patterns, and if no --include pattern is specified, all files are searched that are not excluded. Patterns are matched to the full path specified, not only to the filename component",
|
||||
args: {
|
||||
name: "GLOB",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--exclude-dir",
|
||||
description:
|
||||
"If -R is specified, only directories matching the given filename pattern are searched. Note that --exclude-dir patterns take priority over --include-dir patterns",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "dir",
|
||||
template: "folders",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description:
|
||||
"Ignore binary files. This option is equivalent to --binary-file=without-match option",
|
||||
},
|
||||
{
|
||||
name: "--include",
|
||||
description:
|
||||
"If specified, only files matching the given filename pattern are searched. Note that --exclude patterns take priority over --include patterns. Patterns are matched to the full path specified, not only to the filename component",
|
||||
args: {
|
||||
name: "GLOB",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--include-dir",
|
||||
description:
|
||||
"If -R is specified, only directories matching the given filename pattern are searched. Note that --exclude-dir patterns take priority over --include-dir patterns",
|
||||
args: {
|
||||
name: "dir",
|
||||
template: "folders",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-R", "-r", "--recursive"],
|
||||
description: "Recursively search subdirectories listed",
|
||||
},
|
||||
{
|
||||
name: "--line-buffered",
|
||||
description:
|
||||
"Force output to be line buffered. By default, output is line buffered when standard output is a terminal and block buffered otherwise",
|
||||
},
|
||||
{
|
||||
name: ["-U", "--binary"],
|
||||
description: "Search binary files, but do not attempt to print them",
|
||||
},
|
||||
{
|
||||
name: ["-J", "-bz2decompress"],
|
||||
description:
|
||||
"Decompress the bzip2(1) compressed file before looking for the text",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version number of grep to the standard output stream",
|
||||
},
|
||||
{
|
||||
name: ["-P", "--perl-regexp"],
|
||||
description: "Interpret pattern as a Perl regular expression",
|
||||
},
|
||||
{
|
||||
name: ["-f", "--file"],
|
||||
description:
|
||||
"Obtain patterns from FILE, one per line. The empty file contains zero patterns, and therefore matches nothing. (-f is specified by POSIX.)",
|
||||
args: {
|
||||
name: "FILE",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
],
|
||||
additionalSuggestions: [
|
||||
{
|
||||
name: "-RIn",
|
||||
description:
|
||||
"Search for a pattern [R]ecursively in the current directory, showing matching line [n]umbers, [I]gnoring non-text files",
|
||||
insertValue: "-RI{cursor}",
|
||||
},
|
||||
{
|
||||
name: "-Hn",
|
||||
description:
|
||||
"Print file name with the corresponding line number (n) for each match",
|
||||
insertValue: "-H{cursor}",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "head",
|
||||
description: "Output the first part of files",
|
||||
args: {
|
||||
name: "file",
|
||||
template: "filepaths",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: ["-c", "--bytes"],
|
||||
description: "Print the first [numBytes] bytes of each file",
|
||||
args: { name: "numBytes" },
|
||||
},
|
||||
{
|
||||
name: ["-n", "--lines"],
|
||||
description: "Print the first [numLines] lines instead of the first 10",
|
||||
args: { name: "numLines" },
|
||||
},
|
||||
{
|
||||
name: ["-q", "--quiet", "--silent"],
|
||||
description: "Never print headers giving file names",
|
||||
},
|
||||
{
|
||||
name: ["-v", "--verbose"],
|
||||
description: "Always print headers giving file names",
|
||||
},
|
||||
{ name: "--help", description: "Display this help and exit" },
|
||||
{
|
||||
name: "--version",
|
||||
description: "Output version information and exit",
|
||||
},
|
||||
],
|
||||
name: "head",
|
||||
description: "Output the first part of files",
|
||||
args: {
|
||||
name: "file",
|
||||
template: "filepaths",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: ["-c", "--bytes"],
|
||||
description: "Print the first [numBytes] bytes of each file",
|
||||
args: { name: "numBytes" },
|
||||
},
|
||||
{
|
||||
name: ["-n", "--lines"],
|
||||
description: "Print the first [numLines] lines instead of the first 10",
|
||||
args: { name: "numLines" },
|
||||
},
|
||||
{
|
||||
name: ["-q", "--quiet", "--silent"],
|
||||
description: "Never print headers giving file names",
|
||||
},
|
||||
{
|
||||
name: ["-v", "--verbose"],
|
||||
description: "Always print headers giving file names",
|
||||
},
|
||||
{ name: "--help", description: "Display this help and exit" },
|
||||
{
|
||||
name: "--version",
|
||||
description: "Output version information and exit",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
// Compatibility: macOS
|
||||
|
||||
function processIcon(path: string): string {
|
||||
const idx = path.indexOf(".app/");
|
||||
if (idx === -1) {
|
||||
return "fig://icon?type=gear";
|
||||
}
|
||||
return "fig://" + path.slice(0, idx + 4);
|
||||
const idx = path.indexOf(".app/");
|
||||
if (idx === -1) {
|
||||
return "fig://icon?type=gear";
|
||||
}
|
||||
return "fig://" + path.slice(0, idx + 4);
|
||||
}
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "kill",
|
||||
description: "Terminate or signal a process",
|
||||
args: {
|
||||
name: "pid",
|
||||
isVariadic: true,
|
||||
generators: {
|
||||
script: ["bash", "-c", "ps axo pid,comm | sed 1d"],
|
||||
postProcess: (result: string) => {
|
||||
return result.split("\n").map((line) => {
|
||||
const [pid, path] = line.trim().split(/\s+/);
|
||||
const name = path.slice(path.lastIndexOf("/") + 1);
|
||||
return {
|
||||
name: pid,
|
||||
description: path,
|
||||
displayName: `${pid} (${name})`,
|
||||
icon: processIcon(path),
|
||||
};
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-s",
|
||||
description: "A symbolic signal name specifying the signal to be sent",
|
||||
args: {
|
||||
name: "signal_name",
|
||||
generators: {
|
||||
// Bash's `kill` builtin has different output to /bin/kill
|
||||
script: ["env", "kill", "-l"],
|
||||
postProcess: (out) =>
|
||||
out.match(/\w+/g)?.map((name) => ({
|
||||
name,
|
||||
description: `Send ${name} instead of TERM`,
|
||||
icon: "fig://icon?type=string",
|
||||
})),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description:
|
||||
"If no operand is given, list the signal names; otherwise, write the signal name corresponding to exit_status",
|
||||
args: {
|
||||
name: "exit_status",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
name: "kill",
|
||||
description: "Terminate or signal a process",
|
||||
args: {
|
||||
name: "pid",
|
||||
isVariadic: true,
|
||||
generators: {
|
||||
script: ["bash", "-c", "ps axo pid,comm | sed 1d"],
|
||||
postProcess: (result: string) => {
|
||||
return result.split("\n").map((line) => {
|
||||
const [pid, path] = line.trim().split(/\s+/);
|
||||
const name = path.slice(path.lastIndexOf("/") + 1);
|
||||
return {
|
||||
name: pid,
|
||||
description: path,
|
||||
displayName: `${pid} (${name})`,
|
||||
icon: processIcon(path),
|
||||
};
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-s",
|
||||
description: "A symbolic signal name specifying the signal to be sent",
|
||||
args: {
|
||||
name: "signal_name",
|
||||
generators: {
|
||||
// Bash's `kill` builtin has different output to /bin/kill
|
||||
script: ["env", "kill", "-l"],
|
||||
postProcess: (out) =>
|
||||
out.match(/\w+/g)?.map((name) => ({
|
||||
name,
|
||||
description: `Send ${name} instead of TERM`,
|
||||
icon: "fig://icon?type=string",
|
||||
})),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description:
|
||||
"If no operand is given, list the signal names; otherwise, write the signal name corresponding to exit_status",
|
||||
args: {
|
||||
name: "exit_status",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,153 +1,153 @@
|
||||
// Linux incompatible
|
||||
|
||||
const signals = [
|
||||
"hup",
|
||||
"int",
|
||||
"quit",
|
||||
"ill",
|
||||
"trap",
|
||||
"abrt",
|
||||
"emt",
|
||||
"fpe",
|
||||
"kill",
|
||||
"bus",
|
||||
"segv",
|
||||
"sys",
|
||||
"pipe",
|
||||
"alrm",
|
||||
// This is the default signal
|
||||
// "term",
|
||||
"urg",
|
||||
"stop",
|
||||
"tstp",
|
||||
"cont",
|
||||
"chld",
|
||||
"ttin",
|
||||
"ttou",
|
||||
"io",
|
||||
"xcpu",
|
||||
"xfsz",
|
||||
"vtalrm",
|
||||
"prof",
|
||||
"winch",
|
||||
"info",
|
||||
"usr1",
|
||||
"usr2",
|
||||
"hup",
|
||||
"int",
|
||||
"quit",
|
||||
"ill",
|
||||
"trap",
|
||||
"abrt",
|
||||
"emt",
|
||||
"fpe",
|
||||
"kill",
|
||||
"bus",
|
||||
"segv",
|
||||
"sys",
|
||||
"pipe",
|
||||
"alrm",
|
||||
// This is the default signal
|
||||
// "term",
|
||||
"urg",
|
||||
"stop",
|
||||
"tstp",
|
||||
"cont",
|
||||
"chld",
|
||||
"ttin",
|
||||
"ttou",
|
||||
"io",
|
||||
"xcpu",
|
||||
"xfsz",
|
||||
"vtalrm",
|
||||
"prof",
|
||||
"winch",
|
||||
"info",
|
||||
"usr1",
|
||||
"usr2",
|
||||
];
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "killall",
|
||||
description: "Kill processes by name",
|
||||
args: {
|
||||
name: "process_name",
|
||||
isVariadic: true,
|
||||
generators: {
|
||||
// All processes, only display the path
|
||||
script: ["bash", "-c", "ps -A -o comm | sort -u"],
|
||||
postProcess: (out) =>
|
||||
out
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((path) => {
|
||||
const appExtIndex = path.indexOf(".app/");
|
||||
const isApp = appExtIndex !== -1;
|
||||
const name = path.slice(path.lastIndexOf("/") + 1);
|
||||
const nameChars = new Set(name);
|
||||
const badChars = ["(", "_", "."];
|
||||
return {
|
||||
name,
|
||||
description: path,
|
||||
priority:
|
||||
!badChars.some((char) => nameChars.has(char)) && isApp
|
||||
? 51
|
||||
: 40,
|
||||
icon: isApp
|
||||
? "fig://" + path.slice(0, appExtIndex + 4)
|
||||
: "fig://icon?type=gear",
|
||||
};
|
||||
}),
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-d",
|
||||
description: "Be verbose (dry run) and display number of user processes",
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Use the effective user ID instead of the real user ID for matching processes with -u",
|
||||
},
|
||||
{
|
||||
name: "-help",
|
||||
description: "Display help and exit",
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description: "Request confirmation before killing each process",
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description: "List the names of the available signals and exit",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Match the process name as a regular expression",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Be verbose",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Be verbose (dry run)",
|
||||
},
|
||||
...signals.map((signal) => ({
|
||||
name: "-SIG" + signal.toUpperCase(),
|
||||
description: `Send ${signal.toUpperCase()} instead of TERM`,
|
||||
})),
|
||||
{
|
||||
name: "-u",
|
||||
description:
|
||||
"Limit potentially matching processes to those belonging to the user",
|
||||
args: {
|
||||
name: "user",
|
||||
generators: {
|
||||
script: ["bash", "-c", "dscl . -list /Users | grep -v '^_'"],
|
||||
postProcess: (out) =>
|
||||
out
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((username) => ({
|
||||
name: username,
|
||||
icon: "fig://template?badge=👤",
|
||||
})),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description:
|
||||
"Limit matching processes to those running on the specified TTY",
|
||||
args: {
|
||||
name: "tty",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Limit matching processes to those matching the given name",
|
||||
args: {
|
||||
name: "name",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-q",
|
||||
description: "Suppress error message if no processes are matched",
|
||||
},
|
||||
{
|
||||
name: "-z",
|
||||
description: "Do not skip zombies",
|
||||
},
|
||||
],
|
||||
name: "killall",
|
||||
description: "Kill processes by name",
|
||||
args: {
|
||||
name: "process_name",
|
||||
isVariadic: true,
|
||||
generators: {
|
||||
// All processes, only display the path
|
||||
script: ["bash", "-c", "ps -A -o comm | sort -u"],
|
||||
postProcess: (out) =>
|
||||
out
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((path) => {
|
||||
const appExtIndex = path.indexOf(".app/");
|
||||
const isApp = appExtIndex !== -1;
|
||||
const name = path.slice(path.lastIndexOf("/") + 1);
|
||||
const nameChars = new Set(name);
|
||||
const badChars = ["(", "_", "."];
|
||||
return {
|
||||
name,
|
||||
description: path,
|
||||
priority:
|
||||
!badChars.some((char) => nameChars.has(char)) && isApp
|
||||
? 51
|
||||
: 40,
|
||||
icon: isApp
|
||||
? "fig://" + path.slice(0, appExtIndex + 4)
|
||||
: "fig://icon?type=gear",
|
||||
};
|
||||
}),
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-d",
|
||||
description: "Be verbose (dry run) and display number of user processes",
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Use the effective user ID instead of the real user ID for matching processes with -u",
|
||||
},
|
||||
{
|
||||
name: "-help",
|
||||
description: "Display help and exit",
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description: "Request confirmation before killing each process",
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description: "List the names of the available signals and exit",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Match the process name as a regular expression",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Be verbose",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Be verbose (dry run)",
|
||||
},
|
||||
...signals.map((signal) => ({
|
||||
name: "-SIG" + signal.toUpperCase(),
|
||||
description: `Send ${signal.toUpperCase()} instead of TERM`,
|
||||
})),
|
||||
{
|
||||
name: "-u",
|
||||
description:
|
||||
"Limit potentially matching processes to those belonging to the user",
|
||||
args: {
|
||||
name: "user",
|
||||
generators: {
|
||||
script: ["bash", "-c", "dscl . -list /Users | grep -v '^_'"],
|
||||
postProcess: (out) =>
|
||||
out
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((username) => ({
|
||||
name: username,
|
||||
icon: "fig://template?badge=👤",
|
||||
})),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description:
|
||||
"Limit matching processes to those running on the specified TTY",
|
||||
args: {
|
||||
name: "tty",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Limit matching processes to those matching the given name",
|
||||
args: {
|
||||
name: "name",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-q",
|
||||
description: "Suppress error message if no processes are matched",
|
||||
},
|
||||
{
|
||||
name: "-z",
|
||||
description: "Do not skip zombies",
|
||||
},
|
||||
],
|
||||
};
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "less",
|
||||
description: "Opposite of more",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: ["-?", "--help"],
|
||||
description:
|
||||
'This option displays a summary of the commands accepted by less (the same as the h command). (Depending on how your shell interprets the question mark, it may be necessary to quote the question mark, thus: "-?"',
|
||||
},
|
||||
{
|
||||
name: ["-a", "--search-skip-screen"],
|
||||
description: `By default, forward searches start at the top of the displayed
|
||||
name: "less",
|
||||
description: "Opposite of more",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: ["-?", "--help"],
|
||||
description:
|
||||
'This option displays a summary of the commands accepted by less (the same as the h command). (Depending on how your shell interprets the question mark, it may be necessary to quote the question mark, thus: "-?"',
|
||||
},
|
||||
{
|
||||
name: ["-a", "--search-skip-screen"],
|
||||
description: `By default, forward searches start at the top of the displayed
|
||||
screen and backwards searches start at the bottom of the
|
||||
displayed screen (except for repeated searches invoked by the n
|
||||
or N commands, which start after or before the "target" line
|
||||
@@ -21,10 +21,10 @@ respectively; see the -j option for more about the target line).
|
||||
The -a option causes forward searches to instead start at the
|
||||
bottom of the screen and backward searches to start at the top
|
||||
of the screen, thus skipping all lines displayed on the screen`,
|
||||
},
|
||||
{
|
||||
name: ["-A", "--SEARCH-SKIP-SCREEN"],
|
||||
description: `Causes all forward searches (not just non-repeated searches) to
|
||||
},
|
||||
{
|
||||
name: ["-A", "--SEARCH-SKIP-SCREEN"],
|
||||
description: `Causes all forward searches (not just non-repeated searches) to
|
||||
start just after the target line, and all backward searches to
|
||||
start just before the target line. Thus, forward searches will
|
||||
skip part of the displayed screen (from the first line up to and
|
||||
@@ -32,23 +32,23 @@ including the target line). Similarly backwards searches will
|
||||
skip the displayed screen from the last line up to and including
|
||||
the target line. This was the default behavior in less versions
|
||||
prior to 441`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-b", "--buffers"],
|
||||
args: { name: "n" },
|
||||
description: `Specifies the amount of buffer space less will use for each
|
||||
{
|
||||
name: ["-b", "--buffers"],
|
||||
args: { name: "n" },
|
||||
description: `Specifies the amount of buffer space less will use for each
|
||||
file, in units of kilobytes (1024 bytes). By default 64 KB of
|
||||
buffer space is used for each file (unless the file is a pipe;
|
||||
see the -B option). The -b option specifies instead that n
|
||||
kilobytes of buffer space should be used for each file. If n is
|
||||
-1, buffer space is unlimited; that is, the entire file can be
|
||||
read into memory`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-B", "--auto-buffers"],
|
||||
description: `By default, when data is read from a pipe, buffers are allocated
|
||||
{
|
||||
name: ["-B", "--auto-buffers"],
|
||||
description: `By default, when data is read from a pipe, buffers are allocated
|
||||
automatically as needed. If a large amount of data is read from
|
||||
the pipe, this can cause a large amount of memory to be
|
||||
allocated. The -B option disables this automatic allocation of
|
||||
@@ -57,33 +57,33 @@ specified by the -b option) is used for the pipe. Warning: use
|
||||
of -B can result in erroneous display, since only the most
|
||||
recently viewed part of the piped data is kept in memory; any
|
||||
earlier data is lost`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-c", "--clear-screen"],
|
||||
description: `Causes full screen repaints to be painted from the top line
|
||||
{
|
||||
name: ["-c", "--clear-screen"],
|
||||
description: `Causes full screen repaints to be painted from the top line
|
||||
down. By default, full screen repaints are done by scrolling
|
||||
from the bottom of the screen`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-C", "--CLEAR-SCREEN"],
|
||||
description: `Same as -c, for compatibility with older versions of less`,
|
||||
},
|
||||
{
|
||||
name: ["-C", "--CLEAR-SCREEN"],
|
||||
description: `Same as -c, for compatibility with older versions of less`,
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-d", "--dumb"],
|
||||
description: `The -d option suppresses the error message normally displayed if
|
||||
{
|
||||
name: ["-d", "--dumb"],
|
||||
description: `The -d option suppresses the error message normally displayed if
|
||||
the terminal is dumb; that is, lacks some important capability,
|
||||
such as the ability to clear the screen or scroll backward. The
|
||||
-d option does not otherwise change the behavior of less on a
|
||||
dumb terminal`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-D", "--color"],
|
||||
args: { name: "xcolor" },
|
||||
description: `Changes the color of different parts of the displayed text. x
|
||||
{
|
||||
name: ["-D", "--color"],
|
||||
args: { name: "xcolor" },
|
||||
description: `Changes the color of different parts of the displayed text. x
|
||||
is a single character which selects the type of text whose color
|
||||
is being set:
|
||||
B Binary characters.
|
||||
@@ -144,80 +144,80 @@ color is set to that of normal text. On MS-DOS versions of
|
||||
less, 8-bit color is not supported; instead, decimal values are
|
||||
interpreted as 4-bit CHAR_INFO.Attributes values (see
|
||||
https://docs.microsoft.com/en-us/windows/console/char-info-str)`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-e", "--quit-at-eof"],
|
||||
description: `Causes less to automatically exit the second time it reaches
|
||||
{
|
||||
name: ["-e", "--quit-at-eof"],
|
||||
description: `Causes less to automatically exit the second time it reaches
|
||||
end-of-file. By default, the only way to exit less is via the
|
||||
"q" command`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-E", "--QUIT-AT-EOF"],
|
||||
description: `Causes less to automatically exit the first time it reaches end-
|
||||
{
|
||||
name: ["-E", "--QUIT-AT-EOF"],
|
||||
description: `Causes less to automatically exit the first time it reaches end-
|
||||
of-file`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-f", "--force"],
|
||||
description: `Forces non-regular files to be opened. (A non-regular file is a
|
||||
{
|
||||
name: ["-f", "--force"],
|
||||
description: `Forces non-regular files to be opened. (A non-regular file is a
|
||||
directory or a device special file.) Also suppresses the
|
||||
warning message when a binary file is opened. By default, less
|
||||
will refuse to open non-regular files. Note that some operating
|
||||
systems will not allow directories to be read, even if -f is
|
||||
set`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-F", "--quit-if-one-screen"],
|
||||
description: `Causes less to automatically exit if the entire file can be
|
||||
{
|
||||
name: ["-F", "--quit-if-one-screen"],
|
||||
description: `Causes less to automatically exit if the entire file can be
|
||||
displayed on the first screen`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-g", "--hilite-search"],
|
||||
description: `Normally, less will highlight ALL strings which match the last
|
||||
{
|
||||
name: ["-g", "--hilite-search"],
|
||||
description: `Normally, less will highlight ALL strings which match the last
|
||||
search command. The -g option changes this behavior to
|
||||
highlight only the particular string which was found by the last
|
||||
search command. This can cause less to run somewhat faster than
|
||||
the default`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-G", "--HILITE-SEARCH"],
|
||||
description: `The -G option suppresses all highlighting of strings found by
|
||||
{
|
||||
name: ["-G", "--HILITE-SEARCH"],
|
||||
description: `The -G option suppresses all highlighting of strings found by
|
||||
search commands`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-h", "--max-back-scroll"],
|
||||
args: { name: "n" },
|
||||
description: `Specifies a maximum number of lines to scroll backward. If it
|
||||
{
|
||||
name: ["-h", "--max-back-scroll"],
|
||||
args: { name: "n" },
|
||||
description: `Specifies a maximum number of lines to scroll backward. If it
|
||||
is necessary to scroll backward more than n lines, the screen is
|
||||
repainted in a forward direction instead. (If the terminal does
|
||||
not have the ability to scroll backward, -h0 is implied.)`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-i", "--ignore-case"],
|
||||
description: `Causes searches to ignore case; that is, uppercase and lowercase
|
||||
{
|
||||
name: ["-i", "--ignore-case"],
|
||||
description: `Causes searches to ignore case; that is, uppercase and lowercase
|
||||
are considered identical. This option is ignored if any
|
||||
uppercase letters appear in the search pattern; in other words,
|
||||
if a pattern contains uppercase letters, then that search does
|
||||
not ignore case`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-I", "--IGNORE-CASE"],
|
||||
description: `Like -i, but searches ignore case even if the pattern contains
|
||||
{
|
||||
name: ["-I", "--IGNORE-CASE"],
|
||||
description: `Like -i, but searches ignore case even if the pattern contains
|
||||
uppercase letters`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-j", "--jump-target"],
|
||||
args: { name: "n" },
|
||||
description: `Specifies a line on the screen where the "target" line is to be
|
||||
{
|
||||
name: ["-j", "--jump-target"],
|
||||
args: { name: "n" },
|
||||
description: `Specifies a line on the screen where the "target" line is to be
|
||||
positioned. The target line is the line specified by any
|
||||
command to search for a pattern, jump to a line number, jump to
|
||||
a file percentage or jump to a tag. The screen line may be
|
||||
@@ -240,57 +240,57 @@ fourth line on the screen, so forward searches begin at the
|
||||
fifth line on the screen. However nonrepeated searches (invoked
|
||||
with "/" or "?") always begin at the start or end of the current
|
||||
screen respectively`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-J", "--status-column"],
|
||||
description: `Displays a status column at the left edge of the screen. The
|
||||
{
|
||||
name: ["-J", "--status-column"],
|
||||
description: `Displays a status column at the left edge of the screen. The
|
||||
status column shows the lines that matched the current search,
|
||||
and any lines that are marked (via the m or M command)`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-k", "--lesskey-file"],
|
||||
args: { name: "filename", template: "filepaths" },
|
||||
description: `Causes less to open and interpret the named file as a lesskey(1)
|
||||
{
|
||||
name: ["-k", "--lesskey-file"],
|
||||
args: { name: "filename", template: "filepaths" },
|
||||
description: `Causes less to open and interpret the named file as a lesskey(1)
|
||||
file. Multiple -k options may be specified. If the LESSKEY or
|
||||
LESSKEY_SYSTEM environment variable is set, or if a lesskey file
|
||||
is found in a standard place (see KEY BINDINGS), it is also used
|
||||
as a lesskey file`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-K", "--quit-on-intr"],
|
||||
description: `Causes less to exit immediately (with status 2) when an
|
||||
{
|
||||
name: ["-K", "--quit-on-intr"],
|
||||
description: `Causes less to exit immediately (with status 2) when an
|
||||
interrupt character (usually ^C) is typed. Normally, an
|
||||
interrupt character causes less to stop whatever it is doing and
|
||||
return to its command prompt. Note that use of this option
|
||||
makes it impossible to return to the command prompt from the "F"
|
||||
command`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-L", "--no-lessopen"],
|
||||
description: `Ignore the LESSOPEN environment variable (see the INPUT
|
||||
{
|
||||
name: ["-L", "--no-lessopen"],
|
||||
description: `Ignore the LESSOPEN environment variable (see the INPUT
|
||||
PREPROCESSOR section below). This option can be set from within
|
||||
less, but it will apply only to files opened subsequently, not
|
||||
to the file which is currently open`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-m", "--long-prompt"],
|
||||
description: `Causes less to prompt verbosely (like more), with the percent
|
||||
{
|
||||
name: ["-m", "--long-prompt"],
|
||||
description: `Causes less to prompt verbosely (like more), with the percent
|
||||
into the file. By default, less prompts with a colon`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-M", "--LONG-PROMPT"],
|
||||
description: `Causes less to prompt even more verbosely than more`,
|
||||
},
|
||||
{
|
||||
name: ["-M", "--LONG-PROMPT"],
|
||||
description: `Causes less to prompt even more verbosely than more`,
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-n", "--line-numbers"],
|
||||
description: `Suppresses line numbers. The default (to use line numbers) may
|
||||
{
|
||||
name: ["-n", "--line-numbers"],
|
||||
description: `Suppresses line numbers. The default (to use line numbers) may
|
||||
cause less to run more slowly in some cases, especially with a
|
||||
very large input file. Suppressing line numbers with the -n
|
||||
option will avoid this problem. Using line numbers means: the
|
||||
@@ -298,46 +298,46 @@ line number will be displayed in the verbose prompt and in the =
|
||||
command, and the v command will pass the current line number to
|
||||
the editor (see also the discussion of LESSEDIT in PROMPTS
|
||||
below)`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-N", "--LINE-NUMBERS"],
|
||||
description: `Causes a line number to be displayed at the beginning of each
|
||||
{
|
||||
name: ["-N", "--LINE-NUMBERS"],
|
||||
description: `Causes a line number to be displayed at the beginning of each
|
||||
line in the display`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-o", "--log-file"],
|
||||
args: { name: "filename", template: "filepaths" },
|
||||
description: `Causes less to copy its input to the named file as it is being
|
||||
{
|
||||
name: ["-o", "--log-file"],
|
||||
args: { name: "filename", template: "filepaths" },
|
||||
description: `Causes less to copy its input to the named file as it is being
|
||||
viewed. This applies only when the input file is a pipe, not an
|
||||
ordinary file. If the file already exists, less will ask for
|
||||
confirmation before overwriting it`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-O", "--LOG-FILE"],
|
||||
args: { name: "filename", template: "filepaths" },
|
||||
description: `The -O option is like -o, but it will overwrite an existing file
|
||||
{
|
||||
name: ["-O", "--LOG-FILE"],
|
||||
args: { name: "filename", template: "filepaths" },
|
||||
description: `The -O option is like -o, but it will overwrite an existing file
|
||||
without asking for confirmation.
|
||||
If no log file has been specified, the -o and -O options can be
|
||||
used from within less to specify a log file. Without a file
|
||||
name, they will simply report the name of the log file. The "s"
|
||||
command is equivalent to specifying -o from within less`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-p", "--pattern"],
|
||||
args: { name: "pattern" },
|
||||
description: `The -p option on the command line is equivalent to specifying
|
||||
{
|
||||
name: ["-p", "--pattern"],
|
||||
args: { name: "pattern" },
|
||||
description: `The -p option on the command line is equivalent to specifying
|
||||
+/pattern; that is, it tells less to start at the first
|
||||
occurrence of pattern in the file`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-P", "--prompt"],
|
||||
args: { name: "prompt" },
|
||||
description: `Provides a way to tailor the three prompt styles to your own
|
||||
{
|
||||
name: ["-P", "--prompt"],
|
||||
args: { name: "prompt" },
|
||||
description: `Provides a way to tailor the three prompt styles to your own
|
||||
preference. This option would normally be put in the LESS
|
||||
environment variable, rather than being typed in with each less
|
||||
command. Such an option must either be the last option in the
|
||||
@@ -352,28 +352,28 @@ that string.
|
||||
F command).
|
||||
All prompt strings consist of a sequence of letters and special
|
||||
escape sequences. See the section on PROMPTS for more details`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-q", "--quiet", "--silent"],
|
||||
description: `Causes moderately "quiet" operation: the terminal bell is not
|
||||
{
|
||||
name: ["-q", "--quiet", "--silent"],
|
||||
description: `Causes moderately "quiet" operation: the terminal bell is not
|
||||
rung if an attempt is made to scroll past the end of the file or
|
||||
before the beginning of the file. If the terminal has a "visual
|
||||
bell", it is used instead. The bell will be rung on certain
|
||||
other errors, such as typing an invalid character. The default
|
||||
is to ring the terminal bell in all such cases`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-Q", "--QUIET", "--SILENT"],
|
||||
description: `Causes totally "quiet" operation: the terminal bell is never
|
||||
{
|
||||
name: ["-Q", "--QUIET", "--SILENT"],
|
||||
description: `Causes totally "quiet" operation: the terminal bell is never
|
||||
rung. If the terminal has a "visual bell", it is used in all
|
||||
cases where the terminal bell would have been rung`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-r", "--raw-control-chars"],
|
||||
description: `Causes "raw" control characters to be displayed. The default is
|
||||
{
|
||||
name: ["-r", "--raw-control-chars"],
|
||||
description: `Causes "raw" control characters to be displayed. The default is
|
||||
to display control characters using the caret notation; for
|
||||
example, a control-A (octal 001) is displayed as "^A". Warning:
|
||||
when the -r option is used, less cannot keep track of the actual
|
||||
@@ -382,11 +382,11 @@ responds to each type of control character). Thus, various
|
||||
display problems may result, such as long lines being split in
|
||||
the wrong place.
|
||||
USE OF THE -r OPTION IS NOT RECOMMENDED`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-R", "--RAW-CONTROL-CHARS"],
|
||||
description: `Like -r, but only ANSI "color" escape sequences and OSC 8
|
||||
{
|
||||
name: ["-R", "--RAW-CONTROL-CHARS"],
|
||||
description: `Like -r, but only ANSI "color" escape sequences and OSC 8
|
||||
hyperlink sequences are output in "raw" form. Unlike -r, the
|
||||
screen appearance is maintained correctly, provided that there
|
||||
are no escape sequences in the file other than these types of
|
||||
@@ -408,27 +408,27 @@ escape sequence. And you can make less think that characters
|
||||
other than the standard ones may appear between the ESC and the
|
||||
m by setting the environment variable LESSANSIMIDCHARS to the
|
||||
list of characters which can appear`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-s", "--squeeze-blank-lines"],
|
||||
description: `Causes consecutive blank lines to be squeezed into a single
|
||||
{
|
||||
name: ["-s", "--squeeze-blank-lines"],
|
||||
description: `Causes consecutive blank lines to be squeezed into a single
|
||||
blank line. This is useful when viewing nroff output`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-S", "--chop-long-lines"],
|
||||
description: `Causes lines longer than the screen width to be chopped
|
||||
{
|
||||
name: ["-S", "--chop-long-lines"],
|
||||
description: `Causes lines longer than the screen width to be chopped
|
||||
(truncated) rather than wrapped. That is, the portion of a long
|
||||
line that does not fit in the screen width is not displayed
|
||||
until you press RIGHT-ARROW. The default is to wrap long lines;
|
||||
that is, display the remainder on the next line`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-t", "--tag"],
|
||||
args: { name: "tag" },
|
||||
description: `The -t option, followed immediately by a TAG, will edit the file
|
||||
{
|
||||
name: ["-t", "--tag"],
|
||||
args: { name: "tag" },
|
||||
description: `The -t option, followed immediately by a TAG, will edit the file
|
||||
containing that tag. For this to work, tag information must be
|
||||
available; for example, there may be a file in the current
|
||||
directory called "tags", which was previously built by ctags(1)
|
||||
@@ -439,24 +439,24 @@ the tag. (See http://www.gnu.org/software/global/global.html).
|
||||
The -t option may also be specified from within less (using the
|
||||
- command) as a way of examining a new file. The command ":t"
|
||||
is equivalent to specifying -t from within less`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-T", "--tag-file"],
|
||||
args: { name: "tagsfile" },
|
||||
description: `Specifies a tags file to be used instead of "tags"`,
|
||||
},
|
||||
{
|
||||
name: ["-T", "--tag-file"],
|
||||
args: { name: "tagsfile" },
|
||||
description: `Specifies a tags file to be used instead of "tags"`,
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-u", "--underline-special"],
|
||||
description: `Causes backspaces and carriage returns to be treated as
|
||||
{
|
||||
name: ["-u", "--underline-special"],
|
||||
description: `Causes backspaces and carriage returns to be treated as
|
||||
printable characters; that is, they are sent to the terminal
|
||||
when they appear in the input`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-U", "--UNDERLINE-SPECIAL"],
|
||||
description: `Causes backspaces, tabs, carriage returns and "formatting
|
||||
{
|
||||
name: ["-U", "--UNDERLINE-SPECIAL"],
|
||||
description: `Causes backspaces, tabs, carriage returns and "formatting
|
||||
characters" (as defined by Unicode) to be treated as control
|
||||
characters; that is, they are handled as specified by the -r
|
||||
option.
|
||||
@@ -473,16 +473,16 @@ specified by the -r option. Unicode formatting characters, such
|
||||
as the Byte Order Mark, are sent to the terminal. Text which is
|
||||
overstruck or underlined can be searched for if neither -u nor
|
||||
-U is in effect`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: `Displays the version number of less`,
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: `Displays the version number of less`,
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-w", "--hilite-unread"],
|
||||
description: `Temporarily highlights the first "new" line after a forward
|
||||
{
|
||||
name: ["-w", "--hilite-unread"],
|
||||
description: `Temporarily highlights the first "new" line after a forward
|
||||
movement of a full page. The first "new" line is the line
|
||||
immediately following the line previously at the bottom of the
|
||||
screen. Also highlights the target line after a g or p command.
|
||||
@@ -490,47 +490,47 @@ The highlight is removed at the next command which causes
|
||||
movement. The entire line is highlighted, unless the -J option
|
||||
is in effect, in which case only the status column is
|
||||
highlighted`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-W", "--HILITE-UNREAD"],
|
||||
description: `Like -w, but temporarily highlights the first new line after any
|
||||
{
|
||||
name: ["-W", "--HILITE-UNREAD"],
|
||||
description: `Like -w, but temporarily highlights the first new line after any
|
||||
forward movement command larger than one line`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-x", "--tabs="],
|
||||
args: { name: "n,..." },
|
||||
description: `Sets tab stops. If only one n is specified, tab stops are set
|
||||
{
|
||||
name: ["-x", "--tabs="],
|
||||
args: { name: "n,..." },
|
||||
description: `Sets tab stops. If only one n is specified, tab stops are set
|
||||
at multiples of n. If multiple values separated by commas are
|
||||
specified, tab stops are set at those positions, and then
|
||||
continue with the same spacing as the last two. For example,
|
||||
-x9,17 will set tabs at positions 9, 17, 25, 33, etc. The
|
||||
default for n is 8`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-X", "--no-init"],
|
||||
description: `Disables sending the termcap initialization and deinitialization
|
||||
{
|
||||
name: ["-X", "--no-init"],
|
||||
description: `Disables sending the termcap initialization and deinitialization
|
||||
strings to the terminal. This is sometimes desirable if the
|
||||
deinitialization string does something unnecessary, like
|
||||
clearing the screen`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-y", "--max-forw-scroll"],
|
||||
args: { name: "n" },
|
||||
description: `Specifies a maximum number of lines to scroll forward. If it is
|
||||
{
|
||||
name: ["-y", "--max-forw-scroll"],
|
||||
args: { name: "n" },
|
||||
description: `Specifies a maximum number of lines to scroll forward. If it is
|
||||
necessary to scroll forward more than n lines, the screen is
|
||||
repainted instead. The -c or -C option may be used to repaint
|
||||
from the top of the screen if desired. By default, any forward
|
||||
movement causes scrolling`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-z", "--window"],
|
||||
args: { name: "n" },
|
||||
description: `Changes the default scrolling window size to n lines. The
|
||||
{
|
||||
name: ["-z", "--window"],
|
||||
args: { name: "n" },
|
||||
description: `Changes the default scrolling window size to n lines. The
|
||||
default is one screenful. The z and w commands can also be used
|
||||
to change the window size. The "z" may be omitted for
|
||||
compatibility with some versions of more. If the number n is
|
||||
@@ -538,11 +538,11 @@ negative, it indicates n lines less than the current screen
|
||||
size. For example, if the screen is 24 lines, -z-4 sets the
|
||||
scrolling window to 20 lines. If the screen is resized to 40
|
||||
lines, the scrolling window automatically changes to 36 lines`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "--quotes",
|
||||
description: `Changes the filename quoting character. This may be necessary
|
||||
{
|
||||
name: "--quotes",
|
||||
description: `Changes the filename quoting character. This may be necessary
|
||||
if you are trying to name a file which contains both spaces and
|
||||
quote characters. Followed by a single character, this changes
|
||||
the quote character to that character. Filenames containing a
|
||||
@@ -554,18 +554,18 @@ by the open quote character and followed by the close quote
|
||||
character. Note that even after the quote characters are
|
||||
changed, this option remains -" (a dash followed by a double
|
||||
quote)`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-~", "--tilde"],
|
||||
description: `Normally lines after end of file are displayed as a single tilde
|
||||
{
|
||||
name: ["-~", "--tilde"],
|
||||
description: `Normally lines after end of file are displayed as a single tilde
|
||||
(~). This option causes lines after end of file to be displayed
|
||||
as blank lines`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ["-#", "--shift"],
|
||||
description: `Specifies the default number of positions to scroll horizontally
|
||||
{
|
||||
name: ["-#", "--shift"],
|
||||
description: `Specifies the default number of positions to scroll horizontally
|
||||
in the RIGHTARROW and LEFTARROW commands. If the number
|
||||
specified is zero, it sets the default number of positions to
|
||||
one half of the screen width. Alternately, the number may be
|
||||
@@ -576,11 +576,11 @@ specified as a fraction, the actual number of scroll positions
|
||||
is recalculated if the terminal window is resized, so that the
|
||||
actual scroll remains at the specified fraction of the screen
|
||||
width`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "--follow-name",
|
||||
description: `Normally, if the input file is renamed while an F command is
|
||||
{
|
||||
name: "--follow-name",
|
||||
description: `Normally, if the input file is renamed while an F command is
|
||||
executing, less will continue to display the contents of the
|
||||
original file despite its name change. If --follow-name is
|
||||
specified, during an F command less will periodically attempt to
|
||||
@@ -588,89 +588,89 @@ reopen the file by name. If the reopen succeeds and the file is
|
||||
a different file from the original (which means that a new file
|
||||
has been created with the same name as the original (now
|
||||
renamed) file), less will display the contents of that new file`,
|
||||
},
|
||||
{
|
||||
name: "--incsearch",
|
||||
description: `Subsequent search commands will be "incremental"; that is, less
|
||||
},
|
||||
{
|
||||
name: "--incsearch",
|
||||
description: `Subsequent search commands will be "incremental"; that is, less
|
||||
will advance to the next line containing the search pattern as
|
||||
each character of the pattern is typed in`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "--line-num-width",
|
||||
description: `Sets the minimum width of the line number field when the -N
|
||||
{
|
||||
name: "--line-num-width",
|
||||
description: `Sets the minimum width of the line number field when the -N
|
||||
option is in effect. The default is 7 characters`,
|
||||
},
|
||||
{
|
||||
name: "--mouse",
|
||||
description: `Enables mouse input: scrolling the mouse wheel down moves
|
||||
},
|
||||
{
|
||||
name: "--mouse",
|
||||
description: `Enables mouse input: scrolling the mouse wheel down moves
|
||||
forward in the file, scrolling the mouse wheel up moves
|
||||
backwards in the file, and clicking the mouse sets the "#" mark
|
||||
to the line where the mouse is clicked. The number of lines to
|
||||
scroll when the wheel is moved can be set by the --wheel-lines
|
||||
option. Mouse input works only on terminals which support X11
|
||||
mouse reporting, and on the Windows version of less`,
|
||||
},
|
||||
{
|
||||
name: "--MOUSE",
|
||||
description: `Like --mouse, except the direction scrolled on mouse wheel
|
||||
},
|
||||
{
|
||||
name: "--MOUSE",
|
||||
description: `Like --mouse, except the direction scrolled on mouse wheel
|
||||
movement is reversed`,
|
||||
},
|
||||
{
|
||||
name: "--no-keypad",
|
||||
description: `Disables sending the keypad initialization and deinitialization
|
||||
},
|
||||
{
|
||||
name: "--no-keypad",
|
||||
description: `Disables sending the keypad initialization and deinitialization
|
||||
strings to the terminal. This is sometimes useful if the keypad
|
||||
strings make the numeric keypad behave in an undesirable manner`,
|
||||
},
|
||||
{
|
||||
name: "--no-histdups",
|
||||
description: `This option changes the behavior so that if a search string or
|
||||
},
|
||||
{
|
||||
name: "--no-histdups",
|
||||
description: `This option changes the behavior so that if a search string or
|
||||
file name is typed in, and the same string is already in the
|
||||
history list, the existing copy is removed from the history list
|
||||
before the new one is added. Thus, a given string will appear
|
||||
only once in the history list. Normally, a string may appear
|
||||
multiple times`,
|
||||
},
|
||||
{
|
||||
name: "--rscroll",
|
||||
description: `This option changes the character used to mark truncated lines.
|
||||
},
|
||||
{
|
||||
name: "--rscroll",
|
||||
description: `This option changes the character used to mark truncated lines.
|
||||
It may begin with a two-character attribute indicator like
|
||||
LESSBINFMT does. If there is no attribute indicator, standout
|
||||
is used. If set to "-", truncated lines are not marked`,
|
||||
},
|
||||
{
|
||||
name: "--save-marks",
|
||||
description: `Save marks in the history file, so marks are retained across
|
||||
},
|
||||
{
|
||||
name: "--save-marks",
|
||||
description: `Save marks in the history file, so marks are retained across
|
||||
different invocations of less`,
|
||||
},
|
||||
{
|
||||
name: "--status-col-width",
|
||||
description: `Sets the width of the status column when the -J option is in
|
||||
},
|
||||
{
|
||||
name: "--status-col-width",
|
||||
description: `Sets the width of the status column when the -J option is in
|
||||
effect. The default is 2 characters`,
|
||||
},
|
||||
{
|
||||
name: "--use-backslash",
|
||||
description: `This option changes the interpretations of options which follow
|
||||
},
|
||||
{
|
||||
name: "--use-backslash",
|
||||
description: `This option changes the interpretations of options which follow
|
||||
this one. After the --use-backslash option, any backslash in an
|
||||
option string is removed and the following character is taken
|
||||
literally. This allows a dollar sign to be included in option
|
||||
strings`,
|
||||
},
|
||||
{
|
||||
name: "--use-color",
|
||||
description: `Enables the colored text in various places. The -D option can
|
||||
},
|
||||
{
|
||||
name: "--use-color",
|
||||
description: `Enables the colored text in various places. The -D option can
|
||||
be used to change the colors. Colored text works only if the
|
||||
terminal supports ANSI color escape sequences (as defined in
|
||||
ECMA-48 SGR; see
|
||||
https://www.ecma-international.org/publications-and-
|
||||
standards/standards/ecma-48)`,
|
||||
},
|
||||
{
|
||||
name: "--wheel-lines",
|
||||
args: { name: "n" },
|
||||
description: `Set the number of lines to scroll when the mouse wheel is rolled`,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "--wheel-lines",
|
||||
args: { name: "n" },
|
||||
description: `Set the number of lines to scroll when the mouse wheel is rolled`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,227 +1,227 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "ls",
|
||||
description: "List directory contents",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: ["filepaths", "folders"],
|
||||
filterStrategy: "fuzzy",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-@",
|
||||
description:
|
||||
"Display extended attribute keys and sizes in long (-l) output",
|
||||
},
|
||||
{
|
||||
name: "-1",
|
||||
description:
|
||||
"(The numeric digit ``one''.) Force output to be one entry per line. This is the default when output is not to a terminal",
|
||||
},
|
||||
{
|
||||
name: "-A",
|
||||
description:
|
||||
"List all entries except for . and ... Always set for the super-user",
|
||||
},
|
||||
{
|
||||
name: "-a",
|
||||
description: "Include directory entries whose names begin with a dot (.)",
|
||||
},
|
||||
{
|
||||
name: "-B",
|
||||
description:
|
||||
"Force printing of non-printable characters (as defined by ctype(3) and current locale settings) in file names as xxx, where xxx is the numeric value of the character in octal",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description: "As -B, but use C escape codes whenever possible",
|
||||
},
|
||||
{
|
||||
name: "-C",
|
||||
description:
|
||||
"Force multi-column output; this is the default when output is to a terminal",
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description:
|
||||
"Use time when file status was last changed for sorting (-t) or long printing (-l)",
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Directories are listed as plain files (not searched recursively)",
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Print the Access Control List (ACL) associated with the file, if present, in long (-l) output",
|
||||
},
|
||||
{
|
||||
name: "-F",
|
||||
description:
|
||||
"Display a slash (/) immediately after each pathname that is a directory, an asterisk (*) after each that is executable, an at sign (@) after each symbolic link, an equals sign (=) after each socket, a percent sign (%) after each whiteout, and a vertical bar (|) after each that is a FIFO",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description: "Output is not sorted. This option turns on the -a option",
|
||||
},
|
||||
{
|
||||
name: "-G",
|
||||
description:
|
||||
"Enable colorized output. This option is equivalent to defining CLICOLOR in the environment. (See below.)",
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description:
|
||||
"This option is only available for compatibility with POSIX; it is used to display the group name in the long (-l) format output (the owner name is suppressed)",
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"Symbolic links on the command line are followed. This option is assumed if none of the -F, -d, or -l options are specified",
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description:
|
||||
"When used with the -l option, use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to three or less using base 2 for sizes",
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"For each file, print the file's file serial number (inode number)",
|
||||
},
|
||||
{
|
||||
name: "-k",
|
||||
description:
|
||||
"If the -s option is specified, print the file size allocation in kilobytes, not blocks. This option overrides the environment variable BLOCKSIZE",
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"Follow all symbolic links to final target and list the file or directory the link references rather than the link itself. This option cancels the -P option",
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description:
|
||||
"(The lowercase letter ``ell''.) List in long format. (See below.) A total sum for all the file sizes is output on a line before the long listing",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description:
|
||||
"Stream output format; list files across the page, separated by commas",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description:
|
||||
"Display user and group IDs numerically, rather than converting to a user or group name in a long (-l) output. This option turns on the -l option",
|
||||
},
|
||||
{
|
||||
name: "-O",
|
||||
description: "Include the file flags in a long (-l) output",
|
||||
},
|
||||
{ name: "-o", description: "List in long format, but omit the group id" },
|
||||
{
|
||||
name: "-P",
|
||||
description:
|
||||
"If argument is a symbolic link, list the link itself rather than the object the link references. This option cancels the -H and -L options",
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description:
|
||||
"Write a slash (`/') after each filename if that file is a directory",
|
||||
},
|
||||
{
|
||||
name: "-q",
|
||||
description:
|
||||
"Force printing of non-graphic characters in file names as the character `?'; this is the default when output is to a terminal",
|
||||
},
|
||||
{ name: "-R", description: "Recursively list subdirectories encountered" },
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Reverse the order of the sort to get reverse lexicographical order or the oldest entries first (or largest files last, if combined with sort by size",
|
||||
},
|
||||
{ name: "-S", description: "Sort files by size" },
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Display the number of file system blocks actually used by each file, in units of 512 bytes, where partial units are rounded up to the next integer value. If the output is to a terminal, a total sum for all the file sizes is output on a line before the listing. The environment variable BLOCKSIZE overrides the unit size of 512 bytes",
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description:
|
||||
"When used with the -l (lowercase letter ``ell'') option, display complete time information for the file, including month, day, hour, minute, second, and year",
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description:
|
||||
"Sort by time modified (most recently modified first) before sorting the operands by lexicographical order",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description:
|
||||
"Use time of last access, instead of last modification of the file for sorting (-t) or long printing (-l)",
|
||||
},
|
||||
{
|
||||
name: "-U",
|
||||
description:
|
||||
"Use time of file creation, instead of last modification for sorting (-t) or long output (-l)",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Force unedited printing of non-graphic characters; this is the default when output is not to a terminal",
|
||||
},
|
||||
{
|
||||
name: "-W",
|
||||
description: "Display whiteouts when scanning directories. (-S) flag)",
|
||||
},
|
||||
{
|
||||
name: "-w",
|
||||
description:
|
||||
"Force raw printing of non-printable characters. This is the default when output is not to a terminal",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"The same as -C, except that the multi-column output is produced with entries sorted across, rather than down, the columns",
|
||||
},
|
||||
{
|
||||
name: "-%",
|
||||
description:
|
||||
"Distinguish dataless files and directories with a '%' character in long (-l) output, and don't materialize dataless directories when listing them",
|
||||
},
|
||||
{
|
||||
name: "-,",
|
||||
description: `When the -l option is set, print file sizes grouped and separated by thousands using the non-monetary separator returned
|
||||
name: "ls",
|
||||
description: "List directory contents",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: ["filepaths", "folders"],
|
||||
filterStrategy: "fuzzy",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-@",
|
||||
description:
|
||||
"Display extended attribute keys and sizes in long (-l) output",
|
||||
},
|
||||
{
|
||||
name: "-1",
|
||||
description:
|
||||
"(The numeric digit ``one''.) Force output to be one entry per line. This is the default when output is not to a terminal",
|
||||
},
|
||||
{
|
||||
name: "-A",
|
||||
description:
|
||||
"List all entries except for . and ... Always set for the super-user",
|
||||
},
|
||||
{
|
||||
name: "-a",
|
||||
description: "Include directory entries whose names begin with a dot (.)",
|
||||
},
|
||||
{
|
||||
name: "-B",
|
||||
description:
|
||||
"Force printing of non-printable characters (as defined by ctype(3) and current locale settings) in file names as xxx, where xxx is the numeric value of the character in octal",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description: "As -B, but use C escape codes whenever possible",
|
||||
},
|
||||
{
|
||||
name: "-C",
|
||||
description:
|
||||
"Force multi-column output; this is the default when output is to a terminal",
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description:
|
||||
"Use time when file status was last changed for sorting (-t) or long printing (-l)",
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Directories are listed as plain files (not searched recursively)",
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Print the Access Control List (ACL) associated with the file, if present, in long (-l) output",
|
||||
},
|
||||
{
|
||||
name: "-F",
|
||||
description:
|
||||
"Display a slash (/) immediately after each pathname that is a directory, an asterisk (*) after each that is executable, an at sign (@) after each symbolic link, an equals sign (=) after each socket, a percent sign (%) after each whiteout, and a vertical bar (|) after each that is a FIFO",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description: "Output is not sorted. This option turns on the -a option",
|
||||
},
|
||||
{
|
||||
name: "-G",
|
||||
description:
|
||||
"Enable colorized output. This option is equivalent to defining CLICOLOR in the environment. (See below.)",
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description:
|
||||
"This option is only available for compatibility with POSIX; it is used to display the group name in the long (-l) format output (the owner name is suppressed)",
|
||||
},
|
||||
{
|
||||
name: "-H",
|
||||
description:
|
||||
"Symbolic links on the command line are followed. This option is assumed if none of the -F, -d, or -l options are specified",
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description:
|
||||
"When used with the -l option, use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to three or less using base 2 for sizes",
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"For each file, print the file's file serial number (inode number)",
|
||||
},
|
||||
{
|
||||
name: "-k",
|
||||
description:
|
||||
"If the -s option is specified, print the file size allocation in kilobytes, not blocks. This option overrides the environment variable BLOCKSIZE",
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"Follow all symbolic links to final target and list the file or directory the link references rather than the link itself. This option cancels the -P option",
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description:
|
||||
"(The lowercase letter ``ell''.) List in long format. (See below.) A total sum for all the file sizes is output on a line before the long listing",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description:
|
||||
"Stream output format; list files across the page, separated by commas",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description:
|
||||
"Display user and group IDs numerically, rather than converting to a user or group name in a long (-l) output. This option turns on the -l option",
|
||||
},
|
||||
{
|
||||
name: "-O",
|
||||
description: "Include the file flags in a long (-l) output",
|
||||
},
|
||||
{ name: "-o", description: "List in long format, but omit the group id" },
|
||||
{
|
||||
name: "-P",
|
||||
description:
|
||||
"If argument is a symbolic link, list the link itself rather than the object the link references. This option cancels the -H and -L options",
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description:
|
||||
"Write a slash (`/') after each filename if that file is a directory",
|
||||
},
|
||||
{
|
||||
name: "-q",
|
||||
description:
|
||||
"Force printing of non-graphic characters in file names as the character `?'; this is the default when output is to a terminal",
|
||||
},
|
||||
{ name: "-R", description: "Recursively list subdirectories encountered" },
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Reverse the order of the sort to get reverse lexicographical order or the oldest entries first (or largest files last, if combined with sort by size",
|
||||
},
|
||||
{ name: "-S", description: "Sort files by size" },
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Display the number of file system blocks actually used by each file, in units of 512 bytes, where partial units are rounded up to the next integer value. If the output is to a terminal, a total sum for all the file sizes is output on a line before the listing. The environment variable BLOCKSIZE overrides the unit size of 512 bytes",
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description:
|
||||
"When used with the -l (lowercase letter ``ell'') option, display complete time information for the file, including month, day, hour, minute, second, and year",
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description:
|
||||
"Sort by time modified (most recently modified first) before sorting the operands by lexicographical order",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description:
|
||||
"Use time of last access, instead of last modification of the file for sorting (-t) or long printing (-l)",
|
||||
},
|
||||
{
|
||||
name: "-U",
|
||||
description:
|
||||
"Use time of file creation, instead of last modification for sorting (-t) or long output (-l)",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Force unedited printing of non-graphic characters; this is the default when output is not to a terminal",
|
||||
},
|
||||
{
|
||||
name: "-W",
|
||||
description: "Display whiteouts when scanning directories. (-S) flag)",
|
||||
},
|
||||
{
|
||||
name: "-w",
|
||||
description:
|
||||
"Force raw printing of non-printable characters. This is the default when output is not to a terminal",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"The same as -C, except that the multi-column output is produced with entries sorted across, rather than down, the columns",
|
||||
},
|
||||
{
|
||||
name: "-%",
|
||||
description:
|
||||
"Distinguish dataless files and directories with a '%' character in long (-l) output, and don't materialize dataless directories when listing them",
|
||||
},
|
||||
{
|
||||
name: "-,",
|
||||
description: `When the -l option is set, print file sizes grouped and separated by thousands using the non-monetary separator returned
|
||||
by localeconv(3), typically a comma or period. If no locale is set, or the locale does not have a non-monetary separator, this
|
||||
option has no effect. This option is not defined in IEEE Std 1003.1-2001 (“POSIX.1”)`,
|
||||
dependsOn: ["-l"],
|
||||
},
|
||||
{
|
||||
name: "--color",
|
||||
description: `Output colored escape sequences based on when, which may be set to either always, auto, or never`,
|
||||
requiresSeparator: true,
|
||||
args: {
|
||||
name: "when",
|
||||
suggestions: [
|
||||
{
|
||||
name: ["always", "yes", "force"],
|
||||
description: "Will make ls always output color",
|
||||
},
|
||||
{
|
||||
name: "auto",
|
||||
description:
|
||||
"Will make ls output escape sequences based on termcap(5), but only if stdout is a tty and either the -G flag is specified or the COLORTERM environment variable is set and not empty",
|
||||
},
|
||||
{
|
||||
name: ["never", "no", "none"],
|
||||
description:
|
||||
"Will disable color regardless of environment variables",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
dependsOn: ["-l"],
|
||||
},
|
||||
{
|
||||
name: "--color",
|
||||
description: `Output colored escape sequences based on when, which may be set to either always, auto, or never`,
|
||||
requiresSeparator: true,
|
||||
args: {
|
||||
name: "when",
|
||||
suggestions: [
|
||||
{
|
||||
name: ["always", "yes", "force"],
|
||||
description: "Will make ls always output color",
|
||||
},
|
||||
{
|
||||
name: "auto",
|
||||
description:
|
||||
"Will make ls output escape sequences based on termcap(5), but only if stdout is a tty and either the -G flag is specified or the COLORTERM environment variable is set and not empty",
|
||||
},
|
||||
{
|
||||
name: ["never", "no", "none"],
|
||||
description:
|
||||
"Will disable color regardless of environment variables",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "mkdir",
|
||||
description: "Make directories",
|
||||
args: {
|
||||
name: "directory name",
|
||||
template: "folders",
|
||||
suggestCurrentToken: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: ["-m", "--mode"],
|
||||
description: "Set file mode (as in chmod), not a=rwx - umask",
|
||||
args: { name: "MODE" },
|
||||
},
|
||||
{
|
||||
name: ["-p", "--parents"],
|
||||
description: "No error if existing, make parent directories as needed",
|
||||
},
|
||||
{
|
||||
name: ["-v", "--verbose"],
|
||||
description: "Print a message for each created directory",
|
||||
},
|
||||
{
|
||||
name: ["-Z", "--context"],
|
||||
description:
|
||||
"Set the SELinux security context of each created directory to CTX",
|
||||
args: { name: "CTX" },
|
||||
},
|
||||
{ name: "--help", description: "Display this help and exit" },
|
||||
{
|
||||
name: "--version",
|
||||
description: "Output version information and exit",
|
||||
},
|
||||
],
|
||||
name: "mkdir",
|
||||
description: "Make directories",
|
||||
args: {
|
||||
name: "directory name",
|
||||
template: "folders",
|
||||
suggestCurrentToken: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: ["-m", "--mode"],
|
||||
description: "Set file mode (as in chmod), not a=rwx - umask",
|
||||
args: { name: "MODE" },
|
||||
},
|
||||
{
|
||||
name: ["-p", "--parents"],
|
||||
description: "No error if existing, make parent directories as needed",
|
||||
},
|
||||
{
|
||||
name: ["-v", "--verbose"],
|
||||
description: "Print a message for each created directory",
|
||||
},
|
||||
{
|
||||
name: ["-Z", "--context"],
|
||||
description:
|
||||
"Set the SELinux security context of each created directory to CTX",
|
||||
args: { name: "CTX" },
|
||||
},
|
||||
{ name: "--help", description: "Display this help and exit" },
|
||||
{
|
||||
name: "--version",
|
||||
description: "Output version information and exit",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,55 +1,55 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "more",
|
||||
description: "Opposite of less",
|
||||
options: [
|
||||
{
|
||||
name: ["-d", "--silent"],
|
||||
description:
|
||||
"Prompt with '[Press space to continue, 'q' to quit.]', and display '[Press 'h' for instructions.]' instead of ringing the bell when an illegal key is pressed",
|
||||
},
|
||||
{
|
||||
name: ["-l", "--logical"],
|
||||
description: "Do not pause after any line containing a ^L (form feed)",
|
||||
},
|
||||
{
|
||||
name: ["-f", "--no-pause"],
|
||||
description: "Count logical lines, rather than screen lines",
|
||||
},
|
||||
{
|
||||
name: ["-p", "--print-over"],
|
||||
description: "Instead, clear the whole screen and then display the text",
|
||||
},
|
||||
{
|
||||
name: ["-c", "--clean-print"],
|
||||
description:
|
||||
"Instead, paint each screen from the top, clearing the remainder of each line as it is displayed",
|
||||
},
|
||||
{
|
||||
name: ["-s", "--squeeze"],
|
||||
description: "Squeeze multiple blank lines into one",
|
||||
},
|
||||
{
|
||||
name: ["-u", "--plain"],
|
||||
description: "Silently ignored as backwards compatibility",
|
||||
},
|
||||
{
|
||||
name: ["-n", "--lines"],
|
||||
description: "Specify the number of lines per screenful",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: "--help",
|
||||
description: "Display help text",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Display version information",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
name: "more",
|
||||
description: "Opposite of less",
|
||||
options: [
|
||||
{
|
||||
name: ["-d", "--silent"],
|
||||
description:
|
||||
"Prompt with '[Press space to continue, 'q' to quit.]', and display '[Press 'h' for instructions.]' instead of ringing the bell when an illegal key is pressed",
|
||||
},
|
||||
{
|
||||
name: ["-l", "--logical"],
|
||||
description: "Do not pause after any line containing a ^L (form feed)",
|
||||
},
|
||||
{
|
||||
name: ["-f", "--no-pause"],
|
||||
description: "Count logical lines, rather than screen lines",
|
||||
},
|
||||
{
|
||||
name: ["-p", "--print-over"],
|
||||
description: "Instead, clear the whole screen and then display the text",
|
||||
},
|
||||
{
|
||||
name: ["-c", "--clean-print"],
|
||||
description:
|
||||
"Instead, paint each screen from the top, clearing the remainder of each line as it is displayed",
|
||||
},
|
||||
{
|
||||
name: ["-s", "--squeeze"],
|
||||
description: "Squeeze multiple blank lines into one",
|
||||
},
|
||||
{
|
||||
name: ["-u", "--plain"],
|
||||
description: "Silently ignored as backwards compatibility",
|
||||
},
|
||||
{
|
||||
name: ["-n", "--lines"],
|
||||
description: "Specify the number of lines per screenful",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: "--help",
|
||||
description: "Display help text",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Display version information",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "mv",
|
||||
description: "Move & rename files and folders",
|
||||
args: [
|
||||
{
|
||||
name: "source",
|
||||
isVariadic: true,
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
{
|
||||
name: "target",
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"Do not prompt for confirmation before overwriting the destination path",
|
||||
exclusiveOn: ["-i", "-n"],
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Cause mv to write a prompt to standard error before moving a file that would overwrite an existing file",
|
||||
exclusiveOn: ["-f", "-n"],
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Do not overwrite existing file",
|
||||
exclusiveOn: ["-f", "-i"],
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Cause mv to be verbose, showing files after they are moved",
|
||||
},
|
||||
],
|
||||
name: "mv",
|
||||
description: "Move & rename files and folders",
|
||||
args: [
|
||||
{
|
||||
name: "source",
|
||||
isVariadic: true,
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
{
|
||||
name: "target",
|
||||
template: ["filepaths", "folders"],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"Do not prompt for confirmation before overwriting the destination path",
|
||||
exclusiveOn: ["-i", "-n"],
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Cause mv to write a prompt to standard error before moving a file that would overwrite an existing file",
|
||||
exclusiveOn: ["-f", "-n"],
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Do not overwrite existing file",
|
||||
exclusiveOn: ["-f", "-i"],
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Cause mv to be verbose, showing files after they are moved",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "nano",
|
||||
description: "Nano's ANOther editor, an enhanced free Pico clone",
|
||||
args: {
|
||||
template: "filepaths",
|
||||
},
|
||||
name: "nano",
|
||||
description: "Nano's ANOther editor, an enhanced free Pico clone",
|
||||
args: {
|
||||
template: "filepaths",
|
||||
},
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,318 +1,316 @@
|
||||
// args
|
||||
const version: Fig.Arg = {
|
||||
name: "version",
|
||||
description: "Node version",
|
||||
suggestions: [
|
||||
{
|
||||
name: "node",
|
||||
description: "The latest version of node",
|
||||
},
|
||||
{
|
||||
name: "iojs",
|
||||
description: "The latest version of io.js",
|
||||
},
|
||||
{
|
||||
name: "system",
|
||||
description: "System-installed version of node",
|
||||
},
|
||||
],
|
||||
name: "version",
|
||||
description: "Node version",
|
||||
suggestions: [
|
||||
{
|
||||
name: "node",
|
||||
description: "The latest version of node",
|
||||
},
|
||||
{
|
||||
name: "iojs",
|
||||
description: "The latest version of io.js",
|
||||
},
|
||||
{
|
||||
name: "system",
|
||||
description: "System-installed version of node",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const command: Fig.Arg = {
|
||||
name: "command",
|
||||
isVariadic: true,
|
||||
name: "command",
|
||||
isVariadic: true,
|
||||
};
|
||||
|
||||
const args: Fig.Arg = {
|
||||
name: "args",
|
||||
isVariadic: true,
|
||||
name: "args",
|
||||
isVariadic: true,
|
||||
};
|
||||
|
||||
const pattern: Fig.Arg = {
|
||||
name: "pattern",
|
||||
};
|
||||
|
||||
|
||||
const name: Fig.Arg = {
|
||||
name: "name",
|
||||
name: "name",
|
||||
};
|
||||
|
||||
const ltsName: Fig.Arg = {
|
||||
name: "LTS name",
|
||||
name: "LTS name",
|
||||
};
|
||||
|
||||
const colorCodes: Fig.Arg = {
|
||||
name: "color codes",
|
||||
description: 'Using format "yMeBg"',
|
||||
name: "color codes",
|
||||
description: 'Using format "yMeBg"',
|
||||
};
|
||||
|
||||
// options
|
||||
const noColors: Fig.Option = {
|
||||
name: "--no-colors",
|
||||
description: "Suppress colored output",
|
||||
name: "--no-colors",
|
||||
description: "Suppress colored output",
|
||||
};
|
||||
|
||||
const noAlias: Fig.Option = {
|
||||
name: "--no-alias",
|
||||
description: "Suppress `nvm alias` output",
|
||||
name: "--no-alias",
|
||||
description: "Suppress `nvm alias` output",
|
||||
};
|
||||
|
||||
const silent: Fig.Option = {
|
||||
name: "--silent",
|
||||
description: "Silences stdout/stderr output",
|
||||
name: "--silent",
|
||||
description: "Silences stdout/stderr output",
|
||||
};
|
||||
|
||||
const lts: Fig.Option = {
|
||||
name: "--lts",
|
||||
description:
|
||||
"Uses automatic LTS (long-term support) alias `lts/*`, if available",
|
||||
name: "--lts",
|
||||
description:
|
||||
"Uses automatic LTS (long-term support) alias `lts/*`, if available",
|
||||
};
|
||||
|
||||
const ltsWithName: Fig.Option = {
|
||||
name: "--lts",
|
||||
description: "Uses automatic alias for provided LTS line, if available",
|
||||
args: ltsName,
|
||||
name: "--lts",
|
||||
description: "Uses automatic alias for provided LTS line, if available",
|
||||
args: ltsName,
|
||||
};
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "nvm",
|
||||
description: "Node Package Manager",
|
||||
subcommands: [
|
||||
{
|
||||
name: "install",
|
||||
description:
|
||||
"Download and install a <version>. Uses .nvmrc if available and version is omitted",
|
||||
args: { ...version, isOptional: true },
|
||||
options: [
|
||||
{
|
||||
name: "-s",
|
||||
description: "Skip binary download, install from source only",
|
||||
},
|
||||
{
|
||||
name: "--reinstall-packages-from",
|
||||
description:
|
||||
"When installing, reinstall packages installed in <version>",
|
||||
args: version,
|
||||
},
|
||||
{
|
||||
...lts,
|
||||
description:
|
||||
"When installing, only select from LTS (long-term support) versions",
|
||||
},
|
||||
{
|
||||
...ltsWithName,
|
||||
description:
|
||||
"When installing, only select from versions for a specific LTS line",
|
||||
},
|
||||
{
|
||||
name: "--skip-default-packages",
|
||||
description:
|
||||
"When installing, skip the default-packages file if it exists",
|
||||
},
|
||||
{
|
||||
name: "--latest-npm",
|
||||
description:
|
||||
"After installing, attempt to upgrade to the latest working npm on the given node version",
|
||||
},
|
||||
{
|
||||
name: "--no-progress",
|
||||
description: "Disable the progress bar on any downloads",
|
||||
},
|
||||
{
|
||||
name: "--alias",
|
||||
description:
|
||||
"After installing, set the alias specified to the version specified. (same as: nvm alias <name> <version>)",
|
||||
args: name,
|
||||
},
|
||||
{
|
||||
name: "--default",
|
||||
description:
|
||||
"After installing, set default alias to the version specified. (same as: nvm alias default <version>)",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "uninstall",
|
||||
description: "Uninstall a version",
|
||||
args: version,
|
||||
options: [
|
||||
{
|
||||
...lts,
|
||||
description:
|
||||
"Uninstall using automatic LTS (long-term support) alias `lts/*`, if available",
|
||||
},
|
||||
{
|
||||
...ltsWithName,
|
||||
description:
|
||||
"Uninstall using automatic alias for provided LTS line, if available",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "use",
|
||||
description:
|
||||
"Modify PATH to use <version>. Uses .nvmrc if available and version is omitted",
|
||||
args: { ...version, isOptional: true },
|
||||
options: [silent, lts, ltsWithName],
|
||||
},
|
||||
{
|
||||
name: "exec",
|
||||
description:
|
||||
"Run <command> on <version>. Uses .nvmrc if available and version is omitted",
|
||||
args: [{ ...version, isOptional: true }, command],
|
||||
options: [silent, lts, ltsWithName],
|
||||
},
|
||||
{
|
||||
name: "run",
|
||||
description:
|
||||
"Run `node` on <version> with <args> as arguments. Uses .nvmrc if available and version is omitted",
|
||||
args: [{ ...version, isOptional: true }, args],
|
||||
options: [silent, lts, ltsWithName],
|
||||
},
|
||||
{
|
||||
name: "current",
|
||||
description: "Display currently activated version of Node",
|
||||
},
|
||||
{
|
||||
name: "ls",
|
||||
description:
|
||||
"List installed versions, matching a given <version> if provided",
|
||||
args: version,
|
||||
options: [noColors, noAlias],
|
||||
},
|
||||
{
|
||||
name: "ls-remote",
|
||||
description:
|
||||
"List remote versions available for install, matching a given <version> if provided",
|
||||
args: version,
|
||||
options: [
|
||||
{
|
||||
...lts,
|
||||
description:
|
||||
"When listing, only show LTS (long-term support) versions",
|
||||
},
|
||||
{
|
||||
...ltsWithName,
|
||||
description:
|
||||
"When listing, only show versions for a specific LTS line",
|
||||
},
|
||||
noColors,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
description: "Resolve the given description to a single local version",
|
||||
args: version,
|
||||
},
|
||||
{
|
||||
name: "version-remote",
|
||||
description: "Resolve the given description to a single remote version",
|
||||
args: version,
|
||||
options: [
|
||||
{
|
||||
...lts,
|
||||
description:
|
||||
"When listing, only show LTS (long-term support) versions",
|
||||
},
|
||||
{
|
||||
...ltsWithName,
|
||||
description:
|
||||
"When listing, only show versions for a specific LTS line",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "deactivate",
|
||||
description: "Undo effects of `nvm` on current shell",
|
||||
options: [silent],
|
||||
},
|
||||
{
|
||||
name: "alias",
|
||||
description:
|
||||
"Show all aliases beginning with <pattern> or Set an alias named <name> pointing to <version>",
|
||||
args: [
|
||||
{
|
||||
name: "pattern or name",
|
||||
description: "Pattern or name",
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
isOptional: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "unalias",
|
||||
description: "Deletes the alias named <name>",
|
||||
args: name,
|
||||
},
|
||||
{
|
||||
name: "install-latest-npm",
|
||||
description:
|
||||
"Attempt to upgrade to the latest working `npm` on the current node version",
|
||||
},
|
||||
{
|
||||
name: "reinstall-packages",
|
||||
description:
|
||||
"Reinstall global `npm` packages contained in <version> to current version",
|
||||
args: version,
|
||||
},
|
||||
{
|
||||
name: "unload",
|
||||
description: "Unload `nvm` from shell",
|
||||
},
|
||||
{
|
||||
name: "which",
|
||||
description:
|
||||
"Display path to installed node version. Uses .nvmrc if available and version is omitted",
|
||||
args: { ...version, isOptional: true },
|
||||
subcommands: [
|
||||
{
|
||||
name: "current",
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
...silent,
|
||||
description:
|
||||
"Silences stdout/stderr output when a version is omitted",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "cache",
|
||||
args: {
|
||||
suggestions: [
|
||||
{
|
||||
name: "dir",
|
||||
description: "Display path to the cache directory for nvm",
|
||||
type: "subcommand",
|
||||
},
|
||||
{
|
||||
name: "clear",
|
||||
description: "Empty cache directory for nvm",
|
||||
type: "subcommand",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "set-colors",
|
||||
description:
|
||||
'Set five text colors using format "yMeBg". Available when supported',
|
||||
args: colorCodes,
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "--help",
|
||||
description: "Show help page",
|
||||
},
|
||||
{
|
||||
name: "--version",
|
||||
description: "Print out the installed version of nvm",
|
||||
},
|
||||
noColors,
|
||||
],
|
||||
name: "nvm",
|
||||
description: "Node Package Manager",
|
||||
subcommands: [
|
||||
{
|
||||
name: "install",
|
||||
description:
|
||||
"Download and install a <version>. Uses .nvmrc if available and version is omitted",
|
||||
args: { ...version, isOptional: true },
|
||||
options: [
|
||||
{
|
||||
name: "-s",
|
||||
description: "Skip binary download, install from source only",
|
||||
},
|
||||
{
|
||||
name: "--reinstall-packages-from",
|
||||
description:
|
||||
"When installing, reinstall packages installed in <version>",
|
||||
args: version,
|
||||
},
|
||||
{
|
||||
...lts,
|
||||
description:
|
||||
"When installing, only select from LTS (long-term support) versions",
|
||||
},
|
||||
{
|
||||
...ltsWithName,
|
||||
description:
|
||||
"When installing, only select from versions for a specific LTS line",
|
||||
},
|
||||
{
|
||||
name: "--skip-default-packages",
|
||||
description:
|
||||
"When installing, skip the default-packages file if it exists",
|
||||
},
|
||||
{
|
||||
name: "--latest-npm",
|
||||
description:
|
||||
"After installing, attempt to upgrade to the latest working npm on the given node version",
|
||||
},
|
||||
{
|
||||
name: "--no-progress",
|
||||
description: "Disable the progress bar on any downloads",
|
||||
},
|
||||
{
|
||||
name: "--alias",
|
||||
description:
|
||||
"After installing, set the alias specified to the version specified. (same as: nvm alias <name> <version>)",
|
||||
args: name,
|
||||
},
|
||||
{
|
||||
name: "--default",
|
||||
description:
|
||||
"After installing, set default alias to the version specified. (same as: nvm alias default <version>)",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "uninstall",
|
||||
description: "Uninstall a version",
|
||||
args: version,
|
||||
options: [
|
||||
{
|
||||
...lts,
|
||||
description:
|
||||
"Uninstall using automatic LTS (long-term support) alias `lts/*`, if available",
|
||||
},
|
||||
{
|
||||
...ltsWithName,
|
||||
description:
|
||||
"Uninstall using automatic alias for provided LTS line, if available",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "use",
|
||||
description:
|
||||
"Modify PATH to use <version>. Uses .nvmrc if available and version is omitted",
|
||||
args: { ...version, isOptional: true },
|
||||
options: [silent, lts, ltsWithName],
|
||||
},
|
||||
{
|
||||
name: "exec",
|
||||
description:
|
||||
"Run <command> on <version>. Uses .nvmrc if available and version is omitted",
|
||||
args: [{ ...version, isOptional: true }, command],
|
||||
options: [silent, lts, ltsWithName],
|
||||
},
|
||||
{
|
||||
name: "run",
|
||||
description:
|
||||
"Run `node` on <version> with <args> as arguments. Uses .nvmrc if available and version is omitted",
|
||||
args: [{ ...version, isOptional: true }, args],
|
||||
options: [silent, lts, ltsWithName],
|
||||
},
|
||||
{
|
||||
name: "current",
|
||||
description: "Display currently activated version of Node",
|
||||
},
|
||||
{
|
||||
name: "ls",
|
||||
description:
|
||||
"List installed versions, matching a given <version> if provided",
|
||||
args: version,
|
||||
options: [noColors, noAlias],
|
||||
},
|
||||
{
|
||||
name: "ls-remote",
|
||||
description:
|
||||
"List remote versions available for install, matching a given <version> if provided",
|
||||
args: version,
|
||||
options: [
|
||||
{
|
||||
...lts,
|
||||
description:
|
||||
"When listing, only show LTS (long-term support) versions",
|
||||
},
|
||||
{
|
||||
...ltsWithName,
|
||||
description:
|
||||
"When listing, only show versions for a specific LTS line",
|
||||
},
|
||||
noColors,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
description: "Resolve the given description to a single local version",
|
||||
args: version,
|
||||
},
|
||||
{
|
||||
name: "version-remote",
|
||||
description: "Resolve the given description to a single remote version",
|
||||
args: version,
|
||||
options: [
|
||||
{
|
||||
...lts,
|
||||
description:
|
||||
"When listing, only show LTS (long-term support) versions",
|
||||
},
|
||||
{
|
||||
...ltsWithName,
|
||||
description:
|
||||
"When listing, only show versions for a specific LTS line",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "deactivate",
|
||||
description: "Undo effects of `nvm` on current shell",
|
||||
options: [silent],
|
||||
},
|
||||
{
|
||||
name: "alias",
|
||||
description:
|
||||
"Show all aliases beginning with <pattern> or Set an alias named <name> pointing to <version>",
|
||||
args: [
|
||||
{
|
||||
name: "pattern or name",
|
||||
description: "Pattern or name",
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
isOptional: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "unalias",
|
||||
description: "Deletes the alias named <name>",
|
||||
args: name,
|
||||
},
|
||||
{
|
||||
name: "install-latest-npm",
|
||||
description:
|
||||
"Attempt to upgrade to the latest working `npm` on the current node version",
|
||||
},
|
||||
{
|
||||
name: "reinstall-packages",
|
||||
description:
|
||||
"Reinstall global `npm` packages contained in <version> to current version",
|
||||
args: version,
|
||||
},
|
||||
{
|
||||
name: "unload",
|
||||
description: "Unload `nvm` from shell",
|
||||
},
|
||||
{
|
||||
name: "which",
|
||||
description:
|
||||
"Display path to installed node version. Uses .nvmrc if available and version is omitted",
|
||||
args: { ...version, isOptional: true },
|
||||
subcommands: [
|
||||
{
|
||||
name: "current",
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
...silent,
|
||||
description:
|
||||
"Silences stdout/stderr output when a version is omitted",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "cache",
|
||||
args: {
|
||||
suggestions: [
|
||||
{
|
||||
name: "dir",
|
||||
description: "Display path to the cache directory for nvm",
|
||||
type: "subcommand",
|
||||
},
|
||||
{
|
||||
name: "clear",
|
||||
description: "Empty cache directory for nvm",
|
||||
type: "subcommand",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "set-colors",
|
||||
description:
|
||||
'Set five text colors using format "yMeBg". Available when supported',
|
||||
args: colorCodes,
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "--help",
|
||||
description: "Show help page",
|
||||
},
|
||||
{
|
||||
name: "--version",
|
||||
description: "Print out the installed version of nvm",
|
||||
},
|
||||
noColors,
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,153 +1,153 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "ps",
|
||||
description: "Report a snapshot of the current processes",
|
||||
options: [
|
||||
{ name: ["-A", "-e"], description: "Select all processes" },
|
||||
{
|
||||
name: "-a",
|
||||
description: "Select all processes except both session leaders",
|
||||
args: { name: "getsid" },
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description: "Select all processes except session leaders",
|
||||
},
|
||||
{
|
||||
name: "--deselect",
|
||||
description:
|
||||
"Select all processes except those that fulfill the specified conditions",
|
||||
},
|
||||
{
|
||||
name: "-N",
|
||||
description:
|
||||
"Select all processes except those that fulfill the specified conditions (negates the selection)",
|
||||
},
|
||||
{
|
||||
name: "--pid",
|
||||
description: "Select by process ID",
|
||||
args: { name: "pidlist" },
|
||||
},
|
||||
{
|
||||
name: "--ppid",
|
||||
description:
|
||||
"Select by parent process ID. This selects the processes with a parent process ID in pidlist",
|
||||
args: { name: "pidlist" },
|
||||
},
|
||||
{
|
||||
name: "--sid",
|
||||
description: "Select by session ID",
|
||||
args: { name: "sesslist" },
|
||||
},
|
||||
{
|
||||
name: "--tty",
|
||||
description: "Select by terminal",
|
||||
args: { name: "ttylist" },
|
||||
},
|
||||
{
|
||||
name: "U",
|
||||
description: "Select by effective user ID (EUID) or name",
|
||||
args: { name: "userlist" },
|
||||
},
|
||||
{
|
||||
name: "-U",
|
||||
description: "Select by real user ID (RUID) or name",
|
||||
args: { name: "userlist" },
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description: "Select by effective user ID (EUID) or name",
|
||||
args: { name: "userlist" },
|
||||
},
|
||||
{
|
||||
name: "--User",
|
||||
description: "Select by real user ID (RUID) or name",
|
||||
args: { name: "userlist" },
|
||||
},
|
||||
{
|
||||
name: "--user",
|
||||
description: "Select by effective user ID (EUID) or name",
|
||||
args: { name: "userlist" },
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Show different scheduler information for the -l option",
|
||||
},
|
||||
{
|
||||
name: "--context",
|
||||
description: "Display security context format (for SE Linux)",
|
||||
},
|
||||
{ name: "-f", description: "Do full-format listing" },
|
||||
{ name: "-F", description: "Extra full format" },
|
||||
{
|
||||
name: ["--format", "-o", "o"],
|
||||
description: "",
|
||||
args: { name: "format" },
|
||||
isRepeatable: true,
|
||||
},
|
||||
{ name: ["-M", "Z"], description: "(for SE Linux)" },
|
||||
{ name: ["-y", "-l"], description: "" },
|
||||
{
|
||||
name: "--cols",
|
||||
description: "Set screen width",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: "--columns",
|
||||
description: "Set screen width",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: "--cumulative",
|
||||
description:
|
||||
"Include some dead child process data (as a sum with the parent)",
|
||||
},
|
||||
{ name: "--forest", description: "ASCII art process tree" },
|
||||
{ name: "-H", description: "Show process hierarchy (forest)" },
|
||||
{
|
||||
name: "--headers",
|
||||
description: "Repeat header lines, one per page of output",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Set namelist file",
|
||||
args: { name: "namelist" },
|
||||
},
|
||||
{
|
||||
name: "--lines",
|
||||
description: "Set screen height",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: ["--no-headers", "--no-heading"],
|
||||
description: "Print no header line at all",
|
||||
},
|
||||
{
|
||||
name: "--rows",
|
||||
description: "Set screen height",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: "--sort",
|
||||
description: "Specify sorting order",
|
||||
args: { name: "spec" },
|
||||
},
|
||||
{
|
||||
name: "--width",
|
||||
description: "Set screen width",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description: "Show threads, possibly with LWP and NLWP columns",
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description: "Show threads, possibly with SPID column",
|
||||
},
|
||||
{ name: "--help", description: "Print a help message" },
|
||||
{ name: "--info", description: "Print debugging info" },
|
||||
{ name: "--version", description: "Print the procps version" },
|
||||
],
|
||||
name: "ps",
|
||||
description: "Report a snapshot of the current processes",
|
||||
options: [
|
||||
{ name: ["-A", "-e"], description: "Select all processes" },
|
||||
{
|
||||
name: "-a",
|
||||
description: "Select all processes except both session leaders",
|
||||
args: { name: "getsid" },
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description: "Select all processes except session leaders",
|
||||
},
|
||||
{
|
||||
name: "--deselect",
|
||||
description:
|
||||
"Select all processes except those that fulfill the specified conditions",
|
||||
},
|
||||
{
|
||||
name: "-N",
|
||||
description:
|
||||
"Select all processes except those that fulfill the specified conditions (negates the selection)",
|
||||
},
|
||||
{
|
||||
name: "--pid",
|
||||
description: "Select by process ID",
|
||||
args: { name: "pidlist" },
|
||||
},
|
||||
{
|
||||
name: "--ppid",
|
||||
description:
|
||||
"Select by parent process ID. This selects the processes with a parent process ID in pidlist",
|
||||
args: { name: "pidlist" },
|
||||
},
|
||||
{
|
||||
name: "--sid",
|
||||
description: "Select by session ID",
|
||||
args: { name: "sesslist" },
|
||||
},
|
||||
{
|
||||
name: "--tty",
|
||||
description: "Select by terminal",
|
||||
args: { name: "ttylist" },
|
||||
},
|
||||
{
|
||||
name: "U",
|
||||
description: "Select by effective user ID (EUID) or name",
|
||||
args: { name: "userlist" },
|
||||
},
|
||||
{
|
||||
name: "-U",
|
||||
description: "Select by real user ID (RUID) or name",
|
||||
args: { name: "userlist" },
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description: "Select by effective user ID (EUID) or name",
|
||||
args: { name: "userlist" },
|
||||
},
|
||||
{
|
||||
name: "--User",
|
||||
description: "Select by real user ID (RUID) or name",
|
||||
args: { name: "userlist" },
|
||||
},
|
||||
{
|
||||
name: "--user",
|
||||
description: "Select by effective user ID (EUID) or name",
|
||||
args: { name: "userlist" },
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Show different scheduler information for the -l option",
|
||||
},
|
||||
{
|
||||
name: "--context",
|
||||
description: "Display security context format (for SE Linux)",
|
||||
},
|
||||
{ name: "-f", description: "Do full-format listing" },
|
||||
{ name: "-F", description: "Extra full format" },
|
||||
{
|
||||
name: ["--format", "-o", "o"],
|
||||
description: "",
|
||||
args: { name: "format" },
|
||||
isRepeatable: true,
|
||||
},
|
||||
{ name: ["-M", "Z"], description: "(for SE Linux)" },
|
||||
{ name: ["-y", "-l"], description: "" },
|
||||
{
|
||||
name: "--cols",
|
||||
description: "Set screen width",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: "--columns",
|
||||
description: "Set screen width",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: "--cumulative",
|
||||
description:
|
||||
"Include some dead child process data (as a sum with the parent)",
|
||||
},
|
||||
{ name: "--forest", description: "ASCII art process tree" },
|
||||
{ name: "-H", description: "Show process hierarchy (forest)" },
|
||||
{
|
||||
name: "--headers",
|
||||
description: "Repeat header lines, one per page of output",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Set namelist file",
|
||||
args: { name: "namelist" },
|
||||
},
|
||||
{
|
||||
name: "--lines",
|
||||
description: "Set screen height",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: ["--no-headers", "--no-heading"],
|
||||
description: "Print no header line at all",
|
||||
},
|
||||
{
|
||||
name: "--rows",
|
||||
description: "Set screen height",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: "--sort",
|
||||
description: "Specify sorting order",
|
||||
args: { name: "spec" },
|
||||
},
|
||||
{
|
||||
name: "--width",
|
||||
description: "Set screen width",
|
||||
args: { name: "n" },
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description: "Show threads, possibly with LWP and NLWP columns",
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description: "Show threads, possibly with SPID column",
|
||||
},
|
||||
{ name: "--help", description: "Print a help message" },
|
||||
{ name: "--info", description: "Print debugging info" },
|
||||
{ name: "--version", description: "Print the procps version" },
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "pwd",
|
||||
description: "Return working directory name",
|
||||
options: [
|
||||
{
|
||||
name: "-L",
|
||||
description: "Display the logical current working directory",
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description: "Display the physical current working directory",
|
||||
},
|
||||
],
|
||||
name: "pwd",
|
||||
description: "Return working directory name",
|
||||
options: [
|
||||
{
|
||||
name: "-L",
|
||||
description: "Display the logical current working directory",
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description: "Display the physical current working directory",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,168 +1,168 @@
|
||||
import { filepaths } from '../../helpers/filepaths';
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "python",
|
||||
description: "Run the python interpreter",
|
||||
generateSpec: async (tokens, executeShellCommand) => {
|
||||
const isDjangoManagePyFilePresentCommand = "cat manage.py | grep -q django";
|
||||
if (
|
||||
(
|
||||
await executeShellCommand({
|
||||
command: "bash",
|
||||
args: ["-c", isDjangoManagePyFilePresentCommand],
|
||||
})
|
||||
).status === 0
|
||||
) {
|
||||
return {
|
||||
name: "python",
|
||||
subcommands: [{ name: "manage.py", loadSpec: "django-admin" }],
|
||||
};
|
||||
}
|
||||
},
|
||||
args: {
|
||||
name: "python script",
|
||||
isScript: true,
|
||||
generators: filepaths({
|
||||
extensions: ["py"],
|
||||
editFileSuggestions: { priority: 76 },
|
||||
}),
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-c",
|
||||
insertValue: "-c '{cursor}'",
|
||||
description:
|
||||
"Execute the Python code in command. command can be one or more statements separated by newlines, with significant leading whitespace as in normal module code",
|
||||
args: {
|
||||
name: "command",
|
||||
isCommand: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Module",
|
||||
args: {
|
||||
name: "python module",
|
||||
isModule: "python/",
|
||||
suggestions: ["http.server"],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-?", "-h", "--help"],
|
||||
description: "Print a short description of all command line options",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print the Python version number and exit",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description:
|
||||
"Issue a warning when comparing bytes or bytearray with str or bytes with int. Issue an error when the option is given twice (-bb)",
|
||||
},
|
||||
{
|
||||
name: "-B",
|
||||
description:
|
||||
"If given, Python won’t try to write .pyc files on the import of source modules",
|
||||
},
|
||||
{
|
||||
name: "--check-hash-based-pycs",
|
||||
description:
|
||||
"Control the validation behavior of hash-based .pyc files. See Cached bytecode invalidation",
|
||||
args: {
|
||||
suggestions: [
|
||||
{ name: "default" },
|
||||
{ name: "always" },
|
||||
{ name: "never" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Turn on parser debugging output (for expert only, depending on compilation options)",
|
||||
},
|
||||
{
|
||||
name: "-E",
|
||||
description:
|
||||
"Ignore all PYTHON* environment variables, e.g. PYTHONPATH and PYTHONHOME, that might be set",
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script or the command, even when sys.stdin does not appear to be a terminal",
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description:
|
||||
"Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script’s directory nor the user’s site-packages directory",
|
||||
},
|
||||
{
|
||||
name: "-O",
|
||||
description:
|
||||
"Remove assert statements and any code conditional on the value of __debug__",
|
||||
},
|
||||
{
|
||||
name: "-OO",
|
||||
description: "Do -O and also discard docstrings",
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description:
|
||||
"Don’t display the copyright and version messages even in interactive mode",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"Turn on hash randomization. This option only has an effect if the PYTHONHASHSEED environment variable is set to 0, since hash randomization is enabled by default",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Don’t add the user site-packages directory to sys.path",
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description:
|
||||
"Disable the import of the module site and the site-dependent manipulations of sys.path that it entails",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description:
|
||||
"Force the stdout and stderr streams to be unbuffered. This option has no effect on the stdin stream",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded",
|
||||
},
|
||||
{
|
||||
name: "-W",
|
||||
description:
|
||||
"Warning control. Python’s warning machinery by default prints warning messages to sys.stderr",
|
||||
args: {},
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"Skip the first line of the source, allowing use of non-Unix forms of #!cmd. This is intended for a DOS specific hack only",
|
||||
},
|
||||
{
|
||||
name: "-X",
|
||||
description: "Reserved for various implementation-specific options",
|
||||
args: {
|
||||
suggestions: [
|
||||
{ name: "faulthandler" },
|
||||
{ name: "showrefcount" },
|
||||
{ name: "tracemalloc" },
|
||||
{ name: "showalloccount" },
|
||||
{ name: "importtime" },
|
||||
{ name: "dev" },
|
||||
{ name: "utf8" },
|
||||
{ name: "pycache_prefix=PATH" },
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
name: "python",
|
||||
description: "Run the python interpreter",
|
||||
generateSpec: async (tokens, executeShellCommand) => {
|
||||
const isDjangoManagePyFilePresentCommand = "cat manage.py | grep -q django";
|
||||
if (
|
||||
(
|
||||
await executeShellCommand({
|
||||
command: "bash",
|
||||
args: ["-c", isDjangoManagePyFilePresentCommand],
|
||||
})
|
||||
).status === 0
|
||||
) {
|
||||
return {
|
||||
name: "python",
|
||||
subcommands: [{ name: "manage.py", loadSpec: "django-admin" }],
|
||||
};
|
||||
}
|
||||
},
|
||||
args: {
|
||||
name: "python script",
|
||||
isScript: true,
|
||||
generators: filepaths({
|
||||
extensions: ["py"],
|
||||
editFileSuggestions: { priority: 76 },
|
||||
}),
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-c",
|
||||
insertValue: "-c '{cursor}'",
|
||||
description:
|
||||
"Execute the Python code in command. command can be one or more statements separated by newlines, with significant leading whitespace as in normal module code",
|
||||
args: {
|
||||
name: "command",
|
||||
isCommand: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Module",
|
||||
args: {
|
||||
name: "python module",
|
||||
isModule: "python/",
|
||||
suggestions: ["http.server"],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-?", "-h", "--help"],
|
||||
description: "Print a short description of all command line options",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print the Python version number and exit",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description:
|
||||
"Issue a warning when comparing bytes or bytearray with str or bytes with int. Issue an error when the option is given twice (-bb)",
|
||||
},
|
||||
{
|
||||
name: "-B",
|
||||
description:
|
||||
"If given, Python won’t try to write .pyc files on the import of source modules",
|
||||
},
|
||||
{
|
||||
name: "--check-hash-based-pycs",
|
||||
description:
|
||||
"Control the validation behavior of hash-based .pyc files. See Cached bytecode invalidation",
|
||||
args: {
|
||||
suggestions: [
|
||||
{ name: "default" },
|
||||
{ name: "always" },
|
||||
{ name: "never" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Turn on parser debugging output (for expert only, depending on compilation options)",
|
||||
},
|
||||
{
|
||||
name: "-E",
|
||||
description:
|
||||
"Ignore all PYTHON* environment variables, e.g. PYTHONPATH and PYTHONHOME, that might be set",
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script or the command, even when sys.stdin does not appear to be a terminal",
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description:
|
||||
"Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script’s directory nor the user’s site-packages directory",
|
||||
},
|
||||
{
|
||||
name: "-O",
|
||||
description:
|
||||
"Remove assert statements and any code conditional on the value of __debug__",
|
||||
},
|
||||
{
|
||||
name: "-OO",
|
||||
description: "Do -O and also discard docstrings",
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description:
|
||||
"Don’t display the copyright and version messages even in interactive mode",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"Turn on hash randomization. This option only has an effect if the PYTHONHASHSEED environment variable is set to 0, since hash randomization is enabled by default",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Don’t add the user site-packages directory to sys.path",
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description:
|
||||
"Disable the import of the module site and the site-dependent manipulations of sys.path that it entails",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description:
|
||||
"Force the stdout and stderr streams to be unbuffered. This option has no effect on the stdin stream",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded",
|
||||
},
|
||||
{
|
||||
name: "-W",
|
||||
description:
|
||||
"Warning control. Python’s warning machinery by default prints warning messages to sys.stderr",
|
||||
args: {},
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"Skip the first line of the source, allowing use of non-Unix forms of #!cmd. This is intended for a DOS specific hack only",
|
||||
},
|
||||
{
|
||||
name: "-X",
|
||||
description: "Reserved for various implementation-specific options",
|
||||
args: {
|
||||
suggestions: [
|
||||
{ name: "faulthandler" },
|
||||
{ name: "showrefcount" },
|
||||
{ name: "tracemalloc" },
|
||||
{ name: "showalloccount" },
|
||||
{ name: "importtime" },
|
||||
{ name: "dev" },
|
||||
{ name: "utf8" },
|
||||
{ name: "pycache_prefix=PATH" },
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,170 +1,170 @@
|
||||
import { filepaths } from '../../helpers/filepaths';
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "python3",
|
||||
description: "Run the python interpreter",
|
||||
generateSpec: async (tokens, executeShellCommand) => {
|
||||
const isDjangoManagePyFilePresentCommand = "cat manage.py | grep -q django";
|
||||
name: "python3",
|
||||
description: "Run the python interpreter",
|
||||
generateSpec: async (tokens, executeShellCommand) => {
|
||||
const isDjangoManagePyFilePresentCommand = "cat manage.py | grep -q django";
|
||||
|
||||
if (
|
||||
(
|
||||
await executeShellCommand({
|
||||
command: "bash",
|
||||
args: ["-c", isDjangoManagePyFilePresentCommand],
|
||||
})
|
||||
).status === 0
|
||||
) {
|
||||
return {
|
||||
name: "python3",
|
||||
subcommands: [{ name: "manage.py", loadSpec: "django-admin" }],
|
||||
};
|
||||
}
|
||||
},
|
||||
args: {
|
||||
name: "python script",
|
||||
isScript: true,
|
||||
generators: filepaths({
|
||||
extensions: ["py"],
|
||||
editFileSuggestions: { priority: 76 },
|
||||
}),
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-c",
|
||||
insertValue: "-c '{cursor}'",
|
||||
description:
|
||||
"Execute the Python code in command. command can be one or more statements separated by newlines, with significant leading whitespace as in normal module code",
|
||||
args: {
|
||||
name: "command",
|
||||
isCommand: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
insertValue: "-m '{cursor}'",
|
||||
description:
|
||||
"Search sys.path for the named module and execute its contents as the __main__ module",
|
||||
args: {
|
||||
name: "command",
|
||||
isCommand: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-?", "-h", "--help"],
|
||||
description: "Print a short description of all command line options",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print the Python version number and exit",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description:
|
||||
"Issue a warning when comparing bytes or bytearray with str or bytes with int. Issue an error when the option is given twice (-bb)",
|
||||
},
|
||||
{
|
||||
name: "-B",
|
||||
description:
|
||||
"If given, Python won’t try to write .pyc files on the import of source modules",
|
||||
},
|
||||
{
|
||||
name: "--check-hash-based-pycs",
|
||||
description:
|
||||
"Control the validation behavior of hash-based .pyc files. See Cached bytecode invalidation",
|
||||
args: {
|
||||
suggestions: [
|
||||
{ name: "default" },
|
||||
{ name: "always" },
|
||||
{ name: "never" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Turn on parser debugging output (for expert only, depending on compilation options)",
|
||||
},
|
||||
{
|
||||
name: "-E",
|
||||
description:
|
||||
"Ignore all PYTHON* environment variables, e.g. PYTHONPATH and PYTHONHOME, that might be set",
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script or the command, even when sys.stdin does not appear to be a terminal",
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description:
|
||||
"Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script’s directory nor the user’s site-packages directory",
|
||||
},
|
||||
{
|
||||
name: "-O",
|
||||
description:
|
||||
"Remove assert statements and any code conditional on the value of __debug__",
|
||||
},
|
||||
{
|
||||
name: "-OO",
|
||||
description: "Do -O and also discard docstrings",
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description:
|
||||
"Don’t display the copyright and version messages even in interactive mode",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"Turn on hash randomization. This option only has an effect if the PYTHONHASHSEED environment variable is set to 0, since hash randomization is enabled by default",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Don’t add the user site-packages directory to sys.path",
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description:
|
||||
"Disable the import of the module site and the site-dependent manipulations of sys.path that it entails",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description:
|
||||
"Force the stdout and stderr streams to be unbuffered. This option has no effect on the stdin stream",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded",
|
||||
},
|
||||
{
|
||||
name: "-W",
|
||||
description:
|
||||
"Warning control. Python’s warning machinery by default prints warning messages to sys.stderr",
|
||||
args: {},
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"Skip the first line of the source, allowing use of non-Unix forms of #!cmd. This is intended for a DOS specific hack only",
|
||||
},
|
||||
{
|
||||
name: "-X",
|
||||
description: "Reserved for various implementation-specific options",
|
||||
args: {
|
||||
suggestions: [
|
||||
{ name: "faulthandler" },
|
||||
{ name: "showrefcount" },
|
||||
{ name: "tracemalloc" },
|
||||
{ name: "showalloccount" },
|
||||
{ name: "importtime" },
|
||||
{ name: "dev" },
|
||||
{ name: "utf8" },
|
||||
{ name: "pycache_prefix=PATH" },
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
if (
|
||||
(
|
||||
await executeShellCommand({
|
||||
command: "bash",
|
||||
args: ["-c", isDjangoManagePyFilePresentCommand],
|
||||
})
|
||||
).status === 0
|
||||
) {
|
||||
return {
|
||||
name: "python3",
|
||||
subcommands: [{ name: "manage.py", loadSpec: "django-admin" }],
|
||||
};
|
||||
}
|
||||
},
|
||||
args: {
|
||||
name: "python script",
|
||||
isScript: true,
|
||||
generators: filepaths({
|
||||
extensions: ["py"],
|
||||
editFileSuggestions: { priority: 76 },
|
||||
}),
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-c",
|
||||
insertValue: "-c '{cursor}'",
|
||||
description:
|
||||
"Execute the Python code in command. command can be one or more statements separated by newlines, with significant leading whitespace as in normal module code",
|
||||
args: {
|
||||
name: "command",
|
||||
isCommand: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
insertValue: "-m '{cursor}'",
|
||||
description:
|
||||
"Search sys.path for the named module and execute its contents as the __main__ module",
|
||||
args: {
|
||||
name: "command",
|
||||
isCommand: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-?", "-h", "--help"],
|
||||
description: "Print a short description of all command line options",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print the Python version number and exit",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description:
|
||||
"Issue a warning when comparing bytes or bytearray with str or bytes with int. Issue an error when the option is given twice (-bb)",
|
||||
},
|
||||
{
|
||||
name: "-B",
|
||||
description:
|
||||
"If given, Python won’t try to write .pyc files on the import of source modules",
|
||||
},
|
||||
{
|
||||
name: "--check-hash-based-pycs",
|
||||
description:
|
||||
"Control the validation behavior of hash-based .pyc files. See Cached bytecode invalidation",
|
||||
args: {
|
||||
suggestions: [
|
||||
{ name: "default" },
|
||||
{ name: "always" },
|
||||
{ name: "never" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Turn on parser debugging output (for expert only, depending on compilation options)",
|
||||
},
|
||||
{
|
||||
name: "-E",
|
||||
description:
|
||||
"Ignore all PYTHON* environment variables, e.g. PYTHONPATH and PYTHONHOME, that might be set",
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script or the command, even when sys.stdin does not appear to be a terminal",
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description:
|
||||
"Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script’s directory nor the user’s site-packages directory",
|
||||
},
|
||||
{
|
||||
name: "-O",
|
||||
description:
|
||||
"Remove assert statements and any code conditional on the value of __debug__",
|
||||
},
|
||||
{
|
||||
name: "-OO",
|
||||
description: "Do -O and also discard docstrings",
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description:
|
||||
"Don’t display the copyright and version messages even in interactive mode",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"Turn on hash randomization. This option only has an effect if the PYTHONHASHSEED environment variable is set to 0, since hash randomization is enabled by default",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Don’t add the user site-packages directory to sys.path",
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description:
|
||||
"Disable the import of the module site and the site-dependent manipulations of sys.path that it entails",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description:
|
||||
"Force the stdout and stderr streams to be unbuffered. This option has no effect on the stdin stream",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded",
|
||||
},
|
||||
{
|
||||
name: "-W",
|
||||
description:
|
||||
"Warning control. Python’s warning machinery by default prints warning messages to sys.stderr",
|
||||
args: {},
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description:
|
||||
"Skip the first line of the source, allowing use of non-Unix forms of #!cmd. This is intended for a DOS specific hack only",
|
||||
},
|
||||
{
|
||||
name: "-X",
|
||||
description: "Reserved for various implementation-specific options",
|
||||
args: {
|
||||
suggestions: [
|
||||
{ name: "faulthandler" },
|
||||
{ name: "showrefcount" },
|
||||
{ name: "tracemalloc" },
|
||||
{ name: "showalloccount" },
|
||||
{ name: "importtime" },
|
||||
{ name: "dev" },
|
||||
{ name: "utf8" },
|
||||
{ name: "pycache_prefix=PATH" },
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "rm",
|
||||
description: "Remove directory entries",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: ["folders", "filepaths"],
|
||||
},
|
||||
name: "rm",
|
||||
description: "Remove directory entries",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: ["folders", "filepaths"],
|
||||
},
|
||||
|
||||
options: [
|
||||
{
|
||||
name: ["-r", "-R"],
|
||||
description:
|
||||
"Recursive. Attempt to remove the file hierarchy rooted in each file argument",
|
||||
isDangerous: true,
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description: "Overwrite regular files before deleting them",
|
||||
isDangerous: true,
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Attempt to remove directories as well as other types of files",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"⚠️ Attempt to remove the files without prompting for confirmation",
|
||||
isDangerous: true,
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description: "Request confirmation before attempting to remove each file",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Be verbose when deleting files",
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: ["-r", "-R"],
|
||||
description:
|
||||
"Recursive. Attempt to remove the file hierarchy rooted in each file argument",
|
||||
isDangerous: true,
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description: "Overwrite regular files before deleting them",
|
||||
isDangerous: true,
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description:
|
||||
"Attempt to remove directories as well as other types of files",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"⚠️ Attempt to remove the files without prompting for confirmation",
|
||||
isDangerous: true,
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description: "Request confirmation before attempting to remove each file",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Be verbose when deleting files",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "rmdir",
|
||||
description: "Remove directories",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: "folders",
|
||||
},
|
||||
name: "rmdir",
|
||||
description: "Remove directories",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: "folders",
|
||||
},
|
||||
|
||||
options: [
|
||||
{
|
||||
name: "-p",
|
||||
description: "Remove each directory of path",
|
||||
isDangerous: true,
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-p",
|
||||
description: "Remove each directory of path",
|
||||
isDangerous: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,226 +1,226 @@
|
||||
import { knownHosts, configHosts } from "./ssh";
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "scp",
|
||||
description: "Copies files or directories between hosts on a network",
|
||||
args: [
|
||||
{
|
||||
name: "sources",
|
||||
description: "File or directory, local or remote ([user@]host:[path])",
|
||||
isVariadic: true,
|
||||
generators: [
|
||||
knownHosts,
|
||||
configHosts,
|
||||
{ template: ["history", "filepaths", "folders"] },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "target",
|
||||
description: "File or directory, local or remote ([user@]host:[path])",
|
||||
generators: [
|
||||
knownHosts,
|
||||
configHosts,
|
||||
{ template: ["history", "filepaths", "folders"] },
|
||||
],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-3",
|
||||
description: `Copies between two remote hosts are transferred through the local
|
||||
name: "scp",
|
||||
description: "Copies files or directories between hosts on a network",
|
||||
args: [
|
||||
{
|
||||
name: "sources",
|
||||
description: "File or directory, local or remote ([user@]host:[path])",
|
||||
isVariadic: true,
|
||||
generators: [
|
||||
knownHosts,
|
||||
configHosts,
|
||||
{ template: ["history", "filepaths", "folders"] },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "target",
|
||||
description: "File or directory, local or remote ([user@]host:[path])",
|
||||
generators: [
|
||||
knownHosts,
|
||||
configHosts,
|
||||
{ template: ["history", "filepaths", "folders"] },
|
||||
],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: "-3",
|
||||
description: `Copies between two remote hosts are transferred through the local
|
||||
host. Without this option the data is copied directly between the
|
||||
two remote hosts. Note that this option disables the progress
|
||||
meter and selects batch mode for the second host, since scp cannot
|
||||
ask for passwords or passphrases for both hosts`,
|
||||
},
|
||||
{
|
||||
name: "-4",
|
||||
description: "Forces scp to use IPv4 addresses only",
|
||||
},
|
||||
{
|
||||
name: "-6",
|
||||
description: "Forces scp to use IPv6 addresses only",
|
||||
},
|
||||
{
|
||||
name: "-A",
|
||||
description:
|
||||
"Allows forwarding of ssh-agent(1) to the remote system. The default is not to forward an authentication agent",
|
||||
},
|
||||
{
|
||||
name: "-B",
|
||||
description:
|
||||
"Selects batch mode (prevents asking for passwords or passphrases)",
|
||||
},
|
||||
{
|
||||
name: "-C",
|
||||
description:
|
||||
"Compression enable. Passes the -C flag to ssh(1) to enable compression",
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description:
|
||||
"Selects the cipher to use for encrypting the data transfer. This option is directly passed to ssh(1)",
|
||||
args: {
|
||||
name: "cipher",
|
||||
description: "The selected cipher specification",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-F",
|
||||
description:
|
||||
"Specifies an alternative per-user configuration file for ssh. This option is directly passed to ssh(1)",
|
||||
args: {
|
||||
name: "ssh_config",
|
||||
description: "The selected ssh config",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Selects the file from which the identity (private key) for public key authentication is read. This option is directly passed to ssh(1)",
|
||||
args: {
|
||||
name: "identity_file",
|
||||
description: "Specified identity file",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-J",
|
||||
description: `Connect to the target host by first making an scp connection to the
|
||||
},
|
||||
{
|
||||
name: "-4",
|
||||
description: "Forces scp to use IPv4 addresses only",
|
||||
},
|
||||
{
|
||||
name: "-6",
|
||||
description: "Forces scp to use IPv6 addresses only",
|
||||
},
|
||||
{
|
||||
name: "-A",
|
||||
description:
|
||||
"Allows forwarding of ssh-agent(1) to the remote system. The default is not to forward an authentication agent",
|
||||
},
|
||||
{
|
||||
name: "-B",
|
||||
description:
|
||||
"Selects batch mode (prevents asking for passwords or passphrases)",
|
||||
},
|
||||
{
|
||||
name: "-C",
|
||||
description:
|
||||
"Compression enable. Passes the -C flag to ssh(1) to enable compression",
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description:
|
||||
"Selects the cipher to use for encrypting the data transfer. This option is directly passed to ssh(1)",
|
||||
args: {
|
||||
name: "cipher",
|
||||
description: "The selected cipher specification",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-F",
|
||||
description:
|
||||
"Specifies an alternative per-user configuration file for ssh. This option is directly passed to ssh(1)",
|
||||
args: {
|
||||
name: "ssh_config",
|
||||
description: "The selected ssh config",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Selects the file from which the identity (private key) for public key authentication is read. This option is directly passed to ssh(1)",
|
||||
args: {
|
||||
name: "identity_file",
|
||||
description: "Specified identity file",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-J",
|
||||
description: `Connect to the target host by first making an scp connection to the
|
||||
jump host described by destination and then establishing a TCP
|
||||
forwarding to the ultimate destination from there. Multiple jump
|
||||
hops may be specified separated by comma characters. This is a
|
||||
shortcut to specify a ProxyJump configuration directive. This
|
||||
option is directly passed to ssh(1)`,
|
||||
args: {
|
||||
name: "destination",
|
||||
description: "Scp destination",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description: "Limits the used bandwidth, specified in Kbit/s",
|
||||
args: {
|
||||
name: "limit",
|
||||
description: "Limit bandwidth in Kbit/s",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-o",
|
||||
description: `Can be used to pass options to ssh in the format used in
|
||||
args: {
|
||||
name: "destination",
|
||||
description: "Scp destination",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description: "Limits the used bandwidth, specified in Kbit/s",
|
||||
args: {
|
||||
name: "limit",
|
||||
description: "Limit bandwidth in Kbit/s",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-o",
|
||||
description: `Can be used to pass options to ssh in the format used in
|
||||
ssh_config(5). This is useful for specifying options for which
|
||||
there is no separate scp command-line flag. For full details of
|
||||
the options listed below, and their possible values, see
|
||||
ssh_config(5)`,
|
||||
args: {
|
||||
name: "option",
|
||||
suggestions: [
|
||||
{ name: "AddressFamily" },
|
||||
{ name: "BatchMode" },
|
||||
{ name: "BindAddress" },
|
||||
{ name: "ChallengeResponseAuthentication" },
|
||||
{ name: "CheckHostIP" },
|
||||
{ name: "Cipher" },
|
||||
{ name: "Ciphers" },
|
||||
{ name: "ClearAllForwardings" },
|
||||
{ name: "Compression" },
|
||||
{ name: "CompressionLevel" },
|
||||
{ name: "ConnectionAttempts" },
|
||||
{ name: "ConnectTimeout" },
|
||||
{ name: "ControlMaster" },
|
||||
{ name: "ControlPath" },
|
||||
{ name: "ControlPersist" },
|
||||
{ name: "DynamicForward" },
|
||||
{ name: "EscapeChar" },
|
||||
{ name: "ExitOnForwardFailure" },
|
||||
{ name: "ForwardAgent" },
|
||||
{ name: "ForwardX11" },
|
||||
{ name: "ForwardX11Timeout" },
|
||||
{ name: "ForwardX11Trusted" },
|
||||
{ name: "GatewayPorts" },
|
||||
{ name: "GlobalKnownHostsFile" },
|
||||
{ name: "GSSAPIAuthentication" },
|
||||
{ name: "GSSAPIDelegateCredentials" },
|
||||
{ name: "HashKnownHosts" },
|
||||
{ name: "Host" },
|
||||
{ name: "HostbasedAuthentication" },
|
||||
{ name: "HostKeyAlgorithms" },
|
||||
{ name: "HostKeyAlias" },
|
||||
{ name: "HostName" },
|
||||
{ name: "IdentityFile" },
|
||||
{ name: "IdentitiesOnly" },
|
||||
{ name: "IPQoS" },
|
||||
{ name: "KbdInteractiveAuthentication" },
|
||||
{ name: "KbdInteractiveDevices" },
|
||||
{ name: "KexAlgorithms" },
|
||||
{ name: "LocalCommand" },
|
||||
{ name: "LocalForward" },
|
||||
{ name: "LogLevel" },
|
||||
{ name: "MACs" },
|
||||
{ name: "NoHostAuthenticationForLocalhost" },
|
||||
{ name: "NumberOfPasswordPrompts" },
|
||||
{ name: "PasswordAuthentication" },
|
||||
{ name: "PermitLocalCommand" },
|
||||
{ name: "PKCS11Provider" },
|
||||
{ name: "Port" },
|
||||
{ name: "PreferredAuthentications" },
|
||||
{ name: "Protocol" },
|
||||
{ name: "ProxyCommand" },
|
||||
{ name: "PubkeyAuthentication" },
|
||||
{ name: "RekeyLimit" },
|
||||
{ name: "RequestTTY" },
|
||||
{ name: "RhostsRSAAuthentication" },
|
||||
{ name: "RSAAuthentication" },
|
||||
{ name: "SendEnv" },
|
||||
{ name: "ServerAliveInterval" },
|
||||
{ name: "ServerAliveCountMax" },
|
||||
{ name: "StrictHostKeyChecking" },
|
||||
{ name: "TCPKeepAlive" },
|
||||
{ name: "Tunnel" },
|
||||
{ name: "TunnelDevice" },
|
||||
{ name: "UsePrivilegedPort" },
|
||||
{ name: "User" },
|
||||
{ name: "UserKnownHostsFile" },
|
||||
{ name: "VerifyHostKeyDNS" },
|
||||
{ name: "VisualHostKey" },
|
||||
{ name: "XAuthLocation" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description: `Specifies the port to connect to on the remote host. Note that
|
||||
args: {
|
||||
name: "option",
|
||||
suggestions: [
|
||||
{ name: "AddressFamily" },
|
||||
{ name: "BatchMode" },
|
||||
{ name: "BindAddress" },
|
||||
{ name: "ChallengeResponseAuthentication" },
|
||||
{ name: "CheckHostIP" },
|
||||
{ name: "Cipher" },
|
||||
{ name: "Ciphers" },
|
||||
{ name: "ClearAllForwardings" },
|
||||
{ name: "Compression" },
|
||||
{ name: "CompressionLevel" },
|
||||
{ name: "ConnectionAttempts" },
|
||||
{ name: "ConnectTimeout" },
|
||||
{ name: "ControlMaster" },
|
||||
{ name: "ControlPath" },
|
||||
{ name: "ControlPersist" },
|
||||
{ name: "DynamicForward" },
|
||||
{ name: "EscapeChar" },
|
||||
{ name: "ExitOnForwardFailure" },
|
||||
{ name: "ForwardAgent" },
|
||||
{ name: "ForwardX11" },
|
||||
{ name: "ForwardX11Timeout" },
|
||||
{ name: "ForwardX11Trusted" },
|
||||
{ name: "GatewayPorts" },
|
||||
{ name: "GlobalKnownHostsFile" },
|
||||
{ name: "GSSAPIAuthentication" },
|
||||
{ name: "GSSAPIDelegateCredentials" },
|
||||
{ name: "HashKnownHosts" },
|
||||
{ name: "Host" },
|
||||
{ name: "HostbasedAuthentication" },
|
||||
{ name: "HostKeyAlgorithms" },
|
||||
{ name: "HostKeyAlias" },
|
||||
{ name: "HostName" },
|
||||
{ name: "IdentityFile" },
|
||||
{ name: "IdentitiesOnly" },
|
||||
{ name: "IPQoS" },
|
||||
{ name: "KbdInteractiveAuthentication" },
|
||||
{ name: "KbdInteractiveDevices" },
|
||||
{ name: "KexAlgorithms" },
|
||||
{ name: "LocalCommand" },
|
||||
{ name: "LocalForward" },
|
||||
{ name: "LogLevel" },
|
||||
{ name: "MACs" },
|
||||
{ name: "NoHostAuthenticationForLocalhost" },
|
||||
{ name: "NumberOfPasswordPrompts" },
|
||||
{ name: "PasswordAuthentication" },
|
||||
{ name: "PermitLocalCommand" },
|
||||
{ name: "PKCS11Provider" },
|
||||
{ name: "Port" },
|
||||
{ name: "PreferredAuthentications" },
|
||||
{ name: "Protocol" },
|
||||
{ name: "ProxyCommand" },
|
||||
{ name: "PubkeyAuthentication" },
|
||||
{ name: "RekeyLimit" },
|
||||
{ name: "RequestTTY" },
|
||||
{ name: "RhostsRSAAuthentication" },
|
||||
{ name: "RSAAuthentication" },
|
||||
{ name: "SendEnv" },
|
||||
{ name: "ServerAliveInterval" },
|
||||
{ name: "ServerAliveCountMax" },
|
||||
{ name: "StrictHostKeyChecking" },
|
||||
{ name: "TCPKeepAlive" },
|
||||
{ name: "Tunnel" },
|
||||
{ name: "TunnelDevice" },
|
||||
{ name: "UsePrivilegedPort" },
|
||||
{ name: "User" },
|
||||
{ name: "UserKnownHostsFile" },
|
||||
{ name: "VerifyHostKeyDNS" },
|
||||
{ name: "VisualHostKey" },
|
||||
{ name: "XAuthLocation" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-P",
|
||||
description: `Specifies the port to connect to on the remote host. Note that
|
||||
this option is written with a capital ‘P’, because -p is already
|
||||
reserved for preserving the times and modes of the file`,
|
||||
args: {
|
||||
name: "port",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description:
|
||||
"Preserves modification times, access times, and modes from the original file",
|
||||
},
|
||||
{
|
||||
name: "-q",
|
||||
description:
|
||||
"Quiet mode: disables the progress meter as well as warning and diagnostic messages from ssh(1)",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Recursively copy entire directories. Note that scp follows symbolic links encountered in the tree traversal",
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description:
|
||||
"Name of program to use for the encrypted connection. The program must understand ssh(1) options",
|
||||
args: {
|
||||
name: "program",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description: `Disable strict filename checking. By default when copying files
|
||||
args: {
|
||||
name: "port",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description:
|
||||
"Preserves modification times, access times, and modes from the original file",
|
||||
},
|
||||
{
|
||||
name: "-q",
|
||||
description:
|
||||
"Quiet mode: disables the progress meter as well as warning and diagnostic messages from ssh(1)",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Recursively copy entire directories. Note that scp follows symbolic links encountered in the tree traversal",
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description:
|
||||
"Name of program to use for the encrypted connection. The program must understand ssh(1) options",
|
||||
args: {
|
||||
name: "program",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description: `Disable strict filename checking. By default when copying files
|
||||
from a remote host to a local directory scp checks that the
|
||||
received filenames match those requested on the command-line to
|
||||
prevent the remote end from sending unexpected or unwanted files.
|
||||
@@ -229,13 +229,13 @@ interpret filename wildcards, these checks may cause wanted files
|
||||
to be rejected. This option disables these checks at the expense
|
||||
of fully trusting that the server will not send unexpected
|
||||
filenames`,
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Verbose mode. Causes scp and ssh(1) to print debugging messages about their progress. This is helpful in debugging connection, authentication, and configuration problems",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Verbose mode. Causes scp and ssh(1) to print debugging messages about their progress. This is helpful in debugging connection, authentication, and configuration problems",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,447 +1,447 @@
|
||||
const knownHostRegex = /(?:[a-zA-Z0-9-]+\.)+[a-zA-Z0-9]+/; // will match numerical IPs as well as domains/subdomains
|
||||
|
||||
const resolveAbsolutePath = (
|
||||
path: string,
|
||||
basePath: string,
|
||||
home: string
|
||||
path: string,
|
||||
basePath: string,
|
||||
home: string
|
||||
): string => {
|
||||
if (path.startsWith("/") || path.startsWith("~/") || path === "~") {
|
||||
return path.replace("~", home);
|
||||
}
|
||||
if (
|
||||
basePath.startsWith("/") ||
|
||||
basePath.startsWith("~/") ||
|
||||
basePath === "~"
|
||||
) {
|
||||
return (
|
||||
basePath.replace("~", home) +
|
||||
(basePath.replace("~", home).endsWith("/") ? "" : "/") +
|
||||
path
|
||||
);
|
||||
}
|
||||
return basePath + (basePath.endsWith("/") ? "" : "/") + path;
|
||||
if (path.startsWith("/") || path.startsWith("~/") || path === "~") {
|
||||
return path.replace("~", home);
|
||||
}
|
||||
if (
|
||||
basePath.startsWith("/") ||
|
||||
basePath.startsWith("~/") ||
|
||||
basePath === "~"
|
||||
) {
|
||||
return (
|
||||
basePath.replace("~", home) +
|
||||
(basePath.replace("~", home).endsWith("/") ? "" : "/") +
|
||||
path
|
||||
);
|
||||
}
|
||||
return basePath + (basePath.endsWith("/") ? "" : "/") + path;
|
||||
};
|
||||
|
||||
const getConfigLines = async (
|
||||
file: string,
|
||||
executeShellCommand: Fig.ExecuteCommandFunction,
|
||||
home: string,
|
||||
basePath: string
|
||||
file: string,
|
||||
executeShellCommand: Fig.ExecuteCommandFunction,
|
||||
home: string,
|
||||
basePath: string
|
||||
) => {
|
||||
const absolutePath = resolveAbsolutePath(file, basePath, home);
|
||||
const absolutePath = resolveAbsolutePath(file, basePath, home);
|
||||
|
||||
const { stdout } = await executeShellCommand({
|
||||
command: "cat",
|
||||
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
|
||||
args: [absolutePath],
|
||||
});
|
||||
const configLines = stdout.split("\n").map((line) => line.trim());
|
||||
const { stdout } = await executeShellCommand({
|
||||
command: "cat",
|
||||
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
|
||||
args: [absolutePath],
|
||||
});
|
||||
const configLines = stdout.split("\n").map((line) => line.trim());
|
||||
|
||||
// Get list of includes in the config file
|
||||
const includes = configLines
|
||||
.filter((line) => line.toLowerCase().startsWith("include "))
|
||||
.map((line) => line.split(" ")[1]);
|
||||
// Get list of includes in the config file
|
||||
const includes = configLines
|
||||
.filter((line) => line.toLowerCase().startsWith("include "))
|
||||
.map((line) => line.split(" ")[1]);
|
||||
|
||||
// Get the lines of every include file
|
||||
const includeLines: any = await Promise.all(
|
||||
includes.map((file) =>
|
||||
getConfigLines(file, executeShellCommand, home, basePath)
|
||||
)
|
||||
);
|
||||
// Get the lines of every include file
|
||||
const includeLines: any = await Promise.all(
|
||||
includes.map((file) =>
|
||||
getConfigLines(file, executeShellCommand, home, basePath)
|
||||
)
|
||||
);
|
||||
|
||||
// Combine config lines with includes config lines
|
||||
return [...configLines, ...includeLines.flat()];
|
||||
// Combine config lines with includes config lines
|
||||
return [...configLines, ...includeLines.flat()];
|
||||
};
|
||||
|
||||
export const knownHosts: Fig.Generator = {
|
||||
custom: async (tokens, executeCommand, context) => {
|
||||
const { stdout } = await executeCommand({
|
||||
command: "cat",
|
||||
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
|
||||
args: [`${context.environmentVariables["HOME"]}/.ssh/known_hosts`],
|
||||
});
|
||||
custom: async (tokens, executeCommand, context) => {
|
||||
const { stdout } = await executeCommand({
|
||||
command: "cat",
|
||||
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
|
||||
args: [`${context.environmentVariables["HOME"]}/.ssh/known_hosts`],
|
||||
});
|
||||
|
||||
return stdout
|
||||
.split("\n")
|
||||
.map((line) => {
|
||||
const match = knownHostRegex.exec(line);
|
||||
if (match) {
|
||||
return String(match);
|
||||
}
|
||||
})
|
||||
.filter((value, index, self) => value && self.indexOf(value) === index)
|
||||
.map((knownHost) => ({
|
||||
name: (tokens[1].endsWith("@") ? tokens[1] : "") + knownHost, // also suggest when user@ is provided
|
||||
description: "SSH host",
|
||||
}));
|
||||
},
|
||||
trigger: "@",
|
||||
return stdout
|
||||
.split("\n")
|
||||
.map((line) => {
|
||||
const match = knownHostRegex.exec(line);
|
||||
if (match) {
|
||||
return String(match);
|
||||
}
|
||||
})
|
||||
.filter((value, index, self) => value && self.indexOf(value) === index)
|
||||
.map((knownHost) => ({
|
||||
name: (tokens[1].endsWith("@") ? tokens[1] : "") + knownHost, // also suggest when user@ is provided
|
||||
description: "SSH host",
|
||||
}));
|
||||
},
|
||||
trigger: "@",
|
||||
};
|
||||
|
||||
export const configHosts: Fig.Generator = {
|
||||
custom: async (tokens, executeShellCommand, context) => {
|
||||
const configLines = await getConfigLines(
|
||||
"config",
|
||||
executeShellCommand,
|
||||
context.environmentVariables["HOME"],
|
||||
"~/.ssh"
|
||||
);
|
||||
custom: async (tokens, executeShellCommand, context) => {
|
||||
const configLines = await getConfigLines(
|
||||
"config",
|
||||
executeShellCommand,
|
||||
context.environmentVariables["HOME"],
|
||||
"~/.ssh"
|
||||
);
|
||||
|
||||
return configLines
|
||||
.filter(
|
||||
(line) =>
|
||||
line.trim().toLowerCase().startsWith("host ") && !line.includes("*")
|
||||
)
|
||||
.map((host) => ({
|
||||
name: host.split(" ")[1],
|
||||
description: "SSH host",
|
||||
priority: 90,
|
||||
}));
|
||||
},
|
||||
return configLines
|
||||
.filter(
|
||||
(line) =>
|
||||
line.trim().toLowerCase().startsWith("host ") && !line.includes("*")
|
||||
)
|
||||
.map((host) => ({
|
||||
name: host.split(" ")[1],
|
||||
description: "SSH host",
|
||||
priority: 90,
|
||||
}));
|
||||
},
|
||||
};
|
||||
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "ssh",
|
||||
description: "Log into a remote machine",
|
||||
args: {
|
||||
name: "user@hostname",
|
||||
description: "Address of remote machine to log into",
|
||||
generators: [knownHosts, configHosts, { template: "history" }],
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-1",
|
||||
description: "Forces ssh to try protocol version 1 only",
|
||||
},
|
||||
{
|
||||
name: "-2",
|
||||
description: "Forces ssh to try protocol version 2 only",
|
||||
},
|
||||
{
|
||||
name: "-4",
|
||||
description: "Forces ssh to use IPv4 addresses only",
|
||||
},
|
||||
{
|
||||
name: "-6",
|
||||
description: "Forces ssh to use IPv6 addresses only",
|
||||
},
|
||||
{
|
||||
name: "-A",
|
||||
description: "Enables forwarding of the authentication agent connection",
|
||||
},
|
||||
{
|
||||
name: "-a",
|
||||
description: "Disables forwarding of the authentication agent connection",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description:
|
||||
"Use bind_address on the local machine as the source address of the connection",
|
||||
args: {
|
||||
name: "bind address",
|
||||
description: "Source address of the connection",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-C",
|
||||
description:
|
||||
"Requests compression of all data (including stdin, stdout, stderr, and data for forwarded X11 and TCP connections)",
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description:
|
||||
"Selects the cipher specification for encrypting the session",
|
||||
args: {
|
||||
name: "cipher spec",
|
||||
description: "The selected cipher specification",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-D",
|
||||
description:
|
||||
"Specifies a local 'dynamic' application-level port forwarding",
|
||||
args: {
|
||||
name: "port",
|
||||
description: "Port of the bind address",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Sets the escape character for sessions with a pty (default: '~')",
|
||||
args: {
|
||||
name: "escape char",
|
||||
description: "Specified escape character",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-F",
|
||||
description: "Specifies an alternative per-user configuration file",
|
||||
args: {
|
||||
name: "configfile",
|
||||
description: "Path to alternative config file",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"Requests ssh to go to background just before command execution",
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description: "Allows remote hosts to connect to local forwarded ports",
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description:
|
||||
"Specify the PKCS#11 shared library ssh should use to communicate with a PKCS#11 token providing the user's private RSA key",
|
||||
args: {
|
||||
name: "pkcs11",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Selects a file from which the identity (private key) for public key authentication is read",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "identity file",
|
||||
description: "Path to identity (private key)",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-K",
|
||||
description:
|
||||
"Enables GSSAPI-based authentication and forwarding (delegation) of GSSAPI credentials to the server",
|
||||
},
|
||||
{
|
||||
name: "-k",
|
||||
description:
|
||||
"Disables forwarding (delegation) of GSSAPI credentials to the server",
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side",
|
||||
args: {
|
||||
name: "port:host:hostport",
|
||||
description: "Local port, followed by host and host port to forward to",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description: "Specifies the user to log in as on the remote machine",
|
||||
args: {
|
||||
name: "login name",
|
||||
description: "Name of user logging into remote machine",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-M",
|
||||
description:
|
||||
"Places the ssh client into ``master'' mode for connection sharing",
|
||||
isRepeatable: true,
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description:
|
||||
"Additionally, for protocol version 2 a comma-separated list of MAC (message authentication code) algorithms can be specified in order of preference",
|
||||
args: {
|
||||
name: "mac spec",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-N",
|
||||
description: "Do not execute a remote command",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description:
|
||||
"Redirects stdin from /dev/null (actually, prevents reading from stdin)",
|
||||
},
|
||||
{
|
||||
name: "-O",
|
||||
description: "Control an active connection multiplexing master process",
|
||||
args: {
|
||||
name: "ctl cmd",
|
||||
description: "Command that's passed to the master process",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-o",
|
||||
description:
|
||||
"Can be used to give options in the format used in the configuration file",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "option",
|
||||
description:
|
||||
"Options that can be specified in the format of the config file",
|
||||
suggestions: [
|
||||
{ name: "AddressFamily" },
|
||||
{ name: "BatchMode" },
|
||||
{ name: "BindAddress" },
|
||||
{ name: "ChallengeResponseAuthentication" },
|
||||
{ name: "CheckHostIP" },
|
||||
{ name: "Cipher" },
|
||||
{ name: "Ciphers" },
|
||||
{ name: "ClearAllForwardings" },
|
||||
{ name: "Compression" },
|
||||
{ name: "CompressionLevel" },
|
||||
{ name: "ConnectionAttempts" },
|
||||
{ name: "ConnectTimeout" },
|
||||
{ name: "ControlMaster" },
|
||||
{ name: "ControlPath" },
|
||||
{ name: "ControlPersist" },
|
||||
{ name: "DynamicForward" },
|
||||
{ name: "EscapeChar" },
|
||||
{ name: "ExitOnForwardFailure" },
|
||||
{ name: "ForwardAgent" },
|
||||
{ name: "ForwardX11" },
|
||||
{ name: "ForwardX11Timeout" },
|
||||
{ name: "ForwardX11Trusted" },
|
||||
{ name: "GatewayPorts" },
|
||||
{ name: "GlobalKnownHostsFile" },
|
||||
{ name: "GSSAPIAuthentication" },
|
||||
{ name: "GSSAPIDelegateCredentials" },
|
||||
{ name: "HashKnownHosts" },
|
||||
{ name: "Host" },
|
||||
{ name: "HostbasedAuthentication" },
|
||||
{ name: "HostKeyAlgorithms" },
|
||||
{ name: "HostKeyAlias" },
|
||||
{ name: "HostName" },
|
||||
{ name: "IdentityFile" },
|
||||
{ name: "IdentitiesOnly" },
|
||||
{ name: "IPQoS" },
|
||||
{ name: "KbdInteractiveAuthentication" },
|
||||
{ name: "KbdInteractiveDevices" },
|
||||
{ name: "KexAlgorithms" },
|
||||
{ name: "LocalCommand" },
|
||||
{ name: "LocalForward" },
|
||||
{ name: "LogLevel" },
|
||||
{ name: "MACs" },
|
||||
{ name: "NoHostAuthenticationForLocalhost" },
|
||||
{ name: "NumberOfPasswordPrompts" },
|
||||
{ name: "PasswordAuthentication" },
|
||||
{ name: "PermitLocalCommand" },
|
||||
{ name: "PKCS11Provider" },
|
||||
{ name: "Port" },
|
||||
{ name: "PreferredAuthentications" },
|
||||
{ name: "Protocol" },
|
||||
{ name: "ProxyCommand" },
|
||||
{ name: "PubkeyAuthentication" },
|
||||
{ name: "RekeyLimit" },
|
||||
{ name: "RequestTTY" },
|
||||
{ name: "RhostsRSAAuthentication" },
|
||||
{ name: "RSAAuthentication" },
|
||||
{ name: "SendEnv" },
|
||||
{ name: "ServerAliveInterval" },
|
||||
{ name: "ServerAliveCountMax" },
|
||||
{ name: "StrictHostKeyChecking" },
|
||||
{ name: "TCPKeepAlive" },
|
||||
{ name: "Tunnel" },
|
||||
{ name: "TunnelDevice" },
|
||||
{ name: "UsePrivilegedPort" },
|
||||
{ name: "User" },
|
||||
{ name: "UserKnownHostsFile" },
|
||||
{ name: "VerifyHostKeyDNS" },
|
||||
{ name: "VisualHostKey" },
|
||||
{ name: "XAuthLocation" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description: "Port to connect to on the remote host",
|
||||
args: {
|
||||
name: "port",
|
||||
description: "Port to connect to",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-q",
|
||||
description:
|
||||
"Quiet mode. Causes most warning and diagnostic messages to be suppressed",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side",
|
||||
args: {
|
||||
name: "port:host:hostport",
|
||||
description: "Local port, followed by host and host port to forward to",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description:
|
||||
"Specifies the location of a control socket for connection sharing, or the string 'none' to disable connection sharing",
|
||||
args: {
|
||||
name: "ctl_path",
|
||||
description: "Location of the control socket",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"May be used to request invocation of a subsystem on the remote system",
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description: "Disable pseudo-tty allocation",
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description: "Force pseudo-tty allocation",
|
||||
isRepeatable: true,
|
||||
},
|
||||
{
|
||||
name: "-V",
|
||||
description: "Display the version number and exit",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Verbose mode. Causes ssh to print debugging messages about its progress",
|
||||
isRepeatable: 3,
|
||||
},
|
||||
{
|
||||
name: "-W",
|
||||
description:
|
||||
"Requests that standard input and output on the client be forwarded to host on port over the secure channel",
|
||||
args: {
|
||||
name: "host:port",
|
||||
description: "Host and port to forward to",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-w",
|
||||
description:
|
||||
"Requests tunnel device forwarding with the specified tun(4) devices between the client (local_tun) and the server (remote_tun)",
|
||||
args: {
|
||||
name: "local tun",
|
||||
description: "Local device to forward to",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-X",
|
||||
description: "Enables X11 forwarding",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description: "Disables X11 forwarding",
|
||||
},
|
||||
{
|
||||
name: "-Y",
|
||||
description: "Enables trusted X11 forwarding",
|
||||
},
|
||||
{
|
||||
name: "-y",
|
||||
description: "Send log information using the syslog(3) system module",
|
||||
},
|
||||
],
|
||||
name: "ssh",
|
||||
description: "Log into a remote machine",
|
||||
args: {
|
||||
name: "user@hostname",
|
||||
description: "Address of remote machine to log into",
|
||||
generators: [knownHosts, configHosts, { template: "history" }],
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-1",
|
||||
description: "Forces ssh to try protocol version 1 only",
|
||||
},
|
||||
{
|
||||
name: "-2",
|
||||
description: "Forces ssh to try protocol version 2 only",
|
||||
},
|
||||
{
|
||||
name: "-4",
|
||||
description: "Forces ssh to use IPv4 addresses only",
|
||||
},
|
||||
{
|
||||
name: "-6",
|
||||
description: "Forces ssh to use IPv6 addresses only",
|
||||
},
|
||||
{
|
||||
name: "-A",
|
||||
description: "Enables forwarding of the authentication agent connection",
|
||||
},
|
||||
{
|
||||
name: "-a",
|
||||
description: "Disables forwarding of the authentication agent connection",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description:
|
||||
"Use bind_address on the local machine as the source address of the connection",
|
||||
args: {
|
||||
name: "bind address",
|
||||
description: "Source address of the connection",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-C",
|
||||
description:
|
||||
"Requests compression of all data (including stdin, stdout, stderr, and data for forwarded X11 and TCP connections)",
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description:
|
||||
"Selects the cipher specification for encrypting the session",
|
||||
args: {
|
||||
name: "cipher spec",
|
||||
description: "The selected cipher specification",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-D",
|
||||
description:
|
||||
"Specifies a local 'dynamic' application-level port forwarding",
|
||||
args: {
|
||||
name: "port",
|
||||
description: "Port of the bind address",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description:
|
||||
"Sets the escape character for sessions with a pty (default: '~')",
|
||||
args: {
|
||||
name: "escape char",
|
||||
description: "Specified escape character",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-F",
|
||||
description: "Specifies an alternative per-user configuration file",
|
||||
args: {
|
||||
name: "configfile",
|
||||
description: "Path to alternative config file",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"Requests ssh to go to background just before command execution",
|
||||
},
|
||||
{
|
||||
name: "-g",
|
||||
description: "Allows remote hosts to connect to local forwarded ports",
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
description:
|
||||
"Specify the PKCS#11 shared library ssh should use to communicate with a PKCS#11 token providing the user's private RSA key",
|
||||
args: {
|
||||
name: "pkcs11",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Selects a file from which the identity (private key) for public key authentication is read",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "identity file",
|
||||
description: "Path to identity (private key)",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-K",
|
||||
description:
|
||||
"Enables GSSAPI-based authentication and forwarding (delegation) of GSSAPI credentials to the server",
|
||||
},
|
||||
{
|
||||
name: "-k",
|
||||
description:
|
||||
"Disables forwarding (delegation) of GSSAPI credentials to the server",
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description:
|
||||
"Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side",
|
||||
args: {
|
||||
name: "port:host:hostport",
|
||||
description: "Local port, followed by host and host port to forward to",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description: "Specifies the user to log in as on the remote machine",
|
||||
args: {
|
||||
name: "login name",
|
||||
description: "Name of user logging into remote machine",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-M",
|
||||
description:
|
||||
"Places the ssh client into ``master'' mode for connection sharing",
|
||||
isRepeatable: true,
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description:
|
||||
"Additionally, for protocol version 2 a comma-separated list of MAC (message authentication code) algorithms can be specified in order of preference",
|
||||
args: {
|
||||
name: "mac spec",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-N",
|
||||
description: "Do not execute a remote command",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description:
|
||||
"Redirects stdin from /dev/null (actually, prevents reading from stdin)",
|
||||
},
|
||||
{
|
||||
name: "-O",
|
||||
description: "Control an active connection multiplexing master process",
|
||||
args: {
|
||||
name: "ctl cmd",
|
||||
description: "Command that's passed to the master process",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-o",
|
||||
description:
|
||||
"Can be used to give options in the format used in the configuration file",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "option",
|
||||
description:
|
||||
"Options that can be specified in the format of the config file",
|
||||
suggestions: [
|
||||
{ name: "AddressFamily" },
|
||||
{ name: "BatchMode" },
|
||||
{ name: "BindAddress" },
|
||||
{ name: "ChallengeResponseAuthentication" },
|
||||
{ name: "CheckHostIP" },
|
||||
{ name: "Cipher" },
|
||||
{ name: "Ciphers" },
|
||||
{ name: "ClearAllForwardings" },
|
||||
{ name: "Compression" },
|
||||
{ name: "CompressionLevel" },
|
||||
{ name: "ConnectionAttempts" },
|
||||
{ name: "ConnectTimeout" },
|
||||
{ name: "ControlMaster" },
|
||||
{ name: "ControlPath" },
|
||||
{ name: "ControlPersist" },
|
||||
{ name: "DynamicForward" },
|
||||
{ name: "EscapeChar" },
|
||||
{ name: "ExitOnForwardFailure" },
|
||||
{ name: "ForwardAgent" },
|
||||
{ name: "ForwardX11" },
|
||||
{ name: "ForwardX11Timeout" },
|
||||
{ name: "ForwardX11Trusted" },
|
||||
{ name: "GatewayPorts" },
|
||||
{ name: "GlobalKnownHostsFile" },
|
||||
{ name: "GSSAPIAuthentication" },
|
||||
{ name: "GSSAPIDelegateCredentials" },
|
||||
{ name: "HashKnownHosts" },
|
||||
{ name: "Host" },
|
||||
{ name: "HostbasedAuthentication" },
|
||||
{ name: "HostKeyAlgorithms" },
|
||||
{ name: "HostKeyAlias" },
|
||||
{ name: "HostName" },
|
||||
{ name: "IdentityFile" },
|
||||
{ name: "IdentitiesOnly" },
|
||||
{ name: "IPQoS" },
|
||||
{ name: "KbdInteractiveAuthentication" },
|
||||
{ name: "KbdInteractiveDevices" },
|
||||
{ name: "KexAlgorithms" },
|
||||
{ name: "LocalCommand" },
|
||||
{ name: "LocalForward" },
|
||||
{ name: "LogLevel" },
|
||||
{ name: "MACs" },
|
||||
{ name: "NoHostAuthenticationForLocalhost" },
|
||||
{ name: "NumberOfPasswordPrompts" },
|
||||
{ name: "PasswordAuthentication" },
|
||||
{ name: "PermitLocalCommand" },
|
||||
{ name: "PKCS11Provider" },
|
||||
{ name: "Port" },
|
||||
{ name: "PreferredAuthentications" },
|
||||
{ name: "Protocol" },
|
||||
{ name: "ProxyCommand" },
|
||||
{ name: "PubkeyAuthentication" },
|
||||
{ name: "RekeyLimit" },
|
||||
{ name: "RequestTTY" },
|
||||
{ name: "RhostsRSAAuthentication" },
|
||||
{ name: "RSAAuthentication" },
|
||||
{ name: "SendEnv" },
|
||||
{ name: "ServerAliveInterval" },
|
||||
{ name: "ServerAliveCountMax" },
|
||||
{ name: "StrictHostKeyChecking" },
|
||||
{ name: "TCPKeepAlive" },
|
||||
{ name: "Tunnel" },
|
||||
{ name: "TunnelDevice" },
|
||||
{ name: "UsePrivilegedPort" },
|
||||
{ name: "User" },
|
||||
{ name: "UserKnownHostsFile" },
|
||||
{ name: "VerifyHostKeyDNS" },
|
||||
{ name: "VisualHostKey" },
|
||||
{ name: "XAuthLocation" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description: "Port to connect to on the remote host",
|
||||
args: {
|
||||
name: "port",
|
||||
description: "Port to connect to",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-q",
|
||||
description:
|
||||
"Quiet mode. Causes most warning and diagnostic messages to be suppressed",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description:
|
||||
"Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side",
|
||||
args: {
|
||||
name: "port:host:hostport",
|
||||
description: "Local port, followed by host and host port to forward to",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description:
|
||||
"Specifies the location of a control socket for connection sharing, or the string 'none' to disable connection sharing",
|
||||
args: {
|
||||
name: "ctl_path",
|
||||
description: "Location of the control socket",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"May be used to request invocation of a subsystem on the remote system",
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description: "Disable pseudo-tty allocation",
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description: "Force pseudo-tty allocation",
|
||||
isRepeatable: true,
|
||||
},
|
||||
{
|
||||
name: "-V",
|
||||
description: "Display the version number and exit",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description:
|
||||
"Verbose mode. Causes ssh to print debugging messages about its progress",
|
||||
isRepeatable: 3,
|
||||
},
|
||||
{
|
||||
name: "-W",
|
||||
description:
|
||||
"Requests that standard input and output on the client be forwarded to host on port over the secure channel",
|
||||
args: {
|
||||
name: "host:port",
|
||||
description: "Host and port to forward to",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-w",
|
||||
description:
|
||||
"Requests tunnel device forwarding with the specified tun(4) devices between the client (local_tun) and the server (remote_tun)",
|
||||
args: {
|
||||
name: "local tun",
|
||||
description: "Local device to forward to",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-X",
|
||||
description: "Enables X11 forwarding",
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description: "Disables X11 forwarding",
|
||||
},
|
||||
{
|
||||
name: "-Y",
|
||||
description: "Enables trusted X11 forwarding",
|
||||
},
|
||||
{
|
||||
name: "-y",
|
||||
description: "Send log information using the syslog(3) system module",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "tail",
|
||||
description: "Display the last part of a file",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-f",
|
||||
description: "Wait for additional data to be appended",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description: "Display in reverse order",
|
||||
},
|
||||
],
|
||||
name: "tail",
|
||||
description: "Display the last part of a file",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-f",
|
||||
description: "Wait for additional data to be appended",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description: "Display in reverse order",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "top",
|
||||
description: "Display Linux tasks",
|
||||
options: [
|
||||
{
|
||||
name: ["-h", "-v"],
|
||||
description: "Show library version and usage prompt",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description: "Starts top in Batch mode",
|
||||
args: {
|
||||
name: "operation",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Starts top with last remembered c state reversed",
|
||||
args: {
|
||||
name: "toggle",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Starts top with the last remembered 'i' state reversed. When this toggle is Off, tasks that are idled or zombied will not be displayed",
|
||||
args: {
|
||||
name: "toggle",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Starts top with secure mode forced",
|
||||
args: {
|
||||
name: "delay",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-pid",
|
||||
description: "Monitor pids",
|
||||
args: {
|
||||
name: "process ids",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
name: "top",
|
||||
description: "Display Linux tasks",
|
||||
options: [
|
||||
{
|
||||
name: ["-h", "-v"],
|
||||
description: "Show library version and usage prompt",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description: "Starts top in Batch mode",
|
||||
args: {
|
||||
name: "operation",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Starts top with last remembered c state reversed",
|
||||
args: {
|
||||
name: "toggle",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description:
|
||||
"Starts top with the last remembered 'i' state reversed. When this toggle is Off, tasks that are idled or zombied will not be displayed",
|
||||
args: {
|
||||
name: "toggle",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Starts top with secure mode forced",
|
||||
args: {
|
||||
name: "delay",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-pid",
|
||||
description: "Monitor pids",
|
||||
args: {
|
||||
name: "process ids",
|
||||
isVariadic: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "touch",
|
||||
description: "Change file access and modification times",
|
||||
args: {
|
||||
name: "file",
|
||||
isVariadic: true,
|
||||
template: "folders",
|
||||
suggestCurrentToken: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-A",
|
||||
description:
|
||||
"Adjust the access and modification time stamps for the file by the specified value",
|
||||
args: {
|
||||
name: "time",
|
||||
description: "[-][[hh]mm]SS",
|
||||
},
|
||||
},
|
||||
{ name: "-a", description: "Change the access time of the file" },
|
||||
{
|
||||
name: "-c",
|
||||
description: "Do not create the file if it does not exist",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"Attempt to force the update, even if the file permissions do not currently permit it",
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description:
|
||||
"If the file is a symbolic link, change the times of the link itself rather than the file that the link points to",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Change the modification time of the file",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Use the access and modifications times from the specified file instead of the current time of day",
|
||||
args: {
|
||||
name: "file",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description:
|
||||
"Change the access and modification times to the specified time instead of the current time of day",
|
||||
args: {
|
||||
name: "timestamp",
|
||||
description: "[[CC]YY]MMDDhhmm[.SS]",
|
||||
},
|
||||
},
|
||||
],
|
||||
name: "touch",
|
||||
description: "Change file access and modification times",
|
||||
args: {
|
||||
name: "file",
|
||||
isVariadic: true,
|
||||
template: "folders",
|
||||
suggestCurrentToken: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-A",
|
||||
description:
|
||||
"Adjust the access and modification time stamps for the file by the specified value",
|
||||
args: {
|
||||
name: "time",
|
||||
description: "[-][[hh]mm]SS",
|
||||
},
|
||||
},
|
||||
{ name: "-a", description: "Change the access time of the file" },
|
||||
{
|
||||
name: "-c",
|
||||
description: "Do not create the file if it does not exist",
|
||||
},
|
||||
{
|
||||
name: "-f",
|
||||
description:
|
||||
"Attempt to force the update, even if the file permissions do not currently permit it",
|
||||
},
|
||||
{
|
||||
name: "-h",
|
||||
description:
|
||||
"If the file is a symbolic link, change the times of the link itself rather than the file that the link points to",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Change the modification time of the file",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Use the access and modifications times from the specified file instead of the current time of day",
|
||||
args: {
|
||||
name: "file",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-t",
|
||||
description:
|
||||
"Change the access and modification times to the specified time instead of the current time of day",
|
||||
args: {
|
||||
name: "timestamp",
|
||||
description: "[[CC]YY]MMDDhhmm[.SS]",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "uname",
|
||||
description: "Print operating system name",
|
||||
options: [
|
||||
{
|
||||
name: "-a",
|
||||
description: "Print all available system information",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Print the machine hardware name",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Print the system hostname",
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description: "Print the machine processor architecture name",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description: "Print the operating system release",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Print the operating system name",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Print the operating system version",
|
||||
},
|
||||
],
|
||||
name: "uname",
|
||||
description: "Print operating system name",
|
||||
options: [
|
||||
{
|
||||
name: "-a",
|
||||
description: "Print all available system information",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Print the machine hardware name",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "Print the system hostname",
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description: "Print the machine processor architecture name",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description: "Print the operating system release",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description: "Print the operating system name",
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Print the operating system version",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,244 +1,244 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "vim",
|
||||
description: "Vi IMproved, a programmer's text editor",
|
||||
args: {
|
||||
template: "filepaths",
|
||||
// suggestCurrentToken: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-v",
|
||||
description: "Vi mode (like 'vi')",
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description: "Ex mode (like 'ex')",
|
||||
},
|
||||
{
|
||||
name: "-E",
|
||||
description: "Improved Ex mode",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Enable silent mode (when in ex mode), or Read Normal mode commands from file",
|
||||
args: {
|
||||
name: "scriptin",
|
||||
template: "filepaths",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description: "Diff mode (like 'vimdiff')",
|
||||
},
|
||||
{
|
||||
name: "-y",
|
||||
description: "Easy mode (like 'evim', modeless)",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description: "Readonly mode (like 'view')",
|
||||
},
|
||||
{
|
||||
name: "-Z",
|
||||
description: "Restricted mode (like 'rvim')",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Modifications (writing files) not allowed",
|
||||
},
|
||||
{
|
||||
name: "-M",
|
||||
description: "Modifications in text not allowed",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description: "Binary mode",
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description: "Lisp mode",
|
||||
},
|
||||
{
|
||||
name: "-C",
|
||||
description: "Compatible with Vi: 'compatible'",
|
||||
},
|
||||
{
|
||||
name: "-N",
|
||||
description: "Not fully Vi compatible: 'nocompatible'",
|
||||
},
|
||||
{
|
||||
name: "-V",
|
||||
description: "Be verbose [level N] [log messages to fname]",
|
||||
args: [
|
||||
{
|
||||
name: "N",
|
||||
},
|
||||
{
|
||||
name: "fname",
|
||||
template: "filepaths",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "-D",
|
||||
description: "Debugging mode",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "No swap file, use memory only",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Recover crashed session if filename is specified, otherwise list swap files and exit",
|
||||
args: {
|
||||
name: "filename",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description: "Same as -r",
|
||||
args: {
|
||||
name: "filename",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description: "Set terminal type to <terminal>",
|
||||
args: {
|
||||
name: "terminal",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--not-a-term",
|
||||
description: "Skip warning for input/output not being a terminal",
|
||||
},
|
||||
{
|
||||
name: "--ttyfail",
|
||||
description: "Exit if input or output is not a terminal",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description: "Use <vimrc> instead of any .vimrc",
|
||||
args: {
|
||||
name: "vimrc",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--noplugin",
|
||||
description: "Don't load plugin scripts",
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description: "Open N tab pages (default: one for each file)",
|
||||
args: {
|
||||
name: "N",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-o",
|
||||
description: "Open N windows (default: one for each file)",
|
||||
args: {
|
||||
name: "N",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-O",
|
||||
description: "Like -o but split vertically",
|
||||
args: {
|
||||
name: "N",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "+",
|
||||
description:
|
||||
"Start at end of file, if line number is specified, start at that line",
|
||||
args: {
|
||||
name: "lnum",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--cmd",
|
||||
description: "Execute <command> before loading any vimrc file",
|
||||
args: {
|
||||
name: "command",
|
||||
isCommand: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Execute <command> after loading the first file",
|
||||
args: {
|
||||
name: "command",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description: "Source file <session> after loading the first file",
|
||||
args: {
|
||||
name: "session",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-w",
|
||||
description: "Append all typed commands to file <scriptout>",
|
||||
args: {
|
||||
name: "scriptout",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-W",
|
||||
description: "Write all typed commands to file <scriptout>",
|
||||
args: {
|
||||
name: "scriptout",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description: "Edit encrypted files",
|
||||
},
|
||||
{
|
||||
name: "--startuptime",
|
||||
description: "Write startup timing messages to <file>",
|
||||
args: {
|
||||
name: "file",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description: "Use <viminfo> instead of .viminfo",
|
||||
args: {
|
||||
name: "viminfo",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--clean",
|
||||
description: "'nocompatible', Vim defaults, no plugins, no viminfo",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print Help message and exit",
|
||||
},
|
||||
{
|
||||
name: "--version",
|
||||
description: "Print version information and exit",
|
||||
},
|
||||
],
|
||||
name: "vim",
|
||||
description: "Vi IMproved, a programmer's text editor",
|
||||
args: {
|
||||
template: "filepaths",
|
||||
// suggestCurrentToken: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "-v",
|
||||
description: "Vi mode (like 'vi')",
|
||||
},
|
||||
{
|
||||
name: "-e",
|
||||
description: "Ex mode (like 'ex')",
|
||||
},
|
||||
{
|
||||
name: "-E",
|
||||
description: "Improved Ex mode",
|
||||
},
|
||||
{
|
||||
name: "-s",
|
||||
description:
|
||||
"Enable silent mode (when in ex mode), or Read Normal mode commands from file",
|
||||
args: {
|
||||
name: "scriptin",
|
||||
template: "filepaths",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-d",
|
||||
description: "Diff mode (like 'vimdiff')",
|
||||
},
|
||||
{
|
||||
name: "-y",
|
||||
description: "Easy mode (like 'evim', modeless)",
|
||||
},
|
||||
{
|
||||
name: "-R",
|
||||
description: "Readonly mode (like 'view')",
|
||||
},
|
||||
{
|
||||
name: "-Z",
|
||||
description: "Restricted mode (like 'rvim')",
|
||||
},
|
||||
{
|
||||
name: "-m",
|
||||
description: "Modifications (writing files) not allowed",
|
||||
},
|
||||
{
|
||||
name: "-M",
|
||||
description: "Modifications in text not allowed",
|
||||
},
|
||||
{
|
||||
name: "-b",
|
||||
description: "Binary mode",
|
||||
},
|
||||
{
|
||||
name: "-l",
|
||||
description: "Lisp mode",
|
||||
},
|
||||
{
|
||||
name: "-C",
|
||||
description: "Compatible with Vi: 'compatible'",
|
||||
},
|
||||
{
|
||||
name: "-N",
|
||||
description: "Not fully Vi compatible: 'nocompatible'",
|
||||
},
|
||||
{
|
||||
name: "-V",
|
||||
description: "Be verbose [level N] [log messages to fname]",
|
||||
args: [
|
||||
{
|
||||
name: "N",
|
||||
},
|
||||
{
|
||||
name: "fname",
|
||||
template: "filepaths",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "-D",
|
||||
description: "Debugging mode",
|
||||
},
|
||||
{
|
||||
name: "-n",
|
||||
description: "No swap file, use memory only",
|
||||
},
|
||||
{
|
||||
name: "-r",
|
||||
description:
|
||||
"Recover crashed session if filename is specified, otherwise list swap files and exit",
|
||||
args: {
|
||||
name: "filename",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-L",
|
||||
description: "Same as -r",
|
||||
args: {
|
||||
name: "filename",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-T",
|
||||
description: "Set terminal type to <terminal>",
|
||||
args: {
|
||||
name: "terminal",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--not-a-term",
|
||||
description: "Skip warning for input/output not being a terminal",
|
||||
},
|
||||
{
|
||||
name: "--ttyfail",
|
||||
description: "Exit if input or output is not a terminal",
|
||||
},
|
||||
{
|
||||
name: "-u",
|
||||
description: "Use <vimrc> instead of any .vimrc",
|
||||
args: {
|
||||
name: "vimrc",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--noplugin",
|
||||
description: "Don't load plugin scripts",
|
||||
},
|
||||
{
|
||||
name: "-p",
|
||||
description: "Open N tab pages (default: one for each file)",
|
||||
args: {
|
||||
name: "N",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-o",
|
||||
description: "Open N windows (default: one for each file)",
|
||||
args: {
|
||||
name: "N",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-O",
|
||||
description: "Like -o but split vertically",
|
||||
args: {
|
||||
name: "N",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "+",
|
||||
description:
|
||||
"Start at end of file, if line number is specified, start at that line",
|
||||
args: {
|
||||
name: "lnum",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--cmd",
|
||||
description: "Execute <command> before loading any vimrc file",
|
||||
args: {
|
||||
name: "command",
|
||||
isCommand: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-c",
|
||||
description: "Execute <command> after loading the first file",
|
||||
args: {
|
||||
name: "command",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-S",
|
||||
description: "Source file <session> after loading the first file",
|
||||
args: {
|
||||
name: "session",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-w",
|
||||
description: "Append all typed commands to file <scriptout>",
|
||||
args: {
|
||||
name: "scriptout",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-W",
|
||||
description: "Write all typed commands to file <scriptout>",
|
||||
args: {
|
||||
name: "scriptout",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-x",
|
||||
description: "Edit encrypted files",
|
||||
},
|
||||
{
|
||||
name: "--startuptime",
|
||||
description: "Write startup timing messages to <file>",
|
||||
args: {
|
||||
name: "file",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "-i",
|
||||
description: "Use <viminfo> instead of .viminfo",
|
||||
args: {
|
||||
name: "viminfo",
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--clean",
|
||||
description: "'nocompatible', Vim defaults, no plugins, no viminfo",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print Help message and exit",
|
||||
},
|
||||
{
|
||||
name: "--version",
|
||||
description: "Print version information and exit",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
|
||||
@@ -1,399 +1,399 @@
|
||||
const completionSpec: Fig.Spec = {
|
||||
name: "wget",
|
||||
description: "A non-interactive network retriever",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
name: "url",
|
||||
description: "The url(s) to retrieve",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Display the version of Wget and exit",
|
||||
},
|
||||
{ name: ["-h", "--help"], description: "Print this help" },
|
||||
{
|
||||
name: ["-b", "--background"],
|
||||
description: "Go to background after startup",
|
||||
},
|
||||
{
|
||||
name: ["-e", "--execute=COMMAND"],
|
||||
description: "Execute a `.wgetrc'-style command",
|
||||
},
|
||||
{ name: ["-o", "--output-file=FILE"], description: "Log messages to FILE" },
|
||||
{
|
||||
name: ["-a", "--append-output=FILE"],
|
||||
description: "Append messages to FILE",
|
||||
},
|
||||
{ name: ["-q", "--quiet"], description: "Quiet (no output)" },
|
||||
{
|
||||
name: ["-v", "--verbose"],
|
||||
description: "Be verbose (this is the default)",
|
||||
},
|
||||
{
|
||||
name: ["-nv", "--no-verbose"],
|
||||
description: "Turn off verboseness, without being quiet",
|
||||
},
|
||||
{
|
||||
name: "--report-speed=TYPE",
|
||||
description: "Output bandwidth as TYPE. TYPE can be bits",
|
||||
},
|
||||
{
|
||||
name: ["-i", "--input-file=FILE"],
|
||||
description: "Download URLs found in local or external FILE",
|
||||
},
|
||||
{ name: ["-F", "--force-html"], description: "Treat input file as HTML" },
|
||||
{
|
||||
name: ["-B", "--base=URL"],
|
||||
description: "Resolves HTML input-file links (-i -F) relative to URL",
|
||||
},
|
||||
{ name: "--config=FILE", description: "Specify config file to use" },
|
||||
{ name: "--no-config", description: "Do not read any config file" },
|
||||
{
|
||||
name: "--rejected-log=FILE",
|
||||
description: "Log reasons for URL rejection to FILE",
|
||||
},
|
||||
{
|
||||
name: ["-t", "--tries=NUMBER"],
|
||||
description: "Set number of retries to NUMBER (0 unlimits)",
|
||||
},
|
||||
{
|
||||
name: "--retry-connrefused",
|
||||
description: "Retry even if connection is refused",
|
||||
},
|
||||
{
|
||||
name: "--retry-on-http-error",
|
||||
description: "Comma-separated list of HTTP errors to retry",
|
||||
},
|
||||
{
|
||||
name: ["-O", "--output-document=FILE"],
|
||||
description: "Write documents to FILE",
|
||||
},
|
||||
{
|
||||
name: ["-nc", "--no-clobber"],
|
||||
description:
|
||||
"Skip downloads that would download to existing files (overwriting them)",
|
||||
},
|
||||
{
|
||||
name: "--no-netrc",
|
||||
description: "Don't try to obtain credentials from .netrc",
|
||||
},
|
||||
{
|
||||
name: ["-c", "--continue"],
|
||||
description: "Resume getting a partially-downloaded file",
|
||||
},
|
||||
{
|
||||
name: "--start-pos=OFFSET",
|
||||
description: "Start downloading from zero-based position OFFSET",
|
||||
},
|
||||
{ name: "--progress=TYPE", description: "Select progress gauge type" },
|
||||
{
|
||||
name: "--show-progress",
|
||||
description: "Display the progress bar in any verbosity mode",
|
||||
},
|
||||
{
|
||||
name: ["-N", "--timestamping"],
|
||||
description: "Don't re-retrieve files unless newer than local",
|
||||
},
|
||||
{ name: ["-S", "--server-response"], description: "Print server response" },
|
||||
{ name: "--spider", description: "Don't download anything" },
|
||||
{
|
||||
name: ["-T", "--timeout=SECONDS"],
|
||||
description: "Set all timeout values to SECONDS",
|
||||
},
|
||||
{
|
||||
name: "--dns-timeout=SECS",
|
||||
description: "Set the DNS lookup timeout to SECS",
|
||||
},
|
||||
{
|
||||
name: "--connect-timeout=SECS",
|
||||
description: "Set the connect timeout to SECS",
|
||||
},
|
||||
{
|
||||
name: "--read-timeout=SECS",
|
||||
description: "Set the read timeout to SECS",
|
||||
},
|
||||
{
|
||||
name: ["-w", "--wait=SECONDS"],
|
||||
description: "Wait SECONDS between retrievals",
|
||||
},
|
||||
{
|
||||
name: "--waitretry=SECONDS",
|
||||
description: "Wait 1..SECONDS between retries of a retrieval",
|
||||
},
|
||||
{
|
||||
name: "--random-wait",
|
||||
description: "Wait from 0.5*WAIT...1.5*WAIT secs between retrievals",
|
||||
},
|
||||
{ name: "--no-proxy", description: "Explicitly turn off proxy" },
|
||||
{
|
||||
name: ["-Q", "--quota=NUMBER"],
|
||||
description: "Set retrieval quota to NUMBER",
|
||||
},
|
||||
{
|
||||
name: "--bind-address=ADDRESS",
|
||||
description: "Bind to ADDRESS (hostname or IP) on local host",
|
||||
},
|
||||
{ name: "--limit-rate=RATE", description: "Limit download rate to RATE" },
|
||||
{ name: "--no-dns-cache", description: "Disable caching DNS lookups" },
|
||||
{
|
||||
name: "--restrict-file-names=OS",
|
||||
description: "Restrict chars in file names to ones OS allows",
|
||||
},
|
||||
{
|
||||
name: "--ignore-case",
|
||||
description: "Ignore case when matching files/directories",
|
||||
},
|
||||
{
|
||||
name: ["-4", "--inet4-only"],
|
||||
description: "Connect only to IPv4 addresses",
|
||||
},
|
||||
{
|
||||
name: ["-6", "--inet6-only"],
|
||||
description: "Connect only to IPv6 addresses",
|
||||
},
|
||||
{
|
||||
name: "--user=USER",
|
||||
description: "Set both ftp and http user to USER",
|
||||
},
|
||||
{
|
||||
name: "--password=PASS",
|
||||
description: "Set both ftp and http password to PASS",
|
||||
},
|
||||
{ name: "--ask-password", description: "Prompt for passwords" },
|
||||
{ name: "--no-iri", description: "Turn off IRI support" },
|
||||
{
|
||||
name: "--local-encoding=ENC",
|
||||
description: "Use ENC as the local encoding for IRIs",
|
||||
},
|
||||
{
|
||||
name: "--remote-encoding=ENC",
|
||||
description: "Use ENC as the default remote encoding",
|
||||
},
|
||||
{ name: "--unlink", description: "Remove file before clobber" },
|
||||
{
|
||||
name: "--xattr",
|
||||
description: "Turn on storage of metadata in extended file attributes",
|
||||
},
|
||||
{
|
||||
name: ["-nd", "--no-directories"],
|
||||
description: "Don't create directories",
|
||||
},
|
||||
{
|
||||
name: ["-x", "--force-directories"],
|
||||
description: "Force creation of directories",
|
||||
},
|
||||
{
|
||||
name: ["-nH", "--no-host-directories"],
|
||||
description: "Don't create host directories",
|
||||
},
|
||||
{
|
||||
name: "--protocol-directories",
|
||||
description: "Use protocol name in directories",
|
||||
},
|
||||
{
|
||||
name: ["-P", "--directory-prefix=PREFIX"],
|
||||
description: "Save files to PREFIX/",
|
||||
},
|
||||
{
|
||||
name: "--cut-dirs=NUMBER",
|
||||
description: "Ignore NUMBER remote directory components",
|
||||
},
|
||||
{ name: "--http-user=USER", description: "Set http user to USER" },
|
||||
{
|
||||
name: "--http-password=PASS",
|
||||
description: "Set http password to PASS",
|
||||
},
|
||||
{ name: "--no-cache", description: "Disallow server-cached data" },
|
||||
{
|
||||
name: ["-E", "--adjust-extension"],
|
||||
description: "Save HTML/CSS documents with proper extensions",
|
||||
},
|
||||
{
|
||||
name: "--ignore-length",
|
||||
description: "Ignore 'Content-Length' header field",
|
||||
},
|
||||
{
|
||||
name: "--header=STRING",
|
||||
description: "Insert STRING among the headers",
|
||||
},
|
||||
{
|
||||
name: "--compression=TYPE",
|
||||
description:
|
||||
"Choose compression, one of auto, gzip and none. (default: none)",
|
||||
},
|
||||
{
|
||||
name: "--max-redirect",
|
||||
description: "Maximum redirections allowed per page",
|
||||
},
|
||||
{ name: "--proxy-user=USER", description: "Set USER as proxy username" },
|
||||
{
|
||||
name: "--proxy-password=PASS",
|
||||
description: "Set PASS as proxy password",
|
||||
},
|
||||
{
|
||||
name: "--referer=URL",
|
||||
description: "Include 'Referer: URL' header in HTTP request",
|
||||
},
|
||||
{ name: "--save-headers", description: "Save the HTTP headers to file" },
|
||||
{
|
||||
name: ["-U", "--user-agent=AGENT"],
|
||||
description: "Identify as AGENT instead of Wget/VERSION",
|
||||
},
|
||||
{
|
||||
name: "--no-http-keep-alive",
|
||||
description: "Disable HTTP keep-alive (persistent connections)",
|
||||
},
|
||||
{ name: "--no-cookies", description: "Don't use cookies" },
|
||||
{
|
||||
name: "--load-cookies=FILE",
|
||||
description: "Load cookies from FILE before session",
|
||||
},
|
||||
{
|
||||
name: "--save-cookies=FILE",
|
||||
description: "Save cookies to FILE after session",
|
||||
},
|
||||
{
|
||||
name: "--keep-session-cookies",
|
||||
description: "Load and save session (non-permanent) cookies",
|
||||
},
|
||||
{
|
||||
name: "--post-data=STRING",
|
||||
description: "Use the POST method; send STRING as the data",
|
||||
},
|
||||
{
|
||||
name: "--post-file=FILE",
|
||||
description: "Use the POST method; send contents of FILE",
|
||||
},
|
||||
{
|
||||
name: "--method=HTTPMethod",
|
||||
description: 'Use method "HTTPMethod" in the request',
|
||||
},
|
||||
{
|
||||
name: "--body-data=STRING",
|
||||
description: "Send STRING as data. --method MUST be set",
|
||||
},
|
||||
{
|
||||
name: "--body-file=FILE",
|
||||
description: "Send contents of FILE. --method MUST be set",
|
||||
},
|
||||
{
|
||||
name: "--content-on-error",
|
||||
description: "Output the received content on server errors",
|
||||
},
|
||||
{
|
||||
name: "--secure-protocol=PR",
|
||||
description: "Choose secure protocol, one of auto, SSLv2,",
|
||||
},
|
||||
{ name: "--https-only", description: "Only follow secure HTTPS links" },
|
||||
{
|
||||
name: "--no-check-certificate",
|
||||
description: "Don't validate the server's certificate",
|
||||
},
|
||||
{ name: "--certificate=FILE", description: "Client certificate file" },
|
||||
{
|
||||
name: "--certificate-type=TYPE",
|
||||
description: "Client certificate type, PEM or DER",
|
||||
},
|
||||
{ name: "--private-key=FILE", description: "Private key file" },
|
||||
{
|
||||
name: "--private-key-type=TYPE",
|
||||
description: "Private key type, PEM or DER",
|
||||
},
|
||||
{
|
||||
name: "--ca-certificate=FILE",
|
||||
description: "File with the bundle of CAs",
|
||||
},
|
||||
{
|
||||
name: "--ca-directory=DIR",
|
||||
description: "Directory where hash list of CAs is stored",
|
||||
},
|
||||
{ name: "--crl-file=FILE", description: "File with bundle of CRLs" },
|
||||
{
|
||||
name: "--ciphers=STR",
|
||||
description:
|
||||
"Set the priority string (GnuTLS) or cipher list string (OpenSSL) directly",
|
||||
},
|
||||
{ name: ["-r", "--recursive"], description: "Specify recursive download" },
|
||||
{
|
||||
name: ["-l", "--level=NUMBER"],
|
||||
description: "Maximum recursion depth (inf or 0 for infinite)",
|
||||
},
|
||||
{
|
||||
name: "--delete-after",
|
||||
description: "Delete files locally after downloading them",
|
||||
},
|
||||
{
|
||||
name: ["-k", "--convert-links"],
|
||||
description: "Make links in downloaded HTML or CSS point to local files",
|
||||
},
|
||||
{
|
||||
name: ["-K", "--backup-converted"],
|
||||
description: "Before converting file X, back up as X.orig",
|
||||
},
|
||||
{
|
||||
name: ["-m", "--mirror"],
|
||||
description: "Shortcut for -N -r -l inf --no-remove-listing",
|
||||
},
|
||||
{
|
||||
name: ["-p", "--page-requisites"],
|
||||
description: "Get all images, etc. needed to display HTML page",
|
||||
},
|
||||
{
|
||||
name: ["-A", "--accept=LIST"],
|
||||
description: "Comma-separated list of accepted extensions",
|
||||
},
|
||||
{
|
||||
name: ["-R", "--reject=LIST"],
|
||||
description: "Comma-separated list of rejected extensions",
|
||||
},
|
||||
{
|
||||
name: "--accept-regex=REGEX",
|
||||
description: "Regex matching accepted URLs",
|
||||
},
|
||||
{
|
||||
name: "--reject-regex=REGEX",
|
||||
description: "Regex matching rejected URLs",
|
||||
},
|
||||
{ name: "--regex-type=TYPE", description: "Regex type (posix)" },
|
||||
{
|
||||
name: ["-D", "--domains=LIST"],
|
||||
description: "Comma-separated list of accepted domains",
|
||||
},
|
||||
{
|
||||
name: "--exclude-domains=LIST",
|
||||
description: "Comma-separated list of rejected domains",
|
||||
},
|
||||
{
|
||||
name: "--follow-ftp",
|
||||
description: "Follow FTP links from HTML documents",
|
||||
},
|
||||
{
|
||||
name: "--follow-tags=LIST",
|
||||
description: "Comma-separated list of followed HTML tags",
|
||||
},
|
||||
{
|
||||
name: "--ignore-tags=LIST",
|
||||
description: "Comma-separated list of ignored HTML tags",
|
||||
},
|
||||
{
|
||||
name: ["-H", "--span-hosts"],
|
||||
description: "Go to foreign hosts when recursive",
|
||||
},
|
||||
{ name: ["-L", "--relative"], description: "Follow relative links only" },
|
||||
{
|
||||
name: ["-I", "--include-directories=LIST"],
|
||||
description: "List of allowed directories",
|
||||
},
|
||||
{
|
||||
name: ["-X", "--exclude-directories=LIST"],
|
||||
description: "List of excluded directories",
|
||||
},
|
||||
{
|
||||
name: ["-np", "--no-parent"],
|
||||
description: "Don't ascend to the parent directory",
|
||||
},
|
||||
],
|
||||
name: "wget",
|
||||
description: "A non-interactive network retriever",
|
||||
args: {
|
||||
isVariadic: true,
|
||||
name: "url",
|
||||
description: "The url(s) to retrieve",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Display the version of Wget and exit",
|
||||
},
|
||||
{ name: ["-h", "--help"], description: "Print this help" },
|
||||
{
|
||||
name: ["-b", "--background"],
|
||||
description: "Go to background after startup",
|
||||
},
|
||||
{
|
||||
name: ["-e", "--execute=COMMAND"],
|
||||
description: "Execute a `.wgetrc'-style command",
|
||||
},
|
||||
{ name: ["-o", "--output-file=FILE"], description: "Log messages to FILE" },
|
||||
{
|
||||
name: ["-a", "--append-output=FILE"],
|
||||
description: "Append messages to FILE",
|
||||
},
|
||||
{ name: ["-q", "--quiet"], description: "Quiet (no output)" },
|
||||
{
|
||||
name: ["-v", "--verbose"],
|
||||
description: "Be verbose (this is the default)",
|
||||
},
|
||||
{
|
||||
name: ["-nv", "--no-verbose"],
|
||||
description: "Turn off verboseness, without being quiet",
|
||||
},
|
||||
{
|
||||
name: "--report-speed=TYPE",
|
||||
description: "Output bandwidth as TYPE. TYPE can be bits",
|
||||
},
|
||||
{
|
||||
name: ["-i", "--input-file=FILE"],
|
||||
description: "Download URLs found in local or external FILE",
|
||||
},
|
||||
{ name: ["-F", "--force-html"], description: "Treat input file as HTML" },
|
||||
{
|
||||
name: ["-B", "--base=URL"],
|
||||
description: "Resolves HTML input-file links (-i -F) relative to URL",
|
||||
},
|
||||
{ name: "--config=FILE", description: "Specify config file to use" },
|
||||
{ name: "--no-config", description: "Do not read any config file" },
|
||||
{
|
||||
name: "--rejected-log=FILE",
|
||||
description: "Log reasons for URL rejection to FILE",
|
||||
},
|
||||
{
|
||||
name: ["-t", "--tries=NUMBER"],
|
||||
description: "Set number of retries to NUMBER (0 unlimits)",
|
||||
},
|
||||
{
|
||||
name: "--retry-connrefused",
|
||||
description: "Retry even if connection is refused",
|
||||
},
|
||||
{
|
||||
name: "--retry-on-http-error",
|
||||
description: "Comma-separated list of HTTP errors to retry",
|
||||
},
|
||||
{
|
||||
name: ["-O", "--output-document=FILE"],
|
||||
description: "Write documents to FILE",
|
||||
},
|
||||
{
|
||||
name: ["-nc", "--no-clobber"],
|
||||
description:
|
||||
"Skip downloads that would download to existing files (overwriting them)",
|
||||
},
|
||||
{
|
||||
name: "--no-netrc",
|
||||
description: "Don't try to obtain credentials from .netrc",
|
||||
},
|
||||
{
|
||||
name: ["-c", "--continue"],
|
||||
description: "Resume getting a partially-downloaded file",
|
||||
},
|
||||
{
|
||||
name: "--start-pos=OFFSET",
|
||||
description: "Start downloading from zero-based position OFFSET",
|
||||
},
|
||||
{ name: "--progress=TYPE", description: "Select progress gauge type" },
|
||||
{
|
||||
name: "--show-progress",
|
||||
description: "Display the progress bar in any verbosity mode",
|
||||
},
|
||||
{
|
||||
name: ["-N", "--timestamping"],
|
||||
description: "Don't re-retrieve files unless newer than local",
|
||||
},
|
||||
{ name: ["-S", "--server-response"], description: "Print server response" },
|
||||
{ name: "--spider", description: "Don't download anything" },
|
||||
{
|
||||
name: ["-T", "--timeout=SECONDS"],
|
||||
description: "Set all timeout values to SECONDS",
|
||||
},
|
||||
{
|
||||
name: "--dns-timeout=SECS",
|
||||
description: "Set the DNS lookup timeout to SECS",
|
||||
},
|
||||
{
|
||||
name: "--connect-timeout=SECS",
|
||||
description: "Set the connect timeout to SECS",
|
||||
},
|
||||
{
|
||||
name: "--read-timeout=SECS",
|
||||
description: "Set the read timeout to SECS",
|
||||
},
|
||||
{
|
||||
name: ["-w", "--wait=SECONDS"],
|
||||
description: "Wait SECONDS between retrievals",
|
||||
},
|
||||
{
|
||||
name: "--waitretry=SECONDS",
|
||||
description: "Wait 1..SECONDS between retries of a retrieval",
|
||||
},
|
||||
{
|
||||
name: "--random-wait",
|
||||
description: "Wait from 0.5*WAIT...1.5*WAIT secs between retrievals",
|
||||
},
|
||||
{ name: "--no-proxy", description: "Explicitly turn off proxy" },
|
||||
{
|
||||
name: ["-Q", "--quota=NUMBER"],
|
||||
description: "Set retrieval quota to NUMBER",
|
||||
},
|
||||
{
|
||||
name: "--bind-address=ADDRESS",
|
||||
description: "Bind to ADDRESS (hostname or IP) on local host",
|
||||
},
|
||||
{ name: "--limit-rate=RATE", description: "Limit download rate to RATE" },
|
||||
{ name: "--no-dns-cache", description: "Disable caching DNS lookups" },
|
||||
{
|
||||
name: "--restrict-file-names=OS",
|
||||
description: "Restrict chars in file names to ones OS allows",
|
||||
},
|
||||
{
|
||||
name: "--ignore-case",
|
||||
description: "Ignore case when matching files/directories",
|
||||
},
|
||||
{
|
||||
name: ["-4", "--inet4-only"],
|
||||
description: "Connect only to IPv4 addresses",
|
||||
},
|
||||
{
|
||||
name: ["-6", "--inet6-only"],
|
||||
description: "Connect only to IPv6 addresses",
|
||||
},
|
||||
{
|
||||
name: "--user=USER",
|
||||
description: "Set both ftp and http user to USER",
|
||||
},
|
||||
{
|
||||
name: "--password=PASS",
|
||||
description: "Set both ftp and http password to PASS",
|
||||
},
|
||||
{ name: "--ask-password", description: "Prompt for passwords" },
|
||||
{ name: "--no-iri", description: "Turn off IRI support" },
|
||||
{
|
||||
name: "--local-encoding=ENC",
|
||||
description: "Use ENC as the local encoding for IRIs",
|
||||
},
|
||||
{
|
||||
name: "--remote-encoding=ENC",
|
||||
description: "Use ENC as the default remote encoding",
|
||||
},
|
||||
{ name: "--unlink", description: "Remove file before clobber" },
|
||||
{
|
||||
name: "--xattr",
|
||||
description: "Turn on storage of metadata in extended file attributes",
|
||||
},
|
||||
{
|
||||
name: ["-nd", "--no-directories"],
|
||||
description: "Don't create directories",
|
||||
},
|
||||
{
|
||||
name: ["-x", "--force-directories"],
|
||||
description: "Force creation of directories",
|
||||
},
|
||||
{
|
||||
name: ["-nH", "--no-host-directories"],
|
||||
description: "Don't create host directories",
|
||||
},
|
||||
{
|
||||
name: "--protocol-directories",
|
||||
description: "Use protocol name in directories",
|
||||
},
|
||||
{
|
||||
name: ["-P", "--directory-prefix=PREFIX"],
|
||||
description: "Save files to PREFIX/",
|
||||
},
|
||||
{
|
||||
name: "--cut-dirs=NUMBER",
|
||||
description: "Ignore NUMBER remote directory components",
|
||||
},
|
||||
{ name: "--http-user=USER", description: "Set http user to USER" },
|
||||
{
|
||||
name: "--http-password=PASS",
|
||||
description: "Set http password to PASS",
|
||||
},
|
||||
{ name: "--no-cache", description: "Disallow server-cached data" },
|
||||
{
|
||||
name: ["-E", "--adjust-extension"],
|
||||
description: "Save HTML/CSS documents with proper extensions",
|
||||
},
|
||||
{
|
||||
name: "--ignore-length",
|
||||
description: "Ignore 'Content-Length' header field",
|
||||
},
|
||||
{
|
||||
name: "--header=STRING",
|
||||
description: "Insert STRING among the headers",
|
||||
},
|
||||
{
|
||||
name: "--compression=TYPE",
|
||||
description:
|
||||
"Choose compression, one of auto, gzip and none. (default: none)",
|
||||
},
|
||||
{
|
||||
name: "--max-redirect",
|
||||
description: "Maximum redirections allowed per page",
|
||||
},
|
||||
{ name: "--proxy-user=USER", description: "Set USER as proxy username" },
|
||||
{
|
||||
name: "--proxy-password=PASS",
|
||||
description: "Set PASS as proxy password",
|
||||
},
|
||||
{
|
||||
name: "--referer=URL",
|
||||
description: "Include 'Referer: URL' header in HTTP request",
|
||||
},
|
||||
{ name: "--save-headers", description: "Save the HTTP headers to file" },
|
||||
{
|
||||
name: ["-U", "--user-agent=AGENT"],
|
||||
description: "Identify as AGENT instead of Wget/VERSION",
|
||||
},
|
||||
{
|
||||
name: "--no-http-keep-alive",
|
||||
description: "Disable HTTP keep-alive (persistent connections)",
|
||||
},
|
||||
{ name: "--no-cookies", description: "Don't use cookies" },
|
||||
{
|
||||
name: "--load-cookies=FILE",
|
||||
description: "Load cookies from FILE before session",
|
||||
},
|
||||
{
|
||||
name: "--save-cookies=FILE",
|
||||
description: "Save cookies to FILE after session",
|
||||
},
|
||||
{
|
||||
name: "--keep-session-cookies",
|
||||
description: "Load and save session (non-permanent) cookies",
|
||||
},
|
||||
{
|
||||
name: "--post-data=STRING",
|
||||
description: "Use the POST method; send STRING as the data",
|
||||
},
|
||||
{
|
||||
name: "--post-file=FILE",
|
||||
description: "Use the POST method; send contents of FILE",
|
||||
},
|
||||
{
|
||||
name: "--method=HTTPMethod",
|
||||
description: 'Use method "HTTPMethod" in the request',
|
||||
},
|
||||
{
|
||||
name: "--body-data=STRING",
|
||||
description: "Send STRING as data. --method MUST be set",
|
||||
},
|
||||
{
|
||||
name: "--body-file=FILE",
|
||||
description: "Send contents of FILE. --method MUST be set",
|
||||
},
|
||||
{
|
||||
name: "--content-on-error",
|
||||
description: "Output the received content on server errors",
|
||||
},
|
||||
{
|
||||
name: "--secure-protocol=PR",
|
||||
description: "Choose secure protocol, one of auto, SSLv2,",
|
||||
},
|
||||
{ name: "--https-only", description: "Only follow secure HTTPS links" },
|
||||
{
|
||||
name: "--no-check-certificate",
|
||||
description: "Don't validate the server's certificate",
|
||||
},
|
||||
{ name: "--certificate=FILE", description: "Client certificate file" },
|
||||
{
|
||||
name: "--certificate-type=TYPE",
|
||||
description: "Client certificate type, PEM or DER",
|
||||
},
|
||||
{ name: "--private-key=FILE", description: "Private key file" },
|
||||
{
|
||||
name: "--private-key-type=TYPE",
|
||||
description: "Private key type, PEM or DER",
|
||||
},
|
||||
{
|
||||
name: "--ca-certificate=FILE",
|
||||
description: "File with the bundle of CAs",
|
||||
},
|
||||
{
|
||||
name: "--ca-directory=DIR",
|
||||
description: "Directory where hash list of CAs is stored",
|
||||
},
|
||||
{ name: "--crl-file=FILE", description: "File with bundle of CRLs" },
|
||||
{
|
||||
name: "--ciphers=STR",
|
||||
description:
|
||||
"Set the priority string (GnuTLS) or cipher list string (OpenSSL) directly",
|
||||
},
|
||||
{ name: ["-r", "--recursive"], description: "Specify recursive download" },
|
||||
{
|
||||
name: ["-l", "--level=NUMBER"],
|
||||
description: "Maximum recursion depth (inf or 0 for infinite)",
|
||||
},
|
||||
{
|
||||
name: "--delete-after",
|
||||
description: "Delete files locally after downloading them",
|
||||
},
|
||||
{
|
||||
name: ["-k", "--convert-links"],
|
||||
description: "Make links in downloaded HTML or CSS point to local files",
|
||||
},
|
||||
{
|
||||
name: ["-K", "--backup-converted"],
|
||||
description: "Before converting file X, back up as X.orig",
|
||||
},
|
||||
{
|
||||
name: ["-m", "--mirror"],
|
||||
description: "Shortcut for -N -r -l inf --no-remove-listing",
|
||||
},
|
||||
{
|
||||
name: ["-p", "--page-requisites"],
|
||||
description: "Get all images, etc. needed to display HTML page",
|
||||
},
|
||||
{
|
||||
name: ["-A", "--accept=LIST"],
|
||||
description: "Comma-separated list of accepted extensions",
|
||||
},
|
||||
{
|
||||
name: ["-R", "--reject=LIST"],
|
||||
description: "Comma-separated list of rejected extensions",
|
||||
},
|
||||
{
|
||||
name: "--accept-regex=REGEX",
|
||||
description: "Regex matching accepted URLs",
|
||||
},
|
||||
{
|
||||
name: "--reject-regex=REGEX",
|
||||
description: "Regex matching rejected URLs",
|
||||
},
|
||||
{ name: "--regex-type=TYPE", description: "Regex type (posix)" },
|
||||
{
|
||||
name: ["-D", "--domains=LIST"],
|
||||
description: "Comma-separated list of accepted domains",
|
||||
},
|
||||
{
|
||||
name: "--exclude-domains=LIST",
|
||||
description: "Comma-separated list of rejected domains",
|
||||
},
|
||||
{
|
||||
name: "--follow-ftp",
|
||||
description: "Follow FTP links from HTML documents",
|
||||
},
|
||||
{
|
||||
name: "--follow-tags=LIST",
|
||||
description: "Comma-separated list of followed HTML tags",
|
||||
},
|
||||
{
|
||||
name: "--ignore-tags=LIST",
|
||||
description: "Comma-separated list of ignored HTML tags",
|
||||
},
|
||||
{
|
||||
name: ["-H", "--span-hosts"],
|
||||
description: "Go to foreign hosts when recursive",
|
||||
},
|
||||
{ name: ["-L", "--relative"], description: "Follow relative links only" },
|
||||
{
|
||||
name: ["-I", "--include-directories=LIST"],
|
||||
description: "List of allowed directories",
|
||||
},
|
||||
{
|
||||
name: ["-X", "--exclude-directories=LIST"],
|
||||
description: "List of excluded directories",
|
||||
},
|
||||
{
|
||||
name: ["-np", "--no-parent"],
|
||||
description: "Don't ascend to the parent directory",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// GNU Wget 1.20.3, a non-interactive network retriever.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user