mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
fix(autocomplete): choose Fig specs by target OS and correct GNU semantics
- Resolve date, base64 and readlink against the target session's OS: macOS keeps its BSD specs while Linux keeps the local GNU ones. The renderer now passes the OS over the Fig bridge, and spec contents, in-flight loads, the available-name list and the loaded-name index are all scoped by command and OS, so one renderer can serve Linux and macOS sessions without mixing them. - Add native macOS date and readlink specs (date gains -z, readlink exposes only -f/-n) and keep the bundled date/base64 specs as the macOS fallback. The bridge spec list merges specs/macos only for macOS sessions, so a platform-only command is never suggested where it cannot load. - Fix GNU readlink: -q/--quiet/-s/--silent suppress error messages, -v/--verbose reports them, and the nonexistent --strip is gone. Restore filepath completion for base64 operands and date -f/-r, and cover date -r with numeric prefixes so digit-leading filenames stay discoverable. - Complete values attached to optional option arguments (-Is -> -Iseconds, --iso-8601=s -> --iso-8601=seconds) only for specs that opt in through netcattyOptionalArgAttached, leaving other commands' optional arguments and required-argument completion unchanged. - Describe su -m as BSD's caller login shell versus util-linux's -s/SHELL order, refresh the affected zh-CN/zh-TW entries and the bundled-date fallback translations, and regenerate zh-TW with the repository script. - Add focused tests for per-OS loader caching, spec listing and scoping, attached-argument completion, path completion, and localized descriptions; update the batch-4 research notes to match.
This commit is contained in:
1 parent
4db44e2ede
commit
f09b3eed05
21 files changed
+1180
-228
No files matched your search
@@ -21,6 +21,7 @@ import {
|
||||
getAvailableSpecs,
|
||||
normalizeCommandName,
|
||||
resolveNames,
|
||||
type FigHostOs,
|
||||
type FigSpec,
|
||||
type FigSubcommand,
|
||||
type FigOption,
|
||||
@@ -246,7 +247,7 @@ export async function getCompletions(
|
||||
options: {
|
||||
hostId?: string;
|
||||
hostGroup?: string;
|
||||
os?: "linux" | "windows" | "macos";
|
||||
os?: FigHostOs;
|
||||
maxResults?: number;
|
||||
/** Session ID for remote path completion */
|
||||
sessionId?: string;
|
||||
@@ -288,7 +289,7 @@ export async function getCompletions(
|
||||
|
||||
const ctx = parseCommandLine(input);
|
||||
const specResult: SpecSuggestionResult = ctx.commandName && ctx.wordIndex >= 0
|
||||
? await getSpecSuggestions(ctx)
|
||||
? await getSpecSuggestions(ctx, options.os)
|
||||
: { suggestions: [] };
|
||||
const suggestions: CompletionSuggestion[] = [];
|
||||
const seenSuggestionTexts = new Set<string>();
|
||||
@@ -473,18 +474,21 @@ function normalizeHistoryPathPrefix(token: string): string {
|
||||
/**
|
||||
* Get suggestions from Fig spec + return resolved args (for path detection reuse).
|
||||
*/
|
||||
async function getSpecSuggestions(ctx: CompletionContext): Promise<SpecSuggestionResult> {
|
||||
async function getSpecSuggestions(
|
||||
ctx: CompletionContext,
|
||||
os?: FigHostOs,
|
||||
): Promise<SpecSuggestionResult> {
|
||||
const suggestions: CompletionSuggestion[] = [];
|
||||
|
||||
const specAvailable = await hasSpec(ctx.commandName);
|
||||
const specAvailable = await hasSpec(ctx.commandName, os);
|
||||
if (!specAvailable) {
|
||||
if (ctx.wordIndex === 0 && ctx.currentWord.length >= 1) {
|
||||
return { suggestions: await getCommandNameSuggestions(ctx.currentWord) };
|
||||
return { suggestions: await getCommandNameSuggestions(ctx.currentWord, os) };
|
||||
}
|
||||
return { suggestions };
|
||||
}
|
||||
|
||||
const spec = await loadSpec(ctx.commandName);
|
||||
const spec = await loadSpec(ctx.commandName, os);
|
||||
if (!spec) return { suggestions };
|
||||
|
||||
// If we're still typing the command name (partial match, not yet complete)
|
||||
@@ -580,6 +584,15 @@ async function getSpecSuggestions(ctx: CompletionContext): Promise<SpecSuggestio
|
||||
appendOptionSuggestions(suggestions, ctx, currentToken, resolved.fallbackOptions);
|
||||
}
|
||||
|
||||
const hasAttachedArgumentSuggestions = appendAttachedOptionalArgumentSuggestions(
|
||||
suggestions,
|
||||
ctx,
|
||||
resolved.options,
|
||||
);
|
||||
if (!hasAttachedArgumentSuggestions) {
|
||||
appendAttachedOptionalArgumentSuggestions(suggestions, ctx, resolved.fallbackOptions);
|
||||
}
|
||||
|
||||
// Suggest argument values from suggestions in the spec
|
||||
if (resolved.args) {
|
||||
const args = Array.isArray(resolved.args) ? resolved.args : [resolved.args];
|
||||
@@ -609,11 +622,14 @@ async function getSpecSuggestions(ctx: CompletionContext): Promise<SpecSuggestio
|
||||
}
|
||||
|
||||
/**
|
||||
* Get command name suggestions by matching against available specs.
|
||||
* Uses the already-imported getAvailableSpecs directly (no dynamic self-import).
|
||||
* Get command name suggestions by matching against the specs available for the
|
||||
* target OS, so a platform-specific command is never suggested to another one.
|
||||
*/
|
||||
async function getCommandNameSuggestions(prefix: string): Promise<CompletionSuggestion[]> {
|
||||
const specs = await getAvailableSpecs();
|
||||
async function getCommandNameSuggestions(
|
||||
prefix: string,
|
||||
os?: FigHostOs,
|
||||
): Promise<CompletionSuggestion[]> {
|
||||
const specs = await getAvailableSpecs(os);
|
||||
const lower = prefix.toLowerCase();
|
||||
const suggestions: CompletionSuggestion[] = [];
|
||||
|
||||
@@ -731,6 +747,55 @@ function mergeOptionLists(
|
||||
return merged;
|
||||
}
|
||||
|
||||
function appendAttachedOptionalArgumentSuggestions(
|
||||
suggestions: CompletionSuggestion[],
|
||||
ctx: CompletionContext,
|
||||
options: FigOption[] | undefined,
|
||||
): boolean {
|
||||
const currentToken = ctx.currentWord;
|
||||
if (!options?.length || !currentToken) return false;
|
||||
|
||||
// An existing option name takes precedence over interpreting a short option
|
||||
// prefix as an attached value.
|
||||
if (options.some((option) => resolveNames(option.name).some((name) => name.startsWith(currentToken)))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let added = false;
|
||||
for (const option of options) {
|
||||
if (option.netcattyOptionalArgAttached !== true) continue;
|
||||
const args = Array.isArray(option.args) ? option.args : option.args ? [option.args] : [];
|
||||
const arg = args[0];
|
||||
if (!arg?.isOptional || !arg.suggestions?.length) continue;
|
||||
|
||||
for (const name of resolveNames(option.name)) {
|
||||
const shortOption = /^-[a-zA-Z0-9]$/.test(name);
|
||||
const longOption = name.startsWith("--") && name.length > 2;
|
||||
if (!shortOption && !longOption) continue;
|
||||
const prefix = longOption ? `${name}=` : name;
|
||||
if (!currentToken.startsWith(prefix)) continue;
|
||||
const typedValue = currentToken.slice(prefix.length);
|
||||
if (shortOption && !typedValue) continue;
|
||||
|
||||
for (const suggestion of arg.suggestions) {
|
||||
const value = typeof suggestion === "string"
|
||||
? suggestion
|
||||
: (Array.isArray(suggestion.name) ? suggestion.name[0] : suggestion.name);
|
||||
if (!value.startsWith(typedValue) || value === typedValue) continue;
|
||||
suggestions.push({
|
||||
text: rebuildCommand(ctx.tokens, ctx.wordIndex, `${prefix}${value}`),
|
||||
displayText: value,
|
||||
description: typeof suggestion === "string" ? undefined : suggestion.description,
|
||||
source: "arg",
|
||||
score: 600,
|
||||
});
|
||||
added = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return added;
|
||||
}
|
||||
|
||||
function appendOptionSuggestions(
|
||||
suggestions: CompletionSuggestion[],
|
||||
ctx: CompletionContext,
|
||||
|
||||
@@ -184,6 +184,7 @@
|
||||
"Adds a newline to the pattern space, then appends the next line of input to the pattern space. If there is no more input then sed exits without processing any more commands": "在模式空间后追加一个换行符,再将下一行输入追加到模式空间;若没有更多输入,sed 退出,不再处理任何命令",
|
||||
"Adds read and execute permissions for all classes": "为所有类别添加读和执行权限",
|
||||
"Adds the user as an owner of the package": "将该用户添加为软件包的所有者",
|
||||
"Adjust and print (but don't set) the second, minute, hour, month day, week day, month, or year according to val": "根据 val 调整并显示秒、分、时、月内日期、星期、月份或年份,但不设置系统时间",
|
||||
"Adjust the access and modification time stamps for the file by the specified value": "按指定值调整文件的访问时间和修改时间",
|
||||
"Advertised address (format: <ip|interface>[:port])": "通告地址(格式:<ip|interface>[:port])",
|
||||
"Advice on how to set your identity configuration when your information is guessed from the system username and domain name": "当你的身份信息是根据系统用户名和域名猜测而来时,关于如何设置身份配置的建议",
|
||||
@@ -836,7 +837,6 @@
|
||||
"DEPRECATED pull multiple images in parallel": "已弃用:并行拉取多个镜像",
|
||||
"DEPRECATED! USE --project-directory INSTEAD. Specify an alternate working directory (default: the path of the, first specified, Compose file)": "已弃用!请改用 --project-directory。指定备用工作目录(默认:最先指定的 Compose 文件的路径)",
|
||||
"DNF package manager (RHEL/Rocky/Alma/Fedora)": "DNF 软件包管理器(RHEL/Rocky/Alma/Fedora)",
|
||||
"DNS lookup utility (Domain Information Groper)": "DNS 查询工具(Domain Information Groper)",
|
||||
"DNS server addrs to use": "要使用的 DNS 服务器地址",
|
||||
"Database table name prefix. Prepended to the names of any database tables used, allowing a single database to be used for several repositories. Supports variable substitution (see git-cvsserver[1] for details). Any non-alphabetic characters will be replaced with underscores": "数据库表名前缀。会加在所用任何数据库表名之前,以便单个数据库供多个仓库使用。支持变量替换(详情参见 git-cvsserver[1])。任何非字母字符都会替换为下划线",
|
||||
"Database used by git-cvsserver to cache revision information derived from the Git repository. The exact meaning depends on the used database driver, for SQLite (which is the default driver) this is a filename. Supports variable substitution (see git-cvsserver[1] for details). May not contain semicolons (`;`). Default: '%Ggitcvs.%m.sqlite'": "git-cvsserver 用来缓存从 Git 仓库派生的修订信息的数据库。具体含义取决于所用数据库驱动;对 SQLite(默认驱动)而言这是一个文件名。支持变量替换(详情参见 git-cvsserver[1])。不得包含分号(`;`)。默认:'%Ggitcvs.%m.sqlite'",
|
||||
@@ -844,6 +844,7 @@
|
||||
"Date string to set the system clock to": "用于设置系统时钟的日期字符串",
|
||||
"Date string, for example '2024-01-01 12:00:00' or 'next friday'": "日期字符串,例如 '2024-01-01 12:00:00' 或 'next friday'",
|
||||
"Debugging mode": "调试模式",
|
||||
"Decode incoming Base64 stream into binary data": "将输入的 Base64 流解码为二进制数据",
|
||||
"Decode input instead of encoding it": "解码输入而不是编码",
|
||||
"Decompress the bzip2(1) compressed file before looking for the text": "查找文本之前,先解压经 bzip2(1) 压缩的文件",
|
||||
"Deepen or shorten the history of a shallow repository to exclude commits reachable from a specified remote branch or tag. This option can be specified multiple times": "加深或缩短浅仓库的历史,以排除从指定远程分支或标签可达的提交。此选项可多次指定",
|
||||
@@ -990,6 +991,7 @@
|
||||
"Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s)": "分发器心跳周期(ns|us|ms|s|m|h)(默认 5s)",
|
||||
"Display Linux tasks": "显示 Linux 任务",
|
||||
"Display Resource (CPU/Memory/Storage) usage": "显示资源(CPU/内存/存储)用量",
|
||||
"Display a file's modification time or a time expressed in seconds since the Epoch": "显示文件的最后修改时间,或自纪元起指定秒数对应的时间",
|
||||
"Display a grand total": "显示总计",
|
||||
"Display a list of available options and exit": "显示可用选项列表并退出",
|
||||
"Display a live stream of container(s) resource usage statistics": "实时显示容器的资源用量统计",
|
||||
@@ -1074,6 +1076,7 @@
|
||||
"Display the progress bar in any verbosity mode": "在任何详细输出模式下都显示进度条",
|
||||
"Display the running processes": "显示正在运行的进程",
|
||||
"Display the running processes of a container": "显示容器中正在运行的进程",
|
||||
"Display the time in the specified output time zone": "按指定的输出时区显示时间",
|
||||
"Display the version number and exit": "显示版本号并退出",
|
||||
"Display the version of Wget and exit": "显示 Wget 的版本并退出",
|
||||
"Display this help and exit": "显示此帮助并退出",
|
||||
@@ -1196,6 +1199,7 @@
|
||||
"Does everything a publish would do except actually publishing to the registry": "执行发布会做的一切,但并不真正发布到注册表",
|
||||
"Doesn't check optionalDependencies": "不检查 optionalDependencies",
|
||||
"Doesn't display branch listing in columns": "不以分列形式显示分支列表",
|
||||
"Domain Information Groper": "域名信息查询工具(Domain Information Groper)",
|
||||
"Don't add a Signed-off-by trailer by the committer at the end of the commit l": "不在提交说明末尾添加提交者的 Signed-off-by 尾注",
|
||||
"Don't apply changes matching the given path": "不应用与给定路径匹配的变更",
|
||||
"Don't ascend to the parent directory": "不上升到父目录",
|
||||
@@ -1248,6 +1252,7 @@
|
||||
"Don't transfer any file smaller than SIZE": "不传输任何小于 SIZE 的文件",
|
||||
"Don't truncate output": "不截断输出",
|
||||
"Don't try to obtain credentials from .netrc": "不尝试从 .netrc 获取凭据",
|
||||
"Don't try to set the date": "不要尝试设置系统日期和时间",
|
||||
"Don't update packages in optionalDependencies": "不更新 optionalDependencies 中的软件包",
|
||||
"Don't use cookies": "不使用 cookie",
|
||||
"Don't validate the server's certificate": "不验证服务器的证书",
|
||||
@@ -1693,12 +1698,6 @@
|
||||
"Help for use": "use 的帮助",
|
||||
"Hibernate and suspend the system": "休眠并挂起系统",
|
||||
"Hibernate the system": "休眠系统",
|
||||
"Hide all sections except the ones requested explicitly": "隐藏所有区段,只显示显式请求的部分",
|
||||
"Hide the additional section": "隐藏附加区段",
|
||||
"Hide the authority section": "隐藏权威区段",
|
||||
"Hide the comment lines": "隐藏注释行",
|
||||
"Hide the question section": "隐藏问题区段",
|
||||
"Hide the statistics block": "隐藏统计信息",
|
||||
"Hides the message at the end of each npm install acknowledging the number of dependencies looking for funding": "隐藏每次 npm install 结束时关于正在寻求资助的依赖数量的提示",
|
||||
"Highlight duration in seconds": "高亮持续时间,单位为秒",
|
||||
"Highlight new and old processes": "高亮新启动和已退出的进程",
|
||||
@@ -2014,6 +2013,7 @@
|
||||
"Initialize, update or inspect submodules": "初始化、更新或检查子模块",
|
||||
"Input file(s)": "输入文件",
|
||||
"Insert STRING among the headers": "在头中插入 STRING",
|
||||
"Insert line breaks every count characters. Default is 0, which generates an unbroken stream": "每 count 个字符插入换行符;默认为 0,输出不换行",
|
||||
"Insert text before a line": "在行前插入文本",
|
||||
"Inspect and manage pip's wheel cache": "检查并管理 pip 的 wheel 缓存",
|
||||
"Inspect authorization": "检查授权",
|
||||
@@ -2135,7 +2135,7 @@
|
||||
"Last number in sequence": "序列的结束数字",
|
||||
"Launch an interactive session": "启动交互式会话",
|
||||
"Leave high-bit chars unescaped in output": "在输出中保留高位字符不转义",
|
||||
"Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made. As a security precaution, if the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non-zero, su will fail": "保持当前环境变量不变,使用目标用户的登录 shell,且不切换目录。作为安全措施,若目标用户的 shell 是非标准 shell(按 getusershell(3) 定义)且调用者的真实 uid 非零,su 将失败",
|
||||
"Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made. As a security precaution, if the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non-zero, su will fail": "尝试保留环境并通常保持当前工作目录。BSD 使用调用者的登录 shell;目标 shell 不在 getusershell(3) 列表且调用者非 root 时会失败。Linux util-linux 优先使用 -s 指定的 shell,其次使用 SHELL;受限 shell、登录选项及 PAM 可能影响结果",
|
||||
"Leave the rejected hunks in corresponding *.rej files": "将遭拒绝的差异块留在对应的 *.rej 文件中",
|
||||
"Leave the swarm": "离开 swarm",
|
||||
"Like --allow-empty this command is primarily for use by foreign SCM interface": "与 --allow-empty 类似,此命令主要供外部 SCM 接口使用",
|
||||
@@ -2509,6 +2509,7 @@
|
||||
"New arguments for the exec credential plugin command for the user entry in kubeconfig": "kubeconfig 中用户条目的 exec 凭据插件命令的新参数",
|
||||
"New url of submodule": "子模块的新 url",
|
||||
"New version": "新版本",
|
||||
"New_time: [[[mm]dd]HH]MM[[cc]yy][.ss], output_fmt: '+' followed by user-defined format string": "New_time:[[[mm]dd]HH]MM[[cc]yy][.ss];output_fmt:'+' 后接用户定义的格式字符串",
|
||||
"No \"%s: Directory has been renamed from %s\", \"%s: Directory has been renamed\"": "不显示 \"%s: Directory has been renamed from %s\"、\"%s: Directory has been renamed\"",
|
||||
"No \"%s: Directory is new\"": "不显示 \"%s: Directory is new\"",
|
||||
"No \"%s: File removed before we read it\"": "不显示 \"%s: File removed before we read it\"",
|
||||
@@ -2560,11 +2561,13 @@
|
||||
"Number of log entries between Raft snapshots (default 10000)": "两次 Raft 快照之间的日志条目数(默认 10000)",
|
||||
"Number of messages to be sent per connection, after that a relogin will happen. If the value is 0 or undefined, send all messages in one connection. See also the `--batch-size` option of git-send-email[1]": "每个连接要发送的消息数,之后会重新登录。若值为 0 或 undefined,则在一个连接中发送全部消息。另见 git-send-email[1] 的 `--batch-size` 选项",
|
||||
"Number of parallel children to be used for all forms of fetching": "用于所有获取形式的并行子进程数",
|
||||
"Number of seconds since the Epoch (00:00:00 UTC, January 1, 1970)": "自纪元(1970 年 1 月 1 日 00:00:00 UTC)起的秒数",
|
||||
"Number of tasks": "任务数",
|
||||
"Number the non-blank output lines, starting at 1": "为非空输出行编号,从 1 开始",
|
||||
"Number the output lines, starting at 1": "为输出行编号,从 1 开始",
|
||||
"Numeric output only. No attempt will be made to lookup symbolic names for host addresses": "仅输出数字。不会尝试查找主机地址的符号名称",
|
||||
"OAuth 2 Bearer Token": "OAuth 2 Bearer 令牌",
|
||||
"Obsolete option, accepted and ignored for compatibility": "过时选项;为兼容而接受,但会被忽略",
|
||||
"Obtain and use a client certificate automatically": "自动获取并使用客户端证书",
|
||||
"Obtain patterns from FILE, one per line. The empty file contains zero patterns, and therefore matches nothing. (-f is specified by POSIX.)": "从 FILE 获取模式,每行一个。空文件包含零个模式,因此不匹配任何内容。(-f 由 POSIX 规定。)",
|
||||
"Of TLS 1.3 ciphersuites> TLS 1.3 cipher suites to use": "要使用的 TLS 1.3 密码套件",
|
||||
@@ -2623,6 +2626,7 @@
|
||||
"Only remove the dependency from optionalDependencies": "仅从 optionalDependencies 移除该依赖",
|
||||
"Only return logs after a specific date (RFC3339). Defaults to all logs. Only one of since-time / since may be used": "仅返回特定日期(RFC3339)之后的日志。默认返回全部日志。since-time / since 只能使用其中一个",
|
||||
"Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs. Only one of since-time / since may be used": "仅返回比相对时长(如 5s、2m 或 3h)更新的日志。默认返回全部日志。since-time / since 只能使用其中一个",
|
||||
"Only set time on the current machine, instead of all machines in the local group": "仅设置当前机器的时间,不设置本地组内其他机器的时间",
|
||||
"Only set time when the file is more recent than what was given with --mtime": "仅当文件比 --mtime 给定的时间更新时才设置时间",
|
||||
"Only show context names": "仅显示上下文名称",
|
||||
"Only show formulae with multiple versions installed": "仅显示已安装多个版本的 formula",
|
||||
@@ -2929,6 +2933,7 @@
|
||||
"Print the client and server version information for the current context": "打印当前上下文的客户端和服务器版本信息",
|
||||
"Print the current context": "打印当前上下文",
|
||||
"Print the current directory": "显示当前目录",
|
||||
"Print the date and time represented by the specified number of seconds since the Epoch": "显示自纪元起指定秒数所对应的日期和时间",
|
||||
"Print the directories checked and git operations performed": "打印已检查的目录和已执行的 git 操作",
|
||||
"Print the effective global node_modules folder to standard out": "将有效的全局 node_modules 目录打印到标准输出",
|
||||
"Print the fields of fields (Currently only 1 level deep)": "打印字段的字段(目前仅 1 层深度)",
|
||||
@@ -3069,21 +3074,16 @@
|
||||
"Put all updated files into place at transfer's end": "在传输结束时将所有已更新文件就位",
|
||||
"Put the post data in the URL and use GET": "将 POST 数据放入 URL 并使用 GET",
|
||||
"Python package manager": "Python 软件包管理器",
|
||||
"Query A records (IPv4 address)": "查询 A 记录(IPv4 地址)",
|
||||
"Query AAAA records (IPv6 address)": "查询 AAAA 记录(IPv6 地址)",
|
||||
"Query ALL DNS Records": "查询所有 DNS 记录",
|
||||
"Query CNAME records (canonical name)": "查询 CNAME 记录(规范名称)",
|
||||
"Query ALL DNS Records": "查询所有 DNS 记录(ANY 结果可能不完整,见 RFC 8482)",
|
||||
"Query Domain A Record": "查询域名的 A 记录",
|
||||
"Query Domain CNAME Record": "查询域名的 CNAME 记录",
|
||||
"Query Domain MX Record": "查询域名的 MX 记录",
|
||||
"Query Domain TXT Record": "查询域名的 TXT 记录",
|
||||
"Query MX records (mail exchangers)": "查询 MX 记录(邮件交换服务器)",
|
||||
"Query NS Record": "查询 NS 记录",
|
||||
"Query NS records (authoritative name servers)": "查询 NS 记录(权威名称服务器)",
|
||||
"Query SOA Record": "查询 SOA 记录",
|
||||
"Query TTL Record": "查询 TTL 记录",
|
||||
"Query TXT records": "查询 TXT 记录",
|
||||
"Query only answer section": "只查询 answer 区段",
|
||||
"Query the SOA record (start of authority)": "查询 SOA 记录(起始授权机构)",
|
||||
"Query only answer section": "隐藏注释、问题、权威和附加区段及统计信息",
|
||||
"Query the registry to resolve image digest and supported platforms (\"always\"|\"changed\"|\"never\") (default \"always\")": "查询注册表以解析镜像摘要和支持的平台(\"always\"|\"changed\"|\"never\")(默认 \"always\")",
|
||||
"Query the systemd journal": "查询 systemd 日志",
|
||||
"Queue a line of filename to be read and inserted into the output stream at the end of the current cycle, or when the next input line is read": "排队读取 filename 的一行,并在当前循环结束或读取下一行输入时插入输出流",
|
||||
@@ -3118,6 +3118,7 @@
|
||||
"Read in a file of environment variables": "读入环境变量文件",
|
||||
"Read in a line delimited file of labels": "读入以行分隔的标签文件",
|
||||
"Read include patterns from FILE": "从 FILE 读取包含模式",
|
||||
"Read input from input_file. Default is stdin; passing - also represents stdin": "从 input_file 读取输入;默认为标准输入,'-' 也表示标准输入",
|
||||
"Read list of source-file names from FILE": "从 FILE 读取源文件名列表",
|
||||
"Read owner translation map from FILE": "从 FILE 读取所有者转换映射",
|
||||
"Read refspecs, one per line, from stdin in addition to those provided as arguments. The \"tag <name>\" format is not supported": "除作为参数提供的引用规格外,还从标准输入读取引用规格,每行一个。不支持 \"tag <name>\" 格式",
|
||||
@@ -3307,7 +3308,7 @@
|
||||
"Report a snapshot of the current processes": "报告当前进程的快照",
|
||||
"Report archived files on stderr": "在标准错误上报告已归档文件",
|
||||
"Report bugs for a package in a web browser": "在网页浏览器中报告软件包的缺陷",
|
||||
"Report every resolved path on standard error": "在标准错误上报告每个已解析的路径",
|
||||
"Report error messages": "显示错误消息",
|
||||
"Report or omit repeated line": "报告或省略重复行",
|
||||
"Report output format": "报告输出格式",
|
||||
"Report the names of files as they are moved": "在移动文件时报告文件名",
|
||||
@@ -3592,7 +3593,6 @@
|
||||
"Send PRET before PASV": "在 PASV 之前发送 PRET",
|
||||
"Send STRING as data. --method MUST be set": "将 STRING 作为数据发送。必须设置 --method",
|
||||
"Send User-Agent <name> to server": "向服务器发送 User-Agent <name>",
|
||||
"Send an ANY query; the response may be incomplete (RFC 8482)": "发起 ANY 查询;响应可能不完整(RFC 8482)",
|
||||
"Send command(s) to server before transfer": "在传输之前向服务器发送命令",
|
||||
"Send contents of FILE. --method MUST be set": "发送 FILE 的内容。必须设置 --method",
|
||||
"Send cookies from string/file": "从字符串/文件发送 cookie",
|
||||
@@ -3708,6 +3708,7 @@
|
||||
"Set the default target": "设置默认目标",
|
||||
"Set the docker endpoint (default [])": "设置 docker 端点(默认 [])",
|
||||
"Set the input block size": "设置输入块大小",
|
||||
"Set the kernel's value for daylight saving time": "设置内核的夏令时标志",
|
||||
"Set the kubernetes endpoint (default [])": "设置 kubernetes 端点(默认 [])",
|
||||
"Set the latest last-applied-configuration annotations by setting it to match the contents of a file. This results in the last-applied-configuration being updated as though 'kubectl apply -f<file> ' was run, without updating any other parts of the object": "通过使其与文件内容一致来设置最新的 last-applied-configuration 注解。这样会更新 last-applied-configuration,效果如同运行了 'kubectl apply -f<file> ',但不会更新对象的任何其他部分",
|
||||
"Set the length object names are abbreviated to. If unspecified or set to \"auto\", an appropriate value is computed based on the approximate number of packed objects in your repository, which hopefully is enough for abbreviated object names to stay unique for some time. If set to \"no\", no abbreviation is made and the object names are shown in their full length. The minimum length is 4": "设置对象名称缩写到的长度。若未指定或设为 \"auto\",将根据仓库中打包对象的大致数量计算一个合适的值,希望足以让缩写后的对象名称在一段时间内保持唯一。若设为 \"no\",则不进行缩写,对象名称以完整长度显示。最小长度为 4",
|
||||
@@ -3726,6 +3727,7 @@
|
||||
"Set the selector on a resource. Note that the new selector will overwrite the old selector if the resource had one prior to the invocation of 'set selector'": "设置资源上的选择器。请注意,若资源在调用 'set selector' 之前已有选择器,新选择器将覆盖旧选择器",
|
||||
"Set the starting point at which to create the new commits to the merge base of <upstream> <branch>. Running git rebase --keep-base <upstream> <branch> is equivalent to running git rebase --onto <upstream>… <upstream>. This option is useful in the case where one is developing a feature on top of an upstream branch. While the feature is being worked on, the upstream branch may advance and it may not be the best idea to keep rebasing on top of the upstream but to keep the base commit as-is. Although both this option and --fork-point find the merge base between <upstream> and <branch>, this option uses the merge base as the starting point on which new commits will be created, whereas --fork-point uses the merge base to determine the set of commits which will be rebased": "将创建新提交的起点设为 <upstream> <branch> 的合并基。运行 git rebase --keep-base <upstream> <branch> 等价于运行 git rebase --onto <upstream>… <upstream>。当你在上游分支之上开发功能时,此选项很有用。功能开发过程中,上游分支可能会前进,持续变基到最新上游之上未必最好,保持基提交不变可能更合适。虽然此选项和 --fork-point 都会找出 <upstream> 与 <branch> 之间的合并基,但此选项把合并基用作创建新提交的起点,而 --fork-point 用合并基来确定将被变基的提交集合",
|
||||
"Set the system time from the given string": "按给定字符串设置系统时间",
|
||||
"Set the system's value for minutes west of GMT": "设置系统中相对于 GMT 向西的分钟数",
|
||||
"Set the target build stage to build": "设置要构建的目标构建阶段",
|
||||
"Set the value of a profile property": "设置 profile 属性的值",
|
||||
"Set this option to `false` to disable the default heuristics that shift diff hunk boundaries to make patches easier to read": "将此选项设为 `false` 可禁用默认启发式;该启发式会移动差异块边界,以使补丁更易读",
|
||||
@@ -3868,7 +3870,7 @@
|
||||
"Show newest entries first": "最新条目优先显示",
|
||||
"Show number of added and deleted lines in decimal notation": "以十进制显示新增和删除的行数",
|
||||
"Show only names of changed files": "仅显示已更改文件的名称",
|
||||
"Show only processes of the given user": "只显示给定用户的进程",
|
||||
"Show only processes for a given user (or $USER)": "只显示给定用户(或 $USER)的进程",
|
||||
"Show only properties by this name": "仅显示此名称的属性",
|
||||
"Show only the given PIDs": "只显示指定的 PID",
|
||||
"Show only unmerged branches in the 'revPrompt' subdialog. This is useful for tools similar to merge or rebase, but not for things like checkout or reset": "仅在 'revPrompt' 子对话框中显示未合并的分支。适用于类似合并或变基的工具,不适用于检出或 reset",
|
||||
@@ -3894,7 +3896,6 @@
|
||||
"Show status in long format (default)": "以长格式显示状态(默认)",
|
||||
"Show the Docker Compose version information": "显示 Docker Compose 版本信息",
|
||||
"Show the Docker version information": "显示 Docker 版本信息",
|
||||
"Show the answer section": "显示答案区段",
|
||||
"Show the author email instead of author name in git-blame[1]. This option defaults to false": "在 git-blame[1] 中显示作者邮箱而非作者名。此选项默认为 false",
|
||||
"Show the branch and tracking info even in short-format": "即使在短格式中也显示分支和跟踪信息",
|
||||
"Show the changelog for a package": "显示软件包的更新日志",
|
||||
@@ -3997,11 +3998,11 @@
|
||||
"Skip warning for input/output not being a terminal": "跳过输入/输出不是终端的警告",
|
||||
"Some commands (e.g. svn and http interfaces) that interactively ask for a password can be told to use an external program given via the value of this variable. Can be overridden by the `GIT_ASKPASS` environment variable. If not set, fall back to the value of the `SSH_ASKPASS` environment variable or, failing that, a simple password prompt. The external program shall be given a suitable prompt as command-line argument and write the password on its STDOUT": "某些以交互方式询问密码的命令(例如 svn 和 http 接口)可使用此变量所给值指定的外部程序。可被环境变量 `GIT_ASKPASS` 覆盖。若未设置,则回退到环境变量 `SSH_ASKPASS` 的值;若仍不可用,则使用简单的密码提示。外部程序会收到合适的提示作为命令行参数,并将密码写入其 STDOUT",
|
||||
"Somewhat quiet output. Don't display ICMP error messages that are in response to our query messages. Originally, the -v flag was required to display such errors, but -v displays all ICMP error messages. On a busy machine, this output can be overbear- ing. Without the -Q flag, ping prints out any ICMP error mes- sages caused by its own ECHO_REQUEST messages": "较为安静的输出。不显示响应本方查询消息的 ICMP 错误消息。最初需要 -v 标志才显示此类错误,但 -v 会显示所有 ICMP 错误消息。在繁忙的机器上,这些输出可能过于冗长。若没有 -Q 标志,ping 会打印由其自身 ECHO_REQUEST 消息引起的任何 ICMP 错误消息",
|
||||
"Sort by COLUMN in list view": "按列表视图中的 COLUMN 排序",
|
||||
"Sort by a random order": "按随机顺序排序",
|
||||
"Sort by general numerical value": "按通用数值排序",
|
||||
"Sort by month abbreviations. Unknown strings are considered smaller than the month names": "按月份缩写排序。未知字符串视为小于月份名称",
|
||||
"Sort by numerical value, but take into account the SI suffix, if present": "按数值排序,但考虑存在的 SI 后缀",
|
||||
"Sort by the given column": "按给定列排序",
|
||||
"Sort by time modified (most recently modified first) before sorting the operands by lexicographical order": "先按修改时间排序(最近修改的在前),再按字典序排序操作数",
|
||||
"Sort fields numerically by arithmetic value": "按算术值对字段进行数值排序",
|
||||
"Sort files by size": "按大小对文件排序",
|
||||
@@ -4221,7 +4222,6 @@
|
||||
"String(s) `receive-pack` and `upload-pack` use to decide which refs to omit from their initial advertisements. Use more than one definition to specify multiple prefix strings. A ref that is under the hierarchies listed in the value of this variable is excluded, and is hidden when responding to `git push` or `git fetch`. See `receive.hideRefs` and `uploadpack.hideRefs` for program-specific versions of this config": "`receive-pack` 和 `upload-pack` 用来决定在初始通告中省略哪些引用的字符串。使用多个定义可指定多个前缀字符串。位于此变量所列层次下的引用会被排除,并在响应 `git push` 或 `git fetch` 时隐藏。程序专用版本参见 `receive.hideRefs` 和 `uploadpack.hideRefs`",
|
||||
"Strip NUMBER leading components from file names on extraction": "提取时从文件名中去除 NUMBER 个前导组成部分",
|
||||
"Strip leading and trailing empty lines, trailing whitepace, commentary and collapse consecutive empty lines": "去除首尾空行、尾部空白、注释,并合并连续空行",
|
||||
"Strip the last component from the path before resolving": "解析前去掉路径的最后一段",
|
||||
"SubResource such as pod/log or deployment/scale": "子资源,例如 pod/log 或 deployment/scale",
|
||||
"Submit audit reports alongside the current npm command to the default registry and all registries configured for scopes": "将审计报告与当前 npm 命令一起提交到默认注册表以及为作用域配置的所有注册表",
|
||||
"Submodules working trees will not be updated": "不会更新子模块的工作区",
|
||||
@@ -4241,6 +4241,7 @@
|
||||
"Suppress info messages and privilege warning": "抑制信息消息和特权警告",
|
||||
"Suppress lines with no field delimiter characters. unless specified, lines with no delimiters are passed through unmodified": "不输出不含字段分隔符的行;若未指定,则不含分隔符的行会原样输出",
|
||||
"Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address": "抑制多播数据包的环回。此标志仅在 ping 目标为多播地址时适用",
|
||||
"Suppress most error messages": "抑制大多数错误消息",
|
||||
"Suppress non-error messages": "抑制非错误消息",
|
||||
"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.)": "抑制正常输出;改为为每个输入文件打印匹配行数。使用 -v、--invert-match 选项时,统计不匹配的行。(-c 由 POSIX 规定。)",
|
||||
"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": "抑制正常输出;改为打印通常不会产生输出的每个输入文件的名称。扫描在第一次匹配时停止",
|
||||
@@ -4398,6 +4399,7 @@
|
||||
"The file to split": "要拆分的文件",
|
||||
"The filter that will be applied when fetching from this promisor remote. Changing or clearing this value will only affect fetches for new commits. To fetch associated objects for commits already present in the local object database, use the `--refetch` option of git-fetch[1]": "从此 promisor 远程获取时将应用的过滤器。更改或清除此值只影响对新提交的获取。要为本地对象数据库中已有的提交获取关联对象,请使用 git-fetch[1] 的 `--refetch` 选项",
|
||||
"The folder to drop the mails into, which is typically the Drafts folder. For example: \"INBOX.Drafts\", \"INBOX/Drafts\" or \"[Gmail]/Drafts\". Required": "投放邮件的文件夹,通常是草稿文件夹。例如:\"INBOX.Drafts\"、\"INBOX/Drafts\" 或 \"[Gmail]/Drafts\"。必填",
|
||||
"The format with which to parse the new date value": "用于解析新日期值的格式",
|
||||
"The hash algorithm to use": "要使用的哈希算法",
|
||||
"The host port mapping for the container port. To demonstrate a single-machine container": "容器端口的主机端口映射。用于演示单机容器",
|
||||
"The id utility displays the user and group names and numeric IDs, of the calling process, to the standard output. If the real and effective IDs are different, both are displayed, otherwise only the real ID is displayed. If a user (login name or user ID) is specified, the user and group IDs of that user are displayed. In this case, the real and effective IDs are assumed to be the same": "id 工具把调用进程的用户名、组名和数字 ID 输出到标准输出。若真实 ID 与有效 ID 不同,两者都会显示,否则只显示真实 ID。若指定了用户(登录名或用户 ID),则显示该用户的用户和组 ID,此时假定真实 ID 与有效 ID 相同",
|
||||
@@ -4445,6 +4447,7 @@
|
||||
"The names of containers in the selected pod templates to change, all containers are selected by default - may use wildcards": "所选 pod 模板中要更改的容器名称,默认选择所有容器,可使用通配符",
|
||||
"The network from which to copy the configuration": "要从中复制配置的网络",
|
||||
"The network protocol for the service to be created. Default is 'TCP'": "要创建的服务的网络协议。默认为 'TCP'",
|
||||
"The new date to set": "要设置的新日期",
|
||||
"The new desired number of replicas. Required": "新的期望副本数。必填",
|
||||
"The number of bytes per record": "每条记录的字节数",
|
||||
"The number of curl sessions (counted across slots) to be kept across requests. They will not be ended with curl_easy_cleanup() until http_cleanup() is invoked. If USE_CURL_MULTI is not defined, this value will be capped at 1. Defaults to 1": "跨请求保留的 curl 会话数(跨槽位计数)。在调用 http_cleanup() 之前,它们不会以 curl_easy_cleanup() 结束。若未定义 USE_CURL_MULTI,此值上限为 1。默认为 1",
|
||||
@@ -4767,6 +4770,7 @@
|
||||
"Use PORT instead of PASV": "使用 PORT 代替 PASV",
|
||||
"Use PROGRAM to compress temporary files (eg. bzip2)": "使用 PROGRAM 压缩临时文件(例如 bzip2)",
|
||||
"Use PROTOCOL for any URL missing a scheme": "对缺少 scheme 的任何 URL 使用 PROTOCOL",
|
||||
"Use RFC 2822 date and time output format": "使用 RFC 2822 日期和时间输出格式",
|
||||
"Use SSLv2": "使用 SSLv2",
|
||||
"Use SSLv3": "使用 SSLv3",
|
||||
"Use TCP Fast Open": "使用 TCP Fast Open",
|
||||
@@ -4822,6 +4826,7 @@
|
||||
"Use revisions from <file> instead of calling git-rev-list": "使用 <file> 中的修订,而不调用 git-rev-list",
|
||||
"Use sed replace EXPRESSION to transform file names": "使用 sed 替换 EXPRESSION 来转换文件名",
|
||||
"Use size for the maximum size of the memory buffer": "将 size 用作内存缓冲区的最大大小",
|
||||
"Use specified format for input instead of the default [[[mm]dd]HH]MM[[cc]yy][.ss] format": "使用指定格式解析输入,而不是默认的 [[[mm]dd]HH]MM[[cc]yy][.ss] 格式",
|
||||
"Use staging as the restore location": "使用暂存区作为恢复位置",
|
||||
"Use stat(2) instead of lstat(2). The information reported by stat will refer to the target of file, if file is a symbolic link, and not to file itself. If the link is broken or the target does not exist, fall back on lstat(2) and report information about the link": "使用 stat(2) 而非 lstat(2)。若 file 是符号链接,报告的是其目标而不是链接本身;若链接损坏或目标不存在,则回退到 lstat(2) 并报告链接自身的信息",
|
||||
"Use string to terminate sequence of numbers": "用 string 终止数字序列",
|
||||
@@ -5083,6 +5088,7 @@
|
||||
"Write cookies to <filename> after operation": "操作后将 cookie 写入 <filename>",
|
||||
"Write documents to FILE": "将文档写入 FILE",
|
||||
"Write output to a file named as the remote file": "将输出写入以远程文件命名的文件",
|
||||
"Write output to output_file. Default is stdout; passing - also represents stdout": "将输出写入 output_file;默认为标准输出,'-' 也表示标准输出",
|
||||
"Write startup timing messages to <file>": "将启动计时消息写入 <file>",
|
||||
"Write the archive to this file": "将归档写入此文件",
|
||||
"Write the container ID to the file": "将容器 ID 写入该文件",
|
||||
@@ -5101,6 +5107,7 @@
|
||||
"You can set this to 'link', in which case a hardlink followed by a delete of the source are used to make sure that object creation will not overwrite existing objects": "可将其设为 'link',此时会先创建硬链接再删除源,以确保创建对象时不会覆盖现有对象",
|
||||
"You can use the --if-present flag to avoid exiting with a non-zero exit code when the script is undefined. This lets you run potentially undefined scripts without breaking the execution chain": "可使用 --if-present 标志,以避免在脚本未定义时以非零退出码退出。这样你可以运行可能未定义的脚本,而不中断执行链",
|
||||
"You may specify up to 16 'pad' bytes to fill out the packet you send. This is useful for diagnosing data-dependent problems in a network. For example, '-p ff' will cause the sent packet to be filled with all ones": "最多可以指定 16 个 'pad' 字节来填充所发送的数据包。这有助于诊断网络中与数据相关的问题。例如,'-p ff' 会使发送的数据包全部填充为 1",
|
||||
"[+|-]val[ymwdHMS]": "[+|-]val[ymwdHMS]",
|
||||
"[-][[hh]mm]SS": "[-][[hh]mm]SS(时间格式)",
|
||||
"[EXPERIMENTAL] A boolean that enables branching support when using `--recurse-submodules` or `submodule.recurse=true`. Enabling this will allow certain commands to accept `--recurse-submodules` and certain commands that already accept `--recurse-submodules` will now consider branches. Defaults to false": "[实验性] 一个布尔值,在使用 `--recurse-submodules` 或 `submodule.recurse=true` 时启用分支支持。启用后,某些命令将接受 `--recurse-submodules`,而已接受 `--recurse-submodules` 的某些命令将会考虑分支。默认为 false",
|
||||
"[[CC]YY]MMDDhhmm[.SS]": "[[CC]YY]MMDDhhmm[.SS](时间格式)",
|
||||
|
||||
@@ -184,6 +184,7 @@
|
||||
"Adds a newline to the pattern space, then appends the next line of input to the pattern space. If there is no more input then sed exits without processing any more commands": "在模式空間後追加一個換行符,再將下一行輸入追加到模式空間;若沒有更多輸入,sed 退出,不再處理任何命令",
|
||||
"Adds read and execute permissions for all classes": "為所有類別新增讀和執行許可權",
|
||||
"Adds the user as an owner of the package": "將該使用者新增為軟體包的所有者",
|
||||
"Adjust and print (but don't set) the second, minute, hour, month day, week day, month, or year according to val": "根據 val 調整並顯示秒、分、時、月內日期、星期、月份或年份,但不設定系統時間",
|
||||
"Adjust the access and modification time stamps for the file by the specified value": "按指定值調整檔案的訪問時間和修改時間",
|
||||
"Advertised address (format: <ip|interface>[:port])": "通告地址(格式:<ip|interface>[:port])",
|
||||
"Advice on how to set your identity configuration when your information is guessed from the system username and domain name": "當你的身份資訊是根據系統使用者名稱和域名猜測而來時,關於如何設定身份配置的建議",
|
||||
@@ -836,7 +837,6 @@
|
||||
"DEPRECATED pull multiple images in parallel": "已棄用:並行拉取多個映象",
|
||||
"DEPRECATED! USE --project-directory INSTEAD. Specify an alternate working directory (default: the path of the, first specified, Compose file)": "已棄用!請改用 --project-directory。指定備用工作目錄(預設:最先指定的 Compose 檔案的路徑)",
|
||||
"DNF package manager (RHEL/Rocky/Alma/Fedora)": "DNF 軟體包管理器(RHEL/Rocky/Alma/Fedora)",
|
||||
"DNS lookup utility (Domain Information Groper)": "DNS 查詢工具(Domain Information Groper)",
|
||||
"DNS server addrs to use": "要使用的 DNS 伺服器地址",
|
||||
"Database table name prefix. Prepended to the names of any database tables used, allowing a single database to be used for several repositories. Supports variable substitution (see git-cvsserver[1] for details). Any non-alphabetic characters will be replaced with underscores": "資料庫表名字首。會加在所用任何資料庫表名之前,以便單個資料庫供多個倉庫使用。支援變數替換(詳情參見 git-cvsserver[1])。任何非字母字元都會替換為下劃線",
|
||||
"Database used by git-cvsserver to cache revision information derived from the Git repository. The exact meaning depends on the used database driver, for SQLite (which is the default driver) this is a filename. Supports variable substitution (see git-cvsserver[1] for details). May not contain semicolons (`;`). Default: '%Ggitcvs.%m.sqlite'": "git-cvsserver 用來快取從 Git 倉庫派生的修訂資訊的資料庫。具體含義取決於所用資料庫驅動;對 SQLite(預設驅動)而言這是一個檔名。支援變數替換(詳情參見 git-cvsserver[1])。不得包含分號(`;`)。預設:'%Ggitcvs.%m.sqlite'",
|
||||
@@ -844,6 +844,7 @@
|
||||
"Date string to set the system clock to": "用於設定系統時鐘的日期字串",
|
||||
"Date string, for example '2024-01-01 12:00:00' or 'next friday'": "日期字串,例如 '2024-01-01 12:00:00' 或 'next friday'",
|
||||
"Debugging mode": "除錯模式",
|
||||
"Decode incoming Base64 stream into binary data": "將輸入的 Base64 流解碼為二進位資料",
|
||||
"Decode input instead of encoding it": "解碼輸入而不是編碼",
|
||||
"Decompress the bzip2(1) compressed file before looking for the text": "查詢文字之前,先解壓經 bzip2(1) 壓縮的檔案",
|
||||
"Deepen or shorten the history of a shallow repository to exclude commits reachable from a specified remote branch or tag. This option can be specified multiple times": "加深或縮短淺倉庫的歷史,以排除從指定遠端分支或標籤可達的提交。此選項可多次指定",
|
||||
@@ -990,6 +991,7 @@
|
||||
"Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s)": "分發器心跳週期(ns|us|ms|s|m|h)(預設 5s)",
|
||||
"Display Linux tasks": "顯示 Linux 任務",
|
||||
"Display Resource (CPU/Memory/Storage) usage": "顯示資源(CPU/記憶體/儲存)用量",
|
||||
"Display a file's modification time or a time expressed in seconds since the Epoch": "顯示檔案的最後修改時間,或自紀元起指定秒數對應的時間",
|
||||
"Display a grand total": "顯示總計",
|
||||
"Display a list of available options and exit": "顯示可用選項列表並退出",
|
||||
"Display a live stream of container(s) resource usage statistics": "即時顯示容器的資源用量統計",
|
||||
@@ -1074,6 +1076,7 @@
|
||||
"Display the progress bar in any verbosity mode": "在任何詳細輸出模式下都顯示進度條",
|
||||
"Display the running processes": "顯示正在執行的行程",
|
||||
"Display the running processes of a container": "顯示容器中正在執行的行程",
|
||||
"Display the time in the specified output time zone": "按指定的輸出時區顯示時間",
|
||||
"Display the version number and exit": "顯示版本號並退出",
|
||||
"Display the version of Wget and exit": "顯示 Wget 的版本並退出",
|
||||
"Display this help and exit": "顯示此幫助並退出",
|
||||
@@ -1196,6 +1199,7 @@
|
||||
"Does everything a publish would do except actually publishing to the registry": "執行釋出會做的一切,但並不真正釋出到登錄檔",
|
||||
"Doesn't check optionalDependencies": "不檢查 optionalDependencies",
|
||||
"Doesn't display branch listing in columns": "不以分列形式顯示分支列表",
|
||||
"Domain Information Groper": "域名資訊查詢工具(Domain Information Groper)",
|
||||
"Don't add a Signed-off-by trailer by the committer at the end of the commit l": "不在提交說明末尾新增提交者的 Signed-off-by 尾註",
|
||||
"Don't apply changes matching the given path": "不應用與給定路徑匹配的變更",
|
||||
"Don't ascend to the parent directory": "不上升到父目錄",
|
||||
@@ -1248,6 +1252,7 @@
|
||||
"Don't transfer any file smaller than SIZE": "不傳輸任何小於 SIZE 的檔案",
|
||||
"Don't truncate output": "不截斷輸出",
|
||||
"Don't try to obtain credentials from .netrc": "不嘗試從 .netrc 獲取憑據",
|
||||
"Don't try to set the date": "不要嘗試設定系統日期和時間",
|
||||
"Don't update packages in optionalDependencies": "不更新 optionalDependencies 中的軟體包",
|
||||
"Don't use cookies": "不使用 cookie",
|
||||
"Don't validate the server's certificate": "不驗證伺服器的證書",
|
||||
@@ -1693,12 +1698,6 @@
|
||||
"Help for use": "use 的幫助",
|
||||
"Hibernate and suspend the system": "休眠並掛起系統",
|
||||
"Hibernate the system": "休眠系統",
|
||||
"Hide all sections except the ones requested explicitly": "隱藏所有區段,只顯示顯式請求的部分",
|
||||
"Hide the additional section": "隱藏附加區段",
|
||||
"Hide the authority section": "隱藏權威區段",
|
||||
"Hide the comment lines": "隱藏註釋行",
|
||||
"Hide the question section": "隱藏問題區段",
|
||||
"Hide the statistics block": "隱藏統計資訊",
|
||||
"Hides the message at the end of each npm install acknowledging the number of dependencies looking for funding": "隱藏每次 npm install 結束時關於正在尋求資助的依賴數量的提示",
|
||||
"Highlight duration in seconds": "高亮持續時間,單位為秒",
|
||||
"Highlight new and old processes": "高亮新啟動和已退出的行程",
|
||||
@@ -2014,6 +2013,7 @@
|
||||
"Initialize, update or inspect submodules": "初始化、更新或檢查子模組",
|
||||
"Input file(s)": "輸入檔案",
|
||||
"Insert STRING among the headers": "在頭中插入 STRING",
|
||||
"Insert line breaks every count characters. Default is 0, which generates an unbroken stream": "每 count 個字元插入換行符;預設為 0,輸出不換行",
|
||||
"Insert text before a line": "在行前插入文字",
|
||||
"Inspect and manage pip's wheel cache": "檢查並管理 pip 的 wheel 快取",
|
||||
"Inspect authorization": "檢查授權",
|
||||
@@ -2135,7 +2135,7 @@
|
||||
"Last number in sequence": "序列的結束數字",
|
||||
"Launch an interactive session": "啟動互動式會話",
|
||||
"Leave high-bit chars unescaped in output": "在輸出中保留高位字元不轉義",
|
||||
"Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made. As a security precaution, if the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non-zero, su will fail": "保持當前環境變數不變,使用目標使用者的登入 shell,且不切換目錄。作為安全措施,若目標使用者的 shell 是非標準 shell(按 getusershell(3) 定義)且呼叫者的真實 uid 非零,su 將失敗",
|
||||
"Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made. As a security precaution, if the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non-zero, su will fail": "嘗試保留環境並通常保持當前工作目錄。BSD 使用呼叫者的登入 shell;目標 shell 不在 getusershell(3) 列表且呼叫者非 root 時會失敗。Linux util-linux 優先使用 -s 指定的 shell,其次使用 SHELL;受限 shell、登入選項及 PAM 可能影響結果",
|
||||
"Leave the rejected hunks in corresponding *.rej files": "將遭拒絕的差異塊留在對應的 *.rej 檔案中",
|
||||
"Leave the swarm": "離開 swarm",
|
||||
"Like --allow-empty this command is primarily for use by foreign SCM interface": "與 --allow-empty 類似,此命令主要供外部 SCM 介面使用",
|
||||
@@ -2509,6 +2509,7 @@
|
||||
"New arguments for the exec credential plugin command for the user entry in kubeconfig": "kubeconfig 中使用者條目的 exec 憑據外掛命令的新引數",
|
||||
"New url of submodule": "子模組的新 url",
|
||||
"New version": "新版本",
|
||||
"New_time: [[[mm]dd]HH]MM[[cc]yy][.ss], output_fmt: '+' followed by user-defined format string": "New_time:[[[mm]dd]HH]MM[[cc]yy][.ss];output_fmt:'+' 後接使用者定義的格式字串",
|
||||
"No \"%s: Directory has been renamed from %s\", \"%s: Directory has been renamed\"": "不顯示 \"%s: Directory has been renamed from %s\"、\"%s: Directory has been renamed\"",
|
||||
"No \"%s: Directory is new\"": "不顯示 \"%s: Directory is new\"",
|
||||
"No \"%s: File removed before we read it\"": "不顯示 \"%s: File removed before we read it\"",
|
||||
@@ -2560,11 +2561,13 @@
|
||||
"Number of log entries between Raft snapshots (default 10000)": "兩次 Raft 快照之間的日誌條目數(預設 10000)",
|
||||
"Number of messages to be sent per connection, after that a relogin will happen. If the value is 0 or undefined, send all messages in one connection. See also the `--batch-size` option of git-send-email[1]": "每個連線要傳送的訊息數,之後會重新登入。若值為 0 或 undefined,則在一個連線中傳送全部訊息。另見 git-send-email[1] 的 `--batch-size` 選項",
|
||||
"Number of parallel children to be used for all forms of fetching": "用於所有獲取形式的並行子行程數",
|
||||
"Number of seconds since the Epoch (00:00:00 UTC, January 1, 1970)": "自紀元(1970 年 1 月 1 日 00:00:00 UTC)起的秒數",
|
||||
"Number of tasks": "任務數",
|
||||
"Number the non-blank output lines, starting at 1": "為非空輸出行編號,從 1 開始",
|
||||
"Number the output lines, starting at 1": "為輸出行編號,從 1 開始",
|
||||
"Numeric output only. No attempt will be made to lookup symbolic names for host addresses": "僅輸出數字。不會嘗試查詢主機地址的符號名稱",
|
||||
"OAuth 2 Bearer Token": "OAuth 2 Bearer 令牌",
|
||||
"Obsolete option, accepted and ignored for compatibility": "過時選項;為相容而接受,但會被忽略",
|
||||
"Obtain and use a client certificate automatically": "自動獲取並使用客戶端證書",
|
||||
"Obtain patterns from FILE, one per line. The empty file contains zero patterns, and therefore matches nothing. (-f is specified by POSIX.)": "從 FILE 獲取模式,每行一個。空檔案包含零個模式,因此不匹配任何內容。(-f 由 POSIX 規定。)",
|
||||
"Of TLS 1.3 ciphersuites> TLS 1.3 cipher suites to use": "要使用的 TLS 1.3 密碼套件",
|
||||
@@ -2623,6 +2626,7 @@
|
||||
"Only remove the dependency from optionalDependencies": "僅從 optionalDependencies 移除該依賴",
|
||||
"Only return logs after a specific date (RFC3339). Defaults to all logs. Only one of since-time / since may be used": "僅返回特定日期(RFC3339)之後的日誌。預設返回全部日誌。since-time / since 只能使用其中一個",
|
||||
"Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs. Only one of since-time / since may be used": "僅返回比相對時長(如 5s、2m 或 3h)更新的日誌。預設返回全部日誌。since-time / since 只能使用其中一個",
|
||||
"Only set time on the current machine, instead of all machines in the local group": "僅設定當前機器的時間,不設定本地組內其他機器的時間",
|
||||
"Only set time when the file is more recent than what was given with --mtime": "僅當檔案比 --mtime 給定的時間更新時才設定時間",
|
||||
"Only show context names": "僅顯示上下文名稱",
|
||||
"Only show formulae with multiple versions installed": "僅顯示已安裝多個版本的 formula",
|
||||
@@ -2929,6 +2933,7 @@
|
||||
"Print the client and server version information for the current context": "列印當前上下文的客戶端和伺服器版本資訊",
|
||||
"Print the current context": "列印當前上下文",
|
||||
"Print the current directory": "顯示當前目錄",
|
||||
"Print the date and time represented by the specified number of seconds since the Epoch": "顯示自紀元起指定秒數所對應的日期和時間",
|
||||
"Print the directories checked and git operations performed": "列印已檢查的目錄和已執行的 git 操作",
|
||||
"Print the effective global node_modules folder to standard out": "將有效的全域性 node_modules 目錄列印到標準輸出",
|
||||
"Print the fields of fields (Currently only 1 level deep)": "列印欄位的欄位(目前僅 1 層深度)",
|
||||
@@ -3069,21 +3074,16 @@
|
||||
"Put all updated files into place at transfer's end": "在傳輸結束時將所有已更新檔案就位",
|
||||
"Put the post data in the URL and use GET": "將 POST 資料放入 URL 並使用 GET",
|
||||
"Python package manager": "Python 軟體包管理器",
|
||||
"Query A records (IPv4 address)": "查詢 A 記錄(IPv4 地址)",
|
||||
"Query AAAA records (IPv6 address)": "查詢 AAAA 記錄(IPv6 地址)",
|
||||
"Query ALL DNS Records": "查詢所有 DNS 記錄",
|
||||
"Query CNAME records (canonical name)": "查詢 CNAME 記錄(規範名稱)",
|
||||
"Query ALL DNS Records": "查詢所有 DNS 記錄(ANY 結果可能不完整,見 RFC 8482)",
|
||||
"Query Domain A Record": "查詢域名的 A 記錄",
|
||||
"Query Domain CNAME Record": "查詢域名的 CNAME 記錄",
|
||||
"Query Domain MX Record": "查詢域名的 MX 記錄",
|
||||
"Query Domain TXT Record": "查詢域名的 TXT 記錄",
|
||||
"Query MX records (mail exchangers)": "查詢 MX 記錄(郵件交換伺服器)",
|
||||
"Query NS Record": "查詢 NS 記錄",
|
||||
"Query NS records (authoritative name servers)": "查詢 NS 記錄(權威名稱伺服器)",
|
||||
"Query SOA Record": "查詢 SOA 記錄",
|
||||
"Query TTL Record": "查詢 TTL 記錄",
|
||||
"Query TXT records": "查詢 TXT 記錄",
|
||||
"Query only answer section": "只查詢 answer 區段",
|
||||
"Query the SOA record (start of authority)": "查詢 SOA 記錄(起始授權機構)",
|
||||
"Query only answer section": "隱藏註釋、問題、權威和附加區段及統計資訊",
|
||||
"Query the registry to resolve image digest and supported platforms (\"always\"|\"changed\"|\"never\") (default \"always\")": "查詢登錄檔以解析映象摘要和支援的平臺(\"always\"|\"changed\"|\"never\")(預設 \"always\")",
|
||||
"Query the systemd journal": "查詢 systemd 日誌",
|
||||
"Queue a line of filename to be read and inserted into the output stream at the end of the current cycle, or when the next input line is read": "排隊讀取 filename 的一行,並在當前迴圈結束或讀取下一行輸入時插入輸出流",
|
||||
@@ -3118,6 +3118,7 @@
|
||||
"Read in a file of environment variables": "讀入環境變數檔案",
|
||||
"Read in a line delimited file of labels": "讀入以行分隔的標籤檔案",
|
||||
"Read include patterns from FILE": "從 FILE 讀取包含模式",
|
||||
"Read input from input_file. Default is stdin; passing - also represents stdin": "從 input_file 讀取輸入;預設為標準輸入,'-' 也表示標準輸入",
|
||||
"Read list of source-file names from FILE": "從 FILE 讀取原始檔名列表",
|
||||
"Read owner translation map from FILE": "從 FILE 讀取所有者轉換對映",
|
||||
"Read refspecs, one per line, from stdin in addition to those provided as arguments. The \"tag <name>\" format is not supported": "除作為引數提供的引用規格外,還從標準輸入讀取引用規格,每行一個。不支援 \"tag <name>\" 格式",
|
||||
@@ -3307,7 +3308,7 @@
|
||||
"Report a snapshot of the current processes": "報告當前行程的快照",
|
||||
"Report archived files on stderr": "在標準錯誤上報告已歸檔檔案",
|
||||
"Report bugs for a package in a web browser": "在網頁瀏覽器中報告軟體包的缺陷",
|
||||
"Report every resolved path on standard error": "在標準錯誤上報告每個已解析的路徑",
|
||||
"Report error messages": "顯示錯誤訊息",
|
||||
"Report or omit repeated line": "報告或省略重複行",
|
||||
"Report output format": "報告輸出格式",
|
||||
"Report the names of files as they are moved": "在移動檔案時報告檔名",
|
||||
@@ -3592,7 +3593,6 @@
|
||||
"Send PRET before PASV": "在 PASV 之前傳送 PRET",
|
||||
"Send STRING as data. --method MUST be set": "將 STRING 作為資料傳送。必須設定 --method",
|
||||
"Send User-Agent <name> to server": "向伺服器傳送 User-Agent <name>",
|
||||
"Send an ANY query; the response may be incomplete (RFC 8482)": "發起 ANY 查詢;響應可能不完整(RFC 8482)",
|
||||
"Send command(s) to server before transfer": "在傳輸之前向伺服器傳送命令",
|
||||
"Send contents of FILE. --method MUST be set": "傳送 FILE 的內容。必須設定 --method",
|
||||
"Send cookies from string/file": "從字串/檔案傳送 cookie",
|
||||
@@ -3708,6 +3708,7 @@
|
||||
"Set the default target": "設定預設目標",
|
||||
"Set the docker endpoint (default [])": "設定 docker 端點(預設 [])",
|
||||
"Set the input block size": "設定輸入塊大小",
|
||||
"Set the kernel's value for daylight saving time": "設定核心的夏令時標誌",
|
||||
"Set the kubernetes endpoint (default [])": "設定 kubernetes 端點(預設 [])",
|
||||
"Set the latest last-applied-configuration annotations by setting it to match the contents of a file. This results in the last-applied-configuration being updated as though 'kubectl apply -f<file> ' was run, without updating any other parts of the object": "通過使其與檔案內容一致來設定最新的 last-applied-configuration 註解。這樣會更新 last-applied-configuration,效果如同運行了 'kubectl apply -f<file> ',但不會更新物件的任何其他部分",
|
||||
"Set the length object names are abbreviated to. If unspecified or set to \"auto\", an appropriate value is computed based on the approximate number of packed objects in your repository, which hopefully is enough for abbreviated object names to stay unique for some time. If set to \"no\", no abbreviation is made and the object names are shown in their full length. The minimum length is 4": "設定物件名稱縮寫到的長度。若未指定或設為 \"auto\",將根據倉庫中打包物件的大致數量計算一個合適的值,希望足以讓縮寫後的物件名稱在一段時間內保持唯一。若設為 \"no\",則不進行縮寫,物件名稱以完整長度顯示。最小長度為 4",
|
||||
@@ -3726,6 +3727,7 @@
|
||||
"Set the selector on a resource. Note that the new selector will overwrite the old selector if the resource had one prior to the invocation of 'set selector'": "設定資源上的選擇器。請注意,若資源在呼叫 'set selector' 之前已有選擇器,新選擇器將覆蓋舊選擇器",
|
||||
"Set the starting point at which to create the new commits to the merge base of <upstream> <branch>. Running git rebase --keep-base <upstream> <branch> is equivalent to running git rebase --onto <upstream>… <upstream>. This option is useful in the case where one is developing a feature on top of an upstream branch. While the feature is being worked on, the upstream branch may advance and it may not be the best idea to keep rebasing on top of the upstream but to keep the base commit as-is. Although both this option and --fork-point find the merge base between <upstream> and <branch>, this option uses the merge base as the starting point on which new commits will be created, whereas --fork-point uses the merge base to determine the set of commits which will be rebased": "將建立新提交的起點設為 <upstream> <branch> 的合併基。執行 git rebase --keep-base <upstream> <branch> 等價於執行 git rebase --onto <upstream>… <upstream>。當你在上游分支之上開發功能時,此選項很有用。功能開發過程中,上游分支可能會前進,持續變基到最新上游之上未必最好,保持基提交不變可能更合適。雖然此選項和 --fork-point 都會找出 <upstream> 與 <branch> 之間的合併基,但此選項把合併基用作建立新提交的起點,而 --fork-point 用合併基來確定將被變基的提交集合",
|
||||
"Set the system time from the given string": "按給定字串設定系統時間",
|
||||
"Set the system's value for minutes west of GMT": "設定系統中相對於 GMT 向西的分鐘數",
|
||||
"Set the target build stage to build": "設定要構建的目標構建階段",
|
||||
"Set the value of a profile property": "設定 profile 屬性的值",
|
||||
"Set this option to `false` to disable the default heuristics that shift diff hunk boundaries to make patches easier to read": "將此選項設為 `false` 可停用預設啟發式;該啟發式會移動差異塊邊界,以使補丁更易讀",
|
||||
@@ -3868,7 +3870,7 @@
|
||||
"Show newest entries first": "最新條目優先顯示",
|
||||
"Show number of added and deleted lines in decimal notation": "以十進位顯示新增和刪除的行數",
|
||||
"Show only names of changed files": "僅顯示已更改檔案的名稱",
|
||||
"Show only processes of the given user": "只顯示給定使用者的行程",
|
||||
"Show only processes for a given user (or $USER)": "只顯示給定使用者(或 $USER)的行程",
|
||||
"Show only properties by this name": "僅顯示此名稱的屬性",
|
||||
"Show only the given PIDs": "只顯示指定的 PID",
|
||||
"Show only unmerged branches in the 'revPrompt' subdialog. This is useful for tools similar to merge or rebase, but not for things like checkout or reset": "僅在 'revPrompt' 子對話方塊中顯示未合併的分支。適用於類似合併或變基的工具,不適用於檢出或 reset",
|
||||
@@ -3894,7 +3896,6 @@
|
||||
"Show status in long format (default)": "以長格式顯示狀態(預設)",
|
||||
"Show the Docker Compose version information": "顯示 Docker Compose 版本資訊",
|
||||
"Show the Docker version information": "顯示 Docker 版本資訊",
|
||||
"Show the answer section": "顯示答案區段",
|
||||
"Show the author email instead of author name in git-blame[1]. This option defaults to false": "在 git-blame[1] 中顯示作者郵箱而非作者名。此選項預設為 false",
|
||||
"Show the branch and tracking info even in short-format": "即使在短格式中也顯示分支和跟蹤資訊",
|
||||
"Show the changelog for a package": "顯示軟體包的更新日誌",
|
||||
@@ -3997,11 +3998,11 @@
|
||||
"Skip warning for input/output not being a terminal": "跳過輸入/輸出不是終端的警告",
|
||||
"Some commands (e.g. svn and http interfaces) that interactively ask for a password can be told to use an external program given via the value of this variable. Can be overridden by the `GIT_ASKPASS` environment variable. If not set, fall back to the value of the `SSH_ASKPASS` environment variable or, failing that, a simple password prompt. The external program shall be given a suitable prompt as command-line argument and write the password on its STDOUT": "某些以互動方式詢問密碼的命令(例如 svn 和 http 介面)可使用此變數所給值指定的外部程式。可被環境變數 `GIT_ASKPASS` 覆蓋。若未設定,則回退到環境變數 `SSH_ASKPASS` 的值;若仍不可用,則使用簡單的密碼提示。外部程式會收到合適的提示作為命令列引數,並將密碼寫入其 STDOUT",
|
||||
"Somewhat quiet output. Don't display ICMP error messages that are in response to our query messages. Originally, the -v flag was required to display such errors, but -v displays all ICMP error messages. On a busy machine, this output can be overbear- ing. Without the -Q flag, ping prints out any ICMP error mes- sages caused by its own ECHO_REQUEST messages": "較為安靜的輸出。不顯示響應本方查詢訊息的 ICMP 錯誤訊息。最初需要 -v 標誌才顯示此類錯誤,但 -v 會顯示所有 ICMP 錯誤訊息。在繁忙的機器上,這些輸出可能過於冗長。若沒有 -Q 標誌,ping 會列印由其自身 ECHO_REQUEST 訊息引起的任何 ICMP 錯誤訊息",
|
||||
"Sort by COLUMN in list view": "按列表檢視中的 COLUMN 排序",
|
||||
"Sort by a random order": "按隨機順序排序",
|
||||
"Sort by general numerical value": "按通用數值排序",
|
||||
"Sort by month abbreviations. Unknown strings are considered smaller than the month names": "按月份縮寫排序。未知字串視為小於月份名稱",
|
||||
"Sort by numerical value, but take into account the SI suffix, if present": "按數值排序,但考慮存在的 SI 字尾",
|
||||
"Sort by the given column": "按給定列排序",
|
||||
"Sort by time modified (most recently modified first) before sorting the operands by lexicographical order": "先按修改時間排序(最近修改的在前),再按字典序排序運算元",
|
||||
"Sort fields numerically by arithmetic value": "按算術值對欄位進行數值排序",
|
||||
"Sort files by size": "按大小對檔案排序",
|
||||
@@ -4221,7 +4222,6 @@
|
||||
"String(s) `receive-pack` and `upload-pack` use to decide which refs to omit from their initial advertisements. Use more than one definition to specify multiple prefix strings. A ref that is under the hierarchies listed in the value of this variable is excluded, and is hidden when responding to `git push` or `git fetch`. See `receive.hideRefs` and `uploadpack.hideRefs` for program-specific versions of this config": "`receive-pack` 和 `upload-pack` 用來決定在初始通告中省略哪些引用的字串。使用多個定義可指定多個字首字串。位於此變數所列層次下的引用會被排除,並在響應 `git push` 或 `git fetch` 時隱藏。程式專用版本參見 `receive.hideRefs` 和 `uploadpack.hideRefs`",
|
||||
"Strip NUMBER leading components from file names on extraction": "提取時從檔名中去除 NUMBER 個前導組成部分",
|
||||
"Strip leading and trailing empty lines, trailing whitepace, commentary and collapse consecutive empty lines": "去除首尾空行、尾部空白、註釋,併合並連續空行",
|
||||
"Strip the last component from the path before resolving": "解析前去掉路徑的最後一段",
|
||||
"SubResource such as pod/log or deployment/scale": "子資源,例如 pod/log 或 deployment/scale",
|
||||
"Submit audit reports alongside the current npm command to the default registry and all registries configured for scopes": "將審計報告與當前 npm 命令一起提交到預設登錄檔以及為作用域配置的所有登錄檔",
|
||||
"Submodules working trees will not be updated": "不會更新子模組的工作區",
|
||||
@@ -4241,6 +4241,7 @@
|
||||
"Suppress info messages and privilege warning": "抑制資訊訊息和特權警告",
|
||||
"Suppress lines with no field delimiter characters. unless specified, lines with no delimiters are passed through unmodified": "不輸出不含欄位分隔符的行;若未指定,則不含分隔符的行會原樣輸出",
|
||||
"Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address": "抑制多播資料包的環回。此標誌僅在 ping 目標為多播地址時適用",
|
||||
"Suppress most error messages": "抑制大多數錯誤訊息",
|
||||
"Suppress non-error messages": "抑制非錯誤訊息",
|
||||
"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.)": "抑制正常輸出;改為為每個輸入檔案列印匹配行數。使用 -v、--invert-match 選項時,統計不匹配的行。(-c 由 POSIX 規定。)",
|
||||
"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": "抑制正常輸出;改為列印通常不會產生輸出的每個輸入檔案的名稱。掃描在第一次匹配時停止",
|
||||
@@ -4398,6 +4399,7 @@
|
||||
"The file to split": "要拆分的檔案",
|
||||
"The filter that will be applied when fetching from this promisor remote. Changing or clearing this value will only affect fetches for new commits. To fetch associated objects for commits already present in the local object database, use the `--refetch` option of git-fetch[1]": "從此 promisor 遠端獲取時將應用的過濾器。更改或清除此值隻影響對新提交的獲取。要為本地物件資料庫中已有的提交獲取關聯物件,請使用 git-fetch[1] 的 `--refetch` 選項",
|
||||
"The folder to drop the mails into, which is typically the Drafts folder. For example: \"INBOX.Drafts\", \"INBOX/Drafts\" or \"[Gmail]/Drafts\". Required": "投放郵件的資料夾,通常是草稿資料夾。例如:\"INBOX.Drafts\"、\"INBOX/Drafts\" 或 \"[Gmail]/Drafts\"。必填",
|
||||
"The format with which to parse the new date value": "用於解析新日期值的格式",
|
||||
"The hash algorithm to use": "要使用的雜湊演算法",
|
||||
"The host port mapping for the container port. To demonstrate a single-machine container": "容器埠的主機埠對映。用於演示單機容器",
|
||||
"The id utility displays the user and group names and numeric IDs, of the calling process, to the standard output. If the real and effective IDs are different, both are displayed, otherwise only the real ID is displayed. If a user (login name or user ID) is specified, the user and group IDs of that user are displayed. In this case, the real and effective IDs are assumed to be the same": "id 工具把呼叫行程的使用者名稱、組名和數字 ID 輸出到標準輸出。若真實 ID 與有效 ID 不同,兩者都會顯示,否則只顯示真實 ID。若指定了使用者(登入名或使用者 ID),則顯示該使用者的使用者和組 ID,此時假定真實 ID 與有效 ID 相同",
|
||||
@@ -4445,6 +4447,7 @@
|
||||
"The names of containers in the selected pod templates to change, all containers are selected by default - may use wildcards": "所選 pod 模板中要更改的容器名稱,預設選擇所有容器,可使用萬用字元",
|
||||
"The network from which to copy the configuration": "要從中複製配置的網路",
|
||||
"The network protocol for the service to be created. Default is 'TCP'": "要建立的服務的網路協議。預設為 'TCP'",
|
||||
"The new date to set": "要設定的新日期",
|
||||
"The new desired number of replicas. Required": "新的期望副本數。必填",
|
||||
"The number of bytes per record": "每條記錄的位元組數",
|
||||
"The number of curl sessions (counted across slots) to be kept across requests. They will not be ended with curl_easy_cleanup() until http_cleanup() is invoked. If USE_CURL_MULTI is not defined, this value will be capped at 1. Defaults to 1": "跨請求保留的 curl 會話數(跨槽位計數)。在呼叫 http_cleanup() 之前,它們不會以 curl_easy_cleanup() 結束。若未定義 USE_CURL_MULTI,此值上限為 1。預設為 1",
|
||||
@@ -4767,6 +4770,7 @@
|
||||
"Use PORT instead of PASV": "使用 PORT 代替 PASV",
|
||||
"Use PROGRAM to compress temporary files (eg. bzip2)": "使用 PROGRAM 壓縮臨時檔案(例如 bzip2)",
|
||||
"Use PROTOCOL for any URL missing a scheme": "對缺少 scheme 的任何 URL 使用 PROTOCOL",
|
||||
"Use RFC 2822 date and time output format": "使用 RFC 2822 日期和時間輸出格式",
|
||||
"Use SSLv2": "使用 SSLv2",
|
||||
"Use SSLv3": "使用 SSLv3",
|
||||
"Use TCP Fast Open": "使用 TCP Fast Open",
|
||||
@@ -4822,6 +4826,7 @@
|
||||
"Use revisions from <file> instead of calling git-rev-list": "使用 <file> 中的修訂,而不呼叫 git-rev-list",
|
||||
"Use sed replace EXPRESSION to transform file names": "使用 sed 替換 EXPRESSION 來轉換檔名",
|
||||
"Use size for the maximum size of the memory buffer": "將 size 用作記憶體緩衝區的最大大小",
|
||||
"Use specified format for input instead of the default [[[mm]dd]HH]MM[[cc]yy][.ss] format": "使用指定格式解析輸入,而不是預設的 [[[mm]dd]HH]MM[[cc]yy][.ss] 格式",
|
||||
"Use staging as the restore location": "使用暫存區作為恢復位置",
|
||||
"Use stat(2) instead of lstat(2). The information reported by stat will refer to the target of file, if file is a symbolic link, and not to file itself. If the link is broken or the target does not exist, fall back on lstat(2) and report information about the link": "使用 stat(2) 而非 lstat(2)。若 file 是符號連結,報告的是其目標而不是連結本身;若連結損壞或目標不存在,則回退到 lstat(2) 並報告連結自身的資訊",
|
||||
"Use string to terminate sequence of numbers": "用 string 終止數字序列",
|
||||
@@ -5083,6 +5088,7 @@
|
||||
"Write cookies to <filename> after operation": "操作後將 cookie 寫入 <filename>",
|
||||
"Write documents to FILE": "將文件寫入 FILE",
|
||||
"Write output to a file named as the remote file": "將輸出寫入以遠端檔案命名的檔案",
|
||||
"Write output to output_file. Default is stdout; passing - also represents stdout": "將輸出寫入 output_file;預設為標準輸出,'-' 也表示標準輸出",
|
||||
"Write startup timing messages to <file>": "將啟動計時訊息寫入 <file>",
|
||||
"Write the archive to this file": "將歸檔寫入此檔案",
|
||||
"Write the container ID to the file": "將容器 ID 寫入該檔案",
|
||||
@@ -5101,6 +5107,7 @@
|
||||
"You can set this to 'link', in which case a hardlink followed by a delete of the source are used to make sure that object creation will not overwrite existing objects": "可將其設為 'link',此時會先建立硬連結再刪除源,以確保建立物件時不會覆蓋現有物件",
|
||||
"You can use the --if-present flag to avoid exiting with a non-zero exit code when the script is undefined. This lets you run potentially undefined scripts without breaking the execution chain": "可使用 --if-present 標誌,以避免在指令碼未定義時以非零退出碼退出。這樣你可以執行可能未定義的指令碼,而不中斷執行鏈",
|
||||
"You may specify up to 16 'pad' bytes to fill out the packet you send. This is useful for diagnosing data-dependent problems in a network. For example, '-p ff' will cause the sent packet to be filled with all ones": "最多可以指定 16 個 'pad' 位元組來填充所傳送的資料包。這有助於診斷網路中與資料相關的問題。例如,'-p ff' 會使傳送的資料包全部填充為 1",
|
||||
"[+|-]val[ymwdHMS]": "[+|-]val[ymwdHMS]",
|
||||
"[-][[hh]mm]SS": "[-][[hh]mm]SS(時間格式)",
|
||||
"[EXPERIMENTAL] A boolean that enables branching support when using `--recurse-submodules` or `submodule.recurse=true`. Enabling this will allow certain commands to accept `--recurse-submodules` and certain commands that already accept `--recurse-submodules` will now consider branches. Defaults to false": "[實驗性] 一個布林值,在使用 `--recurse-submodules` 或 `submodule.recurse=true` 時啟用分支支援。啟用後,某些命令將接受 `--recurse-submodules`,而已接受 `--recurse-submodules` 的某些命令將會考慮分支。預設為 false",
|
||||
"[[CC]YY]MMDDhhmm[.SS]": "[[CC]YY]MMDDhhmm[.SS](時間格式)",
|
||||
|
||||
@@ -12,6 +12,8 @@ export interface FigOption {
|
||||
isRequired?: boolean;
|
||||
isPersistent?: boolean;
|
||||
exclusiveOn?: string[];
|
||||
/** Local extension: optional short values attach directly; long values use '='. */
|
||||
netcattyOptionalArgAttached?: boolean;
|
||||
}
|
||||
|
||||
export interface FigArg {
|
||||
@@ -44,10 +46,12 @@ export interface FigSpec extends FigSubcommand {
|
||||
// Top-level spec may include additional metadata
|
||||
}
|
||||
|
||||
export type FigHostOs = "linux" | "windows" | "macos";
|
||||
|
||||
// Bridge type augmentation
|
||||
interface FigSpecBridge {
|
||||
listFigSpecs?: () => Promise<string[]>;
|
||||
loadFigSpec?: (commandName: string) => Promise<FigSpec | null>;
|
||||
listFigSpecs?: (hostOs?: FigHostOs) => Promise<string[]>;
|
||||
loadFigSpec?: (commandName: string, hostOs?: FigHostOs) => Promise<FigSpec | null>;
|
||||
}
|
||||
|
||||
function getBridge(): FigSpecBridge | undefined {
|
||||
@@ -55,30 +59,48 @@ function getBridge(): FigSpecBridge | undefined {
|
||||
return (window as Window & { netcatty?: FigSpecBridge }).netcatty;
|
||||
}
|
||||
|
||||
// Cache loaded specs
|
||||
const specCache = new Map<string, FigSpec | null>();
|
||||
// Cache by command and target OS: one renderer can contain both Linux and
|
||||
// macOS sessions, whose option names and meanings can differ.
|
||||
const specCache = new Map<string, FigSpec>();
|
||||
|
||||
// In-flight loading promises to avoid duplicate loads
|
||||
// In-flight loading promises to avoid duplicate loads for the same target OS.
|
||||
const inFlightLoads = new Map<string, Promise<FigSpec | null>>();
|
||||
|
||||
// All available spec names
|
||||
let availableSpecs: string[] | null = null;
|
||||
let availableSpecsSet: Set<string> | null = null;
|
||||
function specCacheKey(commandName: string, hostOs?: FigHostOs): string {
|
||||
return JSON.stringify([commandName, hostOs ?? null]);
|
||||
}
|
||||
|
||||
// Spec names and successfully loaded commands, both scoped by target OS so a
|
||||
// macOS-only command never reports as available to a Linux session.
|
||||
const availableSpecs = new Map<string, { names: string[]; set: Set<string> }>();
|
||||
const loadedSpecNames = new Map<string, Set<string>>();
|
||||
|
||||
function hostKey(hostOs?: FigHostOs): string {
|
||||
return hostOs ?? "";
|
||||
}
|
||||
|
||||
function rememberLoadedSpecName(commandName: string, hostOs?: FigHostOs): void {
|
||||
const key = hostKey(hostOs);
|
||||
const loaded = loadedSpecNames.get(key);
|
||||
if (loaded) loaded.add(commandName);
|
||||
else loadedSpecNames.set(key, new Set([commandName]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of all available command specs via IPC.
|
||||
* Get the list of all command specs available for one target OS via IPC.
|
||||
*/
|
||||
export async function getAvailableSpecs(): Promise<string[]> {
|
||||
export async function getAvailableSpecs(hostOs?: FigHostOs): Promise<string[]> {
|
||||
const key = hostKey(hostOs);
|
||||
// Only return cache if it has actual specs (not an empty failure)
|
||||
if (availableSpecs && availableSpecs.length > 0) return availableSpecs;
|
||||
const cached = availableSpecs.get(key);
|
||||
if (cached && cached.names.length > 0) return cached.names;
|
||||
|
||||
try {
|
||||
const bridge = getBridge();
|
||||
if (bridge?.listFigSpecs) {
|
||||
const specs = await bridge.listFigSpecs();
|
||||
const specs = await bridge.listFigSpecs(hostOs);
|
||||
if (Array.isArray(specs) && specs.length > 0) {
|
||||
availableSpecs = specs;
|
||||
availableSpecsSet = new Set(specs);
|
||||
availableSpecs.set(key, { names: specs, set: new Set(specs) });
|
||||
return specs;
|
||||
}
|
||||
}
|
||||
@@ -94,15 +116,17 @@ export async function getAvailableSpecs(): Promise<string[]> {
|
||||
* Load a command specification by name via IPC.
|
||||
* Uses in-flight deduplication to avoid loading the same spec twice concurrently.
|
||||
*/
|
||||
export async function loadSpec(commandName: string): Promise<FigSpec | null> {
|
||||
if (specCache.has(commandName)) {
|
||||
return specCache.get(commandName) ?? null;
|
||||
}
|
||||
export async function loadSpec(commandName: string, hostOs?: FigHostOs): Promise<FigSpec | null> {
|
||||
const cacheKey = specCacheKey(commandName, hostOs);
|
||||
const cached = specCache.get(cacheKey);
|
||||
if (cached) return cached;
|
||||
|
||||
const existing = inFlightLoads.get(commandName);
|
||||
const existing = inFlightLoads.get(cacheKey);
|
||||
if (existing) return existing;
|
||||
|
||||
const loadPromise = (async (): Promise<FigSpec | null> => {
|
||||
// Defer the bridge lookup so even a missing bridge or synchronous throw
|
||||
// clears the in-flight entry after it has been registered.
|
||||
const loadPromise = Promise.resolve().then(async (): Promise<FigSpec | null> => {
|
||||
try {
|
||||
const bridge = getBridge();
|
||||
if (!bridge?.loadFigSpec) {
|
||||
@@ -110,36 +134,33 @@ export async function loadSpec(commandName: string): Promise<FigSpec | null> {
|
||||
return null;
|
||||
}
|
||||
|
||||
const spec = await bridge.loadFigSpec(commandName);
|
||||
const spec = await bridge.loadFigSpec(commandName, hostOs);
|
||||
if (spec) {
|
||||
specCache.set(commandName, spec);
|
||||
specCache.set(cacheKey, spec);
|
||||
rememberLoadedSpecName(commandName, hostOs);
|
||||
}
|
||||
// Don't cache null — the load may have failed transiently (bridge not ready, etc.)
|
||||
// Only cache null when we're confident the spec doesn't exist (hasSpec returned false)
|
||||
return spec;
|
||||
} catch {
|
||||
// Don't cache failures — allow retry on next request
|
||||
return null;
|
||||
} finally {
|
||||
inFlightLoads.delete(commandName);
|
||||
inFlightLoads.delete(cacheKey);
|
||||
}
|
||||
})();
|
||||
});
|
||||
|
||||
inFlightLoads.set(commandName, loadPromise);
|
||||
inFlightLoads.set(cacheKey, loadPromise);
|
||||
return loadPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a spec exists for a given command name (without loading it).
|
||||
* Check if a spec exists for a given command name and target OS.
|
||||
*/
|
||||
export async function hasSpec(commandName: string): Promise<boolean> {
|
||||
// Only trust positive cache hits (spec loaded successfully).
|
||||
// Null entries may be stale failures from preload — ignore them.
|
||||
const cached = specCache.get(commandName);
|
||||
if (cached) return true;
|
||||
export async function hasSpec(commandName: string, hostOs?: FigHostOs): Promise<boolean> {
|
||||
if (loadedSpecNames.get(hostKey(hostOs))?.has(commandName)) return true;
|
||||
|
||||
await getAvailableSpecs();
|
||||
return availableSpecsSet?.has(commandName) ?? false;
|
||||
await getAvailableSpecs(hostOs);
|
||||
return availableSpecs.get(hostKey(hostOs))?.set.has(commandName) ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,7 +185,7 @@ export const COMMON_FIG_SPECS = [
|
||||
* Preload commonly used specs in batches to avoid overwhelming IPC.
|
||||
* Only call this when autocomplete is enabled.
|
||||
*/
|
||||
export function preloadCommonSpecs(): void {
|
||||
export function preloadCommonSpecs(hostOs?: FigHostOs): void {
|
||||
const BATCH_SIZE = 8;
|
||||
let offset = 0;
|
||||
|
||||
@@ -173,7 +194,7 @@ export function preloadCommonSpecs(): void {
|
||||
if (batch.length === 0) return;
|
||||
|
||||
for (const name of batch) {
|
||||
loadSpec(name).catch(() => {});
|
||||
loadSpec(name, hostOs).catch(() => {});
|
||||
}
|
||||
|
||||
offset += BATCH_SIZE;
|
||||
|
||||
@@ -390,13 +390,12 @@ export function useTerminalAutocomplete(
|
||||
*/
|
||||
const typedBufferReliableRef = useRef<boolean>(true);
|
||||
|
||||
// Preload common specs on first mount (only if enabled)
|
||||
// Warm the cache for this session's target OS, including when it changes.
|
||||
useEffect(() => {
|
||||
if (settings.enabled) {
|
||||
preloadCommonSpecs();
|
||||
preloadCommonSpecs(hostOs);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
}, [settings.enabled, hostOs]);
|
||||
|
||||
// Local Terminal: seed autocomplete history from ~/.zsh_history (etc.) once
|
||||
// per stable hostId so prefix suggestions match Ghostty-style histfile recall
|
||||
|
||||
@@ -192,10 +192,15 @@ test("batch 4 spot checks preserve verified semantics, placeholders and upstream
|
||||
assert.ok(
|
||||
simplified["Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made. As a security precaution, if the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non-zero, su will fail"].includes("getusershell(3)"),
|
||||
);
|
||||
assert.equal(simplified["Show the answer section"], "显示答案区段");
|
||||
// dig shares A/MX/CNAME/TXT/SOA/ANY/filter keys with dog, so the caveats
|
||||
// live in the zh-CN values while the English keys stay untouched.
|
||||
assert.equal(
|
||||
simplified["Send an ANY query; the response may be incomplete (RFC 8482)"],
|
||||
"发起 ANY 查询;响应可能不完整(RFC 8482)",
|
||||
simplified["Query ALL DNS Records"],
|
||||
"查询所有 DNS 记录(ANY 结果可能不完整,见 RFC 8482)",
|
||||
);
|
||||
assert.equal(
|
||||
simplified["Query only answer section"],
|
||||
"隐藏注释、问题、权威和附加区段及统计信息",
|
||||
);
|
||||
assert.equal(
|
||||
simplified["Count logical lines, rather than screen lines"],
|
||||
@@ -206,10 +211,7 @@ test("batch 4 spot checks preserve verified semantics, placeholders and upstream
|
||||
simplified["Query NS records (authoritative name servers)"],
|
||||
"查询 NS 记录(权威名称服务器)",
|
||||
);
|
||||
assert.equal(
|
||||
simplified["Query the SOA record (start of authority)"],
|
||||
"查询 SOA 记录(起始授权机构)",
|
||||
);
|
||||
assert.equal(simplified["Query SOA Record"], "查询 SOA 记录");
|
||||
// The local GNU date spec replaces the bundled BSD option set.
|
||||
assert.equal(
|
||||
simplified["Display the last modification time of the given file"],
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
import { createRequire } from "node:module";
|
||||
|
||||
import type { FigSpec } from "./autocomplete/figSpecLoader.ts";
|
||||
|
||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
|
||||
async function loadFixture(relativePath: string): Promise<FigSpec> {
|
||||
const mod = await import(pathToFileURL(path.join(ROOT, relativePath)).href);
|
||||
return mod.default?.default ?? mod.default;
|
||||
}
|
||||
|
||||
const [su, linuxReadlink, macReadlink, linuxDate, macDate, bundledDate, linuxBase64, macBase64] = await Promise.all([
|
||||
loadFixture("node_modules/@withfig/autocomplete/build/su.js"),
|
||||
loadFixture("electron/specs/readlink.js"),
|
||||
loadFixture("electron/specs/macos/readlink.js"),
|
||||
loadFixture("electron/specs/date.js"),
|
||||
loadFixture("electron/specs/macos/date.js"),
|
||||
loadFixture("node_modules/@withfig/autocomplete/build/date.js"),
|
||||
loadFixture("electron/specs/base64.js"),
|
||||
loadFixture("node_modules/@withfig/autocomplete/build/base64.js"),
|
||||
]);
|
||||
|
||||
const byPlatform: Record<string, Record<string, FigSpec>> = {
|
||||
linux: { su, readlink: linuxReadlink, date: linuxDate, base64: linuxBase64 },
|
||||
macos: { su, readlink: macReadlink, date: macDate, base64: macBase64 },
|
||||
};
|
||||
const descriptionsDir = path.join(ROOT, "components/terminal/autocomplete");
|
||||
const dictionaries = {
|
||||
"zh-CN": JSON.parse(fs.readFileSync(path.join(descriptionsDir, "descriptions.zh-CN.json"), "utf8")) as Record<string, string>,
|
||||
"zh-TW": JSON.parse(fs.readFileSync(path.join(descriptionsDir, "descriptions.zh-TW.json"), "utf8")) as Record<string, string>,
|
||||
};
|
||||
|
||||
Object.defineProperty(globalThis, "localStorage", {
|
||||
value: { getItem: () => null, setItem: () => {}, removeItem: () => {}, clear: () => {} },
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(globalThis, "window", {
|
||||
value: {
|
||||
netcatty: {
|
||||
listFigSpecs: async () => ["su", "readlink", "date", "base64"],
|
||||
loadFigSpec: async (name: string, hostOs?: string) =>
|
||||
byPlatform[hostOs ?? "linux"]?.[name] ?? null,
|
||||
},
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
const { getCompletions } = await import("./autocomplete/completionEngine.ts");
|
||||
type Locale = "en" | "zh-CN" | "zh-TW";
|
||||
|
||||
async function suggestions(input: string, os: "linux" | "macos", locale: Locale) {
|
||||
return getCompletions(input, { os, locale, skipPathCompletion: true, maxResults: 100 });
|
||||
}
|
||||
|
||||
function collectDescriptions(node: unknown, out = new Set<string>(), seen = new WeakSet<object>()): Set<string> {
|
||||
if (!node || typeof node !== "object" || seen.has(node)) return out;
|
||||
seen.add(node);
|
||||
const entry = node as Record<string, unknown>;
|
||||
if (typeof entry.description === "string" && entry.description.trim()) out.add(entry.description);
|
||||
for (const value of Object.values(entry)) {
|
||||
if (Array.isArray(value)) value.forEach((child) => collectDescriptions(child, out, seen));
|
||||
else if (value && typeof value === "object") collectDescriptions(value, out, seen);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
test("su -m distinguishes BSD login shells from util-linux shell selection", async () => {
|
||||
const expected: Record<Locale, string> = {
|
||||
en: "Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made. As a security precaution, if the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non-zero, su will fail",
|
||||
"zh-CN": "尝试保留环境并通常保持当前工作目录。BSD 使用调用者的登录 shell;目标 shell 不在 getusershell(3) 列表且调用者非 root 时会失败。Linux util-linux 优先使用 -s 指定的 shell,其次使用 SHELL;受限 shell、登录选项及 PAM 可能影响结果",
|
||||
"zh-TW": "嘗試保留環境並通常保持當前工作目錄。BSD 使用呼叫者的登入 shell;目標 shell 不在 getusershell(3) 列表且呼叫者非 root 時會失敗。Linux util-linux 優先使用 -s 指定的 shell,其次使用 SHELL;受限 shell、登入選項及 PAM 可能影響結果",
|
||||
};
|
||||
for (const os of ["linux", "macos"] as const) {
|
||||
for (const locale of ["en", "zh-CN", "zh-TW"] as const) {
|
||||
const option = (await suggestions("su -", os, locale)).find((item) => item.displayText === "-m");
|
||||
assert.equal(option?.text, "su -m");
|
||||
assert.equal(option?.description, expected[locale]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("GNU readlink quiet and verbose suggestions use the correct descriptions", async () => {
|
||||
const expected: Record<Locale, { quiet: string; verbose: string }> = {
|
||||
en: { quiet: "Suppress most error messages", verbose: "Report error messages" },
|
||||
"zh-CN": { quiet: "抑制大多数错误消息", verbose: "显示错误消息" },
|
||||
"zh-TW": { quiet: "抑制大多數錯誤訊息", verbose: "顯示錯誤訊息" },
|
||||
};
|
||||
for (const locale of ["en", "zh-CN", "zh-TW"] as const) {
|
||||
const result = await suggestions("readlink -", "linux", locale);
|
||||
for (const option of ["-q", "--quiet", "-s", "--silent"]) {
|
||||
const item = result.find((value) => value.displayText === option);
|
||||
assert.equal(item?.text, `readlink ${option}`);
|
||||
assert.equal(item?.description, expected[locale].quiet);
|
||||
}
|
||||
for (const option of ["-v", "--verbose"]) {
|
||||
const item = result.find((value) => value.displayText === option);
|
||||
assert.equal(item?.text, `readlink ${option}`);
|
||||
assert.equal(item?.description, expected[locale].verbose);
|
||||
}
|
||||
assert.equal(result.some((item) => item.displayText === "--strip"), false);
|
||||
}
|
||||
});
|
||||
|
||||
test("all descriptions in macOS date and base64 specs have both translations", () => {
|
||||
for (const [name, spec] of Object.entries({ macDate, bundledDate, macBase64, macReadlink })) {
|
||||
for (const [locale, dictionary] of Object.entries(dictionaries)) {
|
||||
const missing = [...collectDescriptions(spec)].filter((description) => !dictionary[description]?.trim());
|
||||
assert.deepEqual(missing, [], `${name}: missing ${locale} translations`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("macOS date falls back to the bundled spec and keeps its original option semantics", async () => {
|
||||
const { loadFigSpec } = createRequire(import.meta.url)("../../electron/main/registerBridges.cjs") as {
|
||||
loadFigSpec: (electronDir: string, name: string, os: string) => Promise<FigSpec | null>;
|
||||
};
|
||||
// This existing directory has no local specs but shares the real node_modules.
|
||||
const electronDirWithoutOverrides = path.join(ROOT, "scripts");
|
||||
assert.equal(fs.existsSync(path.join(electronDirWithoutOverrides, "specs/macos/date.js")), false);
|
||||
const fallback = await loadFigSpec(electronDirWithoutOverrides, "date", "macos");
|
||||
assert.ok(fallback);
|
||||
const option = (name: string) => fallback.options?.find((item) =>
|
||||
(Array.isArray(item.name) ? item.name : [item.name]).includes(name));
|
||||
const cases = [
|
||||
["-d", "Set the kernel's value for daylight saving time", "设置内核的夏令时标志", "設定核心的夏令時標誌"],
|
||||
["-t", "Set the system's value for minutes west of GMT", "设置系统中相对于 GMT 向西的分钟数", "設定系統中相對於 GMT 向西的分鐘數"],
|
||||
["-n", "Only set time on the current machine, instead of all machines in the local group", "仅设置当前机器的时间,不设置本地组内其他机器的时间", "僅設定當前機器的時間,不設定本地組內其他機器的時間"],
|
||||
["-r", "Print the date and time represented by the specified number of seconds since the Epoch", "显示自纪元起指定秒数所对应的日期和时间", "顯示自紀元起指定秒數所對應的日期和時間"],
|
||||
];
|
||||
const { localizeSpecSuggestionDescriptions } = await import("./autocomplete/autocompleteDescriptionI18n.ts");
|
||||
for (const [name, english, simplified, traditional] of cases) {
|
||||
const entry = option(name);
|
||||
assert.equal(entry?.description, english);
|
||||
assert.equal((await localizeSpecSuggestionDescriptions([entry!], "en"))[0].description, english);
|
||||
assert.equal((await localizeSpecSuggestionDescriptions([entry!], "zh-CN"))[0].description, simplified);
|
||||
assert.equal((await localizeSpecSuggestionDescriptions([entry!], "zh-TW"))[0].description, traditional);
|
||||
}
|
||||
const referenceArg = option("-r")?.args;
|
||||
assert.ok(referenceArg && !Array.isArray(referenceArg));
|
||||
const seconds = "Number of seconds since the Epoch (00:00:00 UTC, January 1, 1970)";
|
||||
assert.equal(referenceArg.description, seconds);
|
||||
assert.equal(dictionaries["zh-CN"][seconds], "自纪元(1970 年 1 月 1 日 00:00:00 UTC)起的秒数");
|
||||
assert.equal(dictionaries["zh-TW"][seconds], "自紀元(1970 年 1 月 1 日 00:00:00 UTC)起的秒數");
|
||||
});
|
||||
|
||||
test("macOS date and base64 show localized BSD semantics", async () => {
|
||||
const expected: Record<Locale, { obsolete: string; reference: string; zone: string; input: string; wrap: string }> = {
|
||||
en: {
|
||||
obsolete: "Obsolete option, accepted and ignored for compatibility",
|
||||
reference: "Display a file's modification time or a time expressed in seconds since the Epoch",
|
||||
zone: "Display the time in the specified output time zone",
|
||||
input: "Read input from input_file. Default is stdin; passing - also represents stdin",
|
||||
wrap: "Insert line breaks every count characters. Default is 0, which generates an unbroken stream",
|
||||
},
|
||||
"zh-CN": {
|
||||
obsolete: "过时选项;为兼容而接受,但会被忽略",
|
||||
reference: "显示文件的最后修改时间,或自纪元起指定秒数对应的时间",
|
||||
zone: "按指定的输出时区显示时间",
|
||||
input: "从 input_file 读取输入;默认为标准输入,'-' 也表示标准输入",
|
||||
wrap: "每 count 个字符插入换行符;默认为 0,输出不换行",
|
||||
},
|
||||
"zh-TW": {
|
||||
obsolete: "過時選項;為相容而接受,但會被忽略",
|
||||
reference: "顯示檔案的最後修改時間,或自紀元起指定秒數對應的時間",
|
||||
zone: "按指定的輸出時區顯示時間",
|
||||
input: "從 input_file 讀取輸入;預設為標準輸入,'-' 也表示標準輸入",
|
||||
wrap: "每 count 個字元插入換行符;預設為 0,輸出不換行",
|
||||
},
|
||||
};
|
||||
assert.deepEqual(macDate.options?.find((option) => option.name === "-z")?.args, { name: "output_zone" });
|
||||
for (const locale of ["en", "zh-CN", "zh-TW"] as const) {
|
||||
const dateOptions = await suggestions("date -", "macos", locale);
|
||||
assert.equal(dateOptions.find((item) => item.displayText === "-n")?.description, expected[locale].obsolete);
|
||||
assert.equal(dateOptions.find((item) => item.displayText === "-r")?.description, expected[locale].reference);
|
||||
const zone = dateOptions.find((item) => item.displayText === "-z");
|
||||
assert.equal(zone?.text, "date -z");
|
||||
assert.equal(zone?.description, expected[locale].zone);
|
||||
const base64Options = await suggestions("base64 -", "macos", locale);
|
||||
assert.equal(base64Options.find((item) => item.displayText === "-i")?.description, expected[locale].input);
|
||||
assert.equal(base64Options.find((item) => item.displayText === "-b")?.description, expected[locale].wrap);
|
||||
}
|
||||
});
|
||||
|
||||
test("macOS readlink shows the localized BSD canonicalization option", async () => {
|
||||
const expected: Record<Locale, string> = {
|
||||
en: "Resolve symbolic links and print the canonical path only if all components exist",
|
||||
"zh-CN": "解析符号链接,仅当所有路径组件都存在时才打印规范路径",
|
||||
"zh-TW": "解析符號連結,僅當所有路徑元件都存在時才打印規範路徑",
|
||||
};
|
||||
for (const locale of ["en", "zh-CN", "zh-TW"] as const) {
|
||||
const result = await suggestions("readlink -", "macos", locale);
|
||||
const option = result.find((item) => item.displayText === "-f");
|
||||
assert.equal(option?.text, "readlink -f");
|
||||
assert.equal(option?.description, expected[locale]);
|
||||
assert.equal(result.some((item) => item.displayText === "-s"), false);
|
||||
}
|
||||
});
|
||||
|
||||
test("macOS description translations retain their argument and format literals", () => {
|
||||
const literalCases: Array<[string, string[]]> = [
|
||||
["Read input from input_file. Default is stdin; passing - also represents stdin", ["input_file", "'-'"]],
|
||||
["Write output to output_file. Default is stdout; passing - also represents stdout", ["output_file", "'-'"]],
|
||||
["[+|-]val[ymwdHMS]", ["[+|-]val[ymwdHMS]"]],
|
||||
["Use specified format for input instead of the default [[[mm]dd]HH]MM[[cc]yy][.ss] format", ["[[[mm]dd]HH]MM[[cc]yy][.ss]"]],
|
||||
];
|
||||
for (const dictionary of Object.values(dictionaries)) {
|
||||
for (const [key, literals] of literalCases) {
|
||||
for (const literal of literals) assert.ok(dictionary[key]?.includes(literal), `${key}: missing ${literal}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,144 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
|
||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const dateSpec = (await import(pathToFileURL(path.join(ROOT, "electron/specs/date.js")).href)).default;
|
||||
const macosDateSpec = (await import(pathToFileURL(path.join(ROOT, "electron/specs/macos/date.js")).href)).default;
|
||||
const loadRequests: Array<{ name: string; os?: string }> = [];
|
||||
const overlappingOptionsSpec = {
|
||||
name: "fixture",
|
||||
options: [
|
||||
{ name: "-f", netcattyOptionalArgAttached: true, args: { isOptional: true, suggestions: ["astest"] } },
|
||||
{ name: "-fast" },
|
||||
],
|
||||
};
|
||||
const ordinaryOptionalSpec = {
|
||||
name: "ordinary",
|
||||
options: [
|
||||
{ name: ["-o", "--output"], args: { isOptional: true, suggestions: ["json"] } },
|
||||
{ name: ["-t", "--type"], netcattyOptionalArgAttached: false, args: { isOptional: true, suggestions: ["json"] } },
|
||||
{ name: ["-q", "--quality"], netcattyOptionalArgAttached: "true", args: { isOptional: true, suggestions: ["json"] } },
|
||||
],
|
||||
};
|
||||
|
||||
Object.defineProperty(globalThis, "localStorage", {
|
||||
value: { getItem: () => null, setItem: () => {}, removeItem: () => {} },
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(globalThis, "window", {
|
||||
value: {
|
||||
netcatty: {
|
||||
listFigSpecs: async () => ["date", "fixture", "ordinary"],
|
||||
loadFigSpec: async (name: string, os?: string) => {
|
||||
loadRequests.push({ name, os });
|
||||
if (name === "date") return os === "macos" ? macosDateSpec : dateSpec;
|
||||
if (name === "fixture") return overlappingOptionsSpec;
|
||||
return name === "ordinary" ? ordinaryOptionalSpec : null;
|
||||
},
|
||||
},
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
const { getCompletions } = await import("./autocomplete/completionEngine.ts");
|
||||
|
||||
test("GNU date completes an optional format attached to the short option", async () => {
|
||||
const suggestions = await getCompletions("date -Is", {
|
||||
os: "linux",
|
||||
skipPathCompletion: true,
|
||||
});
|
||||
const seconds = suggestions.find((suggestion) => suggestion.text === "date -Iseconds");
|
||||
assert.equal(seconds?.displayText, "seconds");
|
||||
});
|
||||
|
||||
test("GNU date completes the value after the long option's equals sign", async () => {
|
||||
const suggestions = await getCompletions("date --iso-8601=s", {
|
||||
os: "linux",
|
||||
skipPathCompletion: true,
|
||||
});
|
||||
assert.equal(
|
||||
suggestions.find((suggestion) => suggestion.text === "date --iso-8601=seconds")?.displayText,
|
||||
"seconds",
|
||||
);
|
||||
|
||||
const allFormats = await getCompletions("date --iso-8601=", {
|
||||
os: "linux",
|
||||
skipPathCompletion: true,
|
||||
});
|
||||
assert.deepEqual(
|
||||
allFormats.filter((suggestion) => suggestion.source === "arg").map((suggestion) => suggestion.text),
|
||||
["date --iso-8601=date", "date --iso-8601=hours", "date --iso-8601=minutes", "date --iso-8601=seconds", "date --iso-8601=ns"],
|
||||
);
|
||||
});
|
||||
|
||||
test("a bare -I remains a complete option and other options stay available", async () => {
|
||||
const bare = await getCompletions("date -I", { os: "linux", skipPathCompletion: true });
|
||||
assert.equal(bare.some((suggestion) => suggestion.text.startsWith("date -Iseconds")), false);
|
||||
|
||||
const afterShort = await getCompletions("date -I ", { os: "linux", skipPathCompletion: true, maxResults: 100 });
|
||||
assert.equal(afterShort.some((suggestion) => suggestion.text === "date -I seconds"), false);
|
||||
const afterLong = await getCompletions("date --iso-8601 ", { os: "linux", skipPathCompletion: true, maxResults: 100 });
|
||||
assert.equal(afterLong.some((suggestion) => suggestion.text === "date --iso-8601 seconds"), false);
|
||||
|
||||
const next = await getCompletions("date -I -", { os: "linux", skipPathCompletion: true, maxResults: 100 });
|
||||
assert.ok(next.some((suggestion) => suggestion.text === "date -I --utc"));
|
||||
});
|
||||
|
||||
test("required option arguments retain their existing separated completion", async () => {
|
||||
const suggestions = await getCompletions("date --rfc-3339 s", {
|
||||
os: "linux",
|
||||
skipPathCompletion: true,
|
||||
});
|
||||
assert.ok(suggestions.some((suggestion) => suggestion.text === "date --rfc-3339 seconds"));
|
||||
|
||||
const attached = await getCompletions("date --rfc-3339=s", {
|
||||
os: "linux",
|
||||
skipPathCompletion: true,
|
||||
});
|
||||
assert.equal(attached.some((suggestion) => suggestion.text === "date --rfc-3339=seconds"), false);
|
||||
});
|
||||
|
||||
test("optional arguments without the explicit attached-value marker do not add attached suggestions", async () => {
|
||||
for (const [input, unwanted] of [
|
||||
["ordinary -oj", "ordinary -ojson"],
|
||||
["ordinary --output=j", "ordinary --output=json"],
|
||||
["ordinary -tj", "ordinary -tjson"],
|
||||
["ordinary --type=j", "ordinary --type=json"],
|
||||
["ordinary -qj", "ordinary -qjson"],
|
||||
["ordinary --quality=j", "ordinary --quality=json"],
|
||||
]) {
|
||||
const suggestions = await getCompletions(input, { os: "linux", skipPathCompletion: true });
|
||||
assert.equal(suggestions.some((suggestion) => suggestion.text === unwanted), false, input);
|
||||
}
|
||||
});
|
||||
|
||||
test("an option name takes precedence over an overlapping short-option argument", async () => {
|
||||
const suggestions = await getCompletions("fixture -fa", {
|
||||
os: "linux",
|
||||
skipPathCompletion: true,
|
||||
});
|
||||
assert.ok(suggestions.some((suggestion) => suggestion.text === "fixture -fast"));
|
||||
assert.equal(suggestions.some((suggestion) => suggestion.text === "fixture -fastest"), false);
|
||||
});
|
||||
|
||||
test("date completion uses the selected host OS even after another host loaded a spec", async () => {
|
||||
const linux = await getCompletions("date -", { os: "linux", skipPathCompletion: true, maxResults: 100 });
|
||||
const macos = await getCompletions("date -", { os: "macos", skipPathCompletion: true, maxResults: 100 });
|
||||
|
||||
assert.ok(linux.some((suggestion) => suggestion.text === "date --date"));
|
||||
assert.equal(linux.some((suggestion) => suggestion.text === "date -j"), false);
|
||||
assert.ok(macos.some((suggestion) => suggestion.text === "date -j"));
|
||||
assert.equal(macos.some((suggestion) => suggestion.text === "date --date"), false);
|
||||
assert.ok(loadRequests.some((request) => request.name === "date" && request.os === "linux"));
|
||||
assert.ok(loadRequests.some((request) => request.name === "date" && request.os === "macos"));
|
||||
});
|
||||
|
||||
test("macOS date completes the supported short option without GNU long options", async () => {
|
||||
const short = await getCompletions("date -Is", { os: "macos", skipPathCompletion: true });
|
||||
assert.ok(short.some((suggestion) => suggestion.text === "date -Iseconds"));
|
||||
|
||||
const long = await getCompletions("date --iso-8601=s", { os: "macos", skipPathCompletion: true });
|
||||
assert.equal(long.some((suggestion) => suggestion.text === "date --iso-8601=seconds"), false);
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { COMMON_FIG_SPECS, normalizeCommandName } from "./autocomplete/figSpecLoader";
|
||||
import { COMMON_FIG_SPECS, getAvailableSpecs, hasSpec, loadSpec, normalizeCommandName } from "./autocomplete/figSpecLoader";
|
||||
|
||||
test("preload common specs includes dnf alongside yum and apt", () => {
|
||||
assert.ok(COMMON_FIG_SPECS.includes("apt"));
|
||||
@@ -23,3 +23,66 @@ test("normalizeCommandName strips path and extension", () => {
|
||||
assert.equal(normalizeCommandName("/usr/bin/dnf"), "dnf");
|
||||
assert.equal(normalizeCommandName("DNF"), "dnf");
|
||||
});
|
||||
|
||||
test("caches and deduplicates specs separately for each target OS", async () => {
|
||||
const calls: string[] = [];
|
||||
Object.defineProperty(globalThis, "window", {
|
||||
configurable: true,
|
||||
value: { netcatty: { loadFigSpec: async (name: string, hostOs: string) => {
|
||||
calls.push(`${name}:${hostOs}`);
|
||||
return { name, description: hostOs };
|
||||
} } },
|
||||
});
|
||||
const [linux, linuxAgain, macos] = await Promise.all([
|
||||
loadSpec("platform-cache-fixture", "linux"),
|
||||
loadSpec("platform-cache-fixture", "linux"),
|
||||
loadSpec("platform-cache-fixture", "macos"),
|
||||
]);
|
||||
assert.equal(linux?.description, "linux");
|
||||
assert.equal(linuxAgain, linux);
|
||||
assert.equal(macos?.description, "macos");
|
||||
assert.deepEqual(calls, ["platform-cache-fixture:linux", "platform-cache-fixture:macos"]);
|
||||
assert.equal(await loadSpec("platform-cache-fixture", "macos"), macos);
|
||||
assert.equal(calls.length, 2);
|
||||
});
|
||||
|
||||
test("retries a spec load after the bridge becomes available", async () => {
|
||||
Object.defineProperty(globalThis, "window", { configurable: true, value: {} });
|
||||
assert.equal(await loadSpec("retry-fixture", "linux"), null);
|
||||
Object.defineProperty(globalThis, "window", {
|
||||
configurable: true,
|
||||
value: { netcatty: { loadFigSpec: async (name: string) => ({ name }) } },
|
||||
});
|
||||
assert.equal((await loadSpec("retry-fixture", "linux"))?.name, "retry-fixture");
|
||||
});
|
||||
|
||||
test("available specs are cached and resolved per target OS", async () => {
|
||||
const listCalls: Array<string | undefined> = [];
|
||||
Object.defineProperty(globalThis, "window", {
|
||||
configurable: true,
|
||||
value: { netcatty: {
|
||||
listFigSpecs: async (hostOs?: string) => {
|
||||
listCalls.push(hostOs);
|
||||
return hostOs === "macos" ? ["common-fixture", "mac-only-fixture"] : ["common-fixture"];
|
||||
},
|
||||
loadFigSpec: async (name: string, hostOs?: string) =>
|
||||
(name === "mac-only-fixture" && hostOs === "macos" ? { name } : null),
|
||||
} },
|
||||
});
|
||||
|
||||
assert.deepEqual(await getAvailableSpecs("linux"), ["common-fixture"]);
|
||||
assert.deepEqual(await getAvailableSpecs("linux"), ["common-fixture"]);
|
||||
assert.deepEqual(listCalls, ["linux"], "the Linux list should be fetched once");
|
||||
|
||||
assert.deepEqual(await getAvailableSpecs("macos"), ["common-fixture", "mac-only-fixture"]);
|
||||
assert.deepEqual(listCalls, ["linux", "macos"]);
|
||||
|
||||
assert.equal(await hasSpec("mac-only-fixture", "linux"), false);
|
||||
assert.equal(await hasSpec("mac-only-fixture", "macos"), true);
|
||||
assert.equal(await hasSpec("common-fixture", "linux"), true);
|
||||
|
||||
// A successful macOS load must not advertise the command to Linux.
|
||||
assert.equal((await loadSpec("mac-only-fixture", "macos"))?.name, "mac-only-fixture");
|
||||
assert.equal(await hasSpec("mac-only-fixture", "linux"), false);
|
||||
assert.equal(await loadSpec("mac-only-fixture", "linux"), null);
|
||||
});
|
||||
@@ -4,9 +4,9 @@ This batch closes the 22 general-purpose commands that the translation audit
|
||||
listed with 15 or fewer missing descriptions. The same numeric tier also
|
||||
contains 184 vendor-specific or niche specs (for example `sapphire`, `yomo`,
|
||||
`tangram`, `mailsy`, `streamlit`); those are intentionally left to a later pass
|
||||
because their semantics need per-tool verification. The Fig spec names,
|
||||
arguments and structure stay untouched; only suggestion descriptions are
|
||||
localized for `zh-CN` and generated into `zh-TW`.
|
||||
because their semantics need per-tool verification. Descriptions are localized
|
||||
for `zh-CN` and generated into `zh-TW`; local Fig specs also correct option
|
||||
semantics where the bundled specs do not match the target operating system.
|
||||
|
||||
Scope: `echo`, `which`, `paste`, `pwd`, `clear`, `su`, `crontab`, `env`,
|
||||
`uname`, `base64`, `date`, `id`, `split`, `seq`, `join`, `dig`, `dd`, `htop`,
|
||||
@@ -53,15 +53,20 @@ and were reviewed for wording that stays correct in every owner:
|
||||
| `split` | 9 | suffix length, `-b`, `-d`, `-l`, `-p`, file, prefix |
|
||||
| `seq` | 11 | start/step/last, `-w`, `-s`, `-f`, `-t` |
|
||||
| `join` | 11 | equality join, `-a`, `-e`, `-o`, `-t`, `-v`, file/field |
|
||||
| `dig` | 17 | local spec: record types and output filters |
|
||||
| `dig` | 10 | local spec: record types and output filters |
|
||||
| `dd` | 14 | block sizes, seek/skip, conversions |
|
||||
| `htop` | 14 | delay, filter, highlight, sort, tree, user |
|
||||
| `basename` | 4 | `-a`, `-s`, operand |
|
||||
| `dirname` | 2 | operand |
|
||||
| `readlink` | 11 | local GNU spec: canonicalize, strip, verbose, zero |
|
||||
| `readlink` | 11 | local GNU spec: canonicalize, quiet, verbose, zero; separate macOS spec |
|
||||
| `more` | 11 | `-d`, `-l`, `-f`, `-p`, `-c`, `-s`, `-u`, `-n` |
|
||||
|
||||
The 22 specs currently expose 182 descriptions; the four local GNU specs replaced the bundled option sets, so `date`, `dig`, `readlink` and `base64` counts reflect the new keys.
|
||||
The table counts the descriptions each command reaches with the specs in this
|
||||
change, so later corrections are already reflected there (`dig` no longer
|
||||
carries the removed `TTL` shortcut, for example). Totals: 175 reachable
|
||||
descriptions on Linux; platform variants add descriptions beyond these numbers.
|
||||
The local `date`, `dig`, `readlink` and `base64` specs replace bundled option
|
||||
sets on Linux, while `htop` corrects the `-H` delay unit.
|
||||
|
||||
All 22 commands are added to `COVERED_COMMANDS` and `COMMON_FIG_SPECS`. They are
|
||||
small, general-purpose utilities, so preloading them costs little and removes the
|
||||
@@ -77,24 +82,29 @@ on-demand spec load for the most common shell sessions.
|
||||
^L (form feed)” and `-f` to “Count logical lines, rather than screen lines”.
|
||||
This matches GNU `more`; the translations follow the option each description
|
||||
belongs to, not the numeric order of the list.
|
||||
- **date**: replaced by a local GNU spec (`electron/specs/date.js`). The bundled
|
||||
Fig spec exposed BSD/macOS flags (`-d` DST, `-f` input format, `-j` dry run,
|
||||
`-n`, `-R`, `-r` epoch seconds, `-t` minutes west of GMT, `-v` adjust) that
|
||||
Linux hosts do not have. The local spec describes `-d/--date`, `--debug`,
|
||||
`-f/--file`, `-I/--iso-8601`, `-R/--rfc-email`, `--rfc-3339`, `-r/--reference`,
|
||||
`-s/--set` and `-u/--utc` instead, and the 13 BSD-only entries were removed
|
||||
after a repository-wide scan showed no other spec used them.
|
||||
- **date**: Linux uses the local GNU spec (`electron/specs/date.js`), with
|
||||
`-d/--date`, `--debug`, `-f/--file`, `-I/--iso-8601`, `-R/--rfc-email`,
|
||||
`--rfc-3339`, `-r/--reference`, `-s/--set` and `-u/--utc`. macOS uses
|
||||
`electron/specs/macos/date.js` for its BSD arguments, including `-f` input
|
||||
format, `-j`, `-r` file or epoch seconds, `-v` adjustment and `-z` output
|
||||
timezone. File suggestions for `-r` also appear for numeric prefixes so that
|
||||
filenames beginning with digits remain discoverable. The bundled macOS
|
||||
spec's obsolete `-d` and `-t` switches are omitted from the local one. If the
|
||||
native spec is ever missing, the loader falls back to the bundled spec and its
|
||||
descriptions keep the older BSD meanings they quote.
|
||||
- **su**: the four descriptions no longer hardcode BSD-only environment claims.
|
||||
`-l` says it switches to the target home and rebuilds the login environment as
|
||||
the implementation and PAM decide, `-m` keeps the current environment without
|
||||
a directory change, and `-f` prevents a csh/tcsh login shell from reading
|
||||
`.cshrc`.
|
||||
the implementation and PAM decide. With `-m`, BSD selects the caller's
|
||||
login shell, while util-linux normally consults `SHELL`; explicit shell and
|
||||
restricted-shell rules affect the latter. `-f` prevents a csh/tcsh login
|
||||
shell from reading `.cshrc`.
|
||||
- **env**: `-P` searches an alternate directory list instead of `PATH`, `-S`
|
||||
splits a string into arguments, and the trailing “Utility to run” describes
|
||||
the command operand. These are three separate keys and are not conflated.
|
||||
- **readlink**: the bundled spec reuses `stat` wording for the command root and
|
||||
`-f` (“printf”, “struct stat”). `electron/specs/readlink.js` replaces it with
|
||||
the GNU options (`-f/-e/-m/-n/-s/-v/-z`) and a plain path operand.
|
||||
`-f` (“printf”, “struct stat”). `electron/specs/readlink.js` supplies the GNU
|
||||
options (`-f/-e/-m/-n/-q/-s/-v/-z`), while the macOS variant supplies its
|
||||
native `-f` and `-n`. `-s/--silent` suppresses errors; there is no `--strip`.
|
||||
- **paste**: `-d` replaces newlines with characters drawn circularly from the
|
||||
list; the translation keeps the “wrap around the list” behavior explicit.
|
||||
- **split**: `-p` starts a new output file on each matching extended regular
|
||||
@@ -111,8 +121,8 @@ command in this batch that the reference covers (21 of 22; `readlink` is absent)
|
||||
That review changed four entries, confirmed the rest, and produced the GNU
|
||||
`date` spec described in the semantic notes.
|
||||
|
||||
Local specs now cover five commands whose bundled Fig data was wrong or macOS-only. Local specs win over `@withfig/autocomplete` at runtime, so Linux hosts
|
||||
see options that actually exist there:
|
||||
Local specs cover five commands whose bundled Fig data was wrong or macOS-only.
|
||||
Linux hosts load the following local versions:
|
||||
|
||||
| Command | Local spec | Bundled spec problem |
|
||||
| --- | --- | --- |
|
||||
@@ -122,15 +132,21 @@ see options that actually exist there:
|
||||
| `base64` | `electron/specs/base64.js` | BSD `-b`/`-i`/`-o`; GNU uses `-w`, and `-i` means ignore garbage while decoding |
|
||||
| `htop` | `electron/specs/htop.js` | `-H` delay described as tenths of a second; htop stores seconds |
|
||||
|
||||
macOS sessions therefore see the GNU option set for these four commands. That is
|
||||
a deliberate Linux-first trade-off, not an oversight.
|
||||
For macOS sessions, the loader uses separate native `date` and `readlink`
|
||||
specs and the bundled BSD `base64` spec. If the native `date` spec is missing,
|
||||
the loader falls back to the bundled BSD `date` spec, whose descriptions retain
|
||||
translations matching their English keys. `dig` and `htop` use their common
|
||||
local specs. The renderer passes the target session's OS over the Fig bridge,
|
||||
and loaded/in-flight spec caches, the available-spec list and the loaded-name
|
||||
index are all scoped by command and OS. For macOS the bridge's spec list merges
|
||||
`specs/` with `specs/macos/`; other sessions see only `specs/`, so a
|
||||
macOS-only command is never suggested where it cannot load.
|
||||
|
||||
The remaining specs in this batch still expose options that do not exist in GNU
|
||||
tools. Those descriptions describe the option each spec actually inserts, so
|
||||
they are **not** rewritten into GNU wording — doing so would label an item with
|
||||
behavior it does not have on the host being connected to:
|
||||
The remaining specs include options or meanings that depend on the platform.
|
||||
The table records examples from the bundled BSD-oriented specs; some flags also
|
||||
exist in GNU or util-linux tools but have different semantics:
|
||||
|
||||
| Command | Spec-only (BSD/macOS) options |
|
||||
| Command | Platform-dependent options |
|
||||
| --- | --- |
|
||||
| `su` | `-f`, `-l`, `-m`, `-` |
|
||||
| `id` | `-A`, `-F`, `-M`, `-P` |
|
||||
@@ -142,17 +158,17 @@ behavior it does not have on the host being connected to:
|
||||
|
||||
`su` is a special case: its spec is close to util-linux, but the wording no
|
||||
longer hardcodes `PATH=/bin:/usr/bin` or a fixed variable list, because Linux
|
||||
`su -l` setup depends on the implementation and PAM configuration. The `-l`,
|
||||
`-m` and `-f` descriptions now state the behavior without platform-specific
|
||||
environment claims.
|
||||
`su -l` setup depends on the implementation and PAM configuration. The `-m`
|
||||
description calls out the BSD and util-linux shell-selection difference; the
|
||||
`-l` and `-f` descriptions avoid fixed environment claims.
|
||||
|
||||
`dd` also carries an upstream artifact: an operand named `files` with “Copy this
|
||||
many files before terminating”, which real `dd` does not have; the literal
|
||||
translation is kept and flagged here instead of inventing behavior.
|
||||
|
||||
Making the remaining commands platform-correct needs per-OS spec selection (the
|
||||
loader currently resolves one spec per command name and ignores `hostOs`), which
|
||||
is a code change rather than a translation change.
|
||||
The loader now supports per-OS spec selection. The remaining commands listed
|
||||
above still use their existing shared specs and need separate review before
|
||||
adding platform-specific overrides.
|
||||
|
||||
## Review fixes (2026-11-08)
|
||||
|
||||
@@ -170,11 +186,11 @@ visible in the completion menu. Every item below was applied:
|
||||
| `join -o` | No longer limited to matched lines; `-o` also formats unpaired output from `-a`/`-v` |
|
||||
| `basename -a` | 支持多个路径名,将每个参数作为路径名处理 |
|
||||
| `env -0` | 每条环境变量记录以 NUL 而非换行符结束 |
|
||||
| `dig` answer filter | Describes hiding comments, question, authority, additional and statistics instead of “query only the answer section” |
|
||||
| `dig ANY` | 发起 ANY 查询;响应可能不完整(RFC 8482) |
|
||||
| `dig TTL` | Removed with the local spec; TTL is a record field, not a record type |
|
||||
| `dig` answer filter | The zh-CN value describes hiding comments, question, authority, additional and statistics; the English key stays unchanged because `dog` shares it |
|
||||
| `dig ANY` | The shared `Query ALL DNS Records` key stays; the zh-CN value carries the RFC 8482 caveat |
|
||||
| `dig TTL` | Removed from the `dig` spec; the dictionary key stays because `dog` still offers TTL |
|
||||
| `readlink -f` | Fixed by the local spec; no longer shows `printf`/`struct stat` wording |
|
||||
| `base64 -i` | Fixed by the GNU local spec (`--ignore-garbage`), documented above |
|
||||
| `base64 -i` | GNU uses `--ignore-garbage`; macOS takes an input file and uses the bundled BSD spec |
|
||||
| `su -l` / `-m` / `-f` | Removed hardcoded environment claims; see the platform note |
|
||||
| `seq` root | 默认按 1 递增;BSD/macOS 在起始值大于结束值时按 -1 递减 |
|
||||
| `uname` root | 显示系统信息(无选项时输出内核名称) |
|
||||
@@ -185,6 +201,12 @@ post-conversion table in the generator (not by hand-editing `zh-TW`):
|
||||
`欄位連線`→`欄位聯結`, `二進位制資料`→`二進位資料`, `后綴`→`字尾`,
|
||||
`執行檔例項`→`執行檔`, `屏幕`→`螢幕`, `文本`→`文字`.
|
||||
|
||||
Shared keys: `dig` keeps `A`, `MX`, `CNAME`, `TXT`, `SOA`, `ANY +noall +answer`
|
||||
and the section-filter descriptions byte-identical to the bundled spec because
|
||||
`dog` reuses them, so their corrections live in the zh-CN values. `NS` is the
|
||||
one dig-specific key (`Query NS records (authoritative name servers)`), and
|
||||
`Query TTL Record` remains in the dictionary for `dog` only.
|
||||
|
||||
## Adopted entries (excerpt)
|
||||
|
||||
| Command | English | zh-CN |
|
||||
|
||||
@@ -1,11 +1,37 @@
|
||||
const test = require("node:test");
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
const { pathToFileURL } = require("node:url");
|
||||
const { getTempFilePath } = require("./tempDirBridge.cjs");
|
||||
|
||||
const {
|
||||
filterExcludedFigSpecs,
|
||||
isExcludedFigSpec,
|
||||
loadFigSpec,
|
||||
registerFigSpecHandlers,
|
||||
} = require("../main/registerBridges.cjs");
|
||||
|
||||
function createSpecFixture(t) {
|
||||
const root = fs.mkdtempSync(`${getTempFilePath("fig-spec-test")}-`);
|
||||
t.after(() => fs.rmSync(root, { recursive: true, force: true }));
|
||||
const electronDir = path.join(root, "electron");
|
||||
const specDir = path.join(electronDir, "specs");
|
||||
const macSpecDir = path.join(specDir, "macos");
|
||||
fs.mkdirSync(macSpecDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(root, "package.json"), JSON.stringify({ type: "module" }));
|
||||
return { electronDir, specDir, macSpecDir };
|
||||
}
|
||||
|
||||
function createFigHandlers(electronDir) {
|
||||
const handlers = new Map();
|
||||
registerFigSpecHandlers({ handle: (name, handler) => handlers.set(name, handler) }, electronDir);
|
||||
return {
|
||||
list: (os) => handlers.get("netcatty:figspec:list")(null, os),
|
||||
load: (name, os) => handlers.get("netcatty:figspec:load")(null, name, os),
|
||||
};
|
||||
}
|
||||
|
||||
test("filters cloud fig specs removed from packaged builds", () => {
|
||||
assert.equal(isExcludedFigSpec("aws"), true);
|
||||
assert.equal(isExcludedFigSpec("aws/s3"), true);
|
||||
@@ -20,3 +46,157 @@ test("filters cloud fig specs removed from packaged builds", () => {
|
||||
["git", "aws-vault"],
|
||||
);
|
||||
});
|
||||
|
||||
test("selects GNU or native macOS specifications for the target session", async () => {
|
||||
const electronDir = path.resolve(__dirname, "..");
|
||||
const option = (spec, flag) => spec.options.find(({ name }) =>
|
||||
(Array.isArray(name) ? name : [name]).includes(flag));
|
||||
|
||||
const [linuxDate, macDate, linuxBase64, macBase64, linuxReadlink, macReadlink] = await Promise.all([
|
||||
loadFigSpec(electronDir, "date", "linux"),
|
||||
loadFigSpec(electronDir, "date", "macos"),
|
||||
loadFigSpec(electronDir, "base64", "linux"),
|
||||
loadFigSpec(electronDir, "base64", "macos"),
|
||||
loadFigSpec(electronDir, "readlink", "linux"),
|
||||
loadFigSpec(electronDir, "readlink", "macos"),
|
||||
]);
|
||||
|
||||
assert.ok(option(linuxDate, "--date"));
|
||||
assert.equal(option(linuxDate, "-j"), undefined);
|
||||
assert.ok(option(macDate, "-j"));
|
||||
assert.ok(option(macDate, "-v"));
|
||||
assert.equal(option(macDate, "-d"), undefined);
|
||||
assert.equal(option(macDate, "--date"), undefined);
|
||||
assert.equal(option(macDate, "-r").args.template, "filepaths");
|
||||
assert.equal(option(linuxBase64, "-i").args, undefined);
|
||||
assert.equal(option(macBase64, "-i").args.template, "filepaths");
|
||||
assert.ok(option(macBase64, "-o"));
|
||||
assert.ok(option(linuxReadlink, "--silent"));
|
||||
assert.equal(option(macReadlink, "--silent"), undefined);
|
||||
assert.equal(option(macReadlink, "-f").args, undefined);
|
||||
assert.equal(macReadlink.args.template, "filepaths");
|
||||
});
|
||||
|
||||
test("rejects excluded and invalid specification names", async () => {
|
||||
const electronDir = path.resolve(__dirname, "..");
|
||||
for (const name of ["../date", "/date", "aws/s3", "gcloud", 42]) {
|
||||
assert.equal(await loadFigSpec(electronDir, name, "macos"), null);
|
||||
}
|
||||
});
|
||||
|
||||
test("IPC list discovers platform-only specs through renderer hasSpec", async (t) => {
|
||||
const { electronDir, specDir, macSpecDir } = createSpecFixture(t);
|
||||
const writeSpec = (dir, name) => fs.writeFileSync(
|
||||
path.join(dir, `${name}.js`),
|
||||
`export default { name: ${JSON.stringify(name)}, options: [] };`,
|
||||
);
|
||||
writeSpec(specDir, "fixture-root-only");
|
||||
writeSpec(macSpecDir, "fixture-macos-only");
|
||||
writeSpec(specDir, "fixture-both");
|
||||
writeSpec(macSpecDir, "fixture-both");
|
||||
writeSpec(specDir, "date");
|
||||
writeSpec(macSpecDir, "date");
|
||||
writeSpec(specDir, "aws");
|
||||
writeSpec(macSpecDir, "gcloud");
|
||||
writeSpec(macSpecDir, "az");
|
||||
fs.mkdirSync(path.join(specDir, "fixture-directory.js"));
|
||||
fs.mkdirSync(path.join(macSpecDir, "fixture-macos-directory.js"));
|
||||
|
||||
const handlers = createFigHandlers(electronDir);
|
||||
const list = await handlers.list("macos");
|
||||
assert.ok(list.includes("fixture-root-only"));
|
||||
assert.ok(list.includes("fixture-macos-only"));
|
||||
assert.equal(list.filter((name) => name === "fixture-both").length, 1);
|
||||
assert.equal(list.filter((name) => name === "date").length, 1);
|
||||
for (const name of ["aws", "gcloud", "az", "fixture-directory", "fixture-macos-directory"]) {
|
||||
assert.equal(list.includes(name), false, name);
|
||||
}
|
||||
|
||||
// A platform-only command must never be suggested to another session.
|
||||
const linuxList = await handlers.list("linux");
|
||||
assert.ok(linuxList.includes("fixture-root-only"));
|
||||
assert.ok(linuxList.includes("fixture-both"));
|
||||
assert.equal(linuxList.includes("fixture-macos-only"), false);
|
||||
const unspecifiedList = await handlers.list();
|
||||
assert.equal(unspecifiedList.includes("fixture-macos-only"), false);
|
||||
|
||||
const previousWindow = Object.getOwnPropertyDescriptor(globalThis, "window");
|
||||
t.after(() => {
|
||||
if (previousWindow) Object.defineProperty(globalThis, "window", previousWindow);
|
||||
else delete globalThis.window;
|
||||
});
|
||||
Object.defineProperty(globalThis, "window", {
|
||||
configurable: true,
|
||||
value: { netcatty: { listFigSpecs: handlers.list, loadFigSpec: handlers.load } },
|
||||
});
|
||||
const rendererModule = path.resolve(__dirname, "../../components/terminal/autocomplete/figSpecLoader.ts");
|
||||
const { hasSpec, loadSpec } = await import(pathToFileURL(rendererModule).href);
|
||||
assert.equal(await hasSpec("fixture-macos-only", "macos"), true);
|
||||
assert.equal(await hasSpec("fixture-macos-only", "linux"), false);
|
||||
assert.equal(await hasSpec("fixture-root-only", "linux"), true);
|
||||
assert.equal(await loadSpec("fixture-macos-only", "linux"), null);
|
||||
assert.equal((await loadSpec("fixture-macos-only", "macos"))?.name, "fixture-macos-only");
|
||||
// Loading for macOS must not make the command available to Linux.
|
||||
assert.equal(await hasSpec("fixture-macos-only", "linux"), false);
|
||||
});
|
||||
|
||||
test("spec listing keeps symlinked files but ignores directories and dangling links", async (t) => {
|
||||
const { electronDir, specDir, macSpecDir } = createSpecFixture(t);
|
||||
fs.writeFileSync(path.join(specDir, "fixture-target.js"), 'export default {name: "fixture-target"};');
|
||||
fs.mkdirSync(path.join(specDir, "fixture-directory"));
|
||||
try {
|
||||
fs.symlinkSync(path.join(specDir, "fixture-target.js"), path.join(macSpecDir, "fixture-link.js"), "file");
|
||||
fs.symlinkSync(path.join(specDir, "fixture-directory"), path.join(macSpecDir, "fixture-dir-link.js"), "dir");
|
||||
fs.symlinkSync(path.join(specDir, "not-present.js"), path.join(macSpecDir, "fixture-dangling.js"), "file");
|
||||
} catch (error) {
|
||||
if (["EPERM", "EACCES", "ENOSYS"].includes(error.code)) return t.skip("symbolic links are unavailable");
|
||||
throw error;
|
||||
}
|
||||
const names = await createFigHandlers(electronDir).list("macos");
|
||||
assert.ok(names.includes("fixture-link"));
|
||||
assert.equal(names.includes("fixture-dir-link"), false);
|
||||
assert.equal(names.includes("fixture-dangling"), false);
|
||||
});
|
||||
|
||||
test("each local specification directory can fail independently", async (t) => {
|
||||
const { electronDir, specDir, macSpecDir } = createSpecFixture(t);
|
||||
fs.writeFileSync(path.join(specDir, "fixture-root-only.js"), 'export default {name: "fixture-root-only"};');
|
||||
const handlers = createFigHandlers(electronDir);
|
||||
fs.rmSync(macSpecDir, { recursive: true });
|
||||
assert.ok((await handlers.list("macos")).includes("fixture-root-only"));
|
||||
|
||||
fs.mkdirSync(macSpecDir);
|
||||
fs.writeFileSync(path.join(macSpecDir, "fixture-macos-only.js"), 'export default {name: "fixture-macos-only"};');
|
||||
const originalReaddir = fs.readdirSync;
|
||||
t.mock.method(fs, "readdirSync", (dir, ...args) => {
|
||||
if (dir === specDir) {
|
||||
const error = new Error("fixture root is unreadable");
|
||||
error.code = "EACCES";
|
||||
throw error;
|
||||
}
|
||||
return originalReaddir(dir, ...args);
|
||||
});
|
||||
const list = await handlers.list("macos");
|
||||
assert.ok(list.includes("fixture-macos-only"));
|
||||
assert.equal(list.includes("fixture-root-only"), false);
|
||||
});
|
||||
|
||||
test("missing specs return null while broken spec modules stay visible", async (t) => {
|
||||
const { electronDir, specDir } = createSpecFixture(t);
|
||||
fs.writeFileSync(path.join(specDir, "missing-import.js"), 'export { default } from "./absent-dependency.js";');
|
||||
fs.writeFileSync(path.join(specDir, "syntax-error.js"), "export default {");
|
||||
|
||||
assert.equal(await loadFigSpec(electronDir, "not-present", "linux"), null);
|
||||
assert.equal(await loadFigSpec(electronDir, "not-present", "macos"), null);
|
||||
await assert.rejects(loadFigSpec(electronDir, "missing-import", "linux"), { code: "ERR_MODULE_NOT_FOUND" });
|
||||
await assert.rejects(loadFigSpec(electronDir, "syntax-error", "linux"), SyntaxError);
|
||||
|
||||
const handlers = createFigHandlers(electronDir);
|
||||
const warn = t.mock.method(console, "warn", () => {});
|
||||
assert.equal(await handlers.load("not-present", "linux"), null);
|
||||
assert.equal(warn.mock.calls.length, 0);
|
||||
// The bridge resolves broken modules to null so invoke never rejects.
|
||||
assert.equal(await handlers.load("missing-import", "linux"), null);
|
||||
assert.equal(await handlers.load("syntax-error", "linux"), null);
|
||||
assert.equal(warn.mock.calls.length, 2);
|
||||
});
|
||||
@@ -0,0 +1,122 @@
|
||||
const test = require("node:test");
|
||||
const assert = require("node:assert/strict");
|
||||
const path = require("node:path");
|
||||
const { pathToFileURL } = require("node:url");
|
||||
const { loadFigSpec } = require("../main/registerBridges.cjs");
|
||||
|
||||
const repoRoot = path.resolve(__dirname, "../..");
|
||||
const specNames = ["base64", "date", "readlink"];
|
||||
|
||||
Object.defineProperty(globalThis, "localStorage", {
|
||||
value: { getItem: () => null, setItem: () => {}, removeItem: () => {}, clear: () => {} },
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(globalThis, "window", {
|
||||
value: {
|
||||
netcatty: {
|
||||
listFigSpecs: async () => specNames,
|
||||
loadFigSpec: async (name, hostOs) => loadFigSpec(path.join(repoRoot, "electron"), name, hostOs),
|
||||
listAutocompleteLocalDir: async (_dir, foldersOnly, prefix = "") => ({
|
||||
success: true,
|
||||
entries: [
|
||||
{ name: "sample.txt", type: "file" },
|
||||
{ name: "2024-report.txt", type: "file" },
|
||||
].filter((entry) => !foldersOnly && entry.name.startsWith(prefix)),
|
||||
}),
|
||||
listAutocompleteRemoteDir: async (_sessionId, _dir, foldersOnly, prefix = "") => ({
|
||||
success: true,
|
||||
entries: [
|
||||
{ name: "sample.txt", type: "file" },
|
||||
{ name: "2024-report.txt", type: "file" },
|
||||
].filter((entry) => !foldersOnly && entry.name.startsWith(prefix)),
|
||||
}),
|
||||
},
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
const enginePromise = import(pathToFileURL(
|
||||
path.join(repoRoot, "components/terminal/autocomplete/completionEngine.ts"),
|
||||
).href);
|
||||
|
||||
const completionOptions = {
|
||||
os: "linux",
|
||||
protocol: "local",
|
||||
cwd: "/repo",
|
||||
maxResults: 100,
|
||||
pathBudgetMs: Infinity,
|
||||
};
|
||||
|
||||
test("GNU readlink offers supported quiet and verbose options with their real meanings", async () => {
|
||||
const { getCompletions } = await enginePromise;
|
||||
const options = await getCompletions("readlink -", completionOptions);
|
||||
for (const name of ["-q", "--quiet", "-s", "--silent"]) {
|
||||
const option = options.find((item) => item.source === "option" && item.displayText === name);
|
||||
assert.equal(option?.text, `readlink ${name}`);
|
||||
assert.equal(option?.description, "Suppress most error messages");
|
||||
}
|
||||
for (const name of ["-v", "--verbose"]) {
|
||||
const option = options.find((item) => item.source === "option" && item.displayText === name);
|
||||
assert.equal(option?.text, `readlink ${name}`);
|
||||
assert.equal(option?.description, "Report error messages");
|
||||
}
|
||||
assert.equal(options.some((item) => item.displayText === "--strip"), false);
|
||||
|
||||
const silent = await getCompletions("readlink --s", completionOptions);
|
||||
assert.equal(silent.some((item) => item.text === "readlink --silent"), true);
|
||||
assert.equal(silent.some((item) => item.text === "readlink --strip"), false);
|
||||
});
|
||||
|
||||
test("GNU base64 and date file arguments complete plain relative paths", async () => {
|
||||
const { getCompletions } = await enginePromise;
|
||||
for (const input of [
|
||||
"base64 sam",
|
||||
"base64 -d sam",
|
||||
"date -f sam",
|
||||
"date --file sam",
|
||||
"date -r sam",
|
||||
"date --reference sam",
|
||||
]) {
|
||||
const options = await getCompletions(input, completionOptions);
|
||||
assert.ok(
|
||||
options.some((item) => item.source === "path" && item.text === input.replace(/sam$/, "sample.txt")),
|
||||
`expected a file path suggestion for ${input}`,
|
||||
);
|
||||
}
|
||||
|
||||
const dateString = await getCompletions("date --date sam", completionOptions);
|
||||
assert.equal(dateString.some((item) => item.source === "path"), false);
|
||||
});
|
||||
|
||||
test("real loader keeps Linux and macOS completions isolated in one renderer", async () => {
|
||||
const { getCompletions } = await enginePromise;
|
||||
const linux = await getCompletions("date -", completionOptions);
|
||||
const macosOptions = { ...completionOptions, os: "macos" };
|
||||
const macos = await getCompletions("date -", macosOptions);
|
||||
assert.ok(linux.some((item) => item.text === "date --date"));
|
||||
assert.ok(macos.some((item) => item.text === "date -j"));
|
||||
assert.equal(macos.some((item) => item.text === "date --date" || item.text === "date -d"), false);
|
||||
|
||||
const macBase64 = await getCompletions("base64 -i sam", macosOptions);
|
||||
assert.ok(macBase64.some((item) => item.source === "path" && item.text === "base64 -i sample.txt"));
|
||||
const macInputFormat = await getCompletions("date -f sam", macosOptions);
|
||||
assert.equal(macInputFormat.some((item) => item.source === "path"), false);
|
||||
const macReference = await getCompletions("date -r sam", macosOptions);
|
||||
assert.ok(macReference.some((item) => item.source === "path" && item.text === "date -r sample.txt"));
|
||||
const macNumericPrefix = await getCompletions("date -r 2024", macosOptions);
|
||||
assert.ok(macNumericPrefix.some((item) => item.source === "path" && item.text === "date -r 2024-report.txt"));
|
||||
const macReadlink = await getCompletions("readlink -", macosOptions);
|
||||
assert.ok(macReadlink.some((item) => item.text === "readlink -f"));
|
||||
assert.equal(macReadlink.some((item) => item.text === "readlink --silent"), false);
|
||||
|
||||
for (const [input, os] of [["base64 -i sam", "macos"], ["date --reference sam", "linux"]]) {
|
||||
const remote = await getCompletions(input, {
|
||||
...completionOptions,
|
||||
os,
|
||||
protocol: "ssh",
|
||||
sessionId: `${os}-fixture`,
|
||||
cwd: "/remote",
|
||||
});
|
||||
assert.ok(remote.some((item) => item.source === "path" && item.text === input.replace(/sam$/, "sample.txt")));
|
||||
}
|
||||
});
|
||||
@@ -20,6 +20,85 @@ function filterExcludedFigSpecs(specNames) {
|
||||
return specNames.filter((name) => !isExcludedFigSpec(name));
|
||||
}
|
||||
|
||||
// The bundled specs for these commands describe the native BSD tools. Their
|
||||
// root-level local overrides describe GNU tools, so they must not replace the
|
||||
// bundled versions in macOS sessions.
|
||||
const macBundledFigSpecs = new Set(["base64", "date"]);
|
||||
|
||||
async function loadFigSpec(electronDir, commandName, hostOs) {
|
||||
// The renderer supplies command names; never allow them to escape the specs
|
||||
// directory or resolve to excluded packages.
|
||||
if (typeof commandName !== "string" || !commandName || commandName.startsWith("/") ||
|
||||
commandName.startsWith("\\") || commandName.includes("..") ||
|
||||
!/^[@a-zA-Z0-9._/+-]+$/.test(commandName) || isExcludedFigSpec(commandName)) return null;
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { pathToFileURL } = require("url");
|
||||
const specDir = path.join(electronDir, "specs");
|
||||
const platformSpec = hostOs === "macos" ? path.join(specDir, "macos", `${commandName}.js`) : null;
|
||||
const localSpec = path.join(specDir, `${commandName}.js`);
|
||||
const bundledSpec = path.join(electronDir, "..", "node_modules", "@withfig", "autocomplete", "build", `${commandName}.js`);
|
||||
const specFile = platformSpec && fs.existsSync(platformSpec)
|
||||
? platformSpec
|
||||
: !(hostOs === "macos" && macBundledFigSpecs.has(commandName)) && fs.existsSync(localSpec)
|
||||
? localSpec
|
||||
: bundledSpec;
|
||||
if (!fs.existsSync(specFile)) return null;
|
||||
const mod = await import(pathToFileURL(specFile).href);
|
||||
const spec = mod.default?.default ?? mod.default ?? null;
|
||||
// IPC requires serializable data — JSON round-trip strips functions/symbols.
|
||||
return spec ? JSON.parse(JSON.stringify(spec)) : null;
|
||||
}
|
||||
|
||||
async function listFigSpecs(electronDir, hostOs) {
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const mod = await import("@withfig/autocomplete");
|
||||
const figSpecs = mod.default || [];
|
||||
const specDir = path.join(electronDir, "specs");
|
||||
const localNames = [];
|
||||
// A macOS-only command must not appear in another session's command list:
|
||||
// it would be suggested, then always load as null.
|
||||
const dirs = hostOs === "macos" ? [specDir, path.join(specDir, "macos")] : [specDir];
|
||||
|
||||
// Every directory is optional and must be read independently.
|
||||
for (const dir of dirs) {
|
||||
try {
|
||||
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
||||
if (!entry.name.endsWith(".js")) continue;
|
||||
let isFile = entry.isFile();
|
||||
if (entry.isSymbolicLink()) {
|
||||
try { isFile = fs.statSync(path.join(dir, entry.name)).isFile(); } catch { /* dangling or inaccessible */ }
|
||||
}
|
||||
if (isFile) localNames.push(entry.name.slice(0, -3));
|
||||
}
|
||||
} catch { /* optional specs directory is unavailable */ }
|
||||
}
|
||||
return filterExcludedFigSpecs([...new Set([...figSpecs, ...localNames])]);
|
||||
}
|
||||
|
||||
function registerFigSpecHandlers(ipcMain, electronDir) {
|
||||
ipcMain.handle("netcatty:figspec:list", async (_event, hostOs) => {
|
||||
try {
|
||||
return await listFigSpecs(electronDir, hostOs);
|
||||
} catch (err) {
|
||||
console.warn("[Main] Failed to load fig spec list:", err?.message || err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
ipcMain.handle("netcatty:figspec:load", async (_event, commandName, hostOs) => {
|
||||
try {
|
||||
return await loadFigSpec(electronDir, commandName, hostOs);
|
||||
} catch (err) {
|
||||
// A broken spec module must not reject the renderer's invoke; completion
|
||||
// degrades to "no suggestions" while the main log keeps the cause.
|
||||
console.warn("[Main] Failed to load fig spec:", commandName, err?.message);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function waitForApplicationSpawn(child, requireCleanLauncherExit = false) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const onSpawn = () => {
|
||||
@@ -635,57 +714,8 @@ function createBridgeRegistrar(context) {
|
||||
}
|
||||
});
|
||||
|
||||
// Fig autocomplete spec loader — uses dynamic import() since @withfig/autocomplete is ESM
|
||||
ipcMain.handle("netcatty:figspec:list", async () => {
|
||||
try {
|
||||
const fs = require("fs");
|
||||
const mod = await import("@withfig/autocomplete");
|
||||
const figSpecs = mod.default || [];
|
||||
// Merge local specs (covers commands missing from @withfig/autocomplete)
|
||||
const localSpecDir = path.join(electronDir, "specs");
|
||||
let localNames = [];
|
||||
try {
|
||||
localNames = fs.readdirSync(localSpecDir)
|
||||
.filter(f => f.endsWith(".js"))
|
||||
.map(f => f.slice(0, -3));
|
||||
} catch { /* no local specs dir */ }
|
||||
const merged = filterExcludedFigSpecs([...new Set([...figSpecs, ...localNames])]);
|
||||
return merged;
|
||||
} catch (err) {
|
||||
console.warn("[Main] Failed to load fig spec list:", err?.message || err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
ipcMain.handle("netcatty:figspec:load", async (_event, commandName) => {
|
||||
try {
|
||||
// Sanitize: reject absolute paths, path traversal, and non-spec characters
|
||||
if (!commandName || commandName.startsWith("/") || commandName.startsWith("\\") ||
|
||||
commandName.includes("..") || !/^[@a-zA-Z0-9._/+-]+$/.test(commandName)) return null;
|
||||
if (isExcludedFigSpec(commandName)) return null;
|
||||
const { pathToFileURL } = require("url");
|
||||
const fs = require("fs");
|
||||
|
||||
// Try local specs first (covers commands missing from @withfig/autocomplete)
|
||||
const localSpec = path.join(electronDir, "specs", `${commandName}.js`);
|
||||
if (fs.existsSync(localSpec)) {
|
||||
const mod = await import(pathToFileURL(localSpec).href);
|
||||
const spec = mod.default?.default ?? mod.default ?? null;
|
||||
return spec ? JSON.parse(JSON.stringify(spec)) : null;
|
||||
}
|
||||
|
||||
// Fall back to @withfig/autocomplete
|
||||
// Can't use `import("@withfig/autocomplete/build/...")` because the package's
|
||||
// "exports" field restricts allowed import paths. Use file URL to bypass.
|
||||
const specFile = path.join(electronDir, "..", "node_modules", "@withfig", "autocomplete", "build", `${commandName}.js`);
|
||||
const mod = await import(pathToFileURL(specFile).href);
|
||||
const spec = mod.default?.default ?? mod.default ?? null;
|
||||
// IPC requires serializable data — JSON round-trip strips functions/symbols
|
||||
return spec ? JSON.parse(JSON.stringify(spec)) : null;
|
||||
} catch (err) {
|
||||
console.warn("[Main] Failed to load fig spec:", commandName, err?.message);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
// Fig specifications are shared by every terminal session.
|
||||
registerFigSpecHandlers(ipcMain, electronDir);
|
||||
|
||||
// Local directory listing for autocomplete (local terminal sessions)
|
||||
ipcMain.handle("netcatty:local:listdir", async (_event, payload) => {
|
||||
@@ -1355,5 +1385,7 @@ module.exports = {
|
||||
createBridgeRegistrar,
|
||||
filterExcludedFigSpecs,
|
||||
isExcludedFigSpec,
|
||||
loadFigSpec,
|
||||
registerFigSpecHandlers,
|
||||
_waitForApplicationSpawnForTests: waitForApplicationSpawn,
|
||||
};
|
||||
@@ -945,8 +945,8 @@ const api = createPreloadApi({
|
||||
|
||||
// Fig autocomplete spec loading via main process
|
||||
const figSpecApi = {
|
||||
listFigSpecs: () => ipcRenderer.invoke("netcatty:figspec:list"),
|
||||
loadFigSpec: (commandName) => ipcRenderer.invoke("netcatty:figspec:load", commandName),
|
||||
listFigSpecs: (hostOs) => ipcRenderer.invoke("netcatty:figspec:list", hostOs),
|
||||
loadFigSpec: (commandName, hostOs) => ipcRenderer.invoke("netcatty:figspec:load", commandName, hostOs),
|
||||
listAutocompleteRemoteDir: (sessionId, dirPath, foldersOnly, filterPrefix, limit) => ipcRenderer.invoke("netcatty:ssh:listdir", {
|
||||
sessionId,
|
||||
path: dirPath,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// base64 spec — GNU coreutils. The bundled Fig spec follows BSD flags
|
||||
// base64 spec - GNU coreutils. The bundled Fig spec follows BSD flags
|
||||
// (-b line length, -i input file, -o output file); GNU uses -w, -i for
|
||||
// ignoring invalid bytes while decoding, and positional files.
|
||||
const completionSpec = {
|
||||
@@ -18,7 +18,7 @@ const completionSpec = {
|
||||
{ name: "--help", description: "Display help text" },
|
||||
{ name: "--version", description: "Display version information" },
|
||||
],
|
||||
args: { name: "file", description: "File to read; standard input when omitted or '-'", isOptional: true, isVariadic: true },
|
||||
args: { name: "file", description: "File to read; standard input when omitted or '-'", isOptional: true, isVariadic: true, template: "filepaths" },
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
@@ -1,4 +1,4 @@
|
||||
// date spec — GNU coreutils date (Linux hosts). The bundled Fig spec follows
|
||||
// date spec - GNU coreutils date (Linux hosts). The bundled Fig spec follows
|
||||
// BSD/macOS flags (-j, -n, -t, -v) that GNU date does not have, so this local
|
||||
// spec describes the GNU option set instead. Local specs win over the bundled
|
||||
// package at runtime and in the translation audit.
|
||||
@@ -18,10 +18,11 @@ const completionSpec = {
|
||||
{
|
||||
name: ["-f", "--file"],
|
||||
description: "Parse each line of the given file like --date",
|
||||
args: { name: "datefile", description: "File with one date string per line" },
|
||||
args: { name: "datefile", description: "File with one date string per line", template: "filepaths" },
|
||||
},
|
||||
{
|
||||
name: ["-I", "--iso-8601"],
|
||||
netcattyOptionalArgAttached: true,
|
||||
description: "Output an ISO 8601 date/time string; the optional format is date, hours, minutes, seconds or ns",
|
||||
args: { name: "format", isOptional: true, suggestions: ["date", "hours", "minutes", "seconds", "ns"] },
|
||||
},
|
||||
@@ -37,7 +38,7 @@ const completionSpec = {
|
||||
{
|
||||
name: ["-r", "--reference"],
|
||||
description: "Display the last modification time of the given file",
|
||||
args: { name: "file", description: "File whose modification time is displayed" },
|
||||
args: { name: "file", description: "File whose modification time is displayed", template: "filepaths" },
|
||||
},
|
||||
{
|
||||
name: ["-s", "--set"],
|
||||
|
||||
+28
-22
@@ -1,31 +1,37 @@
|
||||
// dig spec — corrects two upstream problems: the NS shortcut is labelled as an
|
||||
// MX query, and "TTL" is offered as a record type even though TTL is a field.
|
||||
// dig spec. The bundled spec labels the NS shortcut as "Query MX Record" and
|
||||
// offers "TTL" as a record type, but TTL is a record field. The English keys
|
||||
// for A/MX/CNAME/TXT/SOA, ANY and the section filter stay byte-identical to
|
||||
// the bundled spec because dog shares them; the ANY and filter caveats live in
|
||||
// the zh-CN values instead of new English keys.
|
||||
const shortOption = {
|
||||
name: ["+short", ""],
|
||||
insertValue: "+short {cursor}",
|
||||
description: "Only print meaningful results",
|
||||
args: {},
|
||||
};
|
||||
|
||||
const record = (name, description) => ({
|
||||
name,
|
||||
description,
|
||||
options: [shortOption],
|
||||
});
|
||||
|
||||
const completionSpec = {
|
||||
name: "dig",
|
||||
description: "DNS lookup utility (Domain Information Groper)",
|
||||
description: "Domain Information Groper",
|
||||
subcommands: [
|
||||
{ name: "A", description: "Query A records (IPv4 address)" },
|
||||
{ name: "AAAA", description: "Query AAAA records (IPv6 address)" },
|
||||
{ name: "MX", description: "Query MX records (mail exchangers)" },
|
||||
{ name: "CNAME", description: "Query CNAME records (canonical name)" },
|
||||
{ name: "TXT", description: "Query TXT records" },
|
||||
{ name: "NS", description: "Query NS records (authoritative name servers)" },
|
||||
{ name: "SOA", description: "Query the SOA record (start of authority)" },
|
||||
record("A", "Query Domain A Record"),
|
||||
record("MX", "Query Domain MX Record"),
|
||||
record("CNAME", "Query Domain CNAME Record"),
|
||||
record("TXT", "Query Domain TXT Record"),
|
||||
record("NS", "Query NS records (authoritative name servers)"),
|
||||
record("SOA", "Query SOA Record"),
|
||||
{ name: "ANY +noall +answer", description: "Query ALL DNS Records" },
|
||||
{
|
||||
name: "ANY",
|
||||
description: "Send an ANY query; the response may be incomplete (RFC 8482)",
|
||||
name: "+nocomments +noquestion +noauthority +noadditional +nostats",
|
||||
description: "Query only answer section",
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{ name: "+short", description: "Only print meaningful results" },
|
||||
{ name: "+noall", description: "Hide all sections except the ones requested explicitly" },
|
||||
{ name: "+answer", description: "Show the answer section" },
|
||||
{ name: "+nocomments", description: "Hide the comment lines" },
|
||||
{ name: "+noquestion", description: "Hide the question section" },
|
||||
{ name: "+noauthority", description: "Hide the authority section" },
|
||||
{ name: "+noadditional", description: "Hide the additional section" },
|
||||
{ name: "+nostats", description: "Hide the statistics block" },
|
||||
],
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
@@ -1,6 +1,7 @@
|
||||
// htop spec — the bundled Fig spec says the -H delay is in tenths of a second,
|
||||
// but htop stores it in seconds (Settings.c clamps highlightDelaySecs and
|
||||
// ProcessList.c compares 1000 * highlightDelaySecs). Only that wording differs.
|
||||
// htop spec. The bundled Fig spec gives the -H delay the wrong unit ("tenths
|
||||
// of sec"). htop 3.2.2 parses it as highlightDelaySecs and compares it as
|
||||
// 1000 * highlightDelaySecs, so the value is seconds. Every other description
|
||||
// and argument matches the bundled spec.
|
||||
const completionSpec = {
|
||||
name: "htop",
|
||||
description: "Improved top (interactive process viewer)",
|
||||
@@ -19,15 +20,15 @@ const completionSpec = {
|
||||
args: {
|
||||
name: "delay",
|
||||
description: "Highlight duration in seconds",
|
||||
suggestions: ["10", "1", "60"],
|
||||
isOptional: true,
|
||||
suggestions: ["1", "10", "60"],
|
||||
},
|
||||
},
|
||||
{ name: ["--no-mouse", "-M"], description: "Disable the mouse" },
|
||||
{ name: ["--pid", "-p"], description: "Show only the given PIDs", args: { name: "PID", isVariadic: true } },
|
||||
{ name: ["--sort-key", "-s"], description: "Sort by the given column", args: { name: "column" } },
|
||||
{ name: ["--sort-key", "-s"], description: "Sort by COLUMN in list view", args: { name: "column" } },
|
||||
{ name: ["--tree", "-t"], description: "Show the tree view" },
|
||||
{ name: ["--user", "-u"], description: "Show only processes of the given user", args: { name: "user", isOptional: true, suggestions: ["$USER"] } },
|
||||
{ name: ["--user", "-u"], description: "Show only processes for a given user (or $USER)", args: { name: "user", isOptional: true, suggestions: ["$USER"] } },
|
||||
{ name: ["--no-unicode", "-U"], description: "Do not use unicode but plain ASCII" },
|
||||
{ name: ["--version", "-V"], description: "Print version info" },
|
||||
],
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
// macOS date uses BSD options. In current macOS releases, the old -d/-t
|
||||
// timezone switches are no longer available; time zones are handled by tzdata.
|
||||
const completionSpec = {
|
||||
name: "date",
|
||||
description: "Display or set date and time",
|
||||
options: [
|
||||
{
|
||||
name: "-f",
|
||||
description: "Use specified format for input instead of the default [[[mm]dd]HH]MM[[cc]yy][.ss] format",
|
||||
args: [
|
||||
{ name: "input_fmt", description: "The format with which to parse the new date value" },
|
||||
{ name: "new_date", description: "The new date to set" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "-I",
|
||||
netcattyOptionalArgAttached: true,
|
||||
description: "Output an ISO 8601 date/time string; the optional format is date, hours, minutes, seconds or ns",
|
||||
args: { name: "format", isOptional: true, suggestions: ["date", "hours", "minutes", "seconds", "ns"] },
|
||||
},
|
||||
{ name: "-j", description: "Don't try to set the date" },
|
||||
{ name: "-n", description: "Obsolete option, accepted and ignored for compatibility" },
|
||||
{ name: "-R", description: "Use RFC 2822 date and time output format" },
|
||||
{
|
||||
name: "-r",
|
||||
description: "Display a file's modification time or a time expressed in seconds since the Epoch",
|
||||
// Keep path completion for numeric prefixes: filenames can start with digits.
|
||||
args: { name: "file or seconds", template: "filepaths" },
|
||||
},
|
||||
{ name: "-u", description: "Display or set the date in UTC (Coordinated Universal) time" },
|
||||
{
|
||||
name: "-z",
|
||||
description: "Display the time in the specified output time zone",
|
||||
args: { name: "output_zone" },
|
||||
},
|
||||
{
|
||||
name: "-v",
|
||||
description: "Adjust and print (but don't set) the second, minute, hour, month day, week day, month, or year according to val",
|
||||
args: { name: "val", description: "[+|-]val[ymwdHMS]" },
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "new_time OR output_fmt",
|
||||
description: "New_time: [[[mm]dd]HH]MM[[cc]yy][.ss], output_fmt: '+' followed by user-defined format string",
|
||||
isOptional: true,
|
||||
},
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
@@ -0,0 +1,15 @@
|
||||
// macOS readlink follows BSD options, not GNU's -e/-m/-s/-v flags.
|
||||
const completionSpec = {
|
||||
name: "readlink",
|
||||
description: "Print resolved symbolic links or canonical file names",
|
||||
options: [
|
||||
{
|
||||
name: "-f",
|
||||
description: "Resolve symbolic links and print the canonical path only if all components exist",
|
||||
},
|
||||
{ name: "-n", description: "Do not print a trailing newline" },
|
||||
],
|
||||
args: { name: "file", description: "Symbolic link or path to resolve", isVariadic: true, template: "filepaths" },
|
||||
};
|
||||
|
||||
export default completionSpec;
|
||||
@@ -1,4 +1,4 @@
|
||||
// readlink spec — GNU coreutils. The bundled Fig spec reuses stat wording for
|
||||
// readlink spec - GNU coreutils. The bundled Fig spec reuses stat wording for
|
||||
// the command root and -f, so this local spec describes the real GNU options.
|
||||
const completionSpec = {
|
||||
name: "readlink",
|
||||
@@ -17,8 +17,8 @@ const completionSpec = {
|
||||
description: "Resolve symbolic links and print the canonical path even if components are missing",
|
||||
},
|
||||
{ name: ["-n", "--no-newline"], description: "Do not print a trailing newline" },
|
||||
{ name: ["-s", "--strip"], description: "Strip the last component from the path before resolving" },
|
||||
{ name: ["-v", "--verbose"], description: "Report every resolved path on standard error" },
|
||||
{ name: ["-q", "--quiet", "-s", "--silent"], description: "Suppress most error messages" },
|
||||
{ name: ["-v", "--verbose"], description: "Report error messages" },
|
||||
{ name: ["-z", "--zero"], description: "End each output path with NUL instead of a newline" },
|
||||
{ name: "--help", description: "Display help text" },
|
||||
{ name: "--version", description: "Display version information" },
|
||||
|
||||
Reference in new issue
Block a user