diff --git a/docs/design/refactor.md b/docs/design/refactor.md index 5196a29b..56e43358 100644 --- a/docs/design/refactor.md +++ b/docs/design/refactor.md @@ -230,7 +230,7 @@ Verdicts are from the verification at 1f9b651. Line numbers are those of that co | D10 | dialect commandFeatures reads options with a regex over all words | confirmed | 1.1 | PR #212 | commandFeatures reads the builtin's parse; also finds `trap ERR` (one word). "the dialect check reads a builtin's options from its parse, as dash does" (test/dialect.test.ts) | | D11 | embeddedTextInner switch → registry | proposal, same seam as A9 | 3.1 | PR #237 | src/embedded/registry.ts: `EMBEDDED`, one explainer per `EmbeddedLang` with one return shape (`{ tokens, note? }`, undefined when the text is not of the language); what one needs of the command (regex flavor, `tr` role, perl's letters) it asks of an `EmbeddedContext`. The analyzer's `embeddedTextInner` calls it, then `embeddedExample` for the worked example, only when the text was explained (as before). Every dump unchanged; same output as main on the corpus (see A9) | | D12 | sed and perl have two parsers each | proposal | — | won't do (for now) | see "Not planned" | -| D13 | extras files patch other entries' options | confirmed | 3.5 | planned | | +| D13 | extras files patch other entries' options | confirmed | 3.5 | PR #249 | src/dict/extras.ts, extrasFiles.ts, extrasAdmin.ts and `applyExtras` are gone: each command's extra options and subcommands are in the entry of the file that defines it (a name the main entry defined keeps the main entry's meaning, as `mergeOptions` did). A dump of every entry of `commands` and `builtins` (options, values, texts, subcommands) is identical before and after, option and subcommand order included (the extras came first, then the entry's own); sample.sh dump unchanged. test/dictionary.test.ts fails if an extras file or `applyExtras` comes back; `cmd()` throws on an option named twice. scripts/check-dict-manpages.ts walks every dict table | | D14 | hosts.ts per-CI flags → table; split | confirmed | 3.4 | PR #229 | `CI_SYSTEMS` in src/hosts/yaml.ts holds, per CI system, its detection, label and rules (Windows `script:` skipped, `with:` inputs skipped, `command:` a shell only for GitHub); `stepCi` picks the system of a step; the flags `githubLike`/`circleci`/`azure`/`azureWindows` and the label ternary are gone; src/hosts.ts is split into src/hosts/ (index with the types and the public API, builder, bats, dockerfile, makefile, jenkinsfile, yaml, npm, markdown, python, remap). Dumps of test/fixtures/hosts/* and sample.sh (en, ja) byte-identical; test/hosts.test.ts and the suite unchanged, coverage 100% | | P1 | Code actions only for `shellscript` | corrected: only dialect diagnostics have fixes, so host files are not affected; a language id added in the setting is | 1.5 | PR #208 | integration/extension.itest.ts "offers the quick fix in a language added to bashExplainer.languages" (not run here: needs a downloaded VS Code) | | P2 | VS Code reads settings by hand | confirmed (`readSettings`/`explainOptions` exist in src/settings.ts) | 2.4 | PR #218 | test/document-setup.test.ts "settingsFromEditor" (getter, fallback to the default, unknown list items dropped, minimum, read-only proxies); settings are cached until the configuration changes; VS Code code reads `service.settings`, no `config.get(key, default)` is left. The VS Code integration test (CI) runs the rest | diff --git a/docs/design/semantics.md b/docs/design/semantics.md index f37c2ec3..d1c36028 100644 --- a/docs/design/semantics.md +++ b/docs/design/semantics.md @@ -368,7 +368,7 @@ The code (src/argv/) differs from 3.2–3.4 in these points: - A word that becomes known words (`a{,.bak}`) gives each its role (`each`). An operand whose role depends on how many words an expansion gives is `uncertain`, with the role it may have instead (`otherwise`), or the roles of its words when it gives several (`several`). - There is no converter (A4): every dictionary entry is a `CommandSpec`. `cmd(ja, en, options, rest)` (src/dict/types.ts) builds it from options written as tuples (`OptSpec`, with the flags `arg`, `arg2`, `until`, `fills`, `attached`, `next:`, `lang:` and `persistent`) or as option specs, and from any field of a spec. `positional` (and `positionalLang`) is a shorthand for the last operand alternative: the operands in order, each optional, the last repeating; an option with `fills` adds an alternative before it without the first operand (`grep -e`). `byCount` and `lastIsDestination` write alternatives by count (`seq`, `cp`). The rules the old walk applied by name are in the entries: find's `operandParser` and `expressionSpec`, jq's `longEquals: false` and the `laterOperands` of `--args`, `head`'s and `tail`'s `countOption`, and awk's `assignmentText`. A tuple that gives a language or meanings of values without a value is an error when the dictionary loads. - The flag `persistent` of a tuple (`persistent(list)`) becomes `OptionSpec.persistent`. A subcommand's own option of the same name wins over an inherited one (`kubectl logs -f`, `docker compose run -p`). -- A list of options names each option once: `mergeOptions` throws when a name is given twice in one list. It puts a second list over the first, whose names win: the options of src/dict/extrasFiles.ts and extrasAdmin.ts are merged so, with the entry's own options over them; extra subcommands do not replace the entry's. (A customCommands entry that names an option twice means what it says last.) +- A list of options names each option once: `mergeOptions` throws when a name is given twice in one list. It puts a second list over the first, whose names win. No file patches the options or subcommands of another file's entry (the extras files were merged into their entries; test/dictionary.test.ts checks). (A customCommands entry that names an option twice means what it says last.) - `CommandSpec.program`: the spec of the program named like a builtin (coreutils `echo`, `printf`, `pwd`, `test`, `true`, `false`; procps `kill`). A path (`/bin/kill`) and a slot that starts a program (`env echo`, `sudo kill`) read the words with it, and get no pitfall; its options may differ (procps kill has no `-n` and no job specs, coreutils printf no `-v`). - `CommandSpec.builtin` is the only mark of a builtin. The analyzer reads it for the kind of a command, for "(shell builtin)", and for the assignments before a special builtin in POSIX mode (until B3 builds `NameResolution` from it). It reads `plusOptions` for `declare +x` too. - The builtins of src/dict/builtins.ts are written with `b` (regular, `style: 'posix'`) and `special`, and their operands with `args(...)`: each optional, the last repeating. `exit`, `return`, `shift`, `break`, `continue` and `logout` have `style: 'none'` (`exit -1` is a number). kill's signal patterns and marks, echo's modes and its literal `--`, and set's `next-only` `-o` are in their entries. diff --git a/scripts/check-dict-manpages.ts b/scripts/check-dict-manpages.ts index 6b01c53a..99dc7c53 100644 --- a/scripts/check-dict-manpages.ts +++ b/scripts/check-dict-manpages.ts @@ -6,8 +6,8 @@ * * Pages are cached under $MANPAGE_CACHE (default: a directory in the system temp directory), never in the * repository. - * Checked: the commands of basic, storage, admin, netadmin and monitor (their options and - * subcommands' options) and the extra options of extras*.ts. macOS commands are not on Debian. + * Checked: the commands of core, basic, storage, admin, netadmin, monitor, system, distro and ops (their options and + * subcommands' options). macOS commands are not on Debian. * * Output: per command, the options of ours that neither the page nor `--help` mention (suspect), * the number of options the page has that we lack, and the commands without a page. @@ -21,11 +21,11 @@ import { storage } from '../src/dict/storage'; import { admin } from '../src/dict/admin'; import { netadmin } from '../src/dict/netadmin'; import { monitor } from '../src/dict/monitor'; -import { extraFiles } from '../src/dict/extrasFiles'; -import { extraAdmin } from '../src/dict/extrasAdmin'; -import { extraSubcommands } from '../src/dict/extras'; +import { core } from '../src/dict/commands'; +import { system } from '../src/dict/system'; +import { distro } from '../src/dict/distro'; +import { ops } from '../src/dict/ops'; import type { CommandSpec } from '../src/argv/spec'; -import { cmd } from '../src/dict/types'; const SUITE = 'trixie'; // the current Debian stable release const BASE = 'https://manpages.debian.org'; @@ -56,7 +56,7 @@ function targets(): Map> { m.set(key, [...(m.get(key) ?? []), ...names]); out.set(cmdName, m); }; - for (const table of [basic, storage, admin, netadmin, monitor]) { + for (const table of [core, basic, storage, admin, netadmin, monitor, system, distro, ops]) { for (const [name, doc] of Object.entries(table)) { const m = new Map(); collect(name, doc, m); @@ -64,16 +64,6 @@ function targets(): Map> { if (!m.size) out.set(name, out.get(name) ?? new Map()); } } - for (const table of [extraFiles, extraAdmin]) { - for (const [name, specs] of Object.entries(table)) add(name, name, cmd('', '', specs).options!.flatMap((o) => o.names)); - } - for (const [name, subs] of Object.entries(extraSubcommands)) { - for (const [sub, d] of Object.entries(subs)) { - const m = new Map(); - collect(`${name} ${sub}`, d, m); - for (const [k, v] of m) add(name, k, v); - } - } return out; } diff --git a/src/dict/commands.ts b/src/dict/commands.ts index 595067ad..d04c60f6 100644 --- a/src/dict/commands.ts +++ b/src/dict/commands.ts @@ -10,7 +10,6 @@ import { admin } from './admin'; import { netadmin } from './netadmin'; import { monitor } from './monitor'; import { macos } from './macos'; -import { applyExtras } from './extras'; import { args, ASSIGNMENTS, byCount, cmd, countOption, dashed, lastIsDestination, letters, operand, optionOf, OptSpec, persistent, pos, runs, GNU_INFO } from './types'; const files = pos('対象のファイル', 'target file'); @@ -144,6 +143,16 @@ const IMAGE = operand('IMAGE', 'イメージ', 'image', { repeat: '?' }); const SERVICE = operand('SERVICE', 'サービス', 'service', { repeat: '?' }); /** Subcommands shared by docker and podman. */ +/** The container commands docker and podman share, written before dockerSubs' own. */ +const containerSubs = (): Record => ({ + stats: cmd('コンテナの資源の使用状況を表示する', 'Show live resource usage of containers', [['--no-stream', '1回だけ表示して終わる', 'print once and exit']]), + create: cmd('コンテナを作る(起動はしない)', 'Create a container without starting it', [['--name', 'コンテナ名', 'container name', 'arg']]), + restart: cmd('コンテナを再起動する', 'Restart containers', [['-t|--time', '停止を待つ秒数', 'seconds to wait before killing', 'arg']]), + start: cmd('止まっているコンテナを起動する', 'Start stopped containers', [['-a|--attach', '出力につなぐ', 'attach output'], ['-i|--interactive', '標準入力につなぐ', 'attach stdin']]), + rmi: cmd('イメージを削除する', 'Remove images', [['-f|--force', '強制的に削除', 'force removal']]), + kill: cmd('コンテナにシグナルを送って強制終了する', 'Kill containers by signal', [['-s|--signal', '送るシグナル', 'signal to send', 'arg']]), +}); + const dockerSubs: Record = { run: cmd('イメージから新しいコンテナを起動する', 'Run a new container', dockerRun, { optionsFirst: true, operands: [{ pattern: [IMAGE, runs(IN_CONTAINER)] }] }), build: cmd('Dockerfile からイメージをビルドする', 'Build an image from a Dockerfile', dockerBuild, { positional: [pos('ビルドのコンテキスト(ディレクトリ)', 'build context (directory)')] }), @@ -238,8 +247,65 @@ const findSpec = (spec: CommandSpec): CommandSpec => ({ ...spec, options: spec.options!.filter((o) => o.names.some((n) => /^-[HLP]$/.test(n))), operandParser: 'find-expression', expressionSpec: spec, }); +const signalOpts = (): OptSpec[] => [ + ['-HUP', 'SIGHUP を送る(設定の再読み込み)', 'send SIGHUP (reload configuration)'], + ['-INT', 'SIGINT を送る', 'send SIGINT'], + ['-TERM', 'SIGTERM を送る(既定)', 'send SIGTERM (default)'], + ['-KILL', 'SIGKILL を送る(強制終了)', 'send SIGKILL (force kill)'], + ['-USR1', 'SIGUSR1 を送る', 'send SIGUSR1'], + ['-USR2', 'SIGUSR2 を送る', 'send SIGUSR2'], + ['-STOP', 'SIGSTOP を送る(一時停止)', 'send SIGSTOP (pause)'], + ['-CONT', 'SIGCONT を送る(再開)', 'send SIGCONT (resume)'], + ['-15', 'シグナル 15 (TERM) を送る', 'send signal 15 (TERM)'], +]; +const pgrepCommon = (): OptSpec[] => [ + ['-u|--euid', '実効ユーザーで絞る', 'match the effective user', 'arg'], + ['-U|--uid', '実ユーザーで絞る', 'match the real user', 'arg'], + ['-G|--group', '実グループで絞る', 'match the real group', 'arg'], + ['-P|--parent', '親プロセスの PID で絞る', 'match the parent PID', 'arg'], + ['-t|--terminal', '端末で絞る', 'match the terminal', 'arg'], + ['-s|--session', 'セッション ID で絞る', 'match the session ID', 'arg'], + ['-x|--exact', '名前が完全に一致するものだけ', 'match the name exactly'], + ['-n|--newest', '最も新しく起動したものだけ', 'only the newest'], + ['-o|--oldest', '最も古くから動いているものだけ', 'only the oldest'], + ['-i|--ignore-case', '大文字と小文字を区別しない', 'ignore case'], + ['-v|--inverse', '一致しないものを対象にする', 'negate the match'], + ['-F|--pidfile', 'PID ファイルの PID だけ', 'read PIDs from a file', 'arg'], + ['-a|--list-full', 'コマンドライン全体も表示', 'list the full command line'], + ['-l|--list-name', 'プロセス名も表示', 'list the process name'], + ['-c|--count', '一致した数だけ表示', 'print the number of matches'], + ['-d|--delimiter', '出力の区切り文字', 'output delimiter', 'arg'], +]; + export const core: Record = { ls: cmd('ディレクトリの中身(ファイル一覧)を表示する', 'List directory contents', [ + ['-i|--inode', 'inode 番号も表示', 'print the inode number'], + ['-s|--size', 'ブロック数も表示', 'print the allocated size'], + ['-n|--numeric-uid-gid', 'ユーザーとグループを数値で表示', 'list numeric user and group IDs'], + ['-X', '拡張子で並べる', 'sort by extension'], + ['-v', '数字を自然な順に並べる', 'natural sort of numbers'], + ['-U', '並べ替えない(ディスク上の順)', 'do not sort'], + ['-u', '最終アクセス時刻で並べる/表示する', 'sort or show by access time'], + ['-c', '状態の変更時刻で並べる/表示する', 'sort or show by status change time'], + ['-L|--dereference', 'シンボリックリンクの先の情報を表示', 'show information of link targets'], + ['-p', 'ディレクトリの名前の後ろに `/` を付ける', 'append `/` to directories'], + ['-m', 'コンマ区切りで横に並べる', 'fill the width with a comma-separated list'], + ['-x', '横方向に並べる', 'list entries by lines instead of columns'], + ['-C', '縦方向に並べる', 'list entries by columns'], + ['-Z|--context', 'SELinux のセキュリティコンテキストも表示', 'print the SELinux security context'], + ['-f', '並べ替えず、`-a` も有効にする', 'do not sort; enables `-a`'], + ['-g', '`-l` からオーナーを除く', 'like `-l` but without the owner'], + ['-o', '`-l` からグループを除く', 'like `-l` but without the group'], + ['-G|--no-group', '`-l` でグループを表示しない', 'do not print the group in `-l`'], + ['-k|--kibibytes', 'サイズを 1024 バイト単位で表示', 'use 1024-byte blocks'], + ['-q|--hide-control-chars', '表示できない文字を `?` にする', 'print `?` for non-printable characters'], + ['-b|--escape', '特殊な文字をエスケープして表示', 'print C-style escapes for special characters'], + ['-I|--ignore', '一致する名前を表示しない', 'do not list names matching the pattern', 'arg'], + ['--full-time', '時刻を秒まで完全に表示(`-l --time-style=full-iso`)', 'show full timestamps (`-l --time-style=full-iso`)'], + ['--time-style', '時刻の表示形式(`iso`、`long-iso`、`+%Y-%m-%d`)', 'time format (`iso`, `long-iso`, `+%Y-%m-%d`)', 'arg'], + ['--group-directories-first', 'ディレクトリを先に並べる', 'list directories before files'], + ['--sort', '並べ方(`size`、`time`、`extension`、`version`、`none`)', 'sort key (`size`, `time`, `extension`, `version`, `none`)', 'arg'], + ['--si', 'サイズを 1000 の累乗の単位で表示', 'use powers of 1000 for sizes'], ['-l', '詳細形式(権限・所有者・サイズ・更新日時)で表示', 'long format (permissions, owner, size, mtime)'], ['-a|--all', '`.` で始まる隠しファイルも表示', 'include hidden files starting with `.`'], ['-A|--almost-all', '`.` と `..` 以外の隠しファイルも表示', 'include hidden files except `.` and `..`'], @@ -275,12 +341,31 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long', positional: [pos('表示するファイルまたはディレクトリ(省略時はカレント)', 'file or directory (default: current)')] }), cat: cmd('ファイルの内容を連結して標準出力に出す', 'Concatenate files and print to stdout', [ + ['-b|--number-nonblank', '空行以外に行番号を付ける', 'number non-empty lines'], + ['-E|--show-ends', '行末に `$` を表示', 'show `$` at the end of each line'], + ['-T|--show-tabs', 'タブを `^I` で表示', 'show tabs as `^I`'], + ['-v|--show-nonprinting', '表示できない文字を `^` 記法で表示', 'show non-printing characters with `^` notation'], + ['-e', '`-vE` と同じ', 'same as `-vE`'], + ['-t', '`-vT` と同じ', 'same as `-vT`'], ['-n|--number', '行番号を付ける', 'number all lines'], ['-A|--show-all', '改行やタブなどの制御文字を可視化', 'show non-printing characters'], ['-s|--squeeze-blank', '連続する空行を1行にまとめる', 'squeeze repeated blank lines'], ...GNU_INFO, ], { parser: 'getopt_long', positional: [pos('出力するファイル(`-` または省略で標準入力)', 'file to print (`-` or none = stdin)')] }), grep: cmd('パターン(正規表現)に一致する行を検索して表示する', 'Print lines matching a pattern (regex)', [ + ['-z|--null-data', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], + ['-a|--text', 'バイナリファイルもテキストとして扱う', 'treat binary files as text'], + ['-I', 'バイナリファイルを無視する', 'ignore binary files'], + ['-b|--byte-offset', '各行のバイト位置も表示', 'print the byte offset of each line'], + ['-T|--initial-tab', '行頭の見出しをタブでそろえる', 'align the prefix with a tab'], + ['-Z|--null', 'ファイル名の後ろに NUL を出力', 'output a NUL after file names'], + ['--line-buffered', '行ごとに出力をフラッシュする', 'flush output on every line'], + ['-U|--binary', 'ファイルをバイナリとして読む', 'read files as binary'], + ['-d|--directories', 'ディレクトリの扱い(`read`、`skip`、`recurse`)', 'how to treat directories (`read`, `skip`, `recurse`)', 'arg'], + ['-D|--devices', 'デバイスの扱い(`read`、`skip`)', 'how to treat devices (`read`, `skip`)', 'arg'], + ['-y', '`-i` と同じ(古い)', 'same as `-i` (old)'], + ['--no-ignore-case', '`-i` の指定をなかったことにする', 'cancel `-i`'], + ['--label', '標準入力のファイル名として表示する名前', 'name to show for stdin', 'arg'], ['-i|--ignore-case', '大文字・小文字を区別しない', 'ignore case'], ['-v|--invert-match', '一致しない行を表示する', 'select non-matching lines'], ['-r|--recursive', 'ディレクトリ内を再帰的に検索', 'search directories recursively'], @@ -321,6 +406,13 @@ export const core: Record = { conflictingModes: tx('`-E`・`-F`・`-G`・`-P` のうち別のものと一緒に指定すると、grep は「conflicting matchers specified」と言って何もしない(終了ステータス 2)', 'With another of `-E`, `-F`, `-G`, `-P`, grep refuses the line: "conflicting matchers specified" (exit status 2)'), positional: [pos('検索パターン(正規表現)', 'search pattern (regex)'), pos('検索対象のファイル(省略時は標準入力)', 'file to search (default: stdin)')], positionalLang: ['regex'] }), sed: cmd('ストリームエディタ: 入力を1行ずつスクリプトで編集して出力する(置換は `s/前/後/g`)', 'Stream editor: edit input line by line (substitute with `s/old/new/g`)', [ + ['-u|--unbuffered', '入力と出力のバッファリングを最小にする', 'minimal input and output buffering'], + ['-l|--line-length', '`l` コマンドの折り返し幅', 'line-wrap length for the `l` command', 'arg'], + ['--posix', 'GNU 拡張を無効にする', 'disable GNU extensions'], + ['-b', 'バイナリモードで読み書きする(Linux では効果なし)', 'binary mode (no effect on Linux)'], + ['--follow-symlinks', '`-i` でシンボリックリンクの先を編集する', 'follow symlinks when editing in place'], + ['--debug', '解釈した内容と実行の様子を表示する', 'annotate the program and show how it runs'], + ['--sandbox', 'ファイルの読み書きとコマンド実行を禁止する', 'reject commands that read, write or run programs'], ['-i|--in-place', 'ファイルを直接書き換える(`-i.bak` でバックアップを作る)', 'edit files in place (`-i.bak` keeps a backup)', 'attached'], ['-n|--quiet|--silent', '自動出力を抑止し、`p` コマンドで指定した行だけ出力', 'suppress automatic printing; print only with `p`'], ['-e|--expression', '実行するスクリプトを指定(複数指定可)', 'add a script to run', 'arg fills lang:sed'], @@ -421,6 +513,10 @@ export const core: Record = { ['--version', 'バージョンを表示する', 'print the version'], ], { example: 'xargs', parser: 'getopt_long', optionsFirst: true, operands: [{ pattern: [runs()] }] }), cut: cmd('各行から指定した列(フィールド)や文字位置を切り出す', 'Cut out selected fields or characters from each line', [ + ['-s|--only-delimited', '区切り文字のない行は出力しない', 'do not print lines without the delimiter'], + ['--complement', '指定した以外を出力する', 'select everything except the given fields'], + ['--output-delimiter', '出力の区切り文字', 'output delimiter', 'arg'], + ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], ['-d|--delimiter', '区切り文字(既定はタブ)', 'field delimiter (default: tab)', 'arg'], ['-f|--fields', '取り出すフィールド番号(例: `1,3` や `2-`)', 'fields to select (e.g. `1,3`, `2-`)', 'arg lang:cutfields'], ['-c|--characters', '取り出す文字位置', 'character positions to select', 'arg lang:cutchars'], @@ -429,6 +525,20 @@ export const core: Record = { ...GNU_INFO, ], { example: 'cut', parser: 'getopt_long', positional: [files] }), sort: cmd('行を並べ替える', 'Sort lines', [ + ['-b|--ignore-leading-blanks', '先頭の空白を無視する', 'ignore leading blanks'], + ['-d|--dictionary-order', '英数字と空白だけで比べる', 'consider only blanks and alphanumerics'], + ['-g|--general-numeric-sort', '指数表記も含めて数値として並べる', 'compare as general numbers (with exponents)'], + ['-i|--ignore-nonprinting', '表示できない文字を無視する', 'ignore non-printing characters'], + ['-m|--merge', 'ソート済みのファイルを統合する', 'merge already sorted files'], + ['-M|--month-sort', '月名(JAN〜DEC)として並べる', 'sort by month name (JAN to DEC)'], + ['-R|--random-sort', 'ランダムに並べる', 'shuffle'], + ['-s|--stable', '等しい行の順序を変えない', 'keep equal lines in input order'], + ['-c', '整列済みかどうかを確認するだけ', 'only check whether it is sorted'], + ['-C', '整列済みかどうかを確認し、何も表示しない', 'check quietly'], + ['-S|--buffer-size', '使うメモリの大きさ', 'size of the main memory buffer', 'arg'], + ['-T|--temporary-directory', '一時ファイルを置くディレクトリ', 'directory for temporary files', 'arg'], + ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], + ['--parallel', '並列に処理する数', 'number of sorts run in parallel', 'arg'], ['-n|--numeric-sort', '数値として並べる', 'compare as numbers'], ['-r|--reverse', '逆順(降順)にする', 'reverse order'], ['-u|--unique', '重複行を1つにまとめる', 'output only unique lines'], @@ -448,6 +558,11 @@ export const core: Record = { ...GNU_INFO, ], { example: 'sort', parser: 'getopt_long', positional: [files] }), uniq: cmd('隣接する重複行をまとめる(通常 `sort` の後に使う)', 'Collapse adjacent duplicate lines (usually after `sort`)', [ + ['-f|--skip-fields', '比べるとき先頭のN個のフィールドを飛ばす', 'skip the first N fields when comparing', 'arg'], + ['-s|--skip-chars', '比べるとき先頭のN文字を飛ばす', 'skip the first N characters when comparing', 'arg'], + ['-w|--check-chars', '先頭のN文字だけ比べる', 'compare no more than N characters', 'arg'], + ['-D', '重複した行をすべて出力する', 'print all duplicate lines'], + ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], ['-c|--count', '各行の出現回数を先頭に付ける', 'prefix lines with their count'], ['-d|--repeated', '重複している行だけ表示', 'only print duplicated lines'], ['-u|--unique', '重複していない行だけ表示', 'only print unique lines'], @@ -473,17 +588,27 @@ export const core: Record = { optionsFirst: true, positional: [pos('(旧形式)受け付けるオプション文字', '(old form) the option letters'), pos('解析する引数(通常は `"$@"`)', 'the arguments to parse (usually `"$@"`)')], positionalLang: ['getoptshort'] }), tr: cmd('文字を置換・削除する(標準入力のみ)', 'Translate or delete characters (stdin only)', [ + ['-t|--truncate-set1', '1つ目の文字集合を2つ目の長さに切り詰める', 'truncate the first set to the length of the second'], ['-d|--delete', '指定した文字を削除する', 'delete the characters'], ['-s|--squeeze-repeats', '連続する同じ文字を1つにまとめる', 'squeeze repeated characters'], ['-c|-C|--complement', '指定した文字以外を対象にする', 'use the complement of the set'], ...GNU_INFO, ], { example: 'tr', parser: 'getopt_long', positional: [pos('変換元の文字集合(例: `a-z`)', 'source character set (e.g. `a-z`)'), pos('変換先の文字集合(例: `A-Z`)', 'target character set (e.g. `A-Z`)')], positionalLang: ['trset', 'trset'], operands: [byCount(1, [pos('削除または圧縮する文字集合(`-d`、`-s`)', 'character set to delete or squeeze (`-d`, `-s`)')], { langs: ['trset', 'trset'] })] }), head: cmd('ファイルの先頭部分を表示する(既定は10行)', 'Print the first part of files (default 10 lines)', [ + ['-q|--quiet|--silent', '複数ファイルでもファイル名の見出しを付けない', 'never print file name headers'], + ['-v|--verbose', '常にファイル名の見出しを付ける', 'always print file name headers'], + ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], ['-n|--lines', '表示する行数(`-n -5` は最後の5行以外)', 'number of lines (`-n -5`: all but the last 5)', 'arg'], ['-c|--bytes', '表示するバイト数', 'number of bytes', 'arg'], ...GNU_INFO, ], { example: 'head', parser: 'getopt_long', positional: [files], patternOptions: [LINE_COUNT] }), tail: cmd('ファイルの末尾部分を表示する(既定は10行)', 'Print the last part of files (default 10 lines)', [ + ['-q|--quiet|--silent', '複数ファイルでもファイル名の見出しを付けない', 'never print file name headers'], + ['-v|--verbose', '常にファイル名の見出しを付ける', 'always print file name headers'], + ['-s|--sleep-interval', '`-f` で調べる間隔(秒)', 'seconds between checks with `-f`', 'arg'], + ['--pid', '指定した PID のプロセスが終わったら `-f` をやめる', 'stop `-f` when the given PID exits', 'arg'], + ['--retry', 'ファイルが開けるまで繰り返す', 'keep trying to open the file'], + ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], ['-n|--lines', '表示する行数(`+N` で N 行目以降)', 'number of lines (`+N`: from line N)', 'arg'], ['-c|--bytes', '表示するバイト数', 'number of bytes', 'arg'], ['-f', '追記を監視し続けて表示する(ログ監視)', 'keep following appended data (log watching)'], @@ -493,6 +618,8 @@ export const core: Record = { ...GNU_INFO, ], { example: 'tail', parser: 'getopt_long', positional: [files], patternOptions: [LINE_COUNT, FROM_LINE] }), wc: cmd('行数・単語数・バイト数を数える', 'Count lines, words and bytes', [ + ['-L|--max-line-length', '最も長い行の長さ', 'length of the longest line'], + ['--files0-from', 'NUL 区切りのファイル名の一覧を読むファイル', 'read NUL-separated file names from the given file', 'arg'], ['-l|--lines', '行数を数える', 'count lines'], ['-w|--words', '単語数を数える', 'count words'], ['-c|--bytes', 'バイト数を数える', 'count bytes'], @@ -501,10 +628,57 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long', positional: [files] }), tee: cmd('標準入力を標準出力とファイルの両方に書き出す', 'Copy stdin to stdout and to files', [ + ['-i|--ignore-interrupts', '割り込みシグナルを無視する', 'ignore interrupt signals'], + ['-p', 'パイプへの書き込みエラーを診断する', 'diagnose errors writing to pipes'], + ['--output-error', '書き込みエラーの扱い(`warn`、`exit`…)', 'what to do on write errors (`warn`, `exit`…)', 'attached'], ['-a|--append', 'ファイルに追記する(上書きしない)', 'append instead of overwrite'], ...GNU_INFO, ], { parser: 'getopt_long', positional: [pos('書き出すファイル', 'file to write')] }), curl: cmd('URL を指定してデータを送受信する(HTTP リクエストなど)', 'Transfer data to or from a URL (HTTP requests etc.)', [ + ['-b|--cookie', '送るクッキー(文字列またはファイル)', 'cookies to send (string or file)', 'arg'], + ['-c|--cookie-jar', 'クッキーを保存するファイル', 'file to save cookies to', 'arg'], + ['-A|--user-agent', 'User-Agent の文字列', 'User-Agent string', 'arg'], + ['-e|--referer', 'Referer の値', 'Referer value', 'arg'], + ['-T|--upload-file', 'アップロードするファイル', 'file to upload', 'arg'], + ['-F|--form', 'フォーム(multipart)の項目', 'multipart form field', 'arg'], + ['-x|--proxy', '使うプロキシ', 'proxy to use', 'arg'], + ['-K|--config', '設定ファイル', 'read options from a file', 'arg'], + ['-D|--dump-header', '応答ヘッダーを保存するファイル(`-` で標準出力)', 'file for the response headers (`-` for stdout)', 'arg'], + ['-r|--range', '取得する範囲(バイト)', 'byte range to fetch', 'arg'], + ['-C|--continue-at', '途中から再開する(`-` で自動)', 'resume at the given offset (`-`: automatic)', 'arg'], + ['--data-raw', '変換せずに送るデータ', 'data to send as is', 'arg'], + ['--data-binary', 'バイナリのまま送るデータ', 'data to send as binary', 'arg'], + ['--data-urlencode', 'URL エンコードして送るデータ', 'data to send URL-encoded', 'arg'], + ['-G|--get', 'データを GET のクエリ文字列にする', 'send the data as a GET query string'], + ['-J|--remote-header-name', 'サーバーが指定したファイル名を使う', 'use the server-supplied file name'], + ['-R|--remote-time', '保存するファイルの時刻をサーバーに合わせる', 'set the file time to the remote one'], + ['--cacert', 'CA 証明書のファイル', 'CA certificate file', 'arg'], + ['-E|--cert', 'クライアント証明書', 'client certificate', 'arg'], + ['--key', 'クライアント証明書の秘密鍵', 'private key of the client certificate', 'arg'], + ['--resolve', '名前解決を固定する(`ホスト:ポート:アドレス`)', 'pin name resolution (`host:port:address`)', 'arg'], + ['--interface', '使うネットワークインターフェース', 'network interface to use', 'arg'], + ['--limit-rate', '速度の上限', 'transfer rate limit', 'arg'], + ['--max-redirs', 'リダイレクトをたどる最大回数', 'maximum redirects to follow', 'arg'], + ['--http1.1', 'HTTP/1.1 を使う', 'use HTTP/1.1'], + ['--http2', 'HTTP/2 を使う', 'use HTTP/2'], + ['-4|--ipv4', 'IPv4 だけ', 'IPv4 only'], + ['-6|--ipv6', 'IPv6 だけ', 'IPv6 only'], + ['-Z|--parallel', '複数の転送を並列で行う', 'perform transfers in parallel'], + ['-n|--netrc', '`~/.netrc` の認証情報を使う', 'use credentials from `~/.netrc`'], + ['--noproxy', 'プロキシを使わないホスト', 'hosts that bypass the proxy', 'arg'], + ['-#|--progress-bar', '進行状況をバーで表示', 'show a progress bar'], + ['--fail-with-body', '失敗時(HTTP 400 以上)も本文を出して失敗にする', 'fail on HTTP errors but still print the body'], + ['--oauth2-bearer', 'Bearer トークン', 'bearer token', 'arg'], + ['-N|--no-buffer', '出力をバッファしない', 'disable output buffering'], + ['-l|--list-only', 'FTP でファイル名だけ一覧表示', 'list only file names (FTP)'], + ['-g|--globoff', 'URL の `{}` `[]` を展開しない', 'turn off URL globbing'], + ['--create-dirs', '出力先のディレクトリがなければ作る', 'create the local directory hierarchy'], + ['--output-dir', '出力するディレクトリ', 'directory to save into', 'arg'], + ['--proto', '許可するプロトコル(`=https`)', 'allowed protocols (`=https`)', 'arg'], + ['--tlsv1.2', 'TLS 1.2 以上を使う', 'use TLS 1.2 or newer'], + ['-0|--http1.0', 'HTTP/1.0 を使う', 'use HTTP/1.0'], + ['--trace', '通信の詳細をファイルに記録する', 'write a full trace to a file', 'arg'], + ['--stderr', 'エラー出力の先', 'where to redirect stderr', 'arg'], ['-s|--silent', '進捗やエラーを表示しない', 'silent mode'], ['--retry', '一時的なエラーのとき、指定した回数まで再試行する', 'retry the given number of times on transient errors', 'arg'], ['--retry-delay', '再試行の間隔(秒)', 'seconds between retries', 'arg'], @@ -529,6 +703,45 @@ export const core: Record = { ['-w|--write-out', '完了後に表示する情報の書式', 'output format after completion', 'arg'], ], { positional: [pos('アクセスする URL', 'URL')] }), wget: cmd('URL からファイルをダウンロードする', 'Download files from URLs', [ + ['-P|--directory-prefix', '保存先のディレクトリ', 'directory to save into', 'arg'], + ['-r|--recursive', 'リンクをたどって再帰的に取得する', 'download recursively'], + ['-np|--no-parent', '親ディレクトリには上がらない', 'never ascend to the parent directory'], + ['-l|--level', '再帰の深さ', 'recursion depth', 'arg'], + ['-nd|--no-directories', 'ディレクトリ構造を作らず1か所に保存する', 'do not create a directory hierarchy'], + ['-nc|--no-clobber', '既存のファイルを上書きしない', 'do not overwrite existing files'], + ['-N|--timestamping', '新しいファイルだけ取得する', 'download only newer files'], + ['-b|--background', 'バックグラウンドで実行する', 'go to the background'], + ['-o|--output-file', 'ログを書くファイル', 'write the log to the given file', 'arg'], + ['-a|--append-output', 'ログをファイルに追記する', 'append the log to the given file', 'arg'], + ['-i|--input-file', 'URL の一覧を書いたファイル', 'file with a list of URLs', 'arg'], + ['-U|--user-agent', 'User-Agent の文字列', 'User-Agent string', 'arg'], + ['--header', '追加するヘッダー', 'extra header', 'arg'], + ['--post-data', 'POST で送るデータ', 'data to send with POST', 'arg'], + ['--no-check-certificate', 'サーバー証明書を検証しない(注意)', 'do not validate the server certificate (careful)'], + ['-t|--tries', '再試行の回数', 'number of tries', 'arg'], + ['-T|--timeout', 'タイムアウト(秒)', 'timeout in seconds', 'arg'], + ['--limit-rate', '速度の上限', 'download rate limit', 'arg'], + ['-k|--convert-links', 'ローカルで見られるようリンクを変換する', 'convert links for local viewing'], + ['-p|--page-requisites', 'ページの表示に必要な画像や CSS も取得する', 'also get images and CSS needed to display a page'], + ['-m|--mirror', 'ミラーリング用の設定(`-r -N -l inf`)', 'mirroring options (`-r -N -l inf`)'], + ['-e|--execute', '設定コマンドを実行する', 'execute a `.wgetrc`-style command', 'arg'], + ['--http-user', 'HTTP 認証のユーザー名', 'HTTP user name', 'arg'], + ['--http-password', 'HTTP 認証のパスワード', 'HTTP password', 'arg'], + ['--content-disposition', 'サーバーが指定したファイル名を使う', 'use the server-supplied file name'], + ['-4|--inet4-only', 'IPv4 だけ', 'IPv4 only'], + ['-6|--inet6-only', 'IPv6 だけ', 'IPv6 only'], + ['-S|--server-response', 'サーバーの応答ヘッダーを表示', 'print the server response headers'], + ['-nv|--no-verbose', '簡潔に表示する', 'less verbose, but not quiet'], + ['-v|--verbose', '詳しく表示する', 'verbose'], + ['-nH|--no-host-directories', 'ホスト名のディレクトリを作らない', 'do not create host-name directories'], + ['-x|--force-directories', 'ディレクトリ構造を必ず作る', 'always create the directory hierarchy'], + ['-A|--accept', '取得する拡張子', 'accepted extensions', 'arg'], + ['-R|--reject', '取得しない拡張子', 'rejected extensions', 'arg'], + ['-H|--span-hosts', '他のホストにも移る', 'go to foreign hosts when recursive'], + ['-w|--wait', '取得の間に待つ秒数', 'seconds to wait between retrievals', 'arg'], + ['--save-cookies', 'クッキーを保存するファイル', 'file to save cookies to', 'arg'], + ['--load-cookies', 'クッキーを読むファイル', 'file to load cookies from', 'arg'], + ['--progress', '進行状況の表示形式', 'progress indicator style', 'arg'], ['-O', '保存するファイル名(`-` で標準出力)', 'output file (`-` = stdout)', 'arg'], ['-q|--quiet', '何も表示しない', 'quiet'], ['-c|--continue', '途中まで落としたファイルを再開', 'resume a partial download'], @@ -696,6 +909,17 @@ export const core: Record = { modes: [{ name: 'create' }, { name: 'extract' }, { name: 'list' }, { name: 'append' }, { name: 'update' }, { name: 'catenate' }, { name: 'diff' }, { name: 'delete' }, { name: 'test-label' }], conflictingModes: tx('`-A`・`-c`・`-d`・`-r`・`-t`・`-u`・`-x`・`--delete`・`--test-label` のうち別のものと一緒に指定すると、tar は「You may not specify more than one」と言って何もしない(終了ステータス 2)', 'With another of `-A`, `-c`, `-d`, `-r`, `-t`, `-u`, `-x`, `--delete`, `--test-label`, tar refuses the line: "You may not specify more than one" (exit status 2)'), parser: 'getopt_long' }), gzip: cmd('ファイルを gzip 圧縮する(元ファイルは .gz に置き換わる)', 'Compress files with gzip', [ + ['-f|--force', '強制的に圧縮・展開する', 'force'], + ['-l|--list', '圧縮ファイルの情報(圧縮率)を表示', 'list compressed file information'], + ['-r|--recursive', 'ディレクトリの中も再帰的に', 'recurse into directories'], + ['-t|--test', '圧縮ファイルの整合性を確認する', 'test the integrity'], + ['-v|--verbose', '圧縮率を表示する', 'show the compression ratio'], + ['-q|--quiet', '警告を出さない', 'quiet'], + ['-n|--no-name', '元のファイル名と日時を保存しない', 'do not save the original name and time'], + ['-N|--name', '元のファイル名と日時を保存・復元する', 'save and restore the original name and time'], + ['-S|--suffix', '圧縮ファイルの接尾辞', 'suffix to use', 'arg'], + ['-1|--fast', '最速(圧縮率は低い)', 'fastest, least compression'], + ['-9|--best', '最も強く圧縮(遅い)', 'best compression, slowest'], ['-d|--decompress', '展開する', 'decompress'], ['-c|--stdout', '結果を標準出力に出す(元ファイルを残す)', 'write to stdout, keep originals'], ['-k|--keep', '元ファイルを残す', 'keep the original'], @@ -711,7 +935,32 @@ export const core: Record = { ['--synchronous', '出力を同期して書く(クラッシュに強いが遅い)', 'synchronous output (safer if the system crashes, but slower)'], ...GNU_INFO, ], { parser: 'getopt_long' }), - gunzip: cmd('gzip ファイルを展開する', 'Decompress gzip files', [['-c|--stdout', '展開した内容を標準出力に書く(元のファイルは残す)', 'write to stdout (keep the file)'], ['-k|--keep', '元のファイルを削除しない', 'keep the input file'], ['-f|--force', '既存のファイルを上書きする', 'overwrite existing files'], ['-n|--no-name', '元のファイル名と日時を保存・復元しない', 'do not save or restore the original name and time'], ['-N|--name', '元のファイル名と日時を保存・復元する', 'save or restore the original name and time'], ['--synchronous', '出力を同期して書く(クラッシュに強いが遅い)', 'synchronous output (safer if the system crashes, but slower)'], ['--to-stdout', '`--stdout` と同じ', 'same as `--stdout`'], ['--silent', '`--quiet` と同じ', 'same as `--quiet`'], ['-L|--license', 'ライセンスを表示する', 'display the software license'], ['-Z|--lzw', 'LZW 圧縮(この版では未対応)', 'LZW compression (not supported in this version)'], ['-b|--bits', 'LZW の最大ビット数', 'maximum bits of LZW', 'arg'], ['-a|--ascii', '行末を変換する(Unix では何もしない)', 'convert line ends (ignored on Unix)'], ['-d|--decompress', '展開する', 'decompress'], ['--uncompress', '`--decompress` と同じ', 'same as `--decompress`'], ['--rsyncable', 'rsync で差分転送しやすい形式にする', 'make an rsync-friendly archive'], ['-1|--fast', '最速(圧縮率は低い)', 'fastest, least compression'], ['-9|--best', '最も強く圧縮(遅い)', 'best compression, slowest'], ...GNU_INFO], { parser: 'getopt_long', positional: [files] }), + gunzip: cmd('gzip ファイルを展開する', 'Decompress gzip files', [ + ['-l|--list', '圧縮ファイルの情報(圧縮率)を表示', 'list compressed file information'], + ['-r|--recursive', 'ディレクトリの中も再帰的に', 'recurse into directories'], + ['-t|--test', '圧縮ファイルの整合性を確認する', 'test the integrity'], + ['-v|--verbose', '詳しく表示する', 'verbose'], + ['-q|--quiet', '警告を出さない', 'quiet'], + ['-S|--suffix', '圧縮ファイルの接尾辞', 'suffix to use', 'arg'], + ['-c|--stdout', '展開した内容を標準出力に書く(元のファイルは残す)', 'write to stdout (keep the file)'], + ['-k|--keep', '元のファイルを削除しない', 'keep the input file'], + ['-f|--force', '既存のファイルを上書きする', 'overwrite existing files'], + ['-n|--no-name', '元のファイル名と日時を保存・復元しない', 'do not save or restore the original name and time'], + ['-N|--name', '元のファイル名と日時を保存・復元する', 'save or restore the original name and time'], + ['--synchronous', '出力を同期して書く(クラッシュに強いが遅い)', 'synchronous output (safer if the system crashes, but slower)'], + ['--to-stdout', '`--stdout` と同じ', 'same as `--stdout`'], + ['--silent', '`--quiet` と同じ', 'same as `--quiet`'], + ['-L|--license', 'ライセンスを表示する', 'display the software license'], + ['-Z|--lzw', 'LZW 圧縮(この版では未対応)', 'LZW compression (not supported in this version)'], + ['-b|--bits', 'LZW の最大ビット数', 'maximum bits of LZW', 'arg'], + ['-a|--ascii', '行末を変換する(Unix では何もしない)', 'convert line ends (ignored on Unix)'], + ['-d|--decompress', '展開する', 'decompress'], + ['--uncompress', '`--decompress` と同じ', 'same as `--decompress`'], + ['--rsyncable', 'rsync で差分転送しやすい形式にする', 'make an rsync-friendly archive'], + ['-1|--fast', '最速(圧縮率は低い)', 'fastest, least compression'], + ['-9|--best', '最も強く圧縮(遅い)', 'best compression, slowest'], + ...GNU_INFO, + ], { parser: 'getopt_long', positional: [files] }), zip: cmd('ZIP アーカイブを作る', 'Create ZIP archives', [['-r', 'ディレクトリを再帰的に追加', 'recurse into directories']], { positional: [pos('作る ZIP ファイル', 'ZIP file to create or update'), pos('追加するファイル', 'file to add')] }), unzip: cmd('ZIP アーカイブを展開する', 'Extract ZIP archives', [ ['-d', '展開先ディレクトリ', 'destination directory', 'arg'], @@ -720,6 +969,25 @@ export const core: Record = { ['-l', '展開せず中身を一覧表示', 'list the contents without extracting'], ], { positional: [pos('ZIP ファイル', 'ZIP file'), pos('取り出すファイル', 'file to extract')] }), cp: cmd('ファイルやディレクトリをコピーする', 'Copy files and directories', [ + ['-l|--link', 'コピーせずハードリンクを作る', 'hard-link instead of copying'], + ['-s|--symbolic-link', 'コピーせずシンボリックリンクを作る', 'make symbolic links instead of copying'], + ['-b', '上書きするファイルのバックアップを作る', 'back up files that would be overwritten'], + ['--backup', 'バックアップの方式(`numbered`、`simple`…)', 'backup method (`numbered`, `simple`…)', 'attached'], + ['-S|--suffix', 'バックアップの接尾辞', 'backup suffix', 'arg'], + ['-t|--target-directory', 'コピー先のディレクトリ', 'copy into the given directory', 'arg'], + ['-T|--no-target-directory', 'コピー先を常にファイルとして扱う', 'treat the destination as a file'], + ['-d', 'シンボリックリンクをそのままコピーし、リンクを保つ', 'copy links as links and preserve them'], + ['-L|--dereference', 'シンボリックリンクの先をコピーする', 'follow symbolic links in the source'], + ['-P|--no-dereference', 'シンボリックリンクをたどらない', 'never follow symbolic links'], + ['-H', 'コマンドラインのシンボリックリンクだけたどる', 'follow links given on the command line'], + ['-x|--one-file-system', '他のファイルシステムには入らない', 'stay on this file system'], + ['--preserve', '保つ属性(`mode,ownership,timestamps`、`all`)', 'attributes to preserve (`mode,ownership,timestamps`, `all`)', 'attached'], + ['--no-preserve', '保たない属性', 'attributes not to preserve', 'arg'], + ['--parents', '元のパスの構造ごとコピーする', 'keep the source path structure'], + ['--reflink', 'コピーオンライトで複製する(`auto`、`always`)', 'clone with copy-on-write (`auto`, `always`)', 'attached'], + ['--remove-destination', '先にコピー先を削除してからコピー', 'remove the destination first'], + ['--attributes-only', '中身でなく属性だけコピー', 'copy only the attributes, not the data'], + ['-Z', 'SELinux のコンテキストを設定', 'set the SELinux context'], ['-r|-R|--recursive', 'ディレクトリを再帰的にコピー', 'copy directories recursively'], ['-a|--archive', '属性(権限・日時・リンク)を保ったまま再帰的にコピー', 'archive mode: recursive, preserve attributes'], ['-f|--force', '書き込めない既存ファイルも上書き', 'force overwrite'], @@ -737,6 +1005,11 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long', positional: [pos('コピー元', 'source')], operands: lastIsDestination(pos('コピー元', 'source'), pos('コピー先(新しい名前、または既存のディレクトリ)', 'destination (the new name, or an existing directory)'), pos('コピー先のディレクトリ', 'destination directory')) }), mv: cmd('ファイルを移動・名前変更する', 'Move or rename files', [ + ['-b', '上書きするファイルのバックアップを作る', 'back up files that would be overwritten'], + ['-t|--target-directory', '移動先のディレクトリ', 'move into the given directory', 'arg'], + ['-T|--no-target-directory', '移動先を常にファイルとして扱う', 'treat the destination as a file'], + ['-S|--suffix', 'バックアップの接尾辞', 'backup suffix', 'arg'], + ['--strip-trailing-slashes', '元の名前の末尾の `/` を取る', 'remove trailing slashes from the sources'], ['-f|--force', '確認せず上書き', 'do not prompt before overwriting'], ['-i|--interactive', '上書き前に確認する', 'prompt before overwrite'], ['-n|--no-clobber', '既存ファイルを上書きしない', 'do not overwrite'], @@ -750,6 +1023,9 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long', positional: [pos('移動元', 'source')], operands: lastIsDestination(pos('移動元', 'source'), pos('移動先(新しい名前、または既存のディレクトリ)', 'destination (the new name, or an existing directory)'), pos('移動先のディレクトリ', 'destination directory')) }), rm: cmd('ファイルを削除する(ゴミ箱には入らない)', 'Remove files (no trash; permanent)', [ + ['-I', '多数のファイルや再帰削除の前に1回だけ確認', 'ask once before removing many files or recursing'], + ['--one-file-system', '再帰削除で他のファイルシステムに入らない', 'stay on this file system when recursing'], + ['--no-preserve-root', '`/` も再帰削除の対象にする(極めて危険。注意)', 'do not protect `/` (extremely dangerous; careful)'], ['-r|-R|--recursive', 'ディレクトリを中身ごと再帰的に削除', 'remove directories and their contents'], ['-f|--force', '存在しないファイルを無視し、確認もしない', 'ignore nonexistent files, never prompt'], ['-i', '削除前に1件ずつ確認する', 'prompt before every removal'], @@ -774,18 +1050,33 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long' }), touch: cmd('ファイルの更新日時を現在時刻にする。存在しなければ空ファイルを作成', 'Update file timestamps; create empty files if missing', [ + ['-a', 'アクセス時刻だけ変える', 'change only the access time'], + ['-m', '更新時刻だけ変える', 'change only the modification time'], + ['-h|--no-dereference', 'シンボリックリンク自体を対象にする', 'affect the link itself'], ['-t', '指定した日時にする(`[[CC]YY]MMDDhhmm[.ss]`)', 'use the given time (`[[CC]YY]MMDDhhmm[.ss]`)', 'arg'], ['-d|--date', '指定した日時にする(`2024-01-02 03:04`)', 'use the given date (`2024-01-02 03:04`)', 'arg'], ['-r|--reference', '指定したファイルと同じ日時にする', "use the given file's times", 'arg'], ['-c|--no-create', 'ファイルがなければ作らない', 'do not create missing files'], ['--time', '変える時刻(`atime`, `access`, `use` はアクセス時刻、`mtime`, `modify` は更新時刻)', 'which time to change (`atime`, `access`, `use`: access; `mtime`, `modify`: modification)', 'arg'], ...GNU_INFO, ], { parser: 'getopt_long', positional: [files] }), chmod: cmd('ファイルの権限(パーミッション)を変更する', 'Change file permissions', [ + ['-c|--changes', '変更したものだけ表示', 'report only changes'], + ['-f|--silent|--quiet', 'エラーを表示しない', 'suppress most error messages'], + ['-v|--verbose', '処理したすべてのファイルを表示', 'report every file processed'], + ['--preserve-root', '`/` を再帰的に変更しない', 'refuse recursive changes on `/`'], ['-R|--recursive', 'ディレクトリ内を再帰的に変更', 'change recursively'], ['--reference', '指定したファイルと同じ権限にする', 'use the mode of the given file', 'arg'], ['--no-preserve-root', '`/` も再帰的に変更する(既定)', 'do not protect `/` from recursive changes (the default)'], ...GNU_INFO, ], { parser: 'getopt_long', operands: [byCount(1, [files], { orMore: true, when: '--reference' })], positional: [pos('権限(例: `755`, `+x` は実行権限を付与, `u+w`)', 'mode (e.g. `755`, `+x`, `u+w`)'), files], positionalLang: ['mode'] }), chown: cmd('ファイルの所有者・グループを変更する', 'Change file owner and group', [ + ['-c|--changes', '変更したものだけ表示', 'report only changes'], + ['-f|--silent|--quiet', 'エラーを表示しない', 'suppress most error messages'], + ['-v|--verbose', '処理したすべてのファイルを表示', 'report every file processed'], + ['-h|--no-dereference', 'シンボリックリンク自体を対象にする', 'affect the link itself'], + ['-H', 'コマンドラインのシンボリックリンクだけたどる', 'follow links given on the command line'], + ['-L', 'シンボリックリンクをすべてたどる', 'follow all symbolic links'], + ['-P', 'シンボリックリンクをたどらない(既定)', 'follow no symbolic links (default)'], + ['--from', '現在の所有者が一致するものだけ変更する', 'change only if the current owner matches', 'arg'], ['-R|--recursive', 'ディレクトリ内を再帰的に変更', 'change recursively'], ['--reference', '指定したファイルと同じ所有者・グループにする', 'use the owner and group of the given file', 'arg'], ['--dereference', 'シンボリックリンクの先を対象にする(既定)', 'affect the target of each symbolic link (the default)'], @@ -794,6 +1085,14 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long', operands: [byCount(1, [files], { orMore: true, when: '--reference' })], positional: [pos('所有者(`user:group` 形式)', 'owner (`user:group`)'), files] }), ln: cmd('ファイルへのリンクを作る', 'Create links between files', [ + ['-i|--interactive', '上書きする前に確認する', 'ask before overwriting'], + ['-v|--verbose', '作ったリンクを表示する', 'print each link made'], + ['-b', '上書きするファイルのバックアップを作る', 'back up files that would be overwritten'], + ['-r|--relative', '相対パスのシンボリックリンクを作る', 'make symbolic links relative to the link location'], + ['-t|--target-directory', 'リンクを作るディレクトリ', 'create links in the given directory', 'arg'], + ['-T|--no-target-directory', 'リンク名を常にファイルとして扱う', 'treat the link name as a file'], + ['-L|--logical', 'ハードリンクの元がシンボリックリンクなら先をたどる', 'dereference link targets when hard-linking'], + ['-P|--physical', 'シンボリックリンクそのものにハードリンクを作る', 'hard-link to the symbolic link itself'], ['-s|--symbolic', 'シンボリックリンクを作成(なければハードリンク)', 'make a symbolic link (otherwise hard link)'], ['-f|--force', '既存のリンク先ファイルを置き換える', 'remove existing destination files'], ['-n|--no-dereference', 'リンク先がディレクトリへのシンボリックリンクでもその中に作らない', 'treat a symlinked destination directory as a file'], @@ -810,14 +1109,33 @@ export const core: Record = { byCount(3, [pos('リンク先(実体)', 'target')], { orMore: true, unless: '-t|--target-directory', last: pos('リンクを作るディレクトリ', 'directory to make the links in') }), ], }), - basename: cmd('パスからディレクトリ部分を除いたファイル名を取り出す', 'Strip directory (and optional suffix) from a path', GNU_INFO, { example: 'basename', parser: 'getopt_long', positional: [pos('パス', 'path')], operands: [byCount(2, [pos('パス', 'path'), pos('取り除く拡張子', 'suffix to remove')], { unless: '-a|--multiple|-s|--suffix' })] }), - dirname: cmd('パスからディレクトリ部分を取り出す', 'Strip the last component from a path', GNU_INFO, { example: 'dirname', parser: 'getopt_long', positional: [pos('パス', 'path')] }), + basename: cmd('パスからディレクトリ部分を除いたファイル名を取り出す', 'Strip directory (and optional suffix) from a path', [ + ['-a|--multiple', '複数の引数を処理する', 'support multiple arguments'], + ['-s|--suffix', '取り除く接尾辞', 'remove the given suffix', 'arg'], + ['-z|--zero', '各項目を改行でなく NUL で終える', 'end output with NUL'], + ...GNU_INFO, + ], { example: 'basename', parser: 'getopt_long', positional: [pos('パス', 'path')], operands: [byCount(2, [pos('パス', 'path'), pos('取り除く拡張子', 'suffix to remove')], { unless: '-a|--multiple|-s|--suffix' })] }), + dirname: cmd('パスからディレクトリ部分を取り出す', 'Strip the last component from a path', [ + ['-z|--zero', '各項目を改行でなく NUL で終える', 'end output with NUL'], + ...GNU_INFO, + ], { example: 'dirname', parser: 'getopt_long', positional: [pos('パス', 'path')] }), realpath: cmd('シンボリックリンクや `..` を解決した絶対パスを表示する', 'Print the resolved absolute path', [ + ['-e|--canonicalize-existing', 'すべての要素が存在する場合だけ解決する', 'all components must exist'], + ['-m|--canonicalize-missing', '存在しなくても解決する', 'no component needs to exist'], + ['-s|--strip|--no-symlinks', 'シンボリックリンクを解決しない', 'do not expand symbolic links'], + ['-q|--quiet', 'エラーを表示しない', 'suppress error messages'], + ['--relative-to', '指定したディレクトリからの相対パスで出力', 'print relative to the given directory', 'arg'], + ['--relative-base', '指定したディレクトリ以下のときだけ相対パスで出力', 'print relative only below the given directory', 'arg'], + ['-z|--zero', '各項目を改行でなく NUL で終える', 'end output with NUL'], ['-L|--logical', '`..` をシンボリックリンクより先に解決する', 'resolve `..` before symbolic links'], ['-P|--physical', '出会ったシンボリックリンクから順に解決する(既定)', 'resolve symbolic links as they are met (the default)'], ...GNU_INFO, ], { parser: 'getopt_long', positional: [pos('パス', 'path')] }), readlink: cmd('シンボリックリンクのリンク先を表示する', 'Print the target of a symbolic link', [ + ['-e|--canonicalize-existing', 'すべての要素が存在する場合だけ正規化する', 'canonicalize; all components must exist'], + ['-m|--canonicalize-missing', '存在しなくても正規化する', 'canonicalize; no component needs to exist'], + ['-n|--no-newline', '末尾に改行を付けない', 'do not output a trailing newline'], + ['-z|--zero', '各項目を改行でなく NUL で終える', 'end output with NUL'], ['-f|--canonicalize', '全てのリンクを再帰的に解決した絶対パスを表示', 'canonicalize by following every symlink'], ['-q|--quiet', 'エラーを表示しない', 'suppress error messages'], ['-s|--silent', 'エラーを表示しない', 'suppress error messages'], @@ -825,6 +1143,10 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long' }), date: cmd('日時を表示・設定する', 'Print or set the date and time', [ + ['-s|--set', '時刻を設定する(root)', 'set the time (root)', 'arg'], + ['-f|--file', 'ファイルの各行を日付として整形する', 'format each line of a file as a date', 'arg'], + ['--debug', '日付の解釈を表示する', 'annotate the parsed date'], + ['--rfc-3339', 'RFC 3339 形式で出力(`date`、`seconds`、`ns`)', 'output in RFC 3339 format (`date`, `seconds`, `ns`)', 'arg'], ['-d|--date', '現在時刻の代わりに指定した日時を使う(例: `yesterday`)', 'use the given date instead of now (e.g. `yesterday`)', 'arg'], ['-u|--utc|--universal', 'UTC で表示', 'use UTC'], ['-I|--iso-8601', 'ISO 8601 形式で表示(`-Iseconds` のように精度を直後に付けられる: `date` `hours` `minutes` `seconds` `ns`)', 'ISO 8601 format (a precision may follow directly, as in `-Iseconds`: `date`, `hours`, `minutes`, `seconds`, `ns`)', 'attached'], @@ -944,11 +1266,67 @@ export const core: Record = { operands: [{ pattern: [operand('DESTINATION', '接続先(`user@host`)', 'destination (`user@host`)'), operand('COMMAND', 'リモートで実行するコマンド', 'remote command', { repeat: '?', command: { run: 'shell-string', where: 'remote', joinsWords: true } })] }], }), scp: cmd('SSH 経由でファイルをコピーする', 'Copy files over SSH', [ + ['-q', '進行状況を表示しない', 'quiet; no progress meter'], + ['-C', '通信を圧縮する', 'compress the connection'], + ['-v', '詳しく表示する', 'verbose'], + ['-p', '更新時刻とパーミッションを保つ', 'preserve times and modes'], + ['-l', '帯域の上限(Kbit/s)', 'bandwidth limit in Kbit/s', 'arg'], + ['-o', 'ssh のオプションを渡す', 'pass an ssh option', 'arg'], + ['-F', 'ssh の設定ファイル', 'ssh configuration file', 'arg'], + ['-J', '経由する踏み台ホスト', 'jump host', 'arg'], + ['-3', '2つのリモートの間をこちら経由でコピーする', 'copy between two remote hosts through this host'], + ['-4', 'IPv4 だけを使う', 'use IPv4 only'], + ['-6', 'IPv6 だけを使う', 'use IPv6 only'], + ['-B', '対話せず(バッチ)実行する', 'batch mode; no prompts'], + ['-c', '暗号方式', 'cipher', 'arg'], + ['-S', '使う ssh プログラム', 'ssh program to use', 'arg'], ['-r', 'ディレクトリを再帰的にコピー', 'copy recursively'], ['-P', 'ポート番号', 'port', 'arg'], ['-i', '秘密鍵ファイル', 'identity file', 'arg'], ], { positional: [pos('コピー元(`ホスト:パス` も可)', 'source (or `host:path`)')], operands: lastIsDestination(pos('コピー元(`ホスト:パス` も可)', 'source (or `host:path`)'), pos('コピー先(`ホスト:パス` も可)', 'destination (or `host:path`)'), pos('コピー先のディレクトリ(`ホスト:パス` も可)', 'destination directory (or `host:path`)')) }), rsync: cmd('ファイルを差分転送で同期する(ローカル・リモート間)', 'Sync files efficiently (local or remote)', [ + ['-u|--update', '受け取り側が新しいファイルは飛ばす', 'skip files that are newer on the receiver'], + ['-l|--links', 'シンボリックリンクをリンクのままコピーする', 'copy symlinks as symlinks'], + ['-H|--hard-links', 'ハードリンクを保つ', 'preserve hard links'], + ['-p|--perms', 'パーミッションを保つ', 'preserve permissions'], + ['-o|--owner', '所有者を保つ(root)', 'preserve the owner (root)'], + ['-g|--group', 'グループを保つ', 'preserve the group'], + ['-t|--times', '更新時刻を保つ', 'preserve modification times'], + ['-D', 'デバイスファイルと特殊ファイルを保つ', 'preserve devices and special files'], + ['-x|--one-file-system', '他のファイルシステムに入らない', 'stay on one file system'], + ['-c|--checksum', '時刻とサイズでなくチェックサムで比べる', 'compare by checksum, not time and size'], + ['-b|--backup', '上書きするファイルのバックアップを作る', 'back up replaced files'], + ['--backup-dir', 'バックアップを置くディレクトリ', 'directory for backups', 'arg'], + ['-S|--sparse', '疎なファイルを効率よく扱う', 'handle sparse files efficiently'], + ['-W|--whole-file', '差分でなくファイル全体を送る', 'copy whole files, no delta transfer'], + ['-X|--xattrs', '拡張属性を保つ', 'preserve extended attributes'], + ['-A|--acls', 'ACL を保つ', 'preserve ACLs'], + ['--partial', '途中で切れた転送のファイルを残す', 'keep partially transferred files'], + ['--bwlimit', '帯域の上限(KiB/s)', 'bandwidth limit (KiB/s)', 'arg'], + ['--exclude-from', '除外するパターンを書いたファイル', 'file of exclude patterns', 'arg'], + ['--include', '除外から除くパターン', 'include files matching the pattern', 'arg'], + ['--include-from', '含めるパターンを書いたファイル', 'file of include patterns', 'arg'], + ['--delete-after', '転送が終わってから削除する', 'delete after the transfer'], + ['--delete-before', '転送の前に削除する', 'delete before the transfer'], + ['--delete-excluded', '除外したファイルも受け取り側で削除する', 'also delete excluded files on the receiver'], + ['--stats', '転送の統計を表示', 'show transfer statistics'], + ['-i|--itemize-changes', '変更の内容を1行ずつ表示', 'output a change summary for each file'], + ['--remove-source-files', '送った後で送り元のファイルを削除する(注意)', 'delete source files after sending (careful)'], + ['--files-from', '転送するファイル名を書いたファイル', 'file listing the names to transfer', 'arg'], + ['--link-dest', '変更がないファイルをハードリンクにする基準ディレクトリ', 'hard-link unchanged files against the given directory', 'arg'], + ['-m|--prune-empty-dirs', '空のディレクトリを送らない', 'prune empty directories'], + ['--size-only', 'サイズだけで比べる', 'skip files that match in size'], + ['--ignore-existing', '受け取り側に既にあるファイルは飛ばす', 'skip files that exist on the receiver'], + ['--inplace', '一時ファイルを使わず直接更新する', 'update destination files in place'], + ['--numeric-ids', '名前でなく数値の UID/GID で扱う', 'use numeric user and group IDs'], + ['-q|--quiet', '表示を減らす', 'quiet'], + ['--timeout', 'I/O のタイムアウト(秒)', 'I/O timeout in seconds', 'arg'], + ['-R|--relative', '元のパスの構造ごと送る', 'use relative path names'], + ['--chown', '受け取り側の所有者を指定する', 'set the owner on the receiver', 'arg'], + ['--chmod', '受け取り側のパーミッションを指定する', 'set the permissions on the receiver', 'arg'], + ['--log-file', 'ログを書くファイル', 'log to the given file', 'arg'], + ['--rsh', '使うリモートシェル(`ssh`)', 'remote shell to use (`ssh`)', 'arg'], + ['-8|--8-bit-output', '8 ビット文字をそのまま出力する', 'leave high-bit characters unescaped'], ['-a|--archive', '属性を保ったまま再帰的に同期(`-rlptgoD` と同じ)', 'archive mode (recursive, preserve attributes)'], ['-v|--verbose', '詳細を表示', 'verbose'], ['-z|--compress', '転送時に圧縮', 'compress during transfer'], @@ -1085,7 +1463,9 @@ export const core: Record = { { pattern: [runs({ run: 'shell-string', joinsWords: true, env: 'exported', shell: 'sh' })] }, ], }), - which: cmd('コマンドの実行ファイルのパスを表示する', 'Show the full path of a command'), + which: cmd('コマンドの実行ファイルのパスを表示する', 'Show the full path of a command', [ + ['-a|--all', '見つかったものをすべて表示', 'print all matches in PATH'], + ]), jq: cmd('JSON を整形・抽出・変換する', 'Filter and transform JSON', [ ['-r|--raw-output', '文字列をクォートなしで出力', 'output raw strings without quotes'], ['-c|--compact-output', '1行に詰めて出力', 'compact output'], @@ -1219,8 +1599,30 @@ export const core: Record = { oldStyle: { letters: letters(restoreLetters), needs: 'CrRxti' }, ...args(operand('FILE', '復元するファイル', 'files to restore')), }), - pgrep: cmd('名前に一致するプロセスの PID を表示する', 'Find PIDs by process name', [['-f', 'コマンドライン全体で照合', 'match the full command line']], { positional: [pos('プロセス名のパターン(正規表現)', 'process name pattern (regular expression)')] }), - pkill: cmd('名前に一致するプロセスにシグナルを送る', 'Signal processes by name', [['-f', 'コマンドライン全体で照合', 'match the full command line']], { positional: [pos('プロセス名のパターン(正規表現)', 'process name pattern (regular expression)')] }), + pgrep: cmd('名前に一致するプロセスの PID を表示する', 'Find PIDs by process name', [ + ['-u|--euid', '実効ユーザーで絞る', 'match the effective user', 'arg'], + ['-U|--uid', '実ユーザーで絞る', 'match the real user', 'arg'], + ['-G|--group', '実グループで絞る', 'match the real group', 'arg'], + ['-P|--parent', '親プロセスの PID で絞る', 'match the parent PID', 'arg'], + ['-t|--terminal', '端末で絞る', 'match the terminal', 'arg'], + ['-s|--session', 'セッション ID で絞る', 'match the session ID', 'arg'], + ['-x|--exact', '名前が完全に一致するものだけ', 'match the name exactly'], + ['-n|--newest', '最も新しく起動したものだけ', 'only the newest'], + ['-o|--oldest', '最も古くから動いているものだけ', 'only the oldest'], + ['-i|--ignore-case', '大文字と小文字を区別しない', 'ignore case'], + ['-v|--inverse', '一致しないものを対象にする', 'negate the match'], + ['-F|--pidfile', 'PID ファイルの PID だけ', 'read PIDs from a file', 'arg'], + ['-a|--list-full', 'コマンドライン全体も表示', 'list the full command line'], + ['-l|--list-name', 'プロセス名も表示', 'list the process name'], + ['-c|--count', '一致した数だけ表示', 'print the number of matches'], + ['-d|--delimiter', '出力の区切り文字', 'output delimiter', 'arg'], + ['-f', 'コマンドライン全体で照合', 'match the full command line'], + ], { positional: [pos('プロセス名のパターン(正規表現)', 'process name pattern (regular expression)')] }), + pkill: cmd('名前に一致するプロセスにシグナルを送る', 'Signal processes by name', [ + ...signalOpts(), + ...pgrepCommon(), + ['-f', 'コマンドライン全体で照合', 'match the full command line'], + ], { positional: [pos('プロセス名のパターン(正規表現)', 'process name pattern (regular expression)')] }), seq: cmd('連続した数値を1行ずつ出力する', 'Print a sequence of numbers', [ ['-w|--equal-width', '桁数をゼロ埋めで揃える', 'pad with leading zeros'], ['-s|--separator', '区切り文字', 'separator', 'arg'], @@ -1248,6 +1650,8 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long', positional: [pos('テンプレート(末尾に `XXXXXX`。例: `tmp.XXXXXX`)', 'template ending in `XXXXXX` (e.g. `tmp.XXXXXX`)')] }), stat: cmd('ファイルの詳細情報(サイズ・権限・日時など)を表示する', 'Display file status (size, permissions, times…)', [ + ['-t|--terse', '簡潔な形式で表示', 'terse output'], + ['--printf', '書式を指定して出力', 'custom format, with backslash escapes', 'arg'], ['-c|--format', '表示書式(例: `%s` はサイズ)', 'output format (e.g. `%s` = size)', 'arg'], ['-f|--file-system', 'ファイルでなく、それがあるファイルシステムの情報(Linux。macOS の `-f` は書式の指定)', 'the file system instead of the file (Linux; on macOS `-f` gives the format)'], ['-L|--dereference', 'シンボリックリンクの先を見る', 'follow symbolic links'], @@ -1255,6 +1659,20 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long' }), du: cmd('ファイル・ディレクトリのディスク使用量を表示する', 'Estimate disk usage', [ + ['-a|--all', 'ファイルも表示(ディレクトリだけでなく)', 'show files too, not just directories'], + ['-c|--total', '合計を最後に表示', 'print a grand total'], + ['-k', '1KiB 単位で表示', 'use 1 KiB blocks'], + ['-m', '1MiB 単位で表示', 'use 1 MiB blocks'], + ['-b|--bytes', 'バイト数で表示(`--apparent-size --block-size=1`)', 'print sizes in bytes (`--apparent-size --block-size=1`)'], + ['-x|--one-file-system', '他のファイルシステムに入らない', 'stay on one file system'], + ['-L|--dereference', 'シンボリックリンクの先をたどる', 'follow all symbolic links'], + ['-S|--separate-dirs', 'サブディレクトリの分を含めずに数える', 'do not include the sizes of subdirectories'], + ['--apparent-size', '実際に使っている領域でなく見かけのサイズ', 'show apparent sizes, not disk usage'], + ['--exclude', '除外するパターン', 'exclude names matching the pattern', 'arg'], + ['-0|--null', '各行を改行でなく NUL で終える', 'end each line with NUL'], + ['--si', '1000 の累乗の単位で表示', 'use powers of 1000'], + ['--inodes', '容量でなく inode 数を表示', 'list inode counts instead of sizes'], + ['-B|--block-size', '表示する単位', 'block size to use', 'arg'], ['-s|--summarize', '合計だけを表示', 'show only a total'], ['-h|--human-readable', '読みやすい単位で表示', 'human-readable sizes'], ['-d|--max-depth', '表示する階層の深さ', 'depth limit', 'arg'], @@ -1269,6 +1687,17 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long' }), df: cmd('ファイルシステムの空き容量を表示する', 'Report file system disk space', [ + ['-a|--all', '容量 0 のファイルシステムも含める', 'include file systems with 0 blocks'], + ['-i|--inodes', 'inode の使用状況を表示', 'show inode usage'], + ['-k', '1KiB 単位で表示', 'use 1 KiB blocks'], + ['-T|--print-type', 'ファイルシステムの種類も表示', 'print the file system type'], + ['-t|--type', '指定した種類だけ表示', 'only the given file system type', 'arg'], + ['-x|--exclude-type', '指定した種類を除く', 'exclude the given file system type', 'arg'], + ['-H|--si', '1000 の累乗の単位で表示', 'use powers of 1000'], + ['-l|--local', 'ローカルのファイルシステムだけ', 'local file systems only'], + ['--total', '合計行を付ける', 'add a grand total'], + ['-P|--portability', 'POSIX の書式で表示', 'use the POSIX output format'], + ['-B|--block-size', '表示する単位', 'block size to use', 'arg'], ['-h|--human-readable', '読みやすい単位で表示', 'human-readable sizes'], ['--no-sync', '使用状況を調べる前に `sync` しない(既定)', 'do not call `sync` before getting usage (the default)'], ['--sync', '使用状況を調べる前に `sync` する', 'call `sync` before getting usage'], @@ -1277,7 +1706,17 @@ export const core: Record = { ], { parser: 'getopt_long' }), tput: cmd('端末の機能(色・カーソル位置など)を操作する', 'Query or control terminal capabilities (colors, cursor…)'), less: cmd('ファイルをページ単位でスクロール表示する', 'View text one screen at a time'), - file: cmd('ファイルの種類を判定して表示する', 'Determine file type'), + file: cmd('ファイルの種類を判定して表示する', 'Determine file type', [ + ['-b|--brief', 'ファイル名を付けずに結果だけ表示', 'do not prepend file names'], + ['-i|--mime', 'MIME タイプと文字コードを表示', 'show the MIME type and encoding'], + ['--mime-type', 'MIME タイプだけ表示', 'show only the MIME type'], + ['--mime-encoding', '文字コードだけ表示', 'show only the encoding'], + ['-L|--dereference', 'シンボリックリンクの先を調べる', 'follow symbolic links'], + ['-f|--files-from', '調べるファイル名の一覧を読むファイル', 'read file names from the given file', 'arg'], + ['-z|--uncompress', '圧縮ファイルの中身を調べる', 'look inside compressed files'], + ['-s|--special-files', 'ブロック・キャラクタデバイスの中身も調べる', 'read block and character special files too'], + ['-k|--keep-going', '最初の一致で止めずにすべての一致を表示', 'do not stop at the first match'], + ]), install: cmd('ファイルをコピーし、権限や所有者を設定する', 'Copy files and set attributes', [ ['-m|--mode', '権限', 'permission mode', 'arg lang:mode'], ['-d|--directory', 'ディレクトリを作成', 'create directories'], @@ -1312,6 +1751,13 @@ export const core: Record = { ], { parser: 'getopt_long' }), rev: cmd('各行の文字を左右反転する', 'Reverse characters of each line'), nl: cmd('行番号を付けて表示する', 'Number lines of files', [ + ['-b|--body-numbering', '本文の行番号の付け方(`a` すべて、`t` 空行以外、`n` なし)', 'which body lines to number (`a` all, `t` non-empty, `n` none)', 'arg'], + ['-n|--number-format', '行番号の書式(`ln` 左詰め、`rn` 右詰め、`rz` 0 埋め)', 'number format (`ln` left, `rn` right, `rz` zero-padded)', 'arg'], + ['-w|--number-width', '行番号の桁数', 'width of the line numbers', 'arg'], + ['-s|--number-separator', '行番号と本文の間の文字列', 'string between the number and the text', 'arg'], + ['-v|--starting-line-number', '最初の行番号', 'first line number', 'arg'], + ['-i|--line-increment', '行番号の増分', 'line number increment', 'arg'], + ['-p|--no-renumber', 'ページごとに番号を振り直さない', 'do not restart numbering at each page'], ['-d|--section-delimiter', '論理ページの区切りに使う2文字', 'two characters that delimit logical pages', 'arg'], ['-f|--footer-numbering', 'フッターの行番号の付け方(`a`, `t`, `n`, `pREGEX`)', 'how to number footer lines (`a`, `t`, `n`, `pREGEX`)', 'arg'], ['-h|--header-numbering', 'ヘッダーの行番号の付け方(`a`, `t`, `n`, `pREGEX`)', 'how to number header lines (`a`, `t`, `n`, `pREGEX`)', 'arg'], @@ -1319,11 +1765,17 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long' }), paste: cmd('複数ファイルの行を横に連結する', 'Merge lines of files side by side', [ + ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], ['-d|--delimiters', '区切り文字', 'delimiter', 'arg'], ['-s|--serial', '1ファイルの全行を1行に連結', 'join all lines of each file'], ...GNU_INFO, ], { parser: 'getopt_long' }), column: cmd('入力を列に揃えて表示する', 'Format input into columns', [ + ['-c|--output-width', '出力の幅', 'output width', 'arg'], + ['-o|--output-separator', '表の列の区切り文字', 'column separator for the table output', 'arg'], + ['-x|--fillrows', '縦でなく横に詰める', 'fill rows before columns'], + ['-N|--table-columns', '列の見出し', 'column names', 'arg'], + ['-J|--json', 'JSON で出力', 'output JSON'], ['-t|--table', '表形式に揃える', 'create a table'], ['-s|--separator', '入力の区切り文字', 'input separator', 'arg'], ]), @@ -1339,6 +1791,11 @@ export const core: Record = { ...GNU_INFO, ], { parser: 'getopt_long', positional: [pos('ソート済みのファイル1', 'sorted file 1'), pos('ソート済みのファイル2', 'sorted file 2')] }), split: cmd('ファイルを複数に分割する', 'Split a file into pieces', [ + ['-a|--suffix-length', '出力ファイル名の接尾辞の長さ', 'length of the suffixes', 'arg'], + ['-n|--number', '指定した数のファイルに分ける', 'split into the given number of files', 'arg'], + ['-C|--line-bytes', '行を壊さずに 1 ファイルの最大バイト数を決める', 'maximum bytes per file without splitting lines', 'arg'], + ['--additional-suffix', '接尾辞の後ろに付ける文字列(拡張子など)', 'string added after the suffix (an extension)', 'arg'], + ['--filter', '各ファイルをコマンドに渡す', 'pipe each piece to a command', 'arg'], ['-l|--lines', '1ファイルあたりの行数', 'lines per file', 'arg'], ['-b|--bytes', '1ファイルあたりのサイズ', 'size per file', 'arg'], ['-e|--elide-empty-files', '`-n` で空になるファイルを作らない', 'with `-n`, do not make empty files'], @@ -1563,7 +2020,26 @@ export const core: Record = { ['--tlscert', 'クライアント証明書のファイル', 'client certificate file', 'arg'], ['--tlskey', 'クライアントの秘密鍵のファイル', 'client key file', 'arg'], ['-v|--version', '版を表示して終わる', 'print the version and exit'], - ], { subcommands: dockerSubs }), + ], { + subcommands: { + ...containerSubs(), + pause: cmd('コンテナのプロセスを一時停止する', 'Pause the processes of containers'), + unpause: cmd('一時停止を解除する', 'Unpause containers'), + attach: cmd('実行中のコンテナの入出力につなぐ', 'Attach to the input and output of a running container'), + import: cmd('tar のファイルからイメージを作る', 'Create an image from a tarball'), + commit: cmd('コンテナの変更から新しいイメージを作る', 'Create an image from the changes of a container', [['-m|--message', 'コミットメッセージ', 'commit message', 'arg'], ['-a|--author', '作者', 'author', 'arg']]), + top: cmd('コンテナの中のプロセスを表示する', 'Show the processes of a container'), + history: cmd('イメージの作成履歴(レイヤー)を表示する', 'Show the history (layers) of an image'), + port: cmd('コンテナのポートの対応を表示する', 'Show the port mappings of a container'), + rename: cmd('コンテナの名前を変える', 'Rename a container'), + diff: cmd('コンテナのファイルシステムの変更を表示する', 'Show changes to the container file system'), + search: cmd('Docker Hub のイメージを検索する', 'Search Docker Hub for images'), + info: cmd('Docker の環境の情報を表示する', 'Show system-wide information'), + version: cmd('Docker のバージョンを表示する', 'Show the Docker version'), + events: cmd('サーバーのイベントをリアルタイムで表示する', 'Stream events from the server'), + ...dockerSubs, + }, + }), // podman's global options (`podman --help`), which its subcommands take too. podman: cmd('Podman: Docker と互換のコンテナツール(デーモン不要、root なしでも動く)', 'Podman: a Docker-compatible container tool (no daemon, runs rootless)', persistent([ ['-r|--remote', 'リモートの Podman サービスにつないで操作する', 'work through a remote Podman service'], @@ -1575,7 +2051,14 @@ export const core: Record = { ['--runroot', '実行時の状態を置くディレクトリ', 'directory of the runtime state', 'arg'], ['--storage-driver', 'ストレージのドライバ(`overlay`、`vfs`…)', 'storage driver (`overlay`, `vfs`…)', 'arg'], ['--cgroup-manager', 'cgroup の管理方法(`systemd`、`cgroupfs`)', 'cgroup manager (`systemd`, `cgroupfs`)', 'arg'], - ]), { subcommands: dockerSubs }), + ]), { + subcommands: { + ...containerSubs(), + pod: cmd('Pod(コンテナの集まり)を扱う', 'Handle pods (groups of containers)'), + generate: cmd('systemd のユニットや Kubernetes のマニフェストを生成する', 'Generate systemd units or Kubernetes manifests'), + ...dockerSubs, + }, + }), // npm reads its configuration options anywhere on the line (`npm --prefix dir run build`, `npm run build -w pkg`). npm: cmd('Node.js のパッケージマネージャ', 'Node.js package manager', persistent([ ['-g|--global', 'グローバル(パッケージの置き場所全体)を対象にする', 'act on the global packages'], @@ -1617,4 +2100,3 @@ export const commands: Record = { ...ops, }; -applyExtras(commands); diff --git a/src/dict/distro.ts b/src/dict/distro.ts index 1f9e7183..4462259a 100644 --- a/src/dict/distro.ts +++ b/src/dict/distro.ts @@ -188,6 +188,14 @@ export const distro: Record = { ], { parser: 'getopt_long' }), groups: cmd('ユーザーが属するグループを表示する', 'Print the groups a user belongs to', [...GNU_INFO], { parser: 'getopt_long', positional: [pos('ユーザー名(省略時は自分)', 'user name (default: yourself)')] }), who: cmd('現在ログインしているユーザーを表示する', 'Show who is logged in', [ + ['-d|--dead', '終了したプロセスを表示', 'print dead processes'], + ['-l|--login', 'ログインプロセスを表示', 'print login processes'], + ['-m', '自分の端末の情報だけ表示', 'only the host and user of this terminal'], + ['-p|--process', 'init が起動したプロセスを表示', 'print active processes spawned by init'], + ['-r|--runlevel', '現在のランレベルを表示', 'print the current run level'], + ['-s|--short', '名前・端末・時刻だけ表示(既定)', 'print only name, line and time (default)'], + ['-T|-w|--mesg', 'メッセージを受けられるか(`+` / `-`)を表示', 'show whether messages are allowed (`+` / `-`)'], + ['-t|--time', '最後にシステム時計が変更された時刻を表示', 'print the last system clock change'], ['-b|--boot', '最後に起動した時刻', 'time of last boot'], ['-H|--heading', '見出しの行を付ける', 'print a heading line'], ['-q|--count', 'ユーザー名とその人数だけ表示', 'only names and the number of users'], @@ -216,6 +224,10 @@ export const distro: Record = { // ---- process and system information --------------------------------------------------------- free: cmd('メモリとスワップの使用状況を表示する', 'Show memory and swap usage', [ + ['-k|--kibi', 'KiB 単位で表示', 'show KiB'], + ['-l|--lohi', 'メモリの高位・低位の内訳を表示', 'show detailed low and high memory'], + ['-c|--count', '指定した回数だけ表示', 'print the given number of times', 'arg'], + ['--si', '1000 の累乗の単位で表示', 'use powers of 1000'], ['-h|--human', 'KiB、MiB、GiB など読みやすい単位で表示', 'human-readable units'], ['-m|--mebi', 'MiB 単位で表示', 'show in mebibytes'], ['-g|--gibi', 'GiB 単位で表示', 'show in gibibytes'], @@ -225,6 +237,13 @@ export const distro: Record = { ['-w|--wide', 'バッファとキャッシュを分けて表示', 'show buffers and cache separately'], ]), top: cmd('プロセスの状況を実時間で表示する', 'Display running processes in real time', [ + ['-c', 'コマンドライン全体を表示', 'show the full command line'], + ['-i', 'アイドル状態のプロセスを隠す', 'hide idle processes'], + ['-S', '終了した子プロセスの時間を累計に含める', 'cumulative time mode'], + ['-s', '安全モード(対話コマンドを制限)', 'secure mode'], + ['-w', '出力の幅', 'output width', 'arg'], + ['-E', 'メモリの表示単位(`k`、`m`、`g`…)', 'memory unit for the summary (`k`, `m`, `g`…)', 'arg'], + ['-U', '実ユーザーまたは実効ユーザーで絞る', 'show only the given user', 'arg'], ['-b', 'バッチモード(端末の操作なしで出力し続ける。ログ向け)', 'batch mode (plain output, for logs)'], ['-n', '指定した回数で終了する', 'exit after the given number of iterations', 'arg'], ['-d', '更新間隔(秒)', 'refresh interval in seconds', 'arg'], @@ -240,6 +259,18 @@ export const distro: Record = { ['-o', '指定したプロセス ID を除く', 'omit these PIDs', 'arg'], ], { positional: [pos('プログラム名', 'program name')] }), lsof: cmd('開いているファイルやソケットを一覧表示する', 'List open files and sockets', [ + ['-a', '条件を AND で組み合わせる', 'AND the selection options together'], + ['-d', 'ファイルディスクリプタで絞る', 'select by file descriptor', 'arg'], + ['-F', '機械が読みやすい出力にする', 'output for programs to read', 'arg'], + ['-r', '指定した秒数ごとに繰り返す', 'repeat every N seconds', 'arg'], + ['-s', 'サイズを表示、または状態で絞る(`-sTCP:LISTEN`)', 'show size, or select by state (`-sTCP:LISTEN`)', 'arg'], + ['-U', 'UNIX ドメインソケットだけ', 'UNIX domain sockets only'], + ['-l', 'ユーザー名でなく UID で表示', 'show UIDs, not user names'], + ['-b', 'ブロックしうるカーネル関数を使わない', 'avoid kernel functions that might block'], + ['-w', '警告を出さない', 'suppress warnings'], + ['-R', '親プロセスの PID も表示', 'show the parent PID'], + ['-V', '見つからなかった条件を表示', 'report when a selection finds nothing'], + ['-L', 'リンク数を表示', 'show link counts'], ['-i', 'ネットワーク接続だけ(`:8080` や `tcp` で絞れる)', 'network connections only (a filter such as `:8080` or `tcp` can follow)'], ['-p', '指定したプロセス ID だけ', 'only the given PID', 'arg'], ['-u', '指定したユーザーだけ', 'only the given user', 'arg'], @@ -249,6 +280,13 @@ export const distro: Record = { ['-c', '指定したコマンド名で始まるプロセスだけ', 'only processes whose command starts with the given name', 'arg'], ], { positional: [pos('ファイル名(`-i` の絞り込み `:8080` なども)', 'file name (or the filter of `-i`, such as `:8080`)')] }), fuser: cmd('ファイルやポートを使っているプロセスを表示する', 'Show which processes use files or ports', [ + ['-a|--all', '使われていないファイルも表示', 'show all specified files'], + ['-l|--list-signals', 'シグナルの名前を一覧表示', 'list signal names'], + ['-M|--ismountpoint', 'マウントポイントのときだけ動作', 'only act if the name is a mount point'], + ['-w|--writeonly', '書き込み中のプロセスだけ', 'only processes with write access'], + ['-u|--user', 'ユーザー名も表示', 'append the user name'], + ['-4|--ipv4', 'IPv4 のソケットだけ', 'IPv4 sockets only'], + ['-6|--ipv6', 'IPv6 のソケットだけ', 'IPv6 sockets only'], ['-k|--kill', '使っているプロセスにシグナルを送る(注意)', 'kill the processes using them (careful)'], ['-m|--mount', 'ファイルシステム全体を対象にする', 'name a mounted file system'], ['-v|--verbose', '詳細な形式で表示', 'verbose output'], @@ -264,6 +302,13 @@ export const distro: Record = { ['-n', 'PID の順に並べる', 'sort by PID'], ], { positional: [pos('ユーザー名または PID', 'user name or PID')] }), lscpu: cmd('CPU の情報を表示する', 'Display CPU information', [ + ['-a|--all', 'オンラインとオフラインの CPU を表示', 'print both online and offline CPUs'], + ['-b|--online', 'オンラインの CPU だけ', 'online CPUs only'], + ['-c|--offline', 'オフラインの CPU だけ', 'offline CPUs only'], + ['-x|--hex', 'マスクを 16 進数で表示', 'print hexadecimal masks'], + ['-y|--physical', '物理 ID で表示', 'print physical IDs'], + ['-B|--bytes', 'サイズをバイトで表示', 'print sizes in bytes'], + ['-C|--caches', 'キャッシュの情報を表示', 'show cache information'], ['-e|--extended', 'CPU ごとの表で表示', 'one table row per CPU'], ['-p|--parse', '機械で読みやすい形式', 'machine-readable output'], ['-J|--json', 'JSON で出力', 'output JSON'], @@ -314,6 +359,22 @@ export const distro: Record = { // ---- network ------------------------------------------------------------------------------ ping: cmd('ICMP echo でホストへの到達性を確かめる', 'Check if a host is reachable with ICMP echo', [ + ['-s', 'パケットのデータ長(バイト)', 'packet data size in bytes', 'arg'], + ['-t', 'TTL(経由できるルーターの数)', 'TTL (hops)', 'arg'], + ['-I', '送信元のインターフェースまたはアドレス', 'source interface or address', 'arg'], + ['-b', 'ブロードキャストアドレスにも送る', 'allow pinging a broadcast address'], + ['-a', '応答が来たら音を鳴らす', 'audible ping'], + ['-f', '高速に連続して送る(フラッド。root)', 'flood ping (root)'], + ['-R', '経路を記録する', 'record the route'], + ['-v', '詳しく表示する', 'verbose'], + ['-D', '各行にタイムスタンプを付ける', 'print timestamps'], + ['-M', 'MTU の探索(`do` で DF ビットを立てる)', 'path MTU discovery (`do` sets the DF bit)', 'arg'], + ['-p', 'パケットに詰めるパターン', 'pattern to fill the packet', 'arg'], + ['-l', '最初に連続して送るパケットの数', 'send the given number of packets without waiting', 'arg'], + ['-Q', 'TOS(サービス種別)', 'type of service', 'arg'], + ['-B', '送信元アドレスを固定する', 'do not change the source address'], + ['-O', '応答が届かないパケットも報告する', 'report outstanding replies'], + ['-V', 'バージョンを表示', 'print the version'], ['-c', '指定した回数送って終了する', 'stop after the given number of packets', 'arg'], ['-W', '応答を待つ秒数', 'seconds to wait for a reply', 'arg'], ['-w', '全体の制限時間(秒)', 'overall deadline in seconds', 'arg'], @@ -334,6 +395,13 @@ export const distro: Record = { ['-n', '名前解決をしない', 'no DNS lookups'], ], { positional: [pos('ホスト', 'host'), pos('ポート', 'port')] }), dig: cmd('DNS に問い合わせる', 'Query DNS servers', [ + ['-b', '送信元のアドレス', 'source address', 'arg'], + ['-c', 'クラス(`IN`)', 'query class (`IN`)', 'arg'], + ['-f', '問い合わせを書いたファイル(バッチ)', 'file with queries (batch)', 'arg'], + ['-k', 'TSIG の鍵ファイル', 'TSIG key file', 'arg'], + ['-q', '問い合わせる名前', 'name to query', 'arg'], + ['-y', 'TSIG の鍵(`名前:鍵`)', 'TSIG key (`name:key`)', 'arg'], + ['-m', 'メモリのデバッグ', 'memory usage debugging', 'arg'], ['-x', '逆引き(IP アドレスから名前)', 'reverse lookup (address to name)'], ['-t', 'レコードの種類(`A`、`MX`、`TXT`…)', 'record type (`A`, `MX`, `TXT`…)', 'arg'], ['-p', 'DNS サーバーのポート', 'server port', 'arg'], @@ -342,6 +410,15 @@ export const distro: Record = { ], { positional: [pos('`@サーバー`、名前、レコードの種類、`+short` などの表示オプション', '`@server`, name, record type, display options such as `+short`')] }), nslookup: cmd('DNS に問い合わせる(名前なしで起動すると対話形式)', 'Query DNS servers (interactive if run without a name)', [], { positional: [pos('調べる名前', 'name to look up'), pos('DNS サーバー', 'DNS server')] }), host: cmd('名前と IP アドレスを DNS で変換する', 'Look up DNS names and addresses', [ + ['-v', '詳しく表示する', 'verbose'], + ['-l', 'ドメインの全ホストを一覧表示(ゾーン転送)', 'list all hosts in a domain (zone transfer)'], + ['-r', '再帰問い合わせをしない', 'do not ask for recursion'], + ['-C', 'すべての権威サーバーの SOA を比べる', 'compare SOA records of all authoritative servers'], + ['-d', 'デバッグ表示(`-v` と同じ)', 'debug output (same as `-v`)'], + ['-T', 'TCP を使う', 'use TCP'], + ['-R', '再試行の回数', 'number of retries', 'arg'], + ['-N', '名前の `.` の数(ndots)', 'number of dots (ndots)', 'arg'], + ['-c', 'クラス(`IN`)', 'query class (`IN`)', 'arg'], ['-t', 'レコードの種類(`A`、`MX`、`TXT`…)', 'record type (`A`, `MX`, `TXT`…)', 'arg'], ['-a', 'すべての種類のレコードを詳しく表示', 'all records, verbose'], ['-W', '応答を待つ秒数', 'seconds to wait for a reply', 'arg'], @@ -353,6 +430,26 @@ export const distro: Record = { ['-s', '短い一覧で表示', 'short list'], ], { positional: [pos('インターフェース名、`up` / `down`、アドレス', 'interface name, `up` / `down`, address')] }), netstat: cmd('ネットワーク接続・待ち受けポート・経路を表示する(古い `ss` 相当)', 'Show connections, listening ports and routes (the older counterpart of `ss`)', [ + ['-s|--statistics', 'プロトコルごとの統計を表示', 'show statistics per protocol'], + ['-g|--groups', 'マルチキャストグループを表示', 'show multicast group membership'], + ['-c|--continuous', '1秒ごとに表示を繰り返す', 'print continuously every second'], + ['-e|--extend', '詳しい情報も表示', 'show extended information'], + ['-o|--timers', 'タイマーの情報も表示', 'show timer information'], + ['-W|--wide', 'アドレスを省略しない', 'do not truncate IP addresses'], + ['-x|--unix', 'UNIX ドメインソケットだけ', 'UNIX domain sockets only'], + ['-w|--raw', 'RAW ソケットだけ', 'raw sockets only'], + ['-v|--verbose', '詳しく表示する', 'verbose'], + ['--tcp', 'TCP だけ', 'TCP only'], + ['--udp', 'UDP だけ', 'UDP only'], + ['--listening', '待ち受け中のものだけ', 'listening sockets only'], + ['--all', 'すべてのソケット', 'all sockets'], + ['--numeric', '名前を引かず数値のまま表示', 'numeric output'], + ['--program', 'プロセスの PID と名前も表示', 'show the PID and name of the process'], + ['--route', 'ルーティングテーブル', 'routing table'], + ['--interfaces', 'インターフェースの統計', 'interface statistics'], + ['-4|--inet', 'IPv4 だけ', 'IPv4 only'], + ['-6|--inet6', 'IPv6 だけ', 'IPv6 only'], + ['-M|--masquerade', 'マスカレードされた接続を表示', 'show masqueraded connections'], ['-t', 'TCP', 'TCP'], ['-u', 'UDP', 'UDP'], ['-l', '待ち受けているソケットだけ', 'listening sockets only'], @@ -363,6 +460,14 @@ export const distro: Record = { ['-i', 'インターフェースの統計を表示', 'show interface statistics'], ]), 'ssh-add': cmd('ssh-agent に秘密鍵を登録する', 'Add private keys to ssh-agent', [ + ['-x', 'エージェントをパスワードでロックする', 'lock the agent with a password'], + ['-X', 'エージェントのロックを解除する', 'unlock the agent'], + ['-c', '鍵を使うたびに確認する', 'ask for confirmation on each use'], + ['-q', '表示を減らす', 'quiet'], + ['-v', '詳しく表示する', 'verbose'], + ['-E', 'フィンガープリントのハッシュ', 'fingerprint hash', 'arg'], + ['-K', 'キーチェーンから鍵を読み込む', 'load keys from the keychain'], + ['-A', '保存済みのパスフレーズで鍵を追加する(macOS)', 'add keys with stored passphrases (macOS)'], ['-l', '登録されている鍵の指紋を表示', 'list fingerprints of loaded keys'], ['-L', '登録されている公開鍵を表示', 'list public keys of loaded keys'], ['-d', '指定した鍵を取り除く', 'remove the given keys'], @@ -403,6 +508,32 @@ export const distro: Record = { ['-i', '削除の前に確認する', 'ask before removing'], ], { positional: [pos('登録する crontab ファイル(`-` で標準入力)', 'crontab file to install (`-` for stdin)')] }), journalctl: cmd('systemd のジャーナル(ログ)を表示する', 'Query the systemd journal (logs)', [ + ['-k|--dmesg', 'カーネルのメッセージだけ', 'kernel messages only'], + ['-x|--catalog', '説明文(カタログ)を付ける', 'add explanatory texts from the catalog'], + ['-e|--pager-end', '末尾から表示する', 'jump to the end in the pager'], + ['-a|--all', '長い行や表示できない文字も省略しない', 'show all fields in full'], + ['-g|--grep', 'メッセージを正規表現で絞る', 'filter messages by a regular expression', 'arg'], + ['-t|--identifier', 'syslog の識別子で絞る', 'filter by syslog identifier', 'arg'], + ['-m|--merge', 'すべてのジャーナルを統合して表示', 'merge all available journals'], + ['-D|--directory', '読むジャーナルのディレクトリ', 'journal directory to read', 'arg'], + ['--file', '読むジャーナルのファイル', 'journal file to read', 'arg'], + ['-F|--field', '指定したフィールドの値の一覧', 'print all values of a field', 'arg'], + ['-S', '開始日時(`--since` の短縮形)', 'start time (short for `--since`)', 'arg'], + ['-U', '終了日時(`--until` の短縮形)', 'end time (short for `--until`)', 'arg'], + ['-c|--cursor', '指定したカーソルから表示', 'start at the given cursor', 'arg'], + ['--disk-usage', 'ジャーナルのディスク使用量を表示', 'show the disk space used by journals'], + ['--vacuum-size', 'ジャーナルを指定した容量まで減らす', 'reduce the journals to the given size', 'arg'], + ['--vacuum-time', '指定した時刻より古いジャーナルを削除する', 'delete journals older than the given time', 'arg'], + ['--vacuum-files', 'ジャーナルのファイルを指定した数まで減らす', 'reduce the number of journal files', 'arg'], + ['--verify', 'ジャーナルの整合性を検査する', 'verify journal file consistency'], + ['--list-boots', '記録されている起動を一覧表示', 'list recorded boots'], + ['--utc', '時刻を UTC で表示', 'show times in UTC'], + ['--system', 'システムのジャーナルだけ', 'show system messages only'], + ['--user', 'ユーザーのジャーナルだけ', 'show the current user messages only'], + ['--no-tail', '全行を表示する(既定)', 'show all lines'], + ['-q|--quiet', '補足のメッセージを表示しない', 'do not show informational messages'], + ['--flush', '`/run` のジャーナルを `/var` に書き出す', 'flush `/run` journals to `/var`'], + ['--rotate', 'ジャーナルのファイルを切り替える', 'rotate the journal files'], ['-u|--unit', '指定したユニットのログだけ', 'only the given unit', 'arg'], ['-f|--follow', '新しいログを追い続ける', 'follow new entries'], ['-n|--lines', '表示する末尾の行数', 'number of recent lines', 'arg'], @@ -416,6 +547,11 @@ export const distro: Record = { ]), timedatectl: cmd('システムの時刻とタイムゾーンを表示・設定する', 'Show or set the system time and time zone', [noPager()], { subcommands: { + show: cmd('設定をプロパティの形で表示する', 'Show the settings as properties'), + 'timesync-status': cmd('時刻同期(systemd-timesyncd)の状態を表示する', 'Show the state of time synchronization (systemd-timesyncd)'), + 'show-timesync': cmd('時刻同期の設定をプロパティの形で表示する', 'Show timesync settings as properties'), + 'set-time': cmd('システム時刻を設定する', 'Set the system time'), + 'set-local-rtc': cmd('ハードウェアクロックをローカル時刻とするか決める(`0` / `1`)', 'Set whether the RTC is in local time (`0` / `1`)'), status: cmd('現在の時刻設定を表示する', 'Show the current time settings'), 'set-timezone': cmd('タイムゾーンを設定する(`Asia/Tokyo`…)', 'Set the time zone (`Asia/Tokyo`…)'), 'set-ntp': cmd('NTP による時刻同期を有効・無効にする(`true` / `false`)', 'Turn NTP synchronization on or off (`true` / `false`)'), @@ -428,6 +564,10 @@ export const distro: Record = { ['--pretty', '表示用のホスト名を対象にする', 'the pretty host name'], ], { subcommands: { + 'set-icon-name': cmd('アイコン名を設定する', 'Set the icon name'), + 'set-chassis': cmd('筐体の種類(`desktop`、`laptop`、`server`、`vm`)を設定する', 'Set the chassis type (`desktop`, `laptop`, `server`, `vm`)'), + 'set-deployment': cmd('環境の種類(`production` など)を設定する', 'Set the deployment environment (`production` and so on)'), + 'set-location': cmd('設置場所を設定する', 'Set the location'), status: cmd('現在のホスト名と環境を表示する', 'Show the host name and environment'), 'set-hostname': cmd('ホスト名を設定する', 'Set the host name'), }, @@ -450,6 +590,15 @@ export const distro: Record = { ['--auto', '自動選択に戻す', 'switch to automatic mode'], ], { positional: [pos('名前、パス…', 'name, path…')] }), passwd: cmd('パスワードを変える', 'Change a password', [ + ['-i|--inactive', '期限切れ後にアカウントを無効にするまでの日数', 'days after expiry before the account is disabled', 'arg'], + ['-k|--keep-tokens', '期限切れのパスワードだけを更新する', 'change only expired authentication tokens'], + ['-n|--mindays', 'パスワードを変えられるまでの最小日数', 'minimum days between changes', 'arg'], + ['-x|--maxdays', 'パスワードを変えずに使える最大日数', 'maximum days between changes', 'arg'], + ['-w|--warndays', '期限の何日前から警告するか', 'days of warning before expiry', 'arg'], + ['-q|--quiet', '表示を減らす', 'quiet'], + ['-a|--all', 'すべてのユーザーの状態を表示(`-S` と併用)', 'report all users (with `-S`)'], + ['-R|--root', '代わりのルートディレクトリ', 'apply changes in the given chroot directory', 'arg'], + ['--stdin', '新しいパスワードを標準入力から読む', 'read the new password from stdin'], ['-l|--lock', 'アカウントをロックする', 'lock the account'], ['-u|--unlock', 'アカウントのロックを解除する', 'unlock the account'], ['-d|--delete', 'パスワードを削除する(注意)', 'delete the password (careful)'], @@ -488,10 +637,17 @@ export const distro: Record = { ['-M|--modify-file', 'ファイルから項目を読んで追加・変更する', 'read entries to modify from a file', 'arg'], ], { positional: [files] }), chattr: cmd('ファイルの拡張属性(変更不可など)を変える', 'Change file attributes (immutable and more)', [ + ['-v', '版番号を設定', 'set the file version', 'arg'], + ['-p', 'プロジェクト ID を設定', 'set the project ID', 'arg'], + ['-f', 'エラーを表示しない', 'suppress most error messages'], ['-R', 'ディレクトリの中も再帰的に', 'recurse into directories'], ['-V', '詳しく表示', 'verbose'], ], { positional: [pos('属性の変更(`+i`: 変更不可にする、`-i`: 解く、`+a`: 追記のみ可…)', 'attribute change (`+i`: make immutable, `-i`: clear it, `+a`: append only…)'), files] }), lsattr: cmd('ファイルの拡張属性を表示する', 'List file attributes', [ + ['-l', '属性を名前で表示', 'print options in long names'], + ['-v', 'ファイルの版番号を表示', 'list the file version'], + ['-p', 'プロジェクト ID を表示', 'list the project ID'], + ['-V', 'バージョンを表示', 'print the version'], ['-R', 'ディレクトリの中も再帰的に', 'recurse into directories'], ['-a', '`.` で始まるファイルも表示', 'include files starting with `.`'], ['-d', 'ディレクトリの中身ではなくディレクトリ自体を表示', 'list directories themselves, not their contents'], @@ -506,6 +662,10 @@ export const distro: Record = { ['-v', 'ケーパビリティのないファイルも表示', 'also show files without capabilities'], ], { positional: [files] }), ldconfig: cmd('共有ライブラリのキャッシュを更新する', 'Update the shared library cache', [ + ['-r', '代わりのルートディレクトリ', 'use the given directory as the root', 'arg'], + ['-X', 'シンボリックリンクを更新しない', 'do not update links'], + ['-C', 'キャッシュのファイル', 'cache file', 'arg'], + ['-f', '設定ファイル', 'configuration file', 'arg'], ['-p|--print-cache', 'キャッシュの内容を表示', 'print the cache'], ['-v|--verbose', '詳しく表示', 'verbose'], ['-n', '指定したディレクトリだけ処理する', 'process only the given directories'], @@ -524,6 +684,15 @@ export const distro: Record = { ['-t', 'ファイルシステムの種類', 'file system type', 'arg'], ], { positional: [device] }), fsck: cmd('ファイルシステムを検査して修復する', 'Check and repair a file system', [ + ['-a', '質問なしで自動修復する(`-p` と同じ)', 'repair automatically (same as `-p`)'], + ['-r', '各デバイスの検査の結果を表示', 'report statistics for each device'], + ['-R', 'ルートファイルシステムを飛ばす(`-A` と併用)', 'skip the root file system (with `-A`)'], + ['-s', '検査を並列でなく1つずつ行う', 'serialize checks'], + ['-T', '起動メッセージを表示しない', 'do not show the title'], + ['-V', '詳しく表示する', 'verbose'], + ['-N', '実際には検査せず、何をするか表示する', 'dry run; show what would be done'], + ['-C', '進行状況を表示する', 'show a progress bar'], + ['-M', 'マウント中のものは検査しない', 'skip mounted file systems'], ['-y', '修復の質問にすべて「はい」と答える', 'answer yes to every repair question'], ['-n', '修復せず検査だけ', 'check only, change nothing'], ['-f', 'きれいに見えても強制的に検査する', 'force a check even if the file system looks clean'], @@ -532,6 +701,13 @@ export const distro: Record = { ['-t', 'ファイルシステムの種類', 'file system type', 'arg'], ], { positional: [device] }), losetup: cmd('ループデバイスを設定・表示する(ファイルをデバイスとして扱う)', 'Set up and show loop devices (files used as block devices)', [ + ['-c|--set-capacity', 'ループデバイスのサイズを更新する', 'resize the loop device'], + ['-b|--sector-size', 'セクタサイズ', 'logical sector size', 'arg'], + ['-o|--offset', 'ファイルの開始位置', 'offset into the file', 'arg'], + ['--sizelimit', 'ファイルの使う大きさ', 'limit the size of the data', 'arg'], + ['-n|--noheadings', '見出しを表示しない', 'do not print headings'], + ['-O|--output', '表示する列', 'columns to show', 'arg'], + ['-l|--list', '一覧表示', 'list devices'], ['-f|--find', '空いているループデバイスを探す', 'pick a free loop device'], ['-P|--partscan', 'パーティションを読み取る', 'scan for partitions'], ['-d|--detach', 'ループデバイスを切り離す', 'detach a loop device'], @@ -542,15 +718,29 @@ export const distro: Record = { ['-j|--associated', '指定したファイルに割り当てたデバイスを表示', 'show devices associated with the given file', 'arg'], ], { positional: [pos('ループデバイス、ファイル', 'loop device, file')] }), swapon: cmd('スワップ領域を有効にする', 'Enable swap areas', [ + ['-v|--verbose', '詳しく表示する', 'verbose'], + ['-d|--discard', 'スワップ領域のブロックを破棄する(TRIM)', 'discard freed swap pages'], + ['-e|--ifexists', '存在しないデバイスは無視する', 'silently skip devices that do not exist'], + ['-U', 'UUID で指定する', 'specify by UUID', 'arg'], + ['-L', 'ラベルで指定する', 'specify by label', 'arg'], + ['--noheadings', '見出しを表示しない', 'do not print headings'], + ['--raw', '整形せずに出力', 'raw output'], + ['--bytes', 'サイズをバイトで表示', 'show sizes in bytes'], ['-a|--all', '`/etc/fstab` のスワップをすべて有効にする', 'enable all swaps in `/etc/fstab`'], ['-s|--summary', '使用状況を表示', 'show a summary'], ['--show', '使用状況を表で表示', 'show usage as a table'], ['-p|--priority', '優先度', 'priority', 'arg'], ], { positional: [pos('スワップのデバイスまたはファイル', 'swap device or file')] }), swapoff: cmd('スワップ領域を無効にする', 'Disable swap areas', [ + ['-v|--verbose', '詳しく表示する', 'verbose'], + ['-U', 'UUID で指定する', 'specify by UUID', 'arg'], + ['-L', 'ラベルで指定する', 'specify by label', 'arg'], ['-a|--all', 'すべてのスワップを無効にする', 'disable all swaps'], ], { positional: [pos('スワップのデバイスまたはファイル', 'swap device or file')] }), mkswap: cmd('スワップ領域を作る(内容は失われる)', 'Set up a swap area (destroys the contents)', [ + ['-c|--check', '不良ブロックを検査する', 'check for bad blocks'], + ['-p|--pagesize', 'ページサイズ', 'page size', 'arg'], + ['-v|--swapversion', 'スワップ領域の版(`1`)', 'swap area version (`1`)', 'arg'], ['-L|--label', 'ラベル', 'label', 'arg'], ['-f|--force', '確認せずに作る(注意)', 'force, do not ask (careful)'], ['-U|--uuid', 'UUID', 'UUID', 'arg'], diff --git a/src/dict/extras.ts b/src/dict/extras.ts deleted file mode 100644 index 8abceb2f..00000000 --- a/src/dict/extras.ts +++ /dev/null @@ -1,172 +0,0 @@ -import type { CommandSpec } from '../argv/spec'; -import { cmd, mergeOptions, optionOf, pos } from './types'; -import { extraFiles } from './extrasFiles'; -import { extraAdmin } from './extrasAdmin'; - -// Options and subcommands that the LPIC and LinuC objectives (and everyday administration) use -// and that the first entries of older commands did not list. They are merged into the entries -// that exist; an option or subcommand written in the main entry is never replaced. - -const unit = pos('ユニット名(`nginx.service`…)', 'unit name (`nginx.service`…)'); -const pkg = pos('パッケージ名', 'package name'); -const unitSub = (ja: string, en: string): CommandSpec => cmd(ja, en, [], { positional: [unit] }); -const pkgSub = (ja: string, en: string): CommandSpec => cmd(ja, en, [], { positional: [pkg] }); - -const dnfLike = (): Record => ({ - info: pkgSub('パッケージの詳細を表示する', 'Show package details'), - search: pkgSub('名前や説明からパッケージを検索する', 'Search packages by name or description'), - list: cmd('パッケージを一覧表示する(`installed`、`available`、`updates`)', 'List packages (`installed`, `available`, `updates`)'), - provides: cmd('指定のファイルを提供するパッケージを探す', 'Find the package that provides a file'), - whatprovides: cmd('指定のファイルを提供するパッケージを探す', 'Find the package that provides a file'), - groupinstall: cmd('パッケージグループを入れる', 'Install a package group'), - group: cmd('パッケージグループを扱う(`list`、`install`、`info`)', 'Handle package groups (`list`, `install`, `info`)'), - history: cmd('操作の履歴を表示する(`undo`、`rollback` も)', 'Show the transaction history (also `undo`, `rollback`)'), - repolist: cmd('有効なリポジトリを一覧表示する', 'List the enabled repositories'), - 'check-update': cmd('更新できるパッケージを確認する', 'Check for available updates'), - reinstall: pkgSub('パッケージを入れ直す', 'Reinstall packages'), - downgrade: pkgSub('パッケージの版を下げる', 'Downgrade packages'), - autoremove: cmd('不要になった依存パッケージを削除する', 'Remove unneeded dependencies'), - erase: pkgSub('パッケージを削除する', 'Remove packages'), - 'distro-sync': cmd('リポジトリの版にそろえる', 'Sync installed packages to the repository versions'), -}); - -const containerExtra = (): Record => ({ - stats: cmd('コンテナの資源の使用状況を表示する', 'Show live resource usage of containers', [['--no-stream', '1回だけ表示して終わる', 'print once and exit']]), - create: cmd('コンテナを作る(起動はしない)', 'Create a container without starting it', [['--name', 'コンテナ名', 'container name', 'arg']]), - restart: cmd('コンテナを再起動する', 'Restart containers', [['-t|--time', '停止を待つ秒数', 'seconds to wait before killing', 'arg']]), - start: cmd('止まっているコンテナを起動する', 'Start stopped containers', [['-a|--attach', '出力につなぐ', 'attach output'], ['-i|--interactive', '標準入力につなぐ', 'attach stdin']]), - rmi: cmd('イメージを削除する', 'Remove images', [['-f|--force', '強制的に削除', 'force removal']]), - kill: cmd('コンテナにシグナルを送って強制終了する', 'Kill containers by signal', [['-s|--signal', '送るシグナル', 'signal to send', 'arg']]), -}); - -export const extraSubcommands: Record> = { - systemctl: { - 'is-failed': unitSub('ユニットが失敗状態かどうか確かめる', 'Check whether the unit failed'), - 'list-units': cmd('読み込まれているユニットを一覧表示する', 'List the loaded units'), - 'list-unit-files': cmd('インストールされているユニットファイルと有効・無効の状態を一覧表示する', 'List installed unit files and whether they are enabled'), - 'list-timers': cmd('タイマーと次回の実行時刻を一覧表示する', 'List timers and when they fire next'), - 'list-sockets': cmd('ソケットユニットを一覧表示する', 'List socket units'), - 'list-dependencies': unitSub('ユニットの依存関係を木で表示する', 'Show the dependency tree of a unit'), - 'list-jobs': cmd('実行待ちのジョブを一覧表示する', 'List jobs in progress'), - show: unitSub('ユニットのプロパティを表示する', 'Show the properties of a unit'), - cat: unitSub('ユニットファイルの内容を表示する', 'Show the unit file contents'), - edit: unitSub('ユニットの設定を上書きする(ドロップインを編集)', 'Edit a drop-in override of a unit'), - 'reset-failed': unitSub('失敗の状態を解除する', 'Reset the failed state'), - isolate: unitSub('指定したユニットだけを残して他を止める(ランレベルの切り替え)', 'Start the unit and stop the rest (like switching run levels)'), - 'set-default': unitSub('既定のターゲット(ランレベル)を設定する', 'Set the default target (run level)'), - 'get-default': cmd('既定のターゲット(ランレベル)を表示する', 'Show the default target (run level)'), - poweroff: cmd('システムを停止して電源を切る', 'Shut down and power off the system'), - reboot: cmd('システムを再起動する', 'Reboot the system'), - halt: cmd('システムを停止する', 'Halt the system'), - suspend: cmd('メモリに退避してサスペンドする', 'Suspend the system to RAM'), - hibernate: cmd('ディスクに退避して休止状態にする', 'Hibernate the system to disk'), - rescue: cmd('レスキューモード(シングルユーザー)に入る', 'Enter rescue (single-user) mode'), - emergency: cmd('緊急モードに入る', 'Enter emergency mode'), - kill: unitSub('ユニットのプロセスにシグナルを送る', 'Send a signal to the processes of a unit'), - 'try-restart': unitSub('動いているときだけ再起動する', 'Restart only if it is running'), - 'reload-or-restart': unitSub('再読み込みできれば再読み込み、できなければ再起動する', 'Reload if possible, otherwise restart'), - 'try-reload-or-restart': unitSub('動いているときだけ再読み込みか再起動をする', 'Reload or restart only if it is running'), - reenable: unitSub('いったん無効にしてから有効にし直す', 'Disable and enable the unit again'), - preset: unitSub('プリセットの設定に従って有効・無効にする', 'Enable or disable per the preset files'), - link: cmd('ユニットファイルをリンクで追加する', 'Link a unit file into the search path'), - revert: unitSub('上書きした設定を元に戻す', 'Revert the unit to its vendor version'), - 'daemon-reexec': cmd('systemd 自体を再実行する', 'Re-execute the systemd manager'), - 'is-system-running': cmd('システム全体の状態を表示する', 'Show the overall state of the system'), - cancel: cmd('実行待ちのジョブをキャンセルする', 'Cancel a queued job'), - 'set-property': unitSub('ユニットのプロパティを実行中に変更する', 'Change a property of a running unit'), - 'show-environment': cmd('サービスマネージャーの環境変数を表示する', 'Show the environment of the service manager'), - 'add-wants': unitSub('ターゲットに `Wants=` の依存を追加する', 'Add a `Wants=` dependency to a target'), - freeze: unitSub('ユニットのプロセスを凍結する', 'Freeze the processes of a unit'), - thaw: unitSub('凍結を解除する', 'Thaw a frozen unit'), - }, - 'apt-get': { - 'build-dep': pkgSub('ソースからビルドするのに必要なパッケージを入れる', 'Install the packages needed to build a source package'), - source: pkgSub('ソースパッケージを取得する', 'Fetch a source package'), - check: cmd('壊れた依存関係がないか確かめる', 'Check for broken dependencies'), - changelog: pkgSub('パッケージの変更履歴を表示する', 'Show the package changelog'), - }, - apt: { - 'edit-sources': cmd('パッケージの取得元の設定を編集する', 'Edit the package sources list'), - depends: pkgSub('依存しているパッケージを表示する', 'Show the dependencies'), - rdepends: pkgSub('これに依存しているパッケージを表示する', 'Show reverse dependencies'), - policy: pkgSub('入れられる版と優先度を表示する', 'Show available versions and priorities'), - reinstall: pkgSub('パッケージを入れ直す', 'Reinstall packages'), - }, - yum: { - ...dnfLike(), - localinstall: pkgSub('ローカルの RPM ファイルを入れる', 'Install a local RPM file'), - deplist: pkgSub('依存関係を一覧表示する', 'List dependencies'), - }, - dnf: { - ...dnfLike(), - repoquery: pkgSub('リポジトリのパッケージ情報を問い合わせる', 'Query repository package information'), - module: cmd('モジュール(ストリーム)を扱う(`list`、`enable`、`install`)', 'Handle modules and streams (`list`, `enable`, `install`)'), - 'config-manager': cmd('リポジトリの設定を表示・変更する', 'Show or change repository settings'), - download: pkgSub('RPM をダウンロードだけする', 'Download RPMs without installing'), - mark: cmd('パッケージに印を付ける(`install`、`remove`)', 'Mark packages (`install`, `remove`)'), - swap: cmd('あるパッケージを別のものに置き換える', 'Swap one package for another'), - }, - hostnamectl: { - 'set-icon-name': cmd('アイコン名を設定する', 'Set the icon name'), - 'set-chassis': cmd('筐体の種類(`desktop`、`laptop`、`server`、`vm`)を設定する', 'Set the chassis type (`desktop`, `laptop`, `server`, `vm`)'), - 'set-deployment': cmd('環境の種類(`production` など)を設定する', 'Set the deployment environment (`production` and so on)'), - 'set-location': cmd('設置場所を設定する', 'Set the location'), - }, - timedatectl: { - show: cmd('設定をプロパティの形で表示する', 'Show the settings as properties'), - 'timesync-status': cmd('時刻同期(systemd-timesyncd)の状態を表示する', 'Show the state of time synchronization (systemd-timesyncd)'), - 'show-timesync': cmd('時刻同期の設定をプロパティの形で表示する', 'Show timesync settings as properties'), - 'set-time': cmd('システム時刻を設定する', 'Set the system time'), - 'set-local-rtc': cmd('ハードウェアクロックをローカル時刻とするか決める(`0` / `1`)', 'Set whether the RTC is in local time (`0` / `1`)'), - }, - docker: { - ...containerExtra(), - pause: cmd('コンテナのプロセスを一時停止する', 'Pause the processes of containers'), - unpause: cmd('一時停止を解除する', 'Unpause containers'), - attach: cmd('実行中のコンテナの入出力につなぐ', 'Attach to the input and output of a running container'), - import: cmd('tar のファイルからイメージを作る', 'Create an image from a tarball'), - commit: cmd('コンテナの変更から新しいイメージを作る', 'Create an image from the changes of a container', [['-m|--message', 'コミットメッセージ', 'commit message', 'arg'], ['-a|--author', '作者', 'author', 'arg']]), - top: cmd('コンテナの中のプロセスを表示する', 'Show the processes of a container'), - history: cmd('イメージの作成履歴(レイヤー)を表示する', 'Show the history (layers) of an image'), - port: cmd('コンテナのポートの対応を表示する', 'Show the port mappings of a container'), - rename: cmd('コンテナの名前を変える', 'Rename a container'), - diff: cmd('コンテナのファイルシステムの変更を表示する', 'Show changes to the container file system'), - search: cmd('Docker Hub のイメージを検索する', 'Search Docker Hub for images'), - info: cmd('Docker の環境の情報を表示する', 'Show system-wide information'), - version: cmd('Docker のバージョンを表示する', 'Show the Docker version'), - events: cmd('サーバーのイベントをリアルタイムで表示する', 'Stream events from the server'), - }, - podman: { - ...containerExtra(), - pod: cmd('Pod(コンテナの集まり)を扱う', 'Handle pods (groups of containers)'), - generate: cmd('systemd のユニットや Kubernetes のマニフェストを生成する', 'Generate systemd units or Kubernetes manifests'), - }, - openssl: { - enc: cmd('共通鍵で暗号化・復号する', 'Encrypt or decrypt with a symmetric cipher', [['-aes-256-cbc', 'AES-256 (CBC) を使う', 'use AES-256 (CBC)'], ['-d', '復号する', 'decrypt'], ['-a|-base64', 'Base64 で入出力する', 'use Base64'], ['-salt', 'ソルトを使う', 'use a salt'], ['-pbkdf2', '鍵導出に PBKDF2 を使う', 'use PBKDF2 for key derivation'], ['-in', '入力ファイル', 'input file', 'arg'], ['-out', '出力ファイル', 'output file', 'arg'], ['-k', 'パスワード', 'password', 'arg']], { parser: 'openssl' }), - verify: cmd('証明書を検証する', 'Verify certificates', [['-CAfile', '信頼する CA 証明書のファイル', 'trusted CA certificates file', 'arg'], ['-untrusted', '中間証明書のファイル', 'intermediate certificates file', 'arg']], { parser: 'openssl' }), - pkcs12: cmd('PKCS#12 ファイルを作る・読む', 'Create or read PKCS#12 files', [['-export', '作る', 'create a PKCS#12 file'], ['-in', '入力ファイル', 'input file', 'arg'], ['-out', '出力ファイル', 'output file', 'arg'], ['-inkey', '秘密鍵', 'private key file', 'arg'], ['-nodes', '秘密鍵を暗号化しない', 'do not encrypt private keys'], ['-nokeys', '鍵を出力しない', 'do not output private keys'], ['-clcerts', 'クライアント証明書だけ', 'client certificates only']], { parser: 'openssl' }), - ca: cmd('簡易の認証局(CA)として証明書を発行する', 'Act as a simple certificate authority', [['-config', '設定ファイル', 'configuration file', 'arg'], ['-in', '署名要求(CSR)', 'certificate signing request', 'arg'], ['-out', '出力ファイル', 'output file', 'arg'], ['-days', '有効日数', 'validity in days', 'arg'], ['-batch', '質問しない', 'no prompts']], { parser: 'openssl' }), - genpkey: cmd('秘密鍵を作る(汎用)', 'Generate a private key (generic)', [['-algorithm', '鍵のアルゴリズム(`RSA`、`EC`)', 'key algorithm (`RSA`, `EC`)', 'arg'], ['-out', '出力ファイル', 'output file', 'arg'], ['-pkeyopt', '鍵のオプション(`rsa_keygen_bits:4096`)', 'key option (`rsa_keygen_bits:4096`)', 'arg']], { parser: 'openssl' }), - rsa: cmd('RSA 鍵を処理・変換する', 'Process and convert RSA keys', [['-in', '入力ファイル', 'input file', 'arg'], ['-out', '出力ファイル', 'output file', 'arg'], ['-pubout', '公開鍵を出力する', 'output the public key'], ['-text', '内容を文字で表示', 'print in text form'], ['-noout', '鍵そのものは出力しない', 'do not output the key']], { parser: 'openssl' }), - ecparam: cmd('楕円曲線のパラメータや鍵を作る', 'Generate elliptic curve parameters or keys', [['-name', '曲線の名前(`prime256v1`)', 'curve name (`prime256v1`)', 'arg'], ['-genkey', '鍵を作る', 'generate a key'], ['-out', '出力ファイル', 'output file', 'arg']], { parser: 'openssl' }), - passwd: cmd('パスワードのハッシュを作る', 'Compute password hashes', [['-6', 'SHA-512 (crypt) を使う', 'use SHA-512 crypt'], ['-5', 'SHA-256 (crypt) を使う', 'use SHA-256 crypt'], ['-1', 'MD5 (crypt) を使う', 'use MD5 crypt'], ['-apr1', 'Apache の MD5 形式を使う', 'use the Apache MD5 format'], ['-salt', 'ソルト', 'salt', 'arg'], ['-stdin', '標準入力から読む', 'read from stdin']], { parser: 'openssl' }), - s_server: cmd('テスト用の TLS サーバーを動かす', 'Run a test TLS server', [['-accept', '待ち受けるポート', 'port to listen on', 'arg'], ['-cert', '証明書', 'certificate file', 'arg'], ['-key', '秘密鍵', 'private key file', 'arg'], ['-www', '状態のページを返す', 'serve a status page']], { parser: 'openssl' }), - crl: cmd('証明書失効リスト(CRL)を処理する', 'Process certificate revocation lists (CRLs)', [['-in', '入力ファイル', 'input file', 'arg'], ['-text', '内容を文字で表示', 'print in text form'], ['-noout', 'CRL そのものは出力しない', 'do not output the CRL']], { parser: 'openssl' }), - ciphers: cmd('使える暗号スイートを一覧表示する', 'List the available cipher suites', [['-v', '詳しく表示する', 'verbose']], { parser: 'openssl' }), - list: cmd('使えるアルゴリズムなどを一覧表示する', 'List algorithms and commands'), - pkey: cmd('公開鍵・秘密鍵を処理・変換する', 'Process and convert public and private keys', [['-in', '入力ファイル', 'input file', 'arg'], ['-pubout', '公開鍵を出力する', 'output the public key'], ['-text', '内容を文字で表示', 'print in text form'], ['-noout', '鍵そのものは出力しない', 'do not output the key']], { parser: 'openssl' }), - }, -}; - -/** Merge the extra options and subcommands into the entries of `commands`. What the main entry already has is kept. */ -export function applyExtras(commands: Record): void { - for (const [key, opts] of Object.entries({ ...extraFiles, ...extraAdmin })) { - const spec = commands[key]; - // (`cmd` gives every entry a list of options.) - spec.options = mergeOptions(opts.map(optionOf), spec.options!); - } - for (const [key, subs] of Object.entries(extraSubcommands)) { - const spec = commands[key]; - spec.subcommands = { ...subs, ...spec.subcommands }; - } -} diff --git a/src/dict/extrasAdmin.ts b/src/dict/extrasAdmin.ts deleted file mode 100644 index e2ebe8a8..00000000 --- a/src/dict/extrasAdmin.ts +++ /dev/null @@ -1,633 +0,0 @@ -import { OptSpec, persistent } from './types'; - -// Options of administration, network and transfer commands that the LPIC and LinuC objectives -// use and that the first entries did not list. See extras.ts for how they are merged. - -const iptablesExtra = (): OptSpec[] => [ - ['-P|--policy', 'チェインの既定の動作を決める(`ACCEPT` / `DROP`)', 'set the default policy of a chain (`ACCEPT` / `DROP`)'], - ['-N|--new-chain', 'チェインを新しく作る', 'create a user chain'], - ['-X|--delete-chain', 'ユーザー定義のチェインを削除する', 'delete a user chain'], - ['-Z|--zero', 'パケットとバイトのカウンタを 0 にする', 'zero the counters'], - ['-R|--replace', '番号を指定して規則を置き換える', 'replace a rule by number'], - ['-E|--rename-chain', 'チェインの名前を変える', 'rename a chain'], - ['--sport', '送信元ポート', 'source port', 'arg'], - ['-i|--in-interface', '受信するインターフェース', 'input interface', 'arg'], - ['-o|--out-interface', '送信するインターフェース', 'output interface', 'arg'], - ['-m|--match', '拡張マッチを使う(`state`、`conntrack`、`multiport`…)', 'use an extension match (`state`, `conntrack`, `multiport`…)', 'arg'], - ['--state', '接続の状態で絞る(`ESTABLISHED,RELATED`)', 'match the connection state (`ESTABLISHED,RELATED`)', 'arg'], - ['--ctstate', 'conntrack の状態で絞る', 'match the conntrack state', 'arg'], - ['--dports', '複数の宛先ポート(`multiport`)', 'several destination ports (`multiport`)', 'arg'], - ['--to-destination', 'DNAT の転送先', 'DNAT target address', 'arg'], - ['--to-source', 'SNAT の送信元', 'SNAT source address', 'arg'], - ['--to-ports', 'REDIRECT の転送先ポート', 'REDIRECT target ports', 'arg'], - ['--icmp-type', 'ICMP の種類', 'ICMP type', 'arg'], - ['--tcp-flags', 'TCP のフラグで絞る', 'match TCP flags', 'arg'], - ['--syn', 'TCP の接続開始(SYN)パケットだけ', 'match TCP connection-opening (SYN) packets'], - ['--reject-with', '拒否の応答の種類', 'type of reject reply', 'arg'], - ['--log-prefix', 'ログに付ける接頭辞', 'prefix for log messages', 'arg'], - ['--comment', '規則へのコメント', 'comment for the rule', 'arg'], - ['--line-numbers', '規則に番号を付けて表示', 'show rule numbers'], - ['-x|--exact', 'カウンタを正確な数値で表示', 'show exact counter values'], - ['-g|--goto', '別のチェインへ移る(戻らない)', 'jump to a chain without returning', 'arg'], - ['-f|--fragment', 'フラグメント化されたパケットだけ', 'match fragments'], - ['-c|--set-counters', 'カウンタの初期値', 'initialize the counters', 'arg'], -]; - -export const extraAdmin: Record = { - mount: [ - ['-v|--verbose', '詳しく表示する', 'verbose'], - ['-w|--rw|--read-write', '読み書きできるようにマウントする', 'mount read-write'], - ['-n|--no-mtab', '`/etc/mtab` に書かない', 'do not write `/etc/mtab`'], - ['-f|--fake', '実際にはマウントしない', 'dry run; do not call mount(2)'], - ['-L|--label', 'ラベルでデバイスを指定する', 'mount the device with the given label', 'arg'], - ['-U|--uuid', 'UUID でデバイスを指定する', 'mount the device with the given UUID', 'arg'], - ['--move', 'マウント位置を移す', 'move a mounted tree to another place'], - ['--rbind', '下位のマウントも含めてバインドする', 'bind including submounts'], - ['-B', 'ディレクトリを別の場所にバインドする', 'bind a directory elsewhere'], - ['-R', '下位のマウントも含めてバインドする', 'bind including submounts'], - ['--make-private', 'マウントのイベントを共有しない', 'mark as private'], - ['--make-shared', 'マウントのイベントを共有する', 'mark as shared'], - ['--make-slave', 'マウントのイベントを受け取るだけにする', 'mark as slave'], - ['-l|--show-labels', '一覧にラベルも表示', 'show labels in the list'], - ['-s', '調整できないオプションを無視する', 'ignore unsupported options'], - ['-T|--fstab', '読む fstab のファイル', 'alternative fstab file', 'arg'], - ['-i|--internal-only', '`mount.` ヘルパーを呼ばない', 'do not call the mount helpers'], - ], - umount: [ - ['-r|--read-only', 'アンマウントできないときは読み取り専用で再マウントする', 'remount read-only if unmounting fails'], - ['-R|--recursive', '下位のマウントも順にアンマウントする', 'unmount recursively'], - ['-v|--verbose', '詳しく表示する', 'verbose'], - ['-n|--no-mtab', '`/etc/mtab` に書かない', 'do not write `/etc/mtab`'], - ['-t|--types', '指定した種類のファイルシステムだけ', 'only the given file system type', 'arg'], - ['-d|--detach-loop', 'ループデバイスも解放する', 'free the loop device too'], - ], - swapon: [ - ['-v|--verbose', '詳しく表示する', 'verbose'], - ['-d|--discard', 'スワップ領域のブロックを破棄する(TRIM)', 'discard freed swap pages'], - ['-e|--ifexists', '存在しないデバイスは無視する', 'silently skip devices that do not exist'], - ['-U', 'UUID で指定する', 'specify by UUID', 'arg'], - ['-L', 'ラベルで指定する', 'specify by label', 'arg'], - ['--noheadings', '見出しを表示しない', 'do not print headings'], - ['--raw', '整形せずに出力', 'raw output'], - ['--bytes', 'サイズをバイトで表示', 'show sizes in bytes'], - ], - swapoff: [ - ['-v|--verbose', '詳しく表示する', 'verbose'], - ['-U', 'UUID で指定する', 'specify by UUID', 'arg'], - ['-L', 'ラベルで指定する', 'specify by label', 'arg'], - ], - mkswap: [ - ['-c|--check', '不良ブロックを検査する', 'check for bad blocks'], - ['-p|--pagesize', 'ページサイズ', 'page size', 'arg'], - ['-v|--swapversion', 'スワップ領域の版(`1`)', 'swap area version (`1`)', 'arg'], - ], - fsck: [ - ['-a', '質問なしで自動修復する(`-p` と同じ)', 'repair automatically (same as `-p`)'], - ['-r', '各デバイスの検査の結果を表示', 'report statistics for each device'], - ['-R', 'ルートファイルシステムを飛ばす(`-A` と併用)', 'skip the root file system (with `-A`)'], - ['-s', '検査を並列でなく1つずつ行う', 'serialize checks'], - ['-T', '起動メッセージを表示しない', 'do not show the title'], - ['-V', '詳しく表示する', 'verbose'], - ['-N', '実際には検査せず、何をするか表示する', 'dry run; show what would be done'], - ['-C', '進行状況を表示する', 'show a progress bar'], - ['-M', 'マウント中のものは検査しない', 'skip mounted file systems'], - ], - lsblk: [ - ['-a|--all', '空のデバイスも表示', 'also show empty devices'], - ['-b|--bytes', 'サイズをバイトで表示', 'print sizes in bytes'], - ['-l|--list', '木でなく一覧で表示', 'list format instead of a tree'], - ['-m|--perms', '権限の情報を表示', 'show permissions information'], - ['-P|--pairs', '`キー="値"` の形式で出力', 'output `KEY="value"` pairs'], - ['-r|--raw', '整形しない出力', 'raw output'], - ['-S|--scsi', 'SCSI デバイスだけ', 'SCSI devices only'], - ['-t|--topology', 'トポロジーの情報を表示', 'show topology information'], - ['-s|--inverse', '依存関係を逆向きに表示', 'inverse dependencies'], - ['-e|--exclude', '除外するメジャー番号', 'exclude these major numbers', 'arg'], - ['-i|--ascii', 'ASCII 文字で木を描く', 'use ASCII characters for the tree'], - ['-x|--sort', '並べ替える列', 'sort by the given column', 'arg'], - ['-D|--discard', 'TRIM の情報を表示', 'print discard capabilities'], - ], - blkid: [ - ['-L', '指定したラベルのデバイスを探す', 'find the device with the given label', 'arg'], - ['-U', '指定した UUID のデバイスを探す', 'find the device with the given UUID', 'arg'], - ['-t', '指定した `名前=値` に一致するデバイスを探す', 'find devices matching `NAME=value`', 'arg'], - ['-p', 'キャッシュを使わず低レベルで調べる', 'low-level probing, bypassing the cache'], - ['-c', 'キャッシュファイル(`/dev/null` で使わない)', 'cache file (`/dev/null`: none)', 'arg'], - ['-g', 'キャッシュを整理する', 'garbage-collect the cache'], - ['-i', 'I/O の制限情報を表示', 'show I/O limits'], - ['-l', '条件に合う最初のデバイスだけ', 'look up only the first device matching'], - ], - modprobe: [ - ['-a|--all', '複数のモジュールをすべて読み込む', 'load all listed modules'], - ['-c|--showconfig', '設定を表示する', 'show the configuration'], - ['-f|--force', 'バージョンの検査を無視して強制的に読み込む(注意)', 'force loading ignoring version checks (careful)'], - ['-i|--ignore-install', '`install` の設定を無視する', 'ignore `install` commands in the configuration'], - ['-q|--quiet', '見つからなくても何も表示しない', 'do not complain about missing modules'], - ['-D|--show-depends', '依存するモジュールを表示(読み込まない)', 'show dependencies without loading'], - ['-C|--config', '設定ファイル', 'configuration file', 'arg'], - ['-b|--use-blacklist', 'ブラックリストを名前にも適用する', 'apply the blacklist to names too'], - ['-S|--set-version', 'カーネルのバージョン', 'kernel version', 'arg'], - ['-s|--syslog', 'エラーを syslog に送る', 'send errors to syslog'], - ], - ldd: [ - ['-d|--data-relocs', 'データの再配置を行って未定義のシンボルを報告する', 'perform data relocations and report missing objects'], - ['-r|--function-relocs', '関数の再配置を行って未定義のシンボルを報告する', 'perform function relocations and report missing objects'], - ['-u|--unused', '使われていない直接の依存を表示', 'print unused direct dependencies'], - ], - dmesg: [ - ['-c|--read-clear', '表示してからバッファを消去する', 'clear the ring buffer after printing'], - ['-C|--clear', 'バッファを消去する', 'clear the ring buffer'], - ['-H|--human', '読みやすい形式で表示', 'human-readable output'], - ['-k|--kernel', 'カーネルのメッセージだけ', 'kernel messages only'], - ['-x|--decode', 'ファシリティとレベルを文字で表示', 'decode facility and level to text'], - ['-f|--facility', 'ファシリティで絞る', 'restrict to these facilities', 'arg'], - ['-t|--notime', '時刻を表示しない', 'do not print timestamps'], - ['--time-format', '時刻の書式(`ctime`、`iso`、`reltime`)', 'time format (`ctime`, `iso`, `reltime`)', 'arg'], - ['-r|--raw', '生のメッセージを出力', 'print the raw message buffer'], - ['-n|--console-level', 'コンソールに出すレベルを設定', 'set the console log level', 'arg'], - ['-L|--color', '色を付ける', 'colorize the output'], - ['-P|--nopager', 'ページャーを使わない', 'do not pipe to a pager'], - ['-d|--show-delta', 'メッセージ間の時間差を表示', 'show the time delta between messages'], - ['-u|--userspace', 'ユーザー空間のメッセージだけ', 'userspace messages only'], - ], - ldconfig: [ - ['-r', '代わりのルートディレクトリ', 'use the given directory as the root', 'arg'], - ['-X', 'シンボリックリンクを更新しない', 'do not update links'], - ['-C', 'キャッシュのファイル', 'cache file', 'arg'], - ['-f', '設定ファイル', 'configuration file', 'arg'], - ], - useradd: [ - ['-e|--expiredate', 'アカウントの期限日(`YYYY-MM-DD`)', 'account expiry date (`YYYY-MM-DD`)', 'arg'], - ['-f|--inactive', 'パスワードの期限切れ後にアカウントを無効にするまでの日数', 'days after password expiry before the account is disabled', 'arg'], - ['-k|--skel', 'ホームの雛形のディレクトリ', 'skeleton directory for the home', 'arg'], - ['-o|--non-unique', '重複する UID を許す', 'allow a duplicate UID'], - ['-p|--password', '暗号化済みのパスワード', 'encrypted password', 'arg'], - ['-N|--no-user-group', 'ユーザー名と同じグループを作らない', 'do not create a group with the user name'], - ['-b|--base-dir', 'ホームを作る親ディレクトリ', 'base directory for the home', 'arg'], - ['-D|--defaults', '既定値を表示・変更する', 'show or change the defaults'], - ['-R|--root', '代わりのルートディレクトリ', 'apply changes in the given chroot directory', 'arg'], - ['-Z|--selinux-user', 'SELinux のユーザー', 'SELinux user', 'arg'], - ], - usermod: [ - ['-c|--comment', 'コメント(GECOS)', 'comment (GECOS)', 'arg'], - ['-e|--expiredate', 'アカウントの期限日', 'account expiry date', 'arg'], - ['-f|--inactive', 'パスワードの期限切れ後にアカウントを無効にするまでの日数', 'days after password expiry before the account is disabled', 'arg'], - ['-l|--login', '新しいログイン名', 'new login name', 'arg'], - ['-m|--move-home', '`-d` のとき、ホームの中身を新しい場所に移す', 'with `-d`, move the home contents to the new place'], - ['-o|--non-unique', '重複する UID を許す', 'allow a duplicate UID'], - ['-p|--password', '暗号化済みのパスワード', 'encrypted password', 'arg'], - ['-U|--unlock', 'アカウントのロックを解除する', 'unlock the account'], - ['-R|--root', '代わりのルートディレクトリ', 'apply changes in the given chroot directory', 'arg'], - ], - userdel: [['-R|--root', '代わりのルートディレクトリ', 'apply changes in the given chroot directory', 'arg']], - groupadd: [ - ['-o|--non-unique', '重複する GID を許す', 'allow a duplicate GID'], - ['-p|--password', '暗号化済みのパスワード', 'encrypted password', 'arg'], - ['-R|--root', '代わりのルートディレクトリ', 'apply changes in the given chroot directory', 'arg'], - ], - passwd: [ - ['-i|--inactive', '期限切れ後にアカウントを無効にするまでの日数', 'days after expiry before the account is disabled', 'arg'], - ['-k|--keep-tokens', '期限切れのパスワードだけを更新する', 'change only expired authentication tokens'], - ['-n|--mindays', 'パスワードを変えられるまでの最小日数', 'minimum days between changes', 'arg'], - ['-x|--maxdays', 'パスワードを変えずに使える最大日数', 'maximum days between changes', 'arg'], - ['-w|--warndays', '期限の何日前から警告するか', 'days of warning before expiry', 'arg'], - ['-q|--quiet', '表示を減らす', 'quiet'], - ['-a|--all', 'すべてのユーザーの状態を表示(`-S` と併用)', 'report all users (with `-S`)'], - ['-R|--root', '代わりのルートディレクトリ', 'apply changes in the given chroot directory', 'arg'], - ['--stdin', '新しいパスワードを標準入力から読む', 'read the new password from stdin'], - ], - id: [['-Z|--context', 'SELinux のセキュリティコンテキストを表示', 'print the SELinux security context'], ['-z|--zero', '各項目を改行でなく NUL で区切る', 'delimit entries with NUL']], - who: [ - ['-d|--dead', '終了したプロセスを表示', 'print dead processes'], - ['-l|--login', 'ログインプロセスを表示', 'print login processes'], - ['-m', '自分の端末の情報だけ表示', 'only the host and user of this terminal'], - ['-p|--process', 'init が起動したプロセスを表示', 'print active processes spawned by init'], - ['-r|--runlevel', '現在のランレベルを表示', 'print the current run level'], - ['-s|--short', '名前・端末・時刻だけ表示(既定)', 'print only name, line and time (default)'], - ['-T|-w|--mesg', 'メッセージを受けられるか(`+` / `-`)を表示', 'show whether messages are allowed (`+` / `-`)'], - ['-t|--time', '最後にシステム時計が変更された時刻を表示', 'print the last system clock change'], - ], - // (systemctl reads its options before or after the verb: `systemctl status -l x`.) - systemctl: persistent([ - ['-a|--all', 'すべてのユニットを表示(停止中のものも)', 'show all units, including inactive ones'], - ['-t|--type', 'ユニットの種類で絞る(`service`、`timer`、`socket`…)', 'filter by unit type (`service`, `timer`, `socket`…)', 'arg'], - ['--state', '状態で絞る(`failed`、`running`…)', 'filter by state (`failed`, `running`…)', 'arg'], - ['-l|--full', '長い行を省略しない', 'do not ellipsize output'], - ['-H|--host', '操作するホスト(SSH 経由)', 'operate on a remote host over SSH', 'arg'], - ['--system', 'システムのサービスマネージャーを使う', 'use the system service manager'], - ['--no-reload', '`enable` や `disable` の後に設定を再読み込みしない', 'do not reload after enable or disable'], - ['-f|--force', '強制する(`enable` では既存のリンクを置き換える)', 'force (with `enable`, replace existing links)'], - ['--no-ask-password', 'パスワードを尋ねない', 'do not ask for passwords'], - ['--no-legend', '見出しと脚注を表示しない', 'do not print the legend'], - ['-p|--property', '表示するプロパティ(`show` で)', 'property to show (with `show`)', 'arg'], - ['--failed', '失敗したユニットだけ', 'show only failed units'], - ['--runtime', '再起動すると消える一時的な変更にする', 'make a temporary change that is lost at reboot'], - ['--global', 'すべてのユーザーに対して有効・無効にする', 'enable or disable for all users'], - ['--root', '代わりのルートディレクトリ', 'use the given root directory', 'arg'], - ['-n|--lines', '`status` で表示するログの行数', 'number of journal lines shown by `status`', 'arg'], - ['-o|--output', '`status` のログの形式', 'journal output format for `status`', 'arg'], - ['-r|--recursive', 'ホストとローカルコンテナーのユニットを表示する(`list-units` など)', 'show units of the host and local containers (`list-units`…)'], - ['--reverse', '`list-dependencies` で逆向きに表示', 'show reverse dependencies'], - ['--before', '`list-dependencies` で先に起動するもの', 'show units ordered before'], - ['--after', '`list-dependencies` で後に起動するもの', 'show units ordered after'], - ['--signal', '`kill` で送るシグナル', 'signal to send with `kill`', 'arg'], - ['-M|--machine', '操作するコンテナ', 'operate on a container', 'arg'], - ['--wait', '`start` したユニットが終わるまで待つ', 'wait until started units finish'], - ]), - journalctl: [ - ['-k|--dmesg', 'カーネルのメッセージだけ', 'kernel messages only'], - ['-x|--catalog', '説明文(カタログ)を付ける', 'add explanatory texts from the catalog'], - ['-e|--pager-end', '末尾から表示する', 'jump to the end in the pager'], - ['-a|--all', '長い行や表示できない文字も省略しない', 'show all fields in full'], - ['-g|--grep', 'メッセージを正規表現で絞る', 'filter messages by a regular expression', 'arg'], - ['-t|--identifier', 'syslog の識別子で絞る', 'filter by syslog identifier', 'arg'], - ['-m|--merge', 'すべてのジャーナルを統合して表示', 'merge all available journals'], - ['-D|--directory', '読むジャーナルのディレクトリ', 'journal directory to read', 'arg'], - ['--file', '読むジャーナルのファイル', 'journal file to read', 'arg'], - ['-F|--field', '指定したフィールドの値の一覧', 'print all values of a field', 'arg'], - ['-S', '開始日時(`--since` の短縮形)', 'start time (short for `--since`)', 'arg'], - ['-U', '終了日時(`--until` の短縮形)', 'end time (short for `--until`)', 'arg'], - ['-c|--cursor', '指定したカーソルから表示', 'start at the given cursor', 'arg'], - ['--disk-usage', 'ジャーナルのディスク使用量を表示', 'show the disk space used by journals'], - ['--vacuum-size', 'ジャーナルを指定した容量まで減らす', 'reduce the journals to the given size', 'arg'], - ['--vacuum-time', '指定した時刻より古いジャーナルを削除する', 'delete journals older than the given time', 'arg'], - ['--vacuum-files', 'ジャーナルのファイルを指定した数まで減らす', 'reduce the number of journal files', 'arg'], - ['--verify', 'ジャーナルの整合性を検査する', 'verify journal file consistency'], - ['--list-boots', '記録されている起動を一覧表示', 'list recorded boots'], - ['--utc', '時刻を UTC で表示', 'show times in UTC'], - ['--system', 'システムのジャーナルだけ', 'show system messages only'], - ['--user', 'ユーザーのジャーナルだけ', 'show the current user messages only'], - ['--no-tail', '全行を表示する(既定)', 'show all lines'], - ['-q|--quiet', '補足のメッセージを表示しない', 'do not show informational messages'], - ['--flush', '`/run` のジャーナルを `/var` に書き出す', 'flush `/run` journals to `/var`'], - ['--rotate', 'ジャーナルのファイルを切り替える', 'rotate the journal files'], - ], - ss: [ - ['-s|--summary', '接続数の要約を表示', 'show a summary of socket counts'], - ['-x|--unix', 'UNIX ドメインソケットだけ', 'UNIX domain sockets only'], - ['-e|--extended', '詳しい情報も表示', 'show detailed socket information'], - ['-o|--options', 'タイマーの情報も表示', 'show timer information'], - ['-i|--info', 'TCP の内部情報を表示', 'show internal TCP information'], - ['-m|--memory', 'ソケットのメモリ使用量を表示', 'show socket memory usage'], - ['-4|--ipv4', 'IPv4 だけ', 'IPv4 only'], - ['-6|--ipv6', 'IPv6 だけ', 'IPv6 only'], - ['-w|--raw', 'RAW ソケットだけ', 'raw sockets only'], - ['-H|--no-header', '見出しを表示しない', 'do not print the header'], - ['-r|--resolve', 'アドレスとポートを名前で表示', 'resolve addresses and ports to names'], - ['-Z|--context', 'SELinux のコンテキストも表示', 'show SELinux context'], - ['-K|--kill', '該当するソケットを強制的に閉じる(注意)', 'forcibly close the sockets (careful)'], - ['-f|--family', 'アドレスファミリで絞る', 'select the address family', 'arg'], - ['-O|--oneline', '1つの接続を1行で表示', 'print each socket on one line'], - ], - netstat: [ - ['-s|--statistics', 'プロトコルごとの統計を表示', 'show statistics per protocol'], - ['-g|--groups', 'マルチキャストグループを表示', 'show multicast group membership'], - ['-c|--continuous', '1秒ごとに表示を繰り返す', 'print continuously every second'], - ['-e|--extend', '詳しい情報も表示', 'show extended information'], - ['-o|--timers', 'タイマーの情報も表示', 'show timer information'], - ['-W|--wide', 'アドレスを省略しない', 'do not truncate IP addresses'], - ['-x|--unix', 'UNIX ドメインソケットだけ', 'UNIX domain sockets only'], - ['-w|--raw', 'RAW ソケットだけ', 'raw sockets only'], - ['-v|--verbose', '詳しく表示する', 'verbose'], - ['--tcp', 'TCP だけ', 'TCP only'], - ['--udp', 'UDP だけ', 'UDP only'], - ['--listening', '待ち受け中のものだけ', 'listening sockets only'], - ['--all', 'すべてのソケット', 'all sockets'], - ['--numeric', '名前を引かず数値のまま表示', 'numeric output'], - ['--program', 'プロセスの PID と名前も表示', 'show the PID and name of the process'], - ['--route', 'ルーティングテーブル', 'routing table'], - ['--interfaces', 'インターフェースの統計', 'interface statistics'], - ['-4|--inet', 'IPv4 だけ', 'IPv4 only'], - ['-6|--inet6', 'IPv6 だけ', 'IPv6 only'], - ['-M|--masquerade', 'マスカレードされた接続を表示', 'show masqueraded connections'], - ], - ping: [ - ['-s', 'パケットのデータ長(バイト)', 'packet data size in bytes', 'arg'], - ['-t', 'TTL(経由できるルーターの数)', 'TTL (hops)', 'arg'], - ['-I', '送信元のインターフェースまたはアドレス', 'source interface or address', 'arg'], - ['-b', 'ブロードキャストアドレスにも送る', 'allow pinging a broadcast address'], - ['-a', '応答が来たら音を鳴らす', 'audible ping'], - ['-f', '高速に連続して送る(フラッド。root)', 'flood ping (root)'], - ['-R', '経路を記録する', 'record the route'], - ['-v', '詳しく表示する', 'verbose'], - ['-D', '各行にタイムスタンプを付ける', 'print timestamps'], - ['-M', 'MTU の探索(`do` で DF ビットを立てる)', 'path MTU discovery (`do` sets the DF bit)', 'arg'], - ['-p', 'パケットに詰めるパターン', 'pattern to fill the packet', 'arg'], - ['-l', '最初に連続して送るパケットの数', 'send the given number of packets without waiting', 'arg'], - ['-Q', 'TOS(サービス種別)', 'type of service', 'arg'], - ['-B', '送信元アドレスを固定する', 'do not change the source address'], - ['-O', '応答が届かないパケットも報告する', 'report outstanding replies'], - ['-V', 'バージョンを表示', 'print the version'], - ], - host: [ - ['-v', '詳しく表示する', 'verbose'], - ['-l', 'ドメインの全ホストを一覧表示(ゾーン転送)', 'list all hosts in a domain (zone transfer)'], - ['-r', '再帰問い合わせをしない', 'do not ask for recursion'], - ['-C', 'すべての権威サーバーの SOA を比べる', 'compare SOA records of all authoritative servers'], - ['-d', 'デバッグ表示(`-v` と同じ)', 'debug output (same as `-v`)'], - ['-T', 'TCP を使う', 'use TCP'], - ['-R', '再試行の回数', 'number of retries', 'arg'], - ['-N', '名前の `.` の数(ndots)', 'number of dots (ndots)', 'arg'], - ['-c', 'クラス(`IN`)', 'query class (`IN`)', 'arg'], - ], - dig: [ - ['-b', '送信元のアドレス', 'source address', 'arg'], - ['-c', 'クラス(`IN`)', 'query class (`IN`)', 'arg'], - ['-f', '問い合わせを書いたファイル(バッチ)', 'file with queries (batch)', 'arg'], - ['-k', 'TSIG の鍵ファイル', 'TSIG key file', 'arg'], - ['-q', '問い合わせる名前', 'name to query', 'arg'], - ['-y', 'TSIG の鍵(`名前:鍵`)', 'TSIG key (`name:key`)', 'arg'], - ['-m', 'メモリのデバッグ', 'memory usage debugging', 'arg'], - ], - hostname: [ - ['-d|--domain', 'DNS ドメイン名を表示', 'show the DNS domain name'], - ['-A|--all-fqdns', 'すべての FQDN を表示', 'show all FQDNs'], - ['-b|--boot', 'ホスト名が未設定なら `localhost` を設定する', 'set a default host name if none is set'], - ['-F|--file', 'ファイルからホスト名を設定する', 'set the host name from a file', 'arg'], - ['-a|--alias', '別名を表示', 'show the alias names'], - ], - 'ssh-keygen': [ - ['-p', 'パスフレーズを変更する', 'change the passphrase'], - ['-e', '鍵を別の形式で書き出す', 'export a key to another format'], - ['-i', '別の形式の鍵を読み込む', 'import a key from another format'], - ['-m', '鍵の形式(`PEM`、`RFC4716`)', 'key format (`PEM`, `RFC4716`)', 'arg'], - ['-a', '鍵導出の繰り返し回数', 'number of KDF rounds', 'arg'], - ['-B', 'バブルバブル形式のダイジェストを表示', 'show the bubblebabble digest'], - ['-c', 'コメントを変更する', 'change the comment'], - ['-F', '`known_hosts` からホストを探す', 'search known_hosts for a host', 'arg'], - ['-H', '`known_hosts` のホスト名をハッシュ化する', 'hash the host names in known_hosts'], - ['-s', 'CA の鍵で署名する', 'sign with a CA key', 'arg'], - ['-I', '証明書の識別名', 'certificate identity', 'arg'], - ['-n', '証明書の対象の名前(プリンシパル)', 'principal names for a certificate', 'arg'], - ['-V', '証明書の有効期間', 'certificate validity interval', 'arg'], - ['-E', 'フィンガープリントのハッシュ(`sha256`、`md5`)', 'fingerprint hash (`sha256`, `md5`)', 'arg'], - ['-P', '古いパスフレーズ', 'old passphrase', 'arg'], - ['-o', '新しい OpenSSH 形式で保存する', 'save in the new OpenSSH format'], - ['-r', 'ホストの DNS 用フィンガープリントレコードを出力する', 'print the DNS fingerprint record of a host', 'arg'], - ], - 'ssh-add': [ - ['-x', 'エージェントをパスワードでロックする', 'lock the agent with a password'], - ['-X', 'エージェントのロックを解除する', 'unlock the agent'], - ['-c', '鍵を使うたびに確認する', 'ask for confirmation on each use'], - ['-q', '表示を減らす', 'quiet'], - ['-v', '詳しく表示する', 'verbose'], - ['-E', 'フィンガープリントのハッシュ', 'fingerprint hash', 'arg'], - ['-K', 'キーチェーンから鍵を読み込む', 'load keys from the keychain'], - ['-A', '保存済みのパスフレーズで鍵を追加する(macOS)', 'add keys with stored passphrases (macOS)'], - ], - gpg: [ - ['--gen-key|--generate-key', '鍵ペアを作る', 'generate a key pair'], - ['--full-generate-key', '鍵ペアを詳しい設定で作る', 'generate a key pair with all options'], - ['-K|--list-secret-keys', '秘密鍵を一覧表示', 'list secret keys'], - ['--list-sigs|--list-signatures', '署名も含めて鍵を一覧表示', 'list keys with signatures'], - ['--check-sigs', '署名を検証しながら一覧表示', 'list keys and verify signatures'], - ['--delete-keys', '公開鍵を削除', 'delete public keys'], - ['--delete-secret-keys', '秘密鍵を削除', 'delete secret keys'], - ['--delete-secret-and-public-key', '秘密鍵と公開鍵を削除', 'delete a secret and public key'], - ['--edit-key', '鍵を対話的に編集する', 'edit a key interactively'], - ['--send-keys', '公開鍵を鍵サーバーに送る', 'send public keys to a key server'], - ['--search-keys', '鍵サーバーで鍵を探す', 'search a key server'], - ['--refresh-keys', '鍵サーバーから鍵を更新する', 'refresh keys from a key server'], - ['--export-secret-keys', '秘密鍵を書き出す(注意)', 'export secret keys (careful)'], - ['--clearsign', '平文のまま署名を付ける', 'make a clear text signature'], - ['-c|--symmetric', '共通鍵(パスフレーズ)で暗号化する', 'encrypt with a passphrase (symmetric)'], - ['--gen-revoke', '失効証明書を作る', 'generate a revocation certificate'], - ['--passphrase', 'パスフレーズ(履歴に残る。注意)', 'passphrase (kept in history; careful)', 'arg'], - ['--passphrase-fd', 'パスフレーズを読むファイルディスクリプタ', 'file descriptor to read the passphrase from', 'arg'], - ['--pinentry-mode', 'パスフレーズの入力方法(`loopback`)', 'how to ask for passphrases (`loopback`)', 'arg'], - ['-u|--local-user', '署名に使う鍵', 'key to sign with', 'arg'], - ['--default-key', '既定で署名に使う鍵', 'default key to sign with', 'arg'], - ['--keyid-format', '鍵 ID の表示形式', 'key ID format', 'arg'], - ['--with-colons', '機械が読みやすい出力にする', 'machine-readable output'], - ['--list-packets', 'OpenPGP のパケットを表示', 'list the packets of a message'], - ['--print-md', 'ダイジェストを出力する', 'print message digests', 'arg'], - ['--enarmor', 'バイナリを ASCII アーマーにする', 'convert binary to ASCII armor'], - ['--trust-model', '信頼モデル(`always`…)', 'trust model (`always`…)', 'arg'], - ['--lock-never', 'ロックを使わない', 'do not use locks'], - ], - iptables: iptablesExtra(), - ip6tables: iptablesExtra(), - lsof: [ - ['-a', '条件を AND で組み合わせる', 'AND the selection options together'], - ['-d', 'ファイルディスクリプタで絞る', 'select by file descriptor', 'arg'], - ['-F', '機械が読みやすい出力にする', 'output for programs to read', 'arg'], - ['-r', '指定した秒数ごとに繰り返す', 'repeat every N seconds', 'arg'], - ['-s', 'サイズを表示、または状態で絞る(`-sTCP:LISTEN`)', 'show size, or select by state (`-sTCP:LISTEN`)', 'arg'], - ['-U', 'UNIX ドメインソケットだけ', 'UNIX domain sockets only'], - ['-l', 'ユーザー名でなく UID で表示', 'show UIDs, not user names'], - ['-b', 'ブロックしうるカーネル関数を使わない', 'avoid kernel functions that might block'], - ['-w', '警告を出さない', 'suppress warnings'], - ['-R', '親プロセスの PID も表示', 'show the parent PID'], - ['-V', '見つからなかった条件を表示', 'report when a selection finds nothing'], - ['-L', 'リンク数を表示', 'show link counts'], - ], - fuser: [ - ['-a|--all', '使われていないファイルも表示', 'show all specified files'], - ['-l|--list-signals', 'シグナルの名前を一覧表示', 'list signal names'], - ['-M|--ismountpoint', 'マウントポイントのときだけ動作', 'only act if the name is a mount point'], - ['-w|--writeonly', '書き込み中のプロセスだけ', 'only processes with write access'], - ['-u|--user', 'ユーザー名も表示', 'append the user name'], - ['-4|--ipv4', 'IPv4 のソケットだけ', 'IPv4 sockets only'], - ['-6|--ipv6', 'IPv6 のソケットだけ', 'IPv6 sockets only'], - ], - lsattr: [ - ['-l', '属性を名前で表示', 'print options in long names'], - ['-v', 'ファイルの版番号を表示', 'list the file version'], - ['-p', 'プロジェクト ID を表示', 'list the project ID'], - ['-V', 'バージョンを表示', 'print the version'], - ], - chattr: [ - ['-v', '版番号を設定', 'set the file version', 'arg'], - ['-p', 'プロジェクト ID を設定', 'set the project ID', 'arg'], - ['-f', 'エラーを表示しない', 'suppress most error messages'], - ], - lscpu: [ - ['-a|--all', 'オンラインとオフラインの CPU を表示', 'print both online and offline CPUs'], - ['-b|--online', 'オンラインの CPU だけ', 'online CPUs only'], - ['-c|--offline', 'オフラインの CPU だけ', 'offline CPUs only'], - ['-x|--hex', 'マスクを 16 進数で表示', 'print hexadecimal masks'], - ['-y|--physical', '物理 ID で表示', 'print physical IDs'], - ['-B|--bytes', 'サイズをバイトで表示', 'print sizes in bytes'], - ['-C|--caches', 'キャッシュの情報を表示', 'show cache information'], - ], - wget: [ - ['-P|--directory-prefix', '保存先のディレクトリ', 'directory to save into', 'arg'], - ['-r|--recursive', 'リンクをたどって再帰的に取得する', 'download recursively'], - ['-np|--no-parent', '親ディレクトリには上がらない', 'never ascend to the parent directory'], - ['-l|--level', '再帰の深さ', 'recursion depth', 'arg'], - ['-nd|--no-directories', 'ディレクトリ構造を作らず1か所に保存する', 'do not create a directory hierarchy'], - ['-nc|--no-clobber', '既存のファイルを上書きしない', 'do not overwrite existing files'], - ['-N|--timestamping', '新しいファイルだけ取得する', 'download only newer files'], - ['-b|--background', 'バックグラウンドで実行する', 'go to the background'], - ['-o|--output-file', 'ログを書くファイル', 'write the log to the given file', 'arg'], - ['-a|--append-output', 'ログをファイルに追記する', 'append the log to the given file', 'arg'], - ['-i|--input-file', 'URL の一覧を書いたファイル', 'file with a list of URLs', 'arg'], - ['-U|--user-agent', 'User-Agent の文字列', 'User-Agent string', 'arg'], - ['--header', '追加するヘッダー', 'extra header', 'arg'], - ['--post-data', 'POST で送るデータ', 'data to send with POST', 'arg'], - ['--no-check-certificate', 'サーバー証明書を検証しない(注意)', 'do not validate the server certificate (careful)'], - ['-t|--tries', '再試行の回数', 'number of tries', 'arg'], - ['-T|--timeout', 'タイムアウト(秒)', 'timeout in seconds', 'arg'], - ['--limit-rate', '速度の上限', 'download rate limit', 'arg'], - ['-k|--convert-links', 'ローカルで見られるようリンクを変換する', 'convert links for local viewing'], - ['-p|--page-requisites', 'ページの表示に必要な画像や CSS も取得する', 'also get images and CSS needed to display a page'], - ['-m|--mirror', 'ミラーリング用の設定(`-r -N -l inf`)', 'mirroring options (`-r -N -l inf`)'], - ['-e|--execute', '設定コマンドを実行する', 'execute a `.wgetrc`-style command', 'arg'], - ['--http-user', 'HTTP 認証のユーザー名', 'HTTP user name', 'arg'], - ['--http-password', 'HTTP 認証のパスワード', 'HTTP password', 'arg'], - ['--content-disposition', 'サーバーが指定したファイル名を使う', 'use the server-supplied file name'], - ['-4|--inet4-only', 'IPv4 だけ', 'IPv4 only'], - ['-6|--inet6-only', 'IPv6 だけ', 'IPv6 only'], - ['-S|--server-response', 'サーバーの応答ヘッダーを表示', 'print the server response headers'], - ['-nv|--no-verbose', '簡潔に表示する', 'less verbose, but not quiet'], - ['-v|--verbose', '詳しく表示する', 'verbose'], - ['-nH|--no-host-directories', 'ホスト名のディレクトリを作らない', 'do not create host-name directories'], - ['-x|--force-directories', 'ディレクトリ構造を必ず作る', 'always create the directory hierarchy'], - ['-A|--accept', '取得する拡張子', 'accepted extensions', 'arg'], - ['-R|--reject', '取得しない拡張子', 'rejected extensions', 'arg'], - ['-H|--span-hosts', '他のホストにも移る', 'go to foreign hosts when recursive'], - ['-w|--wait', '取得の間に待つ秒数', 'seconds to wait between retrievals', 'arg'], - ['--save-cookies', 'クッキーを保存するファイル', 'file to save cookies to', 'arg'], - ['--load-cookies', 'クッキーを読むファイル', 'file to load cookies from', 'arg'], - ['--progress', '進行状況の表示形式', 'progress indicator style', 'arg'], - ], - curl: [ - ['-b|--cookie', '送るクッキー(文字列またはファイル)', 'cookies to send (string or file)', 'arg'], - ['-c|--cookie-jar', 'クッキーを保存するファイル', 'file to save cookies to', 'arg'], - ['-A|--user-agent', 'User-Agent の文字列', 'User-Agent string', 'arg'], - ['-e|--referer', 'Referer の値', 'Referer value', 'arg'], - ['-T|--upload-file', 'アップロードするファイル', 'file to upload', 'arg'], - ['-F|--form', 'フォーム(multipart)の項目', 'multipart form field', 'arg'], - ['-x|--proxy', '使うプロキシ', 'proxy to use', 'arg'], - ['-K|--config', '設定ファイル', 'read options from a file', 'arg'], - ['-D|--dump-header', '応答ヘッダーを保存するファイル(`-` で標準出力)', 'file for the response headers (`-` for stdout)', 'arg'], - ['-r|--range', '取得する範囲(バイト)', 'byte range to fetch', 'arg'], - ['-C|--continue-at', '途中から再開する(`-` で自動)', 'resume at the given offset (`-`: automatic)', 'arg'], - ['--data-raw', '変換せずに送るデータ', 'data to send as is', 'arg'], - ['--data-binary', 'バイナリのまま送るデータ', 'data to send as binary', 'arg'], - ['--data-urlencode', 'URL エンコードして送るデータ', 'data to send URL-encoded', 'arg'], - ['-G|--get', 'データを GET のクエリ文字列にする', 'send the data as a GET query string'], - ['-J|--remote-header-name', 'サーバーが指定したファイル名を使う', 'use the server-supplied file name'], - ['-R|--remote-time', '保存するファイルの時刻をサーバーに合わせる', 'set the file time to the remote one'], - ['--cacert', 'CA 証明書のファイル', 'CA certificate file', 'arg'], - ['-E|--cert', 'クライアント証明書', 'client certificate', 'arg'], - ['--key', 'クライアント証明書の秘密鍵', 'private key of the client certificate', 'arg'], - ['--resolve', '名前解決を固定する(`ホスト:ポート:アドレス`)', 'pin name resolution (`host:port:address`)', 'arg'], - ['--interface', '使うネットワークインターフェース', 'network interface to use', 'arg'], - ['--limit-rate', '速度の上限', 'transfer rate limit', 'arg'], - ['--max-redirs', 'リダイレクトをたどる最大回数', 'maximum redirects to follow', 'arg'], - ['--http1.1', 'HTTP/1.1 を使う', 'use HTTP/1.1'], - ['--http2', 'HTTP/2 を使う', 'use HTTP/2'], - ['-4|--ipv4', 'IPv4 だけ', 'IPv4 only'], - ['-6|--ipv6', 'IPv6 だけ', 'IPv6 only'], - ['-Z|--parallel', '複数の転送を並列で行う', 'perform transfers in parallel'], - ['-n|--netrc', '`~/.netrc` の認証情報を使う', 'use credentials from `~/.netrc`'], - ['--noproxy', 'プロキシを使わないホスト', 'hosts that bypass the proxy', 'arg'], - ['-#|--progress-bar', '進行状況をバーで表示', 'show a progress bar'], - ['--fail-with-body', '失敗時(HTTP 400 以上)も本文を出して失敗にする', 'fail on HTTP errors but still print the body'], - ['--oauth2-bearer', 'Bearer トークン', 'bearer token', 'arg'], - ['-N|--no-buffer', '出力をバッファしない', 'disable output buffering'], - ['-l|--list-only', 'FTP でファイル名だけ一覧表示', 'list only file names (FTP)'], - ['-g|--globoff', 'URL の `{}` `[]` を展開しない', 'turn off URL globbing'], - ['--create-dirs', '出力先のディレクトリがなければ作る', 'create the local directory hierarchy'], - ['--output-dir', '出力するディレクトリ', 'directory to save into', 'arg'], - ['--proto', '許可するプロトコル(`=https`)', 'allowed protocols (`=https`)', 'arg'], - ['--tlsv1.2', 'TLS 1.2 以上を使う', 'use TLS 1.2 or newer'], - ['-0|--http1.0', 'HTTP/1.0 を使う', 'use HTTP/1.0'], - ['--trace', '通信の詳細をファイルに記録する', 'write a full trace to a file', 'arg'], - ['--stderr', 'エラー出力の先', 'where to redirect stderr', 'arg'], - ], - scp: [ - ['-q', '進行状況を表示しない', 'quiet; no progress meter'], - ['-C', '通信を圧縮する', 'compress the connection'], - ['-v', '詳しく表示する', 'verbose'], - ['-p', '更新時刻とパーミッションを保つ', 'preserve times and modes'], - ['-l', '帯域の上限(Kbit/s)', 'bandwidth limit in Kbit/s', 'arg'], - ['-o', 'ssh のオプションを渡す', 'pass an ssh option', 'arg'], - ['-F', 'ssh の設定ファイル', 'ssh configuration file', 'arg'], - ['-J', '経由する踏み台ホスト', 'jump host', 'arg'], - ['-3', '2つのリモートの間をこちら経由でコピーする', 'copy between two remote hosts through this host'], - ['-4', 'IPv4 だけを使う', 'use IPv4 only'], - ['-6', 'IPv6 だけを使う', 'use IPv6 only'], - ['-B', '対話せず(バッチ)実行する', 'batch mode; no prompts'], - ['-c', '暗号方式', 'cipher', 'arg'], - ['-S', '使う ssh プログラム', 'ssh program to use', 'arg'], - ], - rsync: [ - ['-u|--update', '受け取り側が新しいファイルは飛ばす', 'skip files that are newer on the receiver'], - ['-l|--links', 'シンボリックリンクをリンクのままコピーする', 'copy symlinks as symlinks'], - ['-H|--hard-links', 'ハードリンクを保つ', 'preserve hard links'], - ['-p|--perms', 'パーミッションを保つ', 'preserve permissions'], - ['-o|--owner', '所有者を保つ(root)', 'preserve the owner (root)'], - ['-g|--group', 'グループを保つ', 'preserve the group'], - ['-t|--times', '更新時刻を保つ', 'preserve modification times'], - ['-D', 'デバイスファイルと特殊ファイルを保つ', 'preserve devices and special files'], - ['-x|--one-file-system', '他のファイルシステムに入らない', 'stay on one file system'], - ['-c|--checksum', '時刻とサイズでなくチェックサムで比べる', 'compare by checksum, not time and size'], - ['-b|--backup', '上書きするファイルのバックアップを作る', 'back up replaced files'], - ['--backup-dir', 'バックアップを置くディレクトリ', 'directory for backups', 'arg'], - ['-S|--sparse', '疎なファイルを効率よく扱う', 'handle sparse files efficiently'], - ['-W|--whole-file', '差分でなくファイル全体を送る', 'copy whole files, no delta transfer'], - ['-X|--xattrs', '拡張属性を保つ', 'preserve extended attributes'], - ['-A|--acls', 'ACL を保つ', 'preserve ACLs'], - ['--partial', '途中で切れた転送のファイルを残す', 'keep partially transferred files'], - ['--bwlimit', '帯域の上限(KiB/s)', 'bandwidth limit (KiB/s)', 'arg'], - ['--exclude-from', '除外するパターンを書いたファイル', 'file of exclude patterns', 'arg'], - ['--include', '除外から除くパターン', 'include files matching the pattern', 'arg'], - ['--include-from', '含めるパターンを書いたファイル', 'file of include patterns', 'arg'], - ['--delete-after', '転送が終わってから削除する', 'delete after the transfer'], - ['--delete-before', '転送の前に削除する', 'delete before the transfer'], - ['--delete-excluded', '除外したファイルも受け取り側で削除する', 'also delete excluded files on the receiver'], - ['--stats', '転送の統計を表示', 'show transfer statistics'], - ['-i|--itemize-changes', '変更の内容を1行ずつ表示', 'output a change summary for each file'], - ['--remove-source-files', '送った後で送り元のファイルを削除する(注意)', 'delete source files after sending (careful)'], - ['--files-from', '転送するファイル名を書いたファイル', 'file listing the names to transfer', 'arg'], - ['--link-dest', '変更がないファイルをハードリンクにする基準ディレクトリ', 'hard-link unchanged files against the given directory', 'arg'], - ['-m|--prune-empty-dirs', '空のディレクトリを送らない', 'prune empty directories'], - ['--size-only', 'サイズだけで比べる', 'skip files that match in size'], - ['--ignore-existing', '受け取り側に既にあるファイルは飛ばす', 'skip files that exist on the receiver'], - ['--inplace', '一時ファイルを使わず直接更新する', 'update destination files in place'], - ['--numeric-ids', '名前でなく数値の UID/GID で扱う', 'use numeric user and group IDs'], - ['-q|--quiet', '表示を減らす', 'quiet'], - ['--timeout', 'I/O のタイムアウト(秒)', 'I/O timeout in seconds', 'arg'], - ['-R|--relative', '元のパスの構造ごと送る', 'use relative path names'], - ['--chown', '受け取り側の所有者を指定する', 'set the owner on the receiver', 'arg'], - ['--chmod', '受け取り側のパーミッションを指定する', 'set the permissions on the receiver', 'arg'], - ['--log-file', 'ログを書くファイル', 'log to the given file', 'arg'], - ['--rsh', '使うリモートシェル(`ssh`)', 'remote shell to use (`ssh`)', 'arg'], - ['-8|--8-bit-output', '8 ビット文字をそのまま出力する', 'leave high-bit characters unescaped'], - ], - sysctl: [ - ['-e|--ignore', '知らないキーのエラーを無視する', 'ignore unknown keys'], - ['-N|--names', '名前だけ表示', 'print names only'], - ['-q|--quiet', '設定した値を表示しない', 'do not echo the values set'], - ['--system', 'すべての設定ファイルを読み込む', 'load all system configuration files'], - ['-r|--pattern', '指定した正規表現に合うものだけ', 'only names matching the given regular expression', 'arg'], - ['-b|--binary', '値を改行なしで出力', 'print values without a newline'], - ['--load', 'ファイルから読み込む(`-p` と同じ)', 'load from a file (same as `-p`)', 'arg'], - ], - logger: [ - ['-f|--file', '指定したファイルの内容を記録する', 'log the contents of the given file', 'arg'], - ['-i|--id', 'プロセス ID も記録する', 'log the process ID'], - ['-u|--socket', '書き込む UNIX ソケット', 'write to the given UNIX socket', 'arg'], - ['-n|--server', 'ログの送信先サーバー', 'remote syslog server', 'arg'], - ['-P|--port', '送信先のポート', 'remote port', 'arg'], - ['-T|--tcp', 'TCP で送る', 'use TCP'], - ['-d|--udp', 'UDP で送る', 'use UDP'], - ['--journald', 'ジャーナルに直接送る', 'send to the journal directly'], - ['--rfc5424', 'RFC 5424 の形式で送る', 'use the RFC 5424 format'], - ], - losetup: [ - ['-c|--set-capacity', 'ループデバイスのサイズを更新する', 'resize the loop device'], - ['-b|--sector-size', 'セクタサイズ', 'logical sector size', 'arg'], - ['-o|--offset', 'ファイルの開始位置', 'offset into the file', 'arg'], - ['--sizelimit', 'ファイルの使う大きさ', 'limit the size of the data', 'arg'], - ['-n|--noheadings', '見出しを表示しない', 'do not print headings'], - ['-O|--output', '表示する列', 'columns to show', 'arg'], - ['-l|--list', '一覧表示', 'list devices'], - ], - mountpoint: [ - ['-d|--fs-devno', 'ファイルシステムのデバイス番号を表示', 'show the device number of the file system'], - ['-x|--devno', 'ブロックデバイスの番号を表示', 'show the device number of a block device'], - ], -}; diff --git a/src/dict/extrasFiles.ts b/src/dict/extrasFiles.ts deleted file mode 100644 index dc172189..00000000 --- a/src/dict/extrasFiles.ts +++ /dev/null @@ -1,374 +0,0 @@ -import { OptSpec } from './types'; - -// Options of file, text and process commands that the LPIC and LinuC objectives use and that the -// first entries did not list. See extras.ts for how they are merged. - -const signalOpts = (): OptSpec[] => [ - ['-HUP', 'SIGHUP を送る(設定の再読み込み)', 'send SIGHUP (reload configuration)'], - ['-INT', 'SIGINT を送る', 'send SIGINT'], - ['-TERM', 'SIGTERM を送る(既定)', 'send SIGTERM (default)'], - ['-KILL', 'SIGKILL を送る(強制終了)', 'send SIGKILL (force kill)'], - ['-USR1', 'SIGUSR1 を送る', 'send SIGUSR1'], - ['-USR2', 'SIGUSR2 を送る', 'send SIGUSR2'], - ['-STOP', 'SIGSTOP を送る(一時停止)', 'send SIGSTOP (pause)'], - ['-CONT', 'SIGCONT を送る(再開)', 'send SIGCONT (resume)'], - ['-15', 'シグナル 15 (TERM) を送る', 'send signal 15 (TERM)'], -]; -const pgrepCommon = (): OptSpec[] => [ - ['-u|--euid', '実効ユーザーで絞る', 'match the effective user', 'arg'], - ['-U|--uid', '実ユーザーで絞る', 'match the real user', 'arg'], - ['-G|--group', '実グループで絞る', 'match the real group', 'arg'], - ['-P|--parent', '親プロセスの PID で絞る', 'match the parent PID', 'arg'], - ['-t|--terminal', '端末で絞る', 'match the terminal', 'arg'], - ['-s|--session', 'セッション ID で絞る', 'match the session ID', 'arg'], - ['-x|--exact', '名前が完全に一致するものだけ', 'match the name exactly'], - ['-n|--newest', '最も新しく起動したものだけ', 'only the newest'], - ['-o|--oldest', '最も古くから動いているものだけ', 'only the oldest'], - ['-i|--ignore-case', '大文字と小文字を区別しない', 'ignore case'], - ['-v|--inverse', '一致しないものを対象にする', 'negate the match'], - ['-F|--pidfile', 'PID ファイルの PID だけ', 'read PIDs from a file', 'arg'], - ['-a|--list-full', 'コマンドライン全体も表示', 'list the full command line'], - ['-l|--list-name', 'プロセス名も表示', 'list the process name'], - ['-c|--count', '一致した数だけ表示', 'print the number of matches'], - ['-d|--delimiter', '出力の区切り文字', 'output delimiter', 'arg'], -]; - -export const extraFiles: Record = { - ls: [ - ['-i|--inode', 'inode 番号も表示', 'print the inode number'], - ['-s|--size', 'ブロック数も表示', 'print the allocated size'], - ['-n|--numeric-uid-gid', 'ユーザーとグループを数値で表示', 'list numeric user and group IDs'], - ['-X', '拡張子で並べる', 'sort by extension'], - ['-v', '数字を自然な順に並べる', 'natural sort of numbers'], - ['-U', '並べ替えない(ディスク上の順)', 'do not sort'], - ['-u', '最終アクセス時刻で並べる/表示する', 'sort or show by access time'], - ['-c', '状態の変更時刻で並べる/表示する', 'sort or show by status change time'], - ['-L|--dereference', 'シンボリックリンクの先の情報を表示', 'show information of link targets'], - ['-p', 'ディレクトリの名前の後ろに `/` を付ける', 'append `/` to directories'], - ['-m', 'コンマ区切りで横に並べる', 'fill the width with a comma-separated list'], - ['-x', '横方向に並べる', 'list entries by lines instead of columns'], - ['-C', '縦方向に並べる', 'list entries by columns'], - ['-Z|--context', 'SELinux のセキュリティコンテキストも表示', 'print the SELinux security context'], - ['-f', '並べ替えず、`-a` も有効にする', 'do not sort; enables `-a`'], - ['-g', '`-l` からオーナーを除く', 'like `-l` but without the owner'], - ['-o', '`-l` からグループを除く', 'like `-l` but without the group'], - ['-G|--no-group', '`-l` でグループを表示しない', 'do not print the group in `-l`'], - ['-k|--kibibytes', 'サイズを 1024 バイト単位で表示', 'use 1024-byte blocks'], - ['-q|--hide-control-chars', '表示できない文字を `?` にする', 'print `?` for non-printable characters'], - ['-b|--escape', '特殊な文字をエスケープして表示', 'print C-style escapes for special characters'], - ['-I|--ignore', '一致する名前を表示しない', 'do not list names matching the pattern', 'arg'], - ['--full-time', '時刻を秒まで完全に表示(`-l --time-style=full-iso`)', 'show full timestamps (`-l --time-style=full-iso`)'], - ['--time-style', '時刻の表示形式(`iso`、`long-iso`、`+%Y-%m-%d`)', 'time format (`iso`, `long-iso`, `+%Y-%m-%d`)', 'arg'], - ['--group-directories-first', 'ディレクトリを先に並べる', 'list directories before files'], - ['--sort', '並べ方(`size`、`time`、`extension`、`version`、`none`)', 'sort key (`size`, `time`, `extension`, `version`, `none`)', 'arg'], - ['--si', 'サイズを 1000 の累乗の単位で表示', 'use powers of 1000 for sizes'], - ], - cp: [ - ['-l|--link', 'コピーせずハードリンクを作る', 'hard-link instead of copying'], - ['-s|--symbolic-link', 'コピーせずシンボリックリンクを作る', 'make symbolic links instead of copying'], - ['-b', '上書きするファイルのバックアップを作る', 'back up files that would be overwritten'], - ['--backup', 'バックアップの方式(`numbered`、`simple`…)', 'backup method (`numbered`, `simple`…)', 'attached'], - ['-S|--suffix', 'バックアップの接尾辞', 'backup suffix', 'arg'], - ['-t|--target-directory', 'コピー先のディレクトリ', 'copy into the given directory', 'arg'], - ['-T|--no-target-directory', 'コピー先を常にファイルとして扱う', 'treat the destination as a file'], - ['-d', 'シンボリックリンクをそのままコピーし、リンクを保つ', 'copy links as links and preserve them'], - ['-L|--dereference', 'シンボリックリンクの先をコピーする', 'follow symbolic links in the source'], - ['-P|--no-dereference', 'シンボリックリンクをたどらない', 'never follow symbolic links'], - ['-H', 'コマンドラインのシンボリックリンクだけたどる', 'follow links given on the command line'], - ['-x|--one-file-system', '他のファイルシステムには入らない', 'stay on this file system'], - ['--preserve', '保つ属性(`mode,ownership,timestamps`、`all`)', 'attributes to preserve (`mode,ownership,timestamps`, `all`)', 'attached'], - ['--no-preserve', '保たない属性', 'attributes not to preserve', 'arg'], - ['--parents', '元のパスの構造ごとコピーする', 'keep the source path structure'], - ['--reflink', 'コピーオンライトで複製する(`auto`、`always`)', 'clone with copy-on-write (`auto`, `always`)', 'attached'], - ['--remove-destination', '先にコピー先を削除してからコピー', 'remove the destination first'], - ['--attributes-only', '中身でなく属性だけコピー', 'copy only the attributes, not the data'], - ['-Z|--context', 'SELinux のコンテキストを設定', 'set the SELinux context'], - ], - mv: [ - ['-b', '上書きするファイルのバックアップを作る', 'back up files that would be overwritten'], - ['-t|--target-directory', '移動先のディレクトリ', 'move into the given directory', 'arg'], - ['-T|--no-target-directory', '移動先を常にファイルとして扱う', 'treat the destination as a file'], - ['-S|--suffix', 'バックアップの接尾辞', 'backup suffix', 'arg'], - ['--strip-trailing-slashes', '元の名前の末尾の `/` を取る', 'remove trailing slashes from the sources'], - ], - rm: [ - ['-I', '多数のファイルや再帰削除の前に1回だけ確認', 'ask once before removing many files or recursing'], - ['--one-file-system', '再帰削除で他のファイルシステムに入らない', 'stay on this file system when recursing'], - ['--no-preserve-root', '`/` も再帰削除の対象にする(極めて危険。注意)', 'do not protect `/` (extremely dangerous; careful)'], - ['--preserve-root', '`/` を再帰削除しない(既定)', 'refuse to remove `/` (default)'], - ], - ln: [ - ['-i|--interactive', '上書きする前に確認する', 'ask before overwriting'], - ['-v|--verbose', '作ったリンクを表示する', 'print each link made'], - ['-b', '上書きするファイルのバックアップを作る', 'back up files that would be overwritten'], - ['-r|--relative', '相対パスのシンボリックリンクを作る', 'make symbolic links relative to the link location'], - ['-t|--target-directory', 'リンクを作るディレクトリ', 'create links in the given directory', 'arg'], - ['-T|--no-target-directory', 'リンク名を常にファイルとして扱う', 'treat the link name as a file'], - ['-L|--logical', 'ハードリンクの元がシンボリックリンクなら先をたどる', 'dereference link targets when hard-linking'], - ['-P|--physical', 'シンボリックリンクそのものにハードリンクを作る', 'hard-link to the symbolic link itself'], - ], - touch: [ - ['-a', 'アクセス時刻だけ変える', 'change only the access time'], - ['-m', '更新時刻だけ変える', 'change only the modification time'], - ['-h|--no-dereference', 'シンボリックリンク自体を対象にする', 'affect the link itself'], - ], - cat: [ - ['-b|--number-nonblank', '空行以外に行番号を付ける', 'number non-empty lines'], - ['-E|--show-ends', '行末に `$` を表示', 'show `$` at the end of each line'], - ['-T|--show-tabs', 'タブを `^I` で表示', 'show tabs as `^I`'], - ['-v|--show-nonprinting', '表示できない文字を `^` 記法で表示', 'show non-printing characters with `^` notation'], - ['-e', '`-vE` と同じ', 'same as `-vE`'], - ['-t', '`-vT` と同じ', 'same as `-vT`'], - ], - head: [ - ['-q|--quiet|--silent', '複数ファイルでもファイル名の見出しを付けない', 'never print file name headers'], - ['-v|--verbose', '常にファイル名の見出しを付ける', 'always print file name headers'], - ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], - ], - tail: [ - ['-q|--quiet|--silent', '複数ファイルでもファイル名の見出しを付けない', 'never print file name headers'], - ['-v|--verbose', '常にファイル名の見出しを付ける', 'always print file name headers'], - ['-s|--sleep-interval', '`-f` で調べる間隔(秒)', 'seconds between checks with `-f`', 'arg'], - ['--pid', '指定した PID のプロセスが終わったら `-f` をやめる', 'stop `-f` when the given PID exits', 'arg'], - ['--retry', 'ファイルが開けるまで繰り返す', 'keep trying to open the file'], - ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], - ], - sort: [ - ['-b|--ignore-leading-blanks', '先頭の空白を無視する', 'ignore leading blanks'], - ['-d|--dictionary-order', '英数字と空白だけで比べる', 'consider only blanks and alphanumerics'], - ['-g|--general-numeric-sort', '指数表記も含めて数値として並べる', 'compare as general numbers (with exponents)'], - ['-i|--ignore-nonprinting', '表示できない文字を無視する', 'ignore non-printing characters'], - ['-m|--merge', 'ソート済みのファイルを統合する', 'merge already sorted files'], - ['-M|--month-sort', '月名(JAN〜DEC)として並べる', 'sort by month name (JAN to DEC)'], - ['-R|--random-sort', 'ランダムに並べる', 'shuffle'], - ['-s|--stable', '等しい行の順序を変えない', 'keep equal lines in input order'], - ['-c|--check', '整列済みかどうかを確認するだけ', 'only check whether it is sorted'], - ['-C', '整列済みかどうかを確認し、何も表示しない', 'check quietly'], - ['-S|--buffer-size', '使うメモリの大きさ', 'size of the main memory buffer', 'arg'], - ['-T|--temporary-directory', '一時ファイルを置くディレクトリ', 'directory for temporary files', 'arg'], - ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], - ['--parallel', '並列に処理する数', 'number of sorts run in parallel', 'arg'], - ], - cut: [ - ['-s|--only-delimited', '区切り文字のない行は出力しない', 'do not print lines without the delimiter'], - ['--complement', '指定した以外を出力する', 'select everything except the given fields'], - ['--output-delimiter', '出力の区切り文字', 'output delimiter', 'arg'], - ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], - ], - tr: [['-t|--truncate-set1', '1つ目の文字集合を2つ目の長さに切り詰める', 'truncate the first set to the length of the second']], - uniq: [ - ['-f|--skip-fields', '比べるとき先頭のN個のフィールドを飛ばす', 'skip the first N fields when comparing', 'arg'], - ['-s|--skip-chars', '比べるとき先頭のN文字を飛ばす', 'skip the first N characters when comparing', 'arg'], - ['-w|--check-chars', '先頭のN文字だけ比べる', 'compare no more than N characters', 'arg'], - ['-D|--all-repeated', '重複した行をすべて出力する', 'print all duplicate lines'], - ['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], - ], - wc: [ - ['-L|--max-line-length', '最も長い行の長さ', 'length of the longest line'], - ['--files0-from', 'NUL 区切りのファイル名の一覧を読むファイル', 'read NUL-separated file names from the given file', 'arg'], - ], - paste: [['-z|--zero-terminated', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline']], - nl: [ - ['-b|--body-numbering', '本文の行番号の付け方(`a` すべて、`t` 空行以外、`n` なし)', 'which body lines to number (`a` all, `t` non-empty, `n` none)', 'arg'], - ['-n|--number-format', '行番号の書式(`ln` 左詰め、`rn` 右詰め、`rz` 0 埋め)', 'number format (`ln` left, `rn` right, `rz` zero-padded)', 'arg'], - ['-w|--number-width', '行番号の桁数', 'width of the line numbers', 'arg'], - ['-s|--number-separator', '行番号と本文の間の文字列', 'string between the number and the text', 'arg'], - ['-v|--starting-line-number', '最初の行番号', 'first line number', 'arg'], - ['-i|--line-increment', '行番号の増分', 'line number increment', 'arg'], - ['-p|--no-renumber', 'ページごとに番号を振り直さない', 'do not restart numbering at each page'], - ], - od: [ - ['-b', '8 進数のバイトで表示', 'octal bytes'], - ['-d', '10 進数の 2 バイト単位で表示', 'unsigned decimal 2-byte units'], - ['-o', '8 進数の 2 バイト単位で表示', 'octal 2-byte units'], - ['-a', '名前付きの文字で表示', 'named characters'], - ['-f', '単精度の浮動小数点数で表示', 'floating point'], - ['-i', '10 進数の整数で表示', 'decimal integers'], - ['-w|--width', '1行に表示するバイト数', 'bytes per output line', 'arg'], - ], - split: [ - ['-a|--suffix-length', '出力ファイル名の接尾辞の長さ', 'length of the suffixes', 'arg'], - ['-d|--numeric-suffixes', '接尾辞を数字にする', 'use numeric suffixes'], - ['-x|--hex-suffixes', '接尾辞を 16 進数にする', 'use hexadecimal suffixes'], - ['-n|--number', '指定した数のファイルに分ける', 'split into the given number of files', 'arg'], - ['-C|--line-bytes', '行を壊さずに 1 ファイルの最大バイト数を決める', 'maximum bytes per file without splitting lines', 'arg'], - ['--additional-suffix', '接尾辞の後ろに付ける文字列(拡張子など)', 'string added after the suffix (an extension)', 'arg'], - ['--filter', '各ファイルをコマンドに渡す', 'pipe each piece to a command', 'arg'], - ], - tee: [ - ['-i|--ignore-interrupts', '割り込みシグナルを無視する', 'ignore interrupt signals'], - ['-p', 'パイプへの書き込みエラーを診断する', 'diagnose errors writing to pipes'], - ['--output-error', '書き込みエラーの扱い(`warn`、`exit`…)', 'what to do on write errors (`warn`, `exit`…)', 'attached'], - ], - file: [ - ['-b|--brief', 'ファイル名を付けずに結果だけ表示', 'do not prepend file names'], - ['-i|--mime', 'MIME タイプと文字コードを表示', 'show the MIME type and encoding'], - ['--mime-type', 'MIME タイプだけ表示', 'show only the MIME type'], - ['--mime-encoding', '文字コードだけ表示', 'show only the encoding'], - ['-L|--dereference', 'シンボリックリンクの先を調べる', 'follow symbolic links'], - ['-f|--files-from', '調べるファイル名の一覧を読むファイル', 'read file names from the given file', 'arg'], - ['-z|--uncompress', '圧縮ファイルの中身を調べる', 'look inside compressed files'], - ['-s|--special-files', 'ブロック・キャラクタデバイスの中身も調べる', 'read block and character special files too'], - ['-k|--keep-going', '最初の一致で止めずにすべての一致を表示', 'do not stop at the first match'], - ], - chmod: [ - ['-c|--changes', '変更したものだけ表示', 'report only changes'], - ['-f|--silent|--quiet', 'エラーを表示しない', 'suppress most error messages'], - ['-v|--verbose', '処理したすべてのファイルを表示', 'report every file processed'], - ['--reference', '同じ権限にするファイル', 'copy the mode of the given file', 'arg'], - ['--preserve-root', '`/` を再帰的に変更しない', 'refuse recursive changes on `/`'], - ], - chown: [ - ['-c|--changes', '変更したものだけ表示', 'report only changes'], - ['-f|--silent|--quiet', 'エラーを表示しない', 'suppress most error messages'], - ['-v|--verbose', '処理したすべてのファイルを表示', 'report every file processed'], - ['-h|--no-dereference', 'シンボリックリンク自体を対象にする', 'affect the link itself'], - ['-H', 'コマンドラインのシンボリックリンクだけたどる', 'follow links given on the command line'], - ['-L', 'シンボリックリンクをすべてたどる', 'follow all symbolic links'], - ['-P', 'シンボリックリンクをたどらない(既定)', 'follow no symbolic links (default)'], - ['--from', '現在の所有者が一致するものだけ変更する', 'change only if the current owner matches', 'arg'], - ['--reference', '同じ所有者にするファイル', 'copy the owner of the given file', 'arg'], - ], - grep: [ - ['-z|--null-data', '行の区切りを改行でなく NUL にする', 'lines end with NUL, not newline'], - ['-a|--text', 'バイナリファイルもテキストとして扱う', 'treat binary files as text'], - ['-I', 'バイナリファイルを無視する', 'ignore binary files'], - ['-b|--byte-offset', '各行のバイト位置も表示', 'print the byte offset of each line'], - ['-T|--initial-tab', '行頭の見出しをタブでそろえる', 'align the prefix with a tab'], - ['-Z|--null', 'ファイル名の後ろに NUL を出力', 'output a NUL after file names'], - ['--line-buffered', '行ごとに出力をフラッシュする', 'flush output on every line'], - ['-U|--binary', 'ファイルをバイナリとして読む', 'read files as binary'], - ['-d|--directories', 'ディレクトリの扱い(`read`、`skip`、`recurse`)', 'how to treat directories (`read`, `skip`, `recurse`)', 'arg'], - ['-D|--devices', 'デバイスの扱い(`read`、`skip`)', 'how to treat devices (`read`, `skip`)', 'arg'], - ['-y', '`-i` と同じ(古い)', 'same as `-i` (old)'], - ['--no-ignore-case', '`-i` の指定をなかったことにする', 'cancel `-i`'], - ['--label', '標準入力のファイル名として表示する名前', 'name to show for stdin', 'arg'], - ], - sed: [ - ['-u|--unbuffered', '入力と出力のバッファリングを最小にする', 'minimal input and output buffering'], - ['-l|--line-length', '`l` コマンドの折り返し幅', 'line-wrap length for the `l` command', 'arg'], - ['--posix', 'GNU 拡張を無効にする', 'disable GNU extensions'], - ['-b', 'バイナリモードで読み書きする(Linux では効果なし)', 'binary mode (no effect on Linux)'], - ['--follow-symlinks', '`-i` でシンボリックリンクの先を編集する', 'follow symlinks when editing in place'], - ['--debug', '解釈した内容と実行の様子を表示する', 'annotate the program and show how it runs'], - ['--sandbox', 'ファイルの読み書きとコマンド実行を禁止する', 'reject commands that read, write or run programs'], - ], - gzip: [ - ['-f|--force', '強制的に圧縮・展開する', 'force'], - ['-l|--list', '圧縮ファイルの情報(圧縮率)を表示', 'list compressed file information'], - ['-r|--recursive', 'ディレクトリの中も再帰的に', 'recurse into directories'], - ['-t|--test', '圧縮ファイルの整合性を確認する', 'test the integrity'], - ['-v|--verbose', '圧縮率を表示する', 'show the compression ratio'], - ['-q|--quiet', '警告を出さない', 'quiet'], - ['-n|--no-name', '元のファイル名と日時を保存しない', 'do not save the original name and time'], - ['-N|--name', '元のファイル名と日時を保存・復元する', 'save and restore the original name and time'], - ['-S|--suffix', '圧縮ファイルの接尾辞', 'suffix to use', 'arg'], - ['-1|--fast', '最速(圧縮率は低い)', 'fastest, least compression'], - ['-9|--best', '最も強く圧縮(遅い)', 'best compression, slowest'], - ], - gunzip: [ - ['-l|--list', '圧縮ファイルの情報(圧縮率)を表示', 'list compressed file information'], - ['-r|--recursive', 'ディレクトリの中も再帰的に', 'recurse into directories'], - ['-t|--test', '圧縮ファイルの整合性を確認する', 'test the integrity'], - ['-v|--verbose', '詳しく表示する', 'verbose'], - ['-q|--quiet', '警告を出さない', 'quiet'], - ['-S|--suffix', '圧縮ファイルの接尾辞', 'suffix to use', 'arg'], - ], - df: [ - ['-a|--all', '容量 0 のファイルシステムも含める', 'include file systems with 0 blocks'], - ['-i|--inodes', 'inode の使用状況を表示', 'show inode usage'], - ['-k', '1KiB 単位で表示', 'use 1 KiB blocks'], - ['-T|--print-type', 'ファイルシステムの種類も表示', 'print the file system type'], - ['-t|--type', '指定した種類だけ表示', 'only the given file system type', 'arg'], - ['-x|--exclude-type', '指定した種類を除く', 'exclude the given file system type', 'arg'], - ['-H|--si', '1000 の累乗の単位で表示', 'use powers of 1000'], - ['-l|--local', 'ローカルのファイルシステムだけ', 'local file systems only'], - ['--total', '合計行を付ける', 'add a grand total'], - ['--output', '表示する列', 'columns to show', 'arg'], - ['-P|--portability', 'POSIX の書式で表示', 'use the POSIX output format'], - ['-B|--block-size', '表示する単位', 'block size to use', 'arg'], - ], - du: [ - ['-a|--all', 'ファイルも表示(ディレクトリだけでなく)', 'show files too, not just directories'], - ['-c|--total', '合計を最後に表示', 'print a grand total'], - ['-k', '1KiB 単位で表示', 'use 1 KiB blocks'], - ['-m', '1MiB 単位で表示', 'use 1 MiB blocks'], - ['-b|--bytes', 'バイト数で表示(`--apparent-size --block-size=1`)', 'print sizes in bytes (`--apparent-size --block-size=1`)'], - ['-x|--one-file-system', '他のファイルシステムに入らない', 'stay on one file system'], - ['-L|--dereference', 'シンボリックリンクの先をたどる', 'follow all symbolic links'], - ['-S|--separate-dirs', 'サブディレクトリの分を含めずに数える', 'do not include the sizes of subdirectories'], - ['--apparent-size', '実際に使っている領域でなく見かけのサイズ', 'show apparent sizes, not disk usage'], - ['--exclude', '除外するパターン', 'exclude names matching the pattern', 'arg'], - ['--time', '更新時刻も表示', 'show the last modification time'], - ['-0|--null', '各行を改行でなく NUL で終える', 'end each line with NUL'], - ['--si', '1000 の累乗の単位で表示', 'use powers of 1000'], - ['--inodes', '容量でなく inode 数を表示', 'list inode counts instead of sizes'], - ['-B|--block-size', '表示する単位', 'block size to use', 'arg'], - ], - free: [ - ['-k|--kibi', 'KiB 単位で表示', 'show KiB'], - ['-l|--lohi', 'メモリの高位・低位の内訳を表示', 'show detailed low and high memory'], - ['-c|--count', '指定した回数だけ表示', 'print the given number of times', 'arg'], - ['--si', '1000 の累乗の単位で表示', 'use powers of 1000'], - ], - top: [ - ['-c', 'コマンドライン全体を表示', 'show the full command line'], - ['-i', 'アイドル状態のプロセスを隠す', 'hide idle processes'], - ['-S', '終了した子プロセスの時間を累計に含める', 'cumulative time mode'], - ['-s', '安全モード(対話コマンドを制限)', 'secure mode'], - ['-w', '出力の幅', 'output width', 'arg'], - ['-E', 'メモリの表示単位(`k`、`m`、`g`…)', 'memory unit for the summary (`k`, `m`, `g`…)', 'arg'], - ['-U', '実ユーザーまたは実効ユーザーで絞る', 'show only the given user', 'arg'], - ], - killall: [ - ...signalOpts(), - ['-i|--interactive', '終了させる前に確認する', 'ask for confirmation before killing'], - ['-e|--exact', '名前が完全に一致するものだけ', 'require an exact match'], - ['-I|--ignore-case', '大文字と小文字を区別しない', 'case-insensitive match'], - ['-g|--process-group', 'プロセスグループ全体に送る', 'kill the process group'], - ['-r|--regexp', '名前を正規表現として扱う', 'interpret the name as a regular expression'], - ['-u|--user', '指定したユーザーのプロセスだけ', 'only processes of the given user', 'arg'], - ['-v|--verbose', '終了させたかどうか表示', 'report whether the signal was sent'], - ['-o|--older-than', '指定した時間より前から動いているものだけ', 'only processes older than the given time', 'arg'], - ['-y|--younger-than', '起動して指定した時間以内のものだけ', 'only processes younger than the given time', 'arg'], - ['-l|--list', 'シグナルの名前を一覧表示', 'list signal names'], - ], - pkill: [...signalOpts(), ...pgrepCommon()], - pgrep: pgrepCommon(), - uname: [['-i|--hardware-platform', 'ハードウェアのプラットフォーム', 'hardware platform']], - date: [ - ['-s|--set', '時刻を設定する(root)', 'set the time (root)', 'arg'], - ['-f|--file', 'ファイルの各行を日付として整形する', 'format each line of a file as a date', 'arg'], - ['--debug', '日付の解釈を表示する', 'annotate the parsed date'], - ['--rfc-3339', 'RFC 3339 形式で出力(`date`、`seconds`、`ns`)', 'output in RFC 3339 format (`date`, `seconds`, `ns`)', 'arg'], - ], - stat: [ - ['-t|--terse', '簡潔な形式で表示', 'terse output'], - ['--printf', '書式を指定して出力', 'custom format, with backslash escapes', 'arg'], - ], - readlink: [ - ['-e|--canonicalize-existing', 'すべての要素が存在する場合だけ正規化する', 'canonicalize; all components must exist'], - ['-m|--canonicalize-missing', '存在しなくても正規化する', 'canonicalize; no component needs to exist'], - ['-n|--no-newline', '末尾に改行を付けない', 'do not output a trailing newline'], - ['-z|--zero', '各項目を改行でなく NUL で終える', 'end output with NUL'], - ], - realpath: [ - ['-e|--canonicalize-existing', 'すべての要素が存在する場合だけ解決する', 'all components must exist'], - ['-m|--canonicalize-missing', '存在しなくても解決する', 'no component needs to exist'], - ['-s|--strip|--no-symlinks', 'シンボリックリンクを解決しない', 'do not expand symbolic links'], - ['-q|--quiet', 'エラーを表示しない', 'suppress error messages'], - ['--relative-to', '指定したディレクトリからの相対パスで出力', 'print relative to the given directory', 'arg'], - ['--relative-base', '指定したディレクトリ以下のときだけ相対パスで出力', 'print relative only below the given directory', 'arg'], - ['-z|--zero', '各項目を改行でなく NUL で終える', 'end output with NUL'], - ], - column: [ - ['-c|--output-width', '出力の幅', 'output width', 'arg'], - ['-o|--output-separator', '表の列の区切り文字', 'column separator for the table output', 'arg'], - ['-x|--fillrows', '縦でなく横に詰める', 'fill rows before columns'], - ['-N|--table-columns', '列の見出し', 'column names', 'arg'], - ['-J|--json', 'JSON で出力', 'output JSON'], - ], - which: [['-a|--all', '見つかったものをすべて表示', 'print all matches in PATH']], - basename: [['-a|--multiple', '複数の引数を処理する', 'support multiple arguments'], ['-s|--suffix', '取り除く接尾辞', 'remove the given suffix', 'arg'], ['-z|--zero', '各項目を改行でなく NUL で終える', 'end output with NUL']], - dirname: [['-z|--zero', '各項目を改行でなく NUL で終える', 'end output with NUL']], -}; diff --git a/src/dict/ops.ts b/src/dict/ops.ts index 89c0f111..096c4367 100644 --- a/src/dict/ops.ts +++ b/src/dict/ops.ts @@ -180,6 +180,33 @@ const gcloudCommon: OptSpec[] = [ // ---- System administration ------------------------------------------------------------------------ const iptables: OptSpec[] = [ + ['-P|--policy', 'チェインの既定の動作を決める(`ACCEPT` / `DROP`)', 'set the default policy of a chain (`ACCEPT` / `DROP`)'], + ['-N|--new-chain', 'チェインを新しく作る', 'create a user chain'], + ['-X|--delete-chain', 'ユーザー定義のチェインを削除する', 'delete a user chain'], + ['-Z|--zero', 'パケットとバイトのカウンタを 0 にする', 'zero the counters'], + ['-R|--replace', '番号を指定して規則を置き換える', 'replace a rule by number'], + ['-E|--rename-chain', 'チェインの名前を変える', 'rename a chain'], + ['--sport', '送信元ポート', 'source port', 'arg'], + ['-i|--in-interface', '受信するインターフェース', 'input interface', 'arg'], + ['-o|--out-interface', '送信するインターフェース', 'output interface', 'arg'], + ['-m|--match', '拡張マッチを使う(`state`、`conntrack`、`multiport`…)', 'use an extension match (`state`, `conntrack`, `multiport`…)', 'arg'], + ['--state', '接続の状態で絞る(`ESTABLISHED,RELATED`)', 'match the connection state (`ESTABLISHED,RELATED`)', 'arg'], + ['--ctstate', 'conntrack の状態で絞る', 'match the conntrack state', 'arg'], + ['--dports', '複数の宛先ポート(`multiport`)', 'several destination ports (`multiport`)', 'arg'], + ['--to-destination', 'DNAT の転送先', 'DNAT target address', 'arg'], + ['--to-source', 'SNAT の送信元', 'SNAT source address', 'arg'], + ['--to-ports', 'REDIRECT の転送先ポート', 'REDIRECT target ports', 'arg'], + ['--icmp-type', 'ICMP の種類', 'ICMP type', 'arg'], + ['--tcp-flags', 'TCP のフラグで絞る', 'match TCP flags', 'arg'], + ['--syn', 'TCP の接続開始(SYN)パケットだけ', 'match TCP connection-opening (SYN) packets'], + ['--reject-with', '拒否の応答の種類', 'type of reject reply', 'arg'], + ['--log-prefix', 'ログに付ける接頭辞', 'prefix for log messages', 'arg'], + ['--comment', '規則へのコメント', 'comment for the rule', 'arg'], + ['--line-numbers', '規則に番号を付けて表示', 'show rule numbers'], + ['-x|--exact', 'カウンタを正確な数値で表示', 'show exact counter values'], + ['-g|--goto', '別のチェインへ移る(戻らない)', 'jump to a chain without returning', 'arg'], + ['-f|--fragment', 'フラグメント化されたパケットだけ', 'match fragments'], + ['-c|--set-counters', 'カウンタの初期値', 'initialize the counters', 'arg'], ['-A|--append', '規則を指定したチェーンの末尾に足す', 'append a rule to the given chain', 'arg'], ['-I|--insert', '規則をチェーンの先頭に入れる', 'insert a rule at the top', 'arg'], ['-D|--delete', '規則を削除する', 'delete a rule', 'arg'], ['-L|--list', '規則を一覧表示する', 'list rules'], ['-S|--list-rules', '規則をコマンドの形で表示する', 'print rules as commands'], ['-F|--flush', '規則をすべて削除する', 'delete all rules'], ['-t|--table', '表(`filter`、`nat`、`mangle`)', 'table (`filter`, `nat`, `mangle`)', 'arg'], @@ -189,6 +216,18 @@ const iptables: OptSpec[] = [ ['-w|--wait', 'ロックが空くまで待つ', 'wait for the lock'], ]; +const signalOpts = (): OptSpec[] => [ + ['-HUP', 'SIGHUP を送る(設定の再読み込み)', 'send SIGHUP (reload configuration)'], + ['-INT', 'SIGINT を送る', 'send SIGINT'], + ['-TERM', 'SIGTERM を送る(既定)', 'send SIGTERM (default)'], + ['-KILL', 'SIGKILL を送る(強制終了)', 'send SIGKILL (force kill)'], + ['-USR1', 'SIGUSR1 を送る', 'send SIGUSR1'], + ['-USR2', 'SIGUSR2 を送る', 'send SIGUSR2'], + ['-STOP', 'SIGSTOP を送る(一時停止)', 'send SIGSTOP (pause)'], + ['-CONT', 'SIGCONT を送る(再開)', 'send SIGCONT (resume)'], + ['-15', 'シグナル 15 (TERM) を送る', 'send signal 15 (TERM)'], +]; + export const ops: Record = { kubectl, uv: cmd('Python のパッケージ・プロジェクト管理ツール(uv)', 'Python package and project manager (uv)', [], { @@ -337,16 +376,46 @@ export const ops: Record = { // ---- Users ---- usermod: cmd('ユーザーの設定を変える', 'Change a user', [ + ['-c|--comment', 'コメント(GECOS)', 'comment (GECOS)', 'arg'], + ['-e|--expiredate', 'アカウントの期限日', 'account expiry date', 'arg'], + ['-f|--inactive', 'パスワードの期限切れ後にアカウントを無効にするまでの日数', 'days after password expiry before the account is disabled', 'arg'], + ['-l|--login', '新しいログイン名', 'new login name', 'arg'], + ['-m|--move-home', '`-d` のとき、ホームの中身を新しい場所に移す', 'with `-d`, move the home contents to the new place'], + ['-o|--non-unique', '重複する UID を許す', 'allow a duplicate UID'], + ['-p|--password', '暗号化済みのパスワード', 'encrypted password', 'arg'], + ['-U|--unlock', 'アカウントのロックを解除する', 'unlock the account'], + ['-R|--root', '代わりのルートディレクトリ', 'apply changes in the given chroot directory', 'arg'], ['-aG', '既存のグループに加えて追加する(`-a` なしの `-G` は置き換え)', 'add to these groups, keeping the others (`-G` without `-a` replaces them)', 'arg'], ['-a|--append', '`-G` と使い、グループを置き換えずに追加する', 'with `-G`, add to groups instead of replacing them'], ['-G|--groups', '所属するグループ(`-a` なしでは置き換え)', 'groups (replaced unless `-a`)', 'arg'], ['-g|--gid', '主グループ', 'primary group', 'arg'], ['-s|--shell', 'ログインシェル', 'login shell', 'arg'], ['-d|--home', 'ホームディレクトリ', 'home directory', 'arg'], ['-u|--uid', 'ユーザー ID', 'user ID', 'arg'], ['-L|--lock', 'パスワードでのログインを止める', 'lock the password'], ], { positional: [user] }), - userdel: cmd('ユーザーを削除する', 'Delete a user', [['-r|--remove', 'ホームディレクトリとメールも削除する', 'remove the home directory and mail too'], ['-f|--force', '強制する', 'force']], { positional: [user] }), + userdel: cmd('ユーザーを削除する', 'Delete a user', [ + ['-R|--root', '代わりのルートディレクトリ', 'apply changes in the given chroot directory', 'arg'], + ['-r|--remove', 'ホームディレクトリとメールも削除する', 'remove the home directory and mail too'], + ['-f|--force', '強制する', 'force'], + ], { positional: [user] }), chsh: cmd('ログインシェルを変える', 'Change the login shell', [['-s|--shell', '新しいシェル', 'new shell', 'arg']], { positional: [user] }), // ---- SSH ---- 'ssh-keygen': cmd('SSH の鍵を作る・管理する', 'Create and manage SSH keys', [ + ['-p', 'パスフレーズを変更する', 'change the passphrase'], + ['-e', '鍵を別の形式で書き出す', 'export a key to another format'], + ['-i', '別の形式の鍵を読み込む', 'import a key from another format'], + ['-m', '鍵の形式(`PEM`、`RFC4716`)', 'key format (`PEM`, `RFC4716`)', 'arg'], + ['-a', '鍵導出の繰り返し回数', 'number of KDF rounds', 'arg'], + ['-B', 'バブルバブル形式のダイジェストを表示', 'show the bubblebabble digest'], + ['-c', 'コメントを変更する', 'change the comment'], + ['-F', '`known_hosts` からホストを探す', 'search known_hosts for a host', 'arg'], + ['-H', '`known_hosts` のホスト名をハッシュ化する', 'hash the host names in known_hosts'], + ['-s', 'CA の鍵で署名する', 'sign with a CA key', 'arg'], + ['-I', '証明書の識別名', 'certificate identity', 'arg'], + ['-n', '証明書の対象の名前(プリンシパル)', 'principal names for a certificate', 'arg'], + ['-V', '証明書の有効期間', 'certificate validity interval', 'arg'], + ['-E', 'フィンガープリントのハッシュ(`sha256`、`md5`)', 'fingerprint hash (`sha256`, `md5`)', 'arg'], + ['-P', '古いパスフレーズ', 'old passphrase', 'arg'], + ['-o', '新しい OpenSSH 形式で保存する', 'save in the new OpenSSH format'], + ['-r', 'ホストの DNS 用フィンガープリントレコードを出力する', 'print the DNS fingerprint record of a host', 'arg'], ['-t', '鍵の種類(`ed25519`、`rsa`…)', 'key type (`ed25519`, `rsa`…)', 'arg'], ['-b', '鍵の長さ(ビット)', 'key size in bits', 'arg'], ['-f', '鍵のファイル', 'key file', 'arg'], ['-N', '新しいパスフレーズ(`""` でなし)', 'new passphrase (`""`: none)', 'arg'], ['-C', 'コメント(メールアドレスなど)', 'comment (e-mail…)', 'arg'], ['-q', '表示しない', 'quiet'], ['-A', 'ホスト鍵をすべての種類で作る', 'generate all missing host keys'], ['-l', '鍵の指紋を表示する', "show a key's fingerprint"], ['-R', 'known_hosts から指定したホストを消す', 'remove the given host from known_hosts', 'arg'], ['-y', '秘密鍵から公開鍵を出力する', 'print the public key of a private key'], @@ -357,21 +426,122 @@ export const ops: Record = { dd: cmd('データをブロック単位でコピー・変換する(ディスクの書き込みに注意)', 'Copy and convert data in blocks (careful when writing to disks)', [], { positional: [pos('`if=入力` `of=出力` `bs=ブロックの大きさ` `count=ブロック数` `status=progress` などの指定', 'settings such as `if=input`, `of=output`, `bs=block size`, `count=blocks`, `status=progress`')], }), - lsblk: cmd('ブロックデバイス(ディスクとパーティション)を一覧表示する', 'List block devices (disks and partitions)', [['-f|--fs', 'ファイルシステムも表示', 'show file systems'], ['-o|--output', '表示する列', 'columns to show', 'arg'], ['-n|--noheadings', '見出しを出さない', 'no header'], ['-d|--nodeps', 'パーティションを出さない', 'no partitions'], ['-J|--json', 'JSON で出力', 'JSON output'], ['-p|--paths', '完全なパス', 'full paths']], { positional: [device] }), - blkid: cmd('ブロックデバイスの種類や UUID を表示する', 'Show the type and UUID of block devices', [['-s', '指定した項目だけ(`UUID`、`TYPE`)', 'only the given tag (`UUID`, `TYPE`)', 'arg'], ['-o', '出力形式(`value` で値だけ)', 'output format (`value`: values only)', 'arg']], { positional: [device] }), + lsblk: cmd('ブロックデバイス(ディスクとパーティション)を一覧表示する', 'List block devices (disks and partitions)', [ + ['-a|--all', '空のデバイスも表示', 'also show empty devices'], + ['-b|--bytes', 'サイズをバイトで表示', 'print sizes in bytes'], + ['-l|--list', '木でなく一覧で表示', 'list format instead of a tree'], + ['-m|--perms', '権限の情報を表示', 'show permissions information'], + ['-P|--pairs', '`キー="値"` の形式で出力', 'output `KEY="value"` pairs'], + ['-r|--raw', '整形しない出力', 'raw output'], + ['-S|--scsi', 'SCSI デバイスだけ', 'SCSI devices only'], + ['-t|--topology', 'トポロジーの情報を表示', 'show topology information'], + ['-s|--inverse', '依存関係を逆向きに表示', 'inverse dependencies'], + ['-e|--exclude', '除外するメジャー番号', 'exclude these major numbers', 'arg'], + ['-i|--ascii', 'ASCII 文字で木を描く', 'use ASCII characters for the tree'], + ['-x|--sort', '並べ替える列', 'sort by the given column', 'arg'], + ['-D|--discard', 'TRIM の情報を表示', 'print discard capabilities'], + ['-f|--fs', 'ファイルシステムも表示', 'show file systems'], + ['-o|--output', '表示する列', 'columns to show', 'arg'], + ['-n|--noheadings', '見出しを出さない', 'no header'], + ['-d|--nodeps', 'パーティションを出さない', 'no partitions'], + ['-J|--json', 'JSON で出力', 'JSON output'], + ['-p|--paths', '完全なパス', 'full paths'], + ], { positional: [device] }), + blkid: cmd('ブロックデバイスの種類や UUID を表示する', 'Show the type and UUID of block devices', [ + ['-L', '指定したラベルのデバイスを探す', 'find the device with the given label', 'arg'], + ['-U', '指定した UUID のデバイスを探す', 'find the device with the given UUID', 'arg'], + ['-t', '指定した `名前=値` に一致するデバイスを探す', 'find devices matching `NAME=value`', 'arg'], + ['-p', 'キャッシュを使わず低レベルで調べる', 'low-level probing, bypassing the cache'], + ['-c', 'キャッシュファイル(`/dev/null` で使わない)', 'cache file (`/dev/null`: none)', 'arg'], + ['-g', 'キャッシュを整理する', 'garbage-collect the cache'], + ['-i', 'I/O の制限情報を表示', 'show I/O limits'], + ['-l', '条件に合う最初のデバイスだけ', 'look up only the first device matching'], + ['-s', '指定した項目だけ(`UUID`、`TYPE`)', 'only the given tag (`UUID`, `TYPE`)', 'arg'], + ['-o', '出力形式(`value` で値だけ)', 'output format (`value`: values only)', 'arg'], + ], { positional: [device] }), findmnt: cmd('マウントされているファイルシステムを表示する', 'Show mounted file systems', [['-t|--types', '種類で絞る', 'filter by type', 'arg'], ['-o|--output', '表示する列', 'columns to show', 'arg'], ['-n|--noheadings', '見出しを出さない', 'no header'], ['-l|--list', '木でなく一覧で', 'list instead of a tree'], ['-u|--notruncate', '切り詰めない', 'do not truncate']], { positional: [pos('マウント先またはデバイス', 'mount point or device')] }), - umount: cmd('ファイルシステムのマウントを外す', 'Unmount file systems', [['-l|--lazy', '使われなくなってから外す', 'detach now, clean up when no longer busy'], ['-f|--force', '強制する', 'force'], ['-a|--all', 'すべて', 'all']], { positional: [pos('マウント先またはデバイス', 'mount point or device')] }), + umount: cmd('ファイルシステムのマウントを外す', 'Unmount file systems', [ + ['-r|--read-only', 'アンマウントできないときは読み取り専用で再マウントする', 'remount read-only if unmounting fails'], + ['-R|--recursive', '下位のマウントも順にアンマウントする', 'unmount recursively'], + ['-v|--verbose', '詳しく表示する', 'verbose'], + ['-n|--no-mtab', '`/etc/mtab` に書かない', 'do not write `/etc/mtab`'], + ['-t|--types', '指定した種類のファイルシステムだけ', 'only the given file system type', 'arg'], + ['-d|--detach-loop', 'ループデバイスも解放する', 'free the loop device too'], + ['-l|--lazy', '使われなくなってから外す', 'detach now, clean up when no longer busy'], + ['-f|--force', '強制する', 'force'], + ['-a|--all', 'すべて', 'all'], + ], { positional: [pos('マウント先またはデバイス', 'mount point or device')] }), sync: cmd('書き込み待ちのデータをディスクに書き出す', 'Write cached data to disk', [ ['-d|--data', 'ファイルのデータだけ同期する(不要なメタデータは除く)', 'sync only file data, no unneeded metadata'], ['-f|--file-system', 'ファイルがあるファイルシステム全体を同期する', 'sync the file systems that contain the files'], ...GNU_INFO, ], { parser: 'getopt_long', positional: [pos('同期するファイル(省略時はすべて)', 'file to sync (default: everything)')] }), - modprobe: cmd('カーネルモジュールを読み込む・外す', 'Load or remove kernel modules', [['-r|--remove', '外す', 'remove'], ['-n|--dry-run', '実際には行わない', 'do not actually do it'], ['-v|--verbose', '詳しく表示', 'verbose']], { positional: [pos('モジュール名', 'module name')] }), - dmesg: cmd('カーネルのメッセージを表示する', 'Show kernel messages', [['-T|--ctime', '人が読める時刻で', 'human-readable timestamps'], ['-w|--follow', '新しいメッセージを待ち続ける', 'wait for new messages'], ['-l|--level', '指定した重要度だけ', 'only these levels', 'arg']]), + modprobe: cmd('カーネルモジュールを読み込む・外す', 'Load or remove kernel modules', [ + ['-a|--all', '複数のモジュールをすべて読み込む', 'load all listed modules'], + ['-c|--showconfig', '設定を表示する', 'show the configuration'], + ['-f|--force', 'バージョンの検査を無視して強制的に読み込む(注意)', 'force loading ignoring version checks (careful)'], + ['-i|--ignore-install', '`install` の設定を無視する', 'ignore `install` commands in the configuration'], + ['-q|--quiet', '見つからなくても何も表示しない', 'do not complain about missing modules'], + ['-D|--show-depends', '依存するモジュールを表示(読み込まない)', 'show dependencies without loading'], + ['-C|--config', '設定ファイル', 'configuration file', 'arg'], + ['-b|--use-blacklist', 'ブラックリストを名前にも適用する', 'apply the blacklist to names too'], + ['-S|--set-version', 'カーネルのバージョン', 'kernel version', 'arg'], + ['-s|--syslog', 'エラーを syslog に送る', 'send errors to syslog'], + ['-r|--remove', '外す', 'remove'], + ['-n|--dry-run', '実際には行わない', 'do not actually do it'], + ['-v|--verbose', '詳しく表示', 'verbose'], + ], { positional: [pos('モジュール名', 'module name')] }), + dmesg: cmd('カーネルのメッセージを表示する', 'Show kernel messages', [ + ['-c|--read-clear', '表示してからバッファを消去する', 'clear the ring buffer after printing'], + ['-C|--clear', 'バッファを消去する', 'clear the ring buffer'], + ['-H|--human', '読みやすい形式で表示', 'human-readable output'], + ['-k|--kernel', 'カーネルのメッセージだけ', 'kernel messages only'], + ['-x|--decode', 'ファシリティとレベルを文字で表示', 'decode facility and level to text'], + ['-f|--facility', 'ファシリティで絞る', 'restrict to these facilities', 'arg'], + ['-t|--notime', '時刻を表示しない', 'do not print timestamps'], + ['--time-format', '時刻の書式(`ctime`、`iso`、`reltime`)', 'time format (`ctime`, `iso`, `reltime`)', 'arg'], + ['-r|--raw', '生のメッセージを出力', 'print the raw message buffer'], + ['-n|--console-level', 'コンソールに出すレベルを設定', 'set the console log level', 'arg'], + ['-L|--color', '色を付ける', 'colorize the output'], + ['-P|--nopager', 'ページャーを使わない', 'do not pipe to a pager'], + ['-d|--show-delta', 'メッセージ間の時間差を表示', 'show the time delta between messages'], + ['-u|--userspace', 'ユーザー空間のメッセージだけ', 'userspace messages only'], + ['-T|--ctime', '人が読める時刻で', 'human-readable timestamps'], + ['-w|--follow', '新しいメッセージを待ち続ける', 'wait for new messages'], + ['-l|--level', '指定した重要度だけ', 'only these levels', 'arg'], + ]), uptime: cmd('起動からの時間と負荷を表示する', 'Show how long the system has been up, and the load', [['-p|--pretty', '読みやすい形で', 'pretty format'], ['-s|--since', '起動した日時', 'boot time']]), service: cmd('サービスを操作する(SysV init。systemd では `systemctl` に渡される)', 'Control services (SysV init; with systemd it calls `systemctl`)', [['--status-all', 'すべてのサービスの状態', 'status of all services']], { positional: [pos('サービス名', 'service name'), pos('操作(`start`、`stop`、`restart`、`status`)', 'action (`start`, `stop`, `restart`, `status`)')] }), - killall: cmd('名前でプロセスにシグナルを送る(既定は終了)', 'Send a signal to processes by name (terminate by default)', [['-s|--signal', '送るシグナル', 'signal to send', 'arg'], ['-q|--quiet', '見つからなくても何も言わない', 'say nothing if none were found'], ['-w|--wait', '終わるまで待つ', 'wait for them to end']], { positional: [pos('プロセス名', 'process name')] }), - logger: cmd('システムのログ(syslog / journal)に書く', 'Write to the system log (syslog/journal)', [['-t|--tag', 'タグ', 'tag', 'arg'], ['-p|--priority', '重要度(`user.err`…)', 'priority (`user.err`…)', 'arg'], ['-s|--stderr', '標準エラーにも出す', 'also write to stderr']], { positional: [pos('メッセージ', 'message')] }), + killall: cmd('名前でプロセスにシグナルを送る(既定は終了)', 'Send a signal to processes by name (terminate by default)', [ + ...signalOpts(), + ['-i|--interactive', '終了させる前に確認する', 'ask for confirmation before killing'], + ['-e|--exact', '名前が完全に一致するものだけ', 'require an exact match'], + ['-I|--ignore-case', '大文字と小文字を区別しない', 'case-insensitive match'], + ['-g|--process-group', 'プロセスグループ全体に送る', 'kill the process group'], + ['-r|--regexp', '名前を正規表現として扱う', 'interpret the name as a regular expression'], + ['-u|--user', '指定したユーザーのプロセスだけ', 'only processes of the given user', 'arg'], + ['-v|--verbose', '終了させたかどうか表示', 'report whether the signal was sent'], + ['-o|--older-than', '指定した時間より前から動いているものだけ', 'only processes older than the given time', 'arg'], + ['-y|--younger-than', '起動して指定した時間以内のものだけ', 'only processes younger than the given time', 'arg'], + ['-l|--list', 'シグナルの名前を一覧表示', 'list signal names'], + ['-s|--signal', '送るシグナル', 'signal to send', 'arg'], + ['-q|--quiet', '見つからなくても何も言わない', 'say nothing if none were found'], + ['-w|--wait', '終わるまで待つ', 'wait for them to end'], + ], { positional: [pos('プロセス名', 'process name')] }), + logger: cmd('システムのログ(syslog / journal)に書く', 'Write to the system log (syslog/journal)', [ + ['-f|--file', '指定したファイルの内容を記録する', 'log the contents of the given file', 'arg'], + ['-i|--id', 'プロセス ID も記録する', 'log the process ID'], + ['-u|--socket', '書き込む UNIX ソケット', 'write to the given UNIX socket', 'arg'], + ['-n|--server', 'ログの送信先サーバー', 'remote syslog server', 'arg'], + ['-P|--port', '送信先のポート', 'remote port', 'arg'], + ['-T|--tcp', 'TCP で送る', 'use TCP'], + ['-d|--udp', 'UDP で送る', 'use UDP'], + ['--journald', 'ジャーナルに直接送る', 'send to the journal directly'], + ['--rfc5424', 'RFC 5424 の形式で送る', 'use the RFC 5424 format'], + ['-t|--tag', 'タグ', 'tag', 'arg'], + ['-p|--priority', '重要度(`user.err`…)', 'priority (`user.err`…)', 'arg'], + ['-s|--stderr', '標準エラーにも出す', 'also write to stderr'], + ], { positional: [pos('メッセージ', 'message')] }), getenforce: cmd('SELinux のモード(Enforcing / Permissive / Disabled)を表示する', 'Show the SELinux mode (Enforcing, Permissive or Disabled)'), iptables: cmd('Linux のパケットフィルタ(ファイアウォール)の規則を操作する', 'Manage Linux packet filter (firewall) rules', iptables), ip6tables: cmd('IPv6 のパケットフィルタの規則を操作する', 'Manage IPv6 packet filter rules', iptables), diff --git a/src/dict/system.ts b/src/dict/system.ts index dd354b2e..0a822cc0 100644 --- a/src/dict/system.ts +++ b/src/dict/system.ts @@ -27,7 +27,33 @@ const aptCommon: OptSpec[] = [ ['--fix-missing|-m', '取得できないパッケージがあっても続ける', 'go on when some packages cannot be downloaded'], ]; -const aptSubs = (extra: Record = {}): Record => ({ +// Subcommands that take one unit or package name. +const unit = pos('ユニット名(`nginx.service`…)', 'unit name (`nginx.service`…)'); +const plainPkg = pos('パッケージ名', 'package name'); +const unitSub = (ja: string, en: string): CommandSpec => cmd(ja, en, [], { positional: [unit] }); +const pkgSub = (ja: string, en: string): CommandSpec => cmd(ja, en, [], { positional: [plainPkg] }); + +const dnfLike = (): Record => ({ + info: pkgSub('パッケージの詳細を表示する', 'Show package details'), + search: pkgSub('名前や説明からパッケージを検索する', 'Search packages by name or description'), + list: cmd('パッケージを一覧表示する(`installed`、`available`、`updates`)', 'List packages (`installed`, `available`, `updates`)'), + provides: cmd('指定のファイルを提供するパッケージを探す', 'Find the package that provides a file'), + whatprovides: cmd('指定のファイルを提供するパッケージを探す', 'Find the package that provides a file'), + groupinstall: cmd('パッケージグループを入れる', 'Install a package group'), + group: cmd('パッケージグループを扱う(`list`、`install`、`info`)', 'Handle package groups (`list`, `install`, `info`)'), + history: cmd('操作の履歴を表示する(`undo`、`rollback` も)', 'Show the transaction history (also `undo`, `rollback`)'), + repolist: cmd('有効なリポジトリを一覧表示する', 'List the enabled repositories'), + 'check-update': cmd('更新できるパッケージを確認する', 'Check for available updates'), + reinstall: pkgSub('パッケージを入れ直す', 'Reinstall packages'), + downgrade: pkgSub('パッケージの版を下げる', 'Downgrade packages'), + autoremove: cmd('不要になった依存パッケージを削除する', 'Remove unneeded dependencies'), + erase: pkgSub('パッケージを削除する', 'Remove packages'), + 'distro-sync': cmd('リポジトリの版にそろえる', 'Sync installed packages to the repository versions'), +}); + + +const aptSubs = (extra: Record = {}, before: Record = {}): Record => ({ + ...before, update: cmd('リポジトリからパッケージの一覧を取り直す(install の前に必要)', 'Refresh the package lists from the repositories (needed before install)', aptCommon), upgrade: cmd('入っているパッケージを新しい版に更新する', 'Upgrade installed packages', aptCommon), 'dist-upgrade': cmd('依存関係の変化も含めてすべて更新する(パッケージの追加・削除もあり)', 'Upgrade everything, adding or removing packages as dependencies change', aptCommon), @@ -62,7 +88,8 @@ const rpmCommon: OptSpec[] = [ ['--allowerasing', '依存の衝突を解くためにパッケージの削除も許す', 'allow removing packages to resolve conflicts'], ]; -const rpmSubs = (): Record => ({ +const rpmSubs = (extra: Record = {}): Record => ({ + ...extra, install: cmd('パッケージをインストールする', 'Install packages', rpmCommon, { positional: [pkg] }), remove: cmd('パッケージを削除する', 'Remove packages', rpmCommon, { positional: [pkg] }), update: cmd('パッケージを更新する', 'Update packages', rpmCommon), @@ -218,13 +245,26 @@ const IP_OBJECTS: Record = { }; export const system: Record = { - 'apt-get': cmd('Debian / Ubuntu のパッケージ管理(APT)', 'Debian/Ubuntu package manager (APT)', aptCommon, { subcommands: aptSubs() }), + 'apt-get': cmd('Debian / Ubuntu のパッケージ管理(APT)', 'Debian/Ubuntu package manager (APT)', aptCommon, { + subcommands: aptSubs({}, { + 'build-dep': pkgSub('ソースからビルドするのに必要なパッケージを入れる', 'Install the packages needed to build a source package'), + source: pkgSub('ソースパッケージを取得する', 'Fetch a source package'), + check: cmd('壊れた依存関係がないか確かめる', 'Check for broken dependencies'), + changelog: pkgSub('パッケージの変更履歴を表示する', 'Show the package changelog'), + }), + }), apt: cmd('Debian / Ubuntu のパッケージ管理(対話向けの APT。スクリプトでは `apt-get` が推奨)', 'Debian/Ubuntu package manager (interactive APT; scripts should use `apt-get`)', aptCommon, { subcommands: aptSubs({ 'full-upgrade': cmd('依存関係の変化も含めてすべて更新する', 'Upgrade everything, adding or removing packages as needed', aptCommon), list: cmd('パッケージを一覧表示する(`--installed`、`--upgradable`)', 'List packages (`--installed`, `--upgradable`)', [['--installed', '入っているものだけ', 'installed ones only'], ['--upgradable', '更新があるものだけ', 'upgradable ones only']]), search: cmd('パッケージを検索する', 'Search for packages', [], { positional: [pos('検索語', 'search term')] }), show: cmd('パッケージの情報を表示する', 'Show package information', [], { positional: [pkg] }), + }, { + 'edit-sources': cmd('パッケージの取得元の設定を編集する', 'Edit the package sources list'), + depends: pkgSub('依存しているパッケージを表示する', 'Show the dependencies'), + rdepends: pkgSub('これに依存しているパッケージを表示する', 'Show reverse dependencies'), + policy: pkgSub('入れられる版と優先度を表示する', 'Show available versions and priorities'), + reinstall: pkgSub('パッケージを入れ直す', 'Reinstall packages'), }), }), 'apt-mark': cmd('APT のパッケージに印を付ける(自動・手動・固定)', 'Mark APT packages (automatic, manual, held)', [], { @@ -291,8 +331,24 @@ export const system: Record = { search: cmd('パッケージを検索する', 'Search for packages', [], { positional: [pos('検索語', 'search term')] }), }, }), - dnf: cmd('Fedora / RHEL のパッケージ管理', 'Fedora/RHEL package manager', rpmCommon, { subcommands: rpmSubs() }), - yum: cmd('RHEL / CentOS のパッケージ管理(古い版。新しくは dnf)', 'RHEL/CentOS package manager (older; dnf replaces it)', rpmCommon, { subcommands: rpmSubs() }), + dnf: cmd('Fedora / RHEL のパッケージ管理', 'Fedora/RHEL package manager', rpmCommon, { + subcommands: rpmSubs({ + ...dnfLike(), + repoquery: pkgSub('リポジトリのパッケージ情報を問い合わせる', 'Query repository package information'), + module: cmd('モジュール(ストリーム)を扱う(`list`、`enable`、`install`)', 'Handle modules and streams (`list`, `enable`, `install`)'), + 'config-manager': cmd('リポジトリの設定を表示・変更する', 'Show or change repository settings'), + download: pkgSub('RPM をダウンロードだけする', 'Download RPMs without installing'), + mark: cmd('パッケージに印を付ける(`install`、`remove`)', 'Mark packages (`install`, `remove`)'), + swap: cmd('あるパッケージを別のものに置き換える', 'Swap one package for another'), + }), + }), + yum: cmd('RHEL / CentOS のパッケージ管理(古い版。新しくは dnf)', 'RHEL/CentOS package manager (older; dnf replaces it)', rpmCommon, { + subcommands: rpmSubs({ + ...dnfLike(), + localinstall: pkgSub('ローカルの RPM ファイルを入れる', 'Install a local RPM file'), + deplist: pkgSub('依存関係を一覧表示する', 'List dependencies'), + }), + }), microdnf: cmd('最小構成のコンテナ向けの dnf', 'Minimal dnf for containers', rpmCommon, { subcommands: rpmSubs() }), brew: cmd('Homebrew(macOS / Linux のパッケージ管理)', 'Homebrew (package manager for macOS and Linux)', [ ['--prefix', 'Homebrew(またはパッケージ)の置き場所を表示する', 'print where Homebrew (or a package) lives'], @@ -448,6 +504,8 @@ export const system: Record = { // ---- Users and groups ---- id: cmd('ユーザーの ID とグループを表示する', "Print a user's IDs and groups", [ + ['-Z|--context', 'SELinux のセキュリティコンテキストを表示', 'print the SELinux security context'], + ['-z|--zero', '各項目を改行でなく NUL で区切る', 'delimit entries with NUL'], ['-u|--user', 'ユーザー ID だけ(`0` なら root)', 'only the user ID (`0` is root)'], ['-g|--group', '主グループの ID だけ', 'only the primary group ID'], ['-G|--groups', '所属するグループの ID すべて', 'all group IDs'], ['-n|--name', '数値でなく名前で表示(`-un` でユーザー名)', 'names instead of numbers (`-un`: user name)'], ['-r|--real', '実 ID を表示する', 'real IDs instead of effective'], @@ -458,6 +516,16 @@ export const system: Record = { positional: [pos('データベース(`passwd`、`group`、`hosts`…)', 'database (`passwd`, `group`, `hosts`…)'), pos('探すキー(名前や ID)', 'key to look up (name or ID)')], }), useradd: cmd('ユーザーを作る', 'Create a user', [ + ['-e|--expiredate', 'アカウントの期限日(`YYYY-MM-DD`)', 'account expiry date (`YYYY-MM-DD`)', 'arg'], + ['-f|--inactive', 'パスワードの期限切れ後にアカウントを無効にするまでの日数', 'days after password expiry before the account is disabled', 'arg'], + ['-k|--skel', 'ホームの雛形のディレクトリ', 'skeleton directory for the home', 'arg'], + ['-o|--non-unique', '重複する UID を許す', 'allow a duplicate UID'], + ['-p|--password', '暗号化済みのパスワード', 'encrypted password', 'arg'], + ['-N|--no-user-group', 'ユーザー名と同じグループを作らない', 'do not create a group with the user name'], + ['-b|--base-dir', 'ホームを作る親ディレクトリ', 'base directory for the home', 'arg'], + ['-D|--defaults', '既定値を表示・変更する', 'show or change the defaults'], + ['-R|--root', '代わりのルートディレクトリ', 'apply changes in the given chroot directory', 'arg'], + ['-Z|--selinux-user', 'SELinux のユーザー', 'SELinux user', 'arg'], ['-m|--create-home', 'ホームディレクトリを作る', 'create the home directory'], ['-M|--no-create-home', 'ホームディレクトリを作らない', 'do not create a home directory'], ['-r|--system', 'システムユーザー(サービス用)として作る', 'create a system account (for services)'], ['-u|--uid', 'ユーザー ID', 'user ID', 'arg'], ['-g|--gid', '主グループ', 'primary group', 'arg'], ['-G|--groups', '追加で所属するグループ(カンマ区切り)', 'extra groups (comma-separated)', 'arg'], @@ -466,6 +534,9 @@ export const system: Record = { ['-l|--no-log-init', 'lastlog などに記録しない(大きな UID で Docker イメージが膨らむのを防ぐ)', 'do not add to lastlog (avoids huge Docker images with large UIDs)'], ], { positional: [user] }), groupadd: cmd('グループを作る', 'Create a group', [ + ['-o|--non-unique', '重複する GID を許す', 'allow a duplicate GID'], + ['-p|--password', '暗号化済みのパスワード', 'encrypted password', 'arg'], + ['-R|--root', '代わりのルートディレクトリ', 'apply changes in the given chroot directory', 'arg'], ['-r|--system', 'システムグループとして作る', 'create a system group'], ['-g|--gid', 'グループ ID', 'group ID', 'arg'], ['-f|--force', 'すでにあっても成功にする', 'succeed if it already exists'], ], { positional: [group] }), adduser: cmd('ユーザーを作る(Debian の対話的な版、または BusyBox / Alpine 版)', "Create a user (Debian's friendlier tool, or BusyBox/Alpine's)", [ @@ -494,6 +565,7 @@ export const system: Record = { // ---- System information and services ---- uname: cmd('OS とマシンの情報を表示する', 'Print system information', [ + ['-i|--hardware-platform', 'ハードウェアのプラットフォーム', 'hardware platform'], ['-a|--all', 'すべての情報', 'all information'], ['-s|--kernel-name', 'カーネル名(`Linux`、`Darwin`…。スクリプトで OS 判定に使う)', 'kernel name (`Linux`, `Darwin`…; used to tell the OS)'], ['-m|--machine', 'マシンのアーキテクチャ(`x86_64`、`arm64`、`aarch64`…)', 'machine architecture (`x86_64`, `arm64`, `aarch64`…)'], ['-r|--kernel-release', 'カーネルのリリース', 'kernel release'], ['-n|--nodename', 'ホスト名', 'host name'], ['-o|--operating-system', 'OS 名', 'operating system'], ['-p|--processor', 'プロセッサの種類', 'processor type'], ['-v|--kernel-version', 'カーネルの版', 'kernel version'], @@ -501,6 +573,11 @@ export const system: Record = { ], { parser: 'getopt_long' }), arch: cmd('マシンのアーキテクチャを表示する(`uname -m` と同じ)', 'Print the machine architecture (same as `uname -m`)', [...GNU_INFO], { parser: 'getopt_long' }), hostname: cmd('ホスト名を表示・設定する', 'Show or set the host name', [ + ['-d|--domain', 'DNS ドメイン名を表示', 'show the DNS domain name'], + ['-A|--all-fqdns', 'すべての FQDN を表示', 'show all FQDNs'], + ['-b|--boot', 'ホスト名が未設定なら `localhost` を設定する', 'set a default host name if none is set'], + ['-F|--file', 'ファイルからホスト名を設定する', 'set the host name from a file', 'arg'], + ['-a|--alias', '別名を表示', 'show the alias names'], ['-f|--fqdn|--long', '完全修飾ドメイン名', 'fully qualified domain name'], ['-s|--short', 'ドメインを除いた名前', 'short name'], ['-I|--all-ip-addresses', 'すべての IP アドレス(Linux)', 'all IP addresses (Linux)'], ['-i|--ip-address', 'ホスト名の IP アドレス', "the host name's IP address"], ]), @@ -519,14 +596,82 @@ export const system: Record = { ['-productName', '製品名(`macOS`)', 'product name (`macOS`)'], ['-productVersion', '版(`14.5`…)', 'version (`14.5`…)'], ['-buildVersion', 'ビルド番号', 'build number'], ], { parser: 'single-dash' }), sysctl: cmd('カーネルのパラメータを表示・変更する', 'Show or change kernel parameters', [ + ['-e|--ignore', '知らないキーのエラーを無視する', 'ignore unknown keys'], + ['-N|--names', '名前だけ表示', 'print names only'], + ['-q|--quiet', '設定した値を表示しない', 'do not echo the values set'], + ['--system', 'すべての設定ファイルを読み込む', 'load all system configuration files'], + ['-r|--pattern', '指定した正規表現に合うものだけ', 'only names matching the given regular expression', 'arg'], + ['-b|--binary', '値を改行なしで出力', 'print values without a newline'], + ['--load', 'ファイルから読み込む(`-p` と同じ)', 'load from a file (same as `-p`)', 'arg'], ['-n', '名前を付けず値だけ', 'values only, no names'], ['-w', '値を書き込む(`名前=値`)', 'write a value (`name=value`)'], ['-a', 'すべて表示する', 'show all'], ['-p', '設定ファイル(既定は `/etc/sysctl.conf`)から読み込む', 'load from a file (default `/etc/sysctl.conf`)'], ], { positional: [pos('パラメータ名(`hw.memsize`、`net.ipv4.ip_forward`…)', 'parameter name (`hw.memsize`, `net.ipv4.ip_forward`…)')] }), systemctl: cmd('systemd のサービスを操作する', 'Control systemd services', persistent([ + ['-a|--all', 'すべてのユニットを表示(停止中のものも)', 'show all units, including inactive ones'], + ['-t|--type', 'ユニットの種類で絞る(`service`、`timer`、`socket`…)', 'filter by unit type (`service`, `timer`, `socket`…)', 'arg'], + ['--state', '状態で絞る(`failed`、`running`…)', 'filter by state (`failed`, `running`…)', 'arg'], + ['-l|--full', '長い行を省略しない', 'do not ellipsize output'], + ['-H|--host', '操作するホスト(SSH 経由)', 'operate on a remote host over SSH', 'arg'], + ['--system', 'システムのサービスマネージャーを使う', 'use the system service manager'], + ['--no-reload', '`enable` や `disable` の後に設定を再読み込みしない', 'do not reload after enable or disable'], + ['-f|--force', '強制する(`enable` では既存のリンクを置き換える)', 'force (with `enable`, replace existing links)'], + ['--no-ask-password', 'パスワードを尋ねない', 'do not ask for passwords'], + ['--no-legend', '見出しと脚注を表示しない', 'do not print the legend'], + ['-p|--property', '表示するプロパティ(`show` で)', 'property to show (with `show`)', 'arg'], + ['--failed', '失敗したユニットだけ', 'show only failed units'], + ['--runtime', '再起動すると消える一時的な変更にする', 'make a temporary change that is lost at reboot'], + ['--global', 'すべてのユーザーに対して有効・無効にする', 'enable or disable for all users'], + ['--root', '代わりのルートディレクトリ', 'use the given root directory', 'arg'], + ['-n|--lines', '`status` で表示するログの行数', 'number of journal lines shown by `status`', 'arg'], + ['-o|--output', '`status` のログの形式', 'journal output format for `status`', 'arg'], + ['-r|--recursive', 'ホストとローカルコンテナーのユニットを表示する(`list-units` など)', 'show units of the host and local containers (`list-units`…)'], + ['--reverse', '`list-dependencies` で逆向きに表示', 'show reverse dependencies'], + ['--before', '`list-dependencies` で先に起動するもの', 'show units ordered before'], + ['--after', '`list-dependencies` で後に起動するもの', 'show units ordered after'], + ['--signal', '`kill` で送るシグナル', 'signal to send with `kill`', 'arg'], + ['-M|--machine', '操作するコンテナ', 'operate on a container', 'arg'], + ['--wait', '`start` したユニットが終わるまで待つ', 'wait until started units finish'], ['--user', '自分のユーザーのサービスを操作する', "control the user's own services"], ['-q|--quiet', '表示を減らす(`is-active` を条件判定に使うとき)', 'less output (when `is-active` is used as a test)'], ['--now', '`enable` と同時に起動(`disable` なら停止)', 'also start with `enable` (stop with `disable`)'], ['--no-pager', 'ページャを使わない', 'do not use a pager'], ]), { subcommands: { + 'is-failed': unitSub('ユニットが失敗状態かどうか確かめる', 'Check whether the unit failed'), + 'list-units': cmd('読み込まれているユニットを一覧表示する', 'List the loaded units'), + 'list-unit-files': cmd('インストールされているユニットファイルと有効・無効の状態を一覧表示する', 'List installed unit files and whether they are enabled'), + 'list-timers': cmd('タイマーと次回の実行時刻を一覧表示する', 'List timers and when they fire next'), + 'list-sockets': cmd('ソケットユニットを一覧表示する', 'List socket units'), + 'list-dependencies': unitSub('ユニットの依存関係を木で表示する', 'Show the dependency tree of a unit'), + 'list-jobs': cmd('実行待ちのジョブを一覧表示する', 'List jobs in progress'), + show: unitSub('ユニットのプロパティを表示する', 'Show the properties of a unit'), + cat: unitSub('ユニットファイルの内容を表示する', 'Show the unit file contents'), + edit: unitSub('ユニットの設定を上書きする(ドロップインを編集)', 'Edit a drop-in override of a unit'), + 'reset-failed': unitSub('失敗の状態を解除する', 'Reset the failed state'), + isolate: unitSub('指定したユニットだけを残して他を止める(ランレベルの切り替え)', 'Start the unit and stop the rest (like switching run levels)'), + 'set-default': unitSub('既定のターゲット(ランレベル)を設定する', 'Set the default target (run level)'), + 'get-default': cmd('既定のターゲット(ランレベル)を表示する', 'Show the default target (run level)'), + poweroff: cmd('システムを停止して電源を切る', 'Shut down and power off the system'), + reboot: cmd('システムを再起動する', 'Reboot the system'), + halt: cmd('システムを停止する', 'Halt the system'), + suspend: cmd('メモリに退避してサスペンドする', 'Suspend the system to RAM'), + hibernate: cmd('ディスクに退避して休止状態にする', 'Hibernate the system to disk'), + rescue: cmd('レスキューモード(シングルユーザー)に入る', 'Enter rescue (single-user) mode'), + emergency: cmd('緊急モードに入る', 'Enter emergency mode'), + kill: unitSub('ユニットのプロセスにシグナルを送る', 'Send a signal to the processes of a unit'), + 'try-restart': unitSub('動いているときだけ再起動する', 'Restart only if it is running'), + 'reload-or-restart': unitSub('再読み込みできれば再読み込み、できなければ再起動する', 'Reload if possible, otherwise restart'), + 'try-reload-or-restart': unitSub('動いているときだけ再読み込みか再起動をする', 'Reload or restart only if it is running'), + reenable: unitSub('いったん無効にしてから有効にし直す', 'Disable and enable the unit again'), + preset: unitSub('プリセットの設定に従って有効・無効にする', 'Enable or disable per the preset files'), + link: cmd('ユニットファイルをリンクで追加する', 'Link a unit file into the search path'), + revert: unitSub('上書きした設定を元に戻す', 'Revert the unit to its vendor version'), + 'daemon-reexec': cmd('systemd 自体を再実行する', 'Re-execute the systemd manager'), + 'is-system-running': cmd('システム全体の状態を表示する', 'Show the overall state of the system'), + cancel: cmd('実行待ちのジョブをキャンセルする', 'Cancel a queued job'), + 'set-property': unitSub('ユニットのプロパティを実行中に変更する', 'Change a property of a running unit'), + 'show-environment': cmd('サービスマネージャーの環境変数を表示する', 'Show the environment of the service manager'), + 'add-wants': unitSub('ターゲットに `Wants=` の依存を追加する', 'Add a `Wants=` dependency to a target'), + freeze: unitSub('ユニットのプロセスを凍結する', 'Freeze the processes of a unit'), + thaw: unitSub('凍結を解除する', 'Thaw a frozen unit'), start: cmd('サービスを起動する', 'Start a service', [], { positional: [pos('サービス名', 'service name')] }), stop: cmd('サービスを停止する', 'Stop a service', [], { positional: [pos('サービス名', 'service name')] }), restart: cmd('サービスを再起動する', 'Restart a service', [], { positional: [pos('サービス名', 'service name')] }), @@ -542,14 +687,36 @@ export const system: Record = { }, }), mount: cmd('ファイルシステムをマウントする', 'Mount a file system', [ + ['-v|--verbose', '詳しく表示する', 'verbose'], + ['-w|--rw|--read-write', '読み書きできるようにマウントする', 'mount read-write'], + ['-n|--no-mtab', '`/etc/mtab` に書かない', 'do not write `/etc/mtab`'], + ['-f|--fake', '実際にはマウントしない', 'dry run; do not call mount(2)'], + ['-L|--label', 'ラベルでデバイスを指定する', 'mount the device with the given label', 'arg'], + ['-U|--uuid', 'UUID でデバイスを指定する', 'mount the device with the given UUID', 'arg'], + ['--move', 'マウント位置を移す', 'move a mounted tree to another place'], + ['--rbind', '下位のマウントも含めてバインドする', 'bind including submounts'], + ['-B', 'ディレクトリを別の場所にバインドする', 'bind a directory elsewhere'], + ['-R', '下位のマウントも含めてバインドする', 'bind including submounts'], + ['--make-private', 'マウントのイベントを共有しない', 'mark as private'], + ['--make-shared', 'マウントのイベントを共有する', 'mark as shared'], + ['--make-slave', 'マウントのイベントを受け取るだけにする', 'mark as slave'], + ['-l|--show-labels', '一覧にラベルも表示', 'show labels in the list'], + ['-s', '調整できないオプションを無視する', 'ignore unsupported options'], + ['-T|--fstab', '読む fstab のファイル', 'alternative fstab file', 'arg'], + ['-i|--internal-only', '`mount.` ヘルパーを呼ばない', 'do not call the mount helpers'], ['-t|--types', 'ファイルシステムの種類', 'file system type', 'arg'], ['-o|--options', 'マウントオプション(`ro`、`bind`…)', 'mount options (`ro`, `bind`…)', 'arg'], ['--bind', 'ディレクトリを別の場所にも見せる', 'make a directory visible elsewhere'], ['--make-rshared', '配下のマウントを共有にする(コンテナ向け)', 'make mounts below shared (for containers)'], ['-a|--all', '`/etc/fstab` のすべてをマウントする', 'mount everything in `/etc/fstab`'], ['-r|--read-only', '読み取り専用', 'read-only'], ], { positional: [pos('デバイス', 'device'), pos('マウント先のディレクトリ', 'directory to mount on')], operands: [byCount(1, [pos('デバイスまたはマウント先(もう一方は `/etc/fstab` から探す)', 'device or mount point (the other is looked up in `/etc/fstab`)')], { unless: '-a|--all' })] }), mountpoint: cmd('ディレクトリがマウントポイントかを調べる', 'Check whether a directory is a mount point', [ + ['-d|--fs-devno', 'ファイルシステムのデバイス番号を表示', 'show the device number of the file system'], + ['-x|--devno', 'ブロックデバイスの番号を表示', 'show the device number of a block device'], ['-q|--quiet', '何も表示せず終了ステータスで返す', 'print nothing; report via the exit status'], ], { positional: [pos('ディレクトリ', 'directory')] }), ldd: cmd('プログラムが使う共有ライブラリを表示する', 'Print the shared libraries a program uses', [ + ['-d|--data-relocs', 'データの再配置を行って未定義のシンボルを報告する', 'perform data relocations and report missing objects'], + ['-r|--function-relocs', '関数の再配置を行って未定義のシンボルを報告する', 'perform function relocations and report missing objects'], + ['-u|--unused', '使われていない直接の依存を表示', 'print unused direct dependencies'], ['--version', '版を表示する(glibc の版がわかる)', 'print the version (tells the glibc version)'], ['-v|--verbose', '詳しく表示する', 'more detail'], ], { positional: [pos('プログラム', 'program')] }), 'locale-gen': cmd('ロケールのデータを作る', 'Generate locale data', [], { positional: [pos('ロケール(`en_US.UTF-8`…)', 'locale (`en_US.UTF-8`…)')] }), @@ -586,12 +753,55 @@ export const system: Record = { ['-br|-brief', '簡潔な表形式', 'brief table'], ], { parser: 'iproute2', subcommandPrefixes: 'first', subcommands: IP_OBJECTS }), ss: cmd('ソケット(通信の接続や待ち受け)を表示する', 'Show sockets (connections and listeners)', [ + ['-s|--summary', '接続数の要約を表示', 'show a summary of socket counts'], + ['-x|--unix', 'UNIX ドメインソケットだけ', 'UNIX domain sockets only'], + ['-e|--extended', '詳しい情報も表示', 'show detailed socket information'], + ['-o|--options', 'タイマーの情報も表示', 'show timer information'], + ['-i|--info', 'TCP の内部情報を表示', 'show internal TCP information'], + ['-m|--memory', 'ソケットのメモリ使用量を表示', 'show socket memory usage'], + ['-4|--ipv4', 'IPv4 だけ', 'IPv4 only'], + ['-6|--ipv6', 'IPv6 だけ', 'IPv6 only'], + ['-w|--raw', 'RAW ソケットだけ', 'raw sockets only'], + ['-H|--no-header', '見出しを表示しない', 'do not print the header'], + ['-r|--resolve', 'アドレスとポートを名前で表示', 'resolve addresses and ports to names'], + ['-Z|--context', 'SELinux のコンテキストも表示', 'show SELinux context'], + ['-K|--kill', '該当するソケットを強制的に閉じる(注意)', 'forcibly close the sockets (careful)'], + ['-f|--family', 'アドレスファミリで絞る', 'select the address family', 'arg'], + ['-O|--oneline', '1つの接続を1行で表示', 'print each socket on one line'], ['-t|--tcp', 'TCP', 'TCP'], ['-u|--udp', 'UDP', 'UDP'], ['-l|--listening', '待ち受け中のものだけ', 'listening sockets only'], ['-n|--numeric', '名前に変換せず数字で表示', 'numeric addresses and ports'], ['-p|--processes', '使っているプロセスも表示', 'show the processes using them'], ['-a|--all', 'すべて', 'all sockets'], ]), // ---- Signatures, checksums and binary data ---- gpg: cmd('GnuPG: 署名の検証・暗号化・鍵の管理', 'GnuPG: verify signatures, encrypt, manage keys', [ + ['--gen-key|--generate-key', '鍵ペアを作る', 'generate a key pair'], + ['--full-generate-key', '鍵ペアを詳しい設定で作る', 'generate a key pair with all options'], + ['-K|--list-secret-keys', '秘密鍵を一覧表示', 'list secret keys'], + ['--list-sigs|--list-signatures', '署名も含めて鍵を一覧表示', 'list keys with signatures'], + ['--check-sigs', '署名を検証しながら一覧表示', 'list keys and verify signatures'], + ['--delete-keys', '公開鍵を削除', 'delete public keys'], + ['--delete-secret-keys', '秘密鍵を削除', 'delete secret keys'], + ['--delete-secret-and-public-key', '秘密鍵と公開鍵を削除', 'delete a secret and public key'], + ['--edit-key', '鍵を対話的に編集する', 'edit a key interactively'], + ['--send-keys', '公開鍵を鍵サーバーに送る', 'send public keys to a key server'], + ['--search-keys', '鍵サーバーで鍵を探す', 'search a key server'], + ['--refresh-keys', '鍵サーバーから鍵を更新する', 'refresh keys from a key server'], + ['--export-secret-keys', '秘密鍵を書き出す(注意)', 'export secret keys (careful)'], + ['--clearsign', '平文のまま署名を付ける', 'make a clear text signature'], + ['-c|--symmetric', '共通鍵(パスフレーズ)で暗号化する', 'encrypt with a passphrase (symmetric)'], + ['--gen-revoke', '失効証明書を作る', 'generate a revocation certificate'], + ['--passphrase', 'パスフレーズ(履歴に残る。注意)', 'passphrase (kept in history; careful)', 'arg'], + ['--passphrase-fd', 'パスフレーズを読むファイルディスクリプタ', 'file descriptor to read the passphrase from', 'arg'], + ['--pinentry-mode', 'パスフレーズの入力方法(`loopback`)', 'how to ask for passphrases (`loopback`)', 'arg'], + ['-u|--local-user', '署名に使う鍵', 'key to sign with', 'arg'], + ['--default-key', '既定で署名に使う鍵', 'default key to sign with', 'arg'], + ['--keyid-format', '鍵 ID の表示形式', 'key ID format', 'arg'], + ['--with-colons', '機械が読みやすい出力にする', 'machine-readable output'], + ['--list-packets', 'OpenPGP のパケットを表示', 'list the packets of a message'], + ['--print-md', 'ダイジェストを出力する', 'print message digests', 'arg'], + ['--enarmor', 'バイナリを ASCII アーマーにする', 'convert binary to ASCII armor'], + ['--trust-model', '信頼モデル(`always`…)', 'trust model (`always`…)', 'arg'], + ['--lock-never', 'ロックを使わない', 'do not use locks'], ['--batch', '対話せずに動く(スクリプト向け)', 'never ask (for scripts)'], ['--no-tty', '端末を使わない', 'do not use the terminal'], ['--yes', '確認に「はい」と答える', 'answer yes to questions'], ['--keyserver', '鍵を取得する鍵サーバー', 'key server to fetch keys from', 'arg'], ['--recv-keys|--receive-keys', '鍵サーバーから、続く ID の鍵を取得する', 'fetch the keys with the IDs that follow from the key server'], ['--verify', '署名を検証する(`gpg --verify 署名 ファイル`)', 'verify a signature (`gpg --verify sig file`)'], ['--dearmor', 'テキスト形式(ASCII armor)の鍵をバイナリに変換する(APT の鍵の定番)', 'convert an ASCII-armored key to binary (the usual step for APT keys)'], @@ -608,6 +818,19 @@ export const system: Record = { ]), openssl: cmd('OpenSSL: 暗号・証明書のツール', 'OpenSSL: cryptography and certificate tool', [], { subcommands: { + enc: cmd('共通鍵で暗号化・復号する', 'Encrypt or decrypt with a symmetric cipher', [['-aes-256-cbc', 'AES-256 (CBC) を使う', 'use AES-256 (CBC)'], ['-d', '復号する', 'decrypt'], ['-a|-base64', 'Base64 で入出力する', 'use Base64'], ['-salt', 'ソルトを使う', 'use a salt'], ['-pbkdf2', '鍵導出に PBKDF2 を使う', 'use PBKDF2 for key derivation'], ['-in', '入力ファイル', 'input file', 'arg'], ['-out', '出力ファイル', 'output file', 'arg'], ['-k', 'パスワード', 'password', 'arg']], { parser: 'openssl' }), + verify: cmd('証明書を検証する', 'Verify certificates', [['-CAfile', '信頼する CA 証明書のファイル', 'trusted CA certificates file', 'arg'], ['-untrusted', '中間証明書のファイル', 'intermediate certificates file', 'arg']], { parser: 'openssl' }), + pkcs12: cmd('PKCS#12 ファイルを作る・読む', 'Create or read PKCS#12 files', [['-export', '作る', 'create a PKCS#12 file'], ['-in', '入力ファイル', 'input file', 'arg'], ['-out', '出力ファイル', 'output file', 'arg'], ['-inkey', '秘密鍵', 'private key file', 'arg'], ['-nodes', '秘密鍵を暗号化しない', 'do not encrypt private keys'], ['-nokeys', '鍵を出力しない', 'do not output private keys'], ['-clcerts', 'クライアント証明書だけ', 'client certificates only']], { parser: 'openssl' }), + ca: cmd('簡易の認証局(CA)として証明書を発行する', 'Act as a simple certificate authority', [['-config', '設定ファイル', 'configuration file', 'arg'], ['-in', '署名要求(CSR)', 'certificate signing request', 'arg'], ['-out', '出力ファイル', 'output file', 'arg'], ['-days', '有効日数', 'validity in days', 'arg'], ['-batch', '質問しない', 'no prompts']], { parser: 'openssl' }), + genpkey: cmd('秘密鍵を作る(汎用)', 'Generate a private key (generic)', [['-algorithm', '鍵のアルゴリズム(`RSA`、`EC`)', 'key algorithm (`RSA`, `EC`)', 'arg'], ['-out', '出力ファイル', 'output file', 'arg'], ['-pkeyopt', '鍵のオプション(`rsa_keygen_bits:4096`)', 'key option (`rsa_keygen_bits:4096`)', 'arg']], { parser: 'openssl' }), + rsa: cmd('RSA 鍵を処理・変換する', 'Process and convert RSA keys', [['-in', '入力ファイル', 'input file', 'arg'], ['-out', '出力ファイル', 'output file', 'arg'], ['-pubout', '公開鍵を出力する', 'output the public key'], ['-text', '内容を文字で表示', 'print in text form'], ['-noout', '鍵そのものは出力しない', 'do not output the key']], { parser: 'openssl' }), + ecparam: cmd('楕円曲線のパラメータや鍵を作る', 'Generate elliptic curve parameters or keys', [['-name', '曲線の名前(`prime256v1`)', 'curve name (`prime256v1`)', 'arg'], ['-genkey', '鍵を作る', 'generate a key'], ['-out', '出力ファイル', 'output file', 'arg']], { parser: 'openssl' }), + passwd: cmd('パスワードのハッシュを作る', 'Compute password hashes', [['-6', 'SHA-512 (crypt) を使う', 'use SHA-512 crypt'], ['-5', 'SHA-256 (crypt) を使う', 'use SHA-256 crypt'], ['-1', 'MD5 (crypt) を使う', 'use MD5 crypt'], ['-apr1', 'Apache の MD5 形式を使う', 'use the Apache MD5 format'], ['-salt', 'ソルト', 'salt', 'arg'], ['-stdin', '標準入力から読む', 'read from stdin']], { parser: 'openssl' }), + s_server: cmd('テスト用の TLS サーバーを動かす', 'Run a test TLS server', [['-accept', '待ち受けるポート', 'port to listen on', 'arg'], ['-cert', '証明書', 'certificate file', 'arg'], ['-key', '秘密鍵', 'private key file', 'arg'], ['-www', '状態のページを返す', 'serve a status page']], { parser: 'openssl' }), + crl: cmd('証明書失効リスト(CRL)を処理する', 'Process certificate revocation lists (CRLs)', [['-in', '入力ファイル', 'input file', 'arg'], ['-text', '内容を文字で表示', 'print in text form'], ['-noout', 'CRL そのものは出力しない', 'do not output the CRL']], { parser: 'openssl' }), + ciphers: cmd('使える暗号スイートを一覧表示する', 'List the available cipher suites', [['-v', '詳しく表示する', 'verbose']], { parser: 'openssl' }), + list: cmd('使えるアルゴリズムなどを一覧表示する', 'List algorithms and commands'), + pkey: cmd('公開鍵・秘密鍵を処理・変換する', 'Process and convert public and private keys', [['-in', '入力ファイル', 'input file', 'arg'], ['-pubout', '公開鍵を出力する', 'output the public key'], ['-text', '内容を文字で表示', 'print in text form'], ['-noout', '鍵そのものは出力しない', 'do not output the key']], { parser: 'openssl' }), rand: cmd('ランダムなバイト列を作る(パスワードや鍵の生成)', 'Generate random bytes (passwords, keys)', [ ['-base64', 'Base64 で出力', 'Base64 output'], ['-hex', '16進数で出力', 'hex output'], ['-out', '出力するファイル', 'output file', 'arg'], ], { positional: [pos('バイト数', 'number of bytes')], parser: 'openssl' }), @@ -652,6 +875,12 @@ export const system: Record = { ['-c|-cols', '1行のバイト数', 'bytes per line', 'arg'], ['-l|-len', '指定したバイト数だけ', 'stop after the given number of bytes', 'arg'], ['-s|-seek', '指定した位置から', 'start at the given offset', 'arg'], ['-i|-include', 'C の配列として出力', 'output as a C array'], ], { positional: [files], parser: 'single-dash' }), od: cmd('ファイルを8進数・16進数などでダンプする', 'Dump files in octal, hex and other formats', [ + ['-b', '8 進数のバイトで表示', 'octal bytes'], + ['-d', '10 進数の 2 バイト単位で表示', 'unsigned decimal 2-byte units'], + ['-o', '8 進数の 2 バイト単位で表示', 'octal 2-byte units'], + ['-a', '名前付きの文字で表示', 'named characters'], + ['-f', '単精度の浮動小数点数で表示', 'floating point'], + ['-i', '10 進数の整数で表示', 'decimal integers'], ['-A|--address-radix', '位置の表示形式(`n` で表示しない、`x` 16進…)', 'offset format (`n`: none, `x`: hex…)', 'arg'], ['-t|--format', '出力形式(`x1`: 1バイトずつ16進、`c`: 文字…)', 'output format (`x1`: hex bytes, `c`: characters…)', 'arg'], ['-v|--output-duplicates', '同じ行の繰り返しを省略しない', 'do not collapse repeated lines'], ['-c', '文字で表示(`-t c` と同じ)', 'characters (same as `-t c`)'], diff --git a/test/dictionary.test.ts b/test/dictionary.test.ts index f882e676..52f1b208 100644 --- a/test/dictionary.test.ts +++ b/test/dictionary.test.ts @@ -1,4 +1,5 @@ import * as assert from 'assert'; +import * as fs from 'fs'; import * as path from 'path'; import type { BashParser as Parser } from '../src/syntax/tree'; import { Analyzer, Token } from '../src/analyzer'; @@ -13,9 +14,6 @@ import { netadmin } from '../src/dict/netadmin'; import { monitor } from '../src/dict/monitor'; import { macos } from '../src/dict/macos'; import { ops } from '../src/dict/ops'; -import { extraFiles } from '../src/dict/extrasFiles'; -import { extraAdmin } from '../src/dict/extrasAdmin'; -import { extraSubcommands } from '../src/dict/extras'; import { cmd } from '../src/dict/types'; import type { CommandSpec, OptionSpec, ValueSpec } from '../src/argv/spec'; import { interpret } from '../src/argv/interpret'; @@ -316,7 +314,7 @@ describe('the dictionary', () => { }); }); - it('defines each command in one base table only, and extras only for commands that exist', () => { + it('defines each command in one base table only', () => { const tables = { core, distro, system, basic, storage, admin, netadmin, monitor, macos, ops }; const where = new Map(); for (const [table, entries] of Object.entries(tables)) { @@ -324,8 +322,14 @@ describe('the dictionary', () => { } const twice = [...where].filter(([, t]) => t.length > 1).map(([n, t]) => `${n} (${t.join(', ')})`); assert.deepStrictEqual(twice, [], 'commands defined in more than one table'); - const orphans = [...Object.keys(extraFiles), ...Object.keys(extraAdmin), ...Object.keys(extraSubcommands)].filter((n) => !where.has(n) && !Object.hasOwn(builtins, n)); - assert.deepStrictEqual(orphans, [], 'extras for commands with no base entry'); + }); + + it('keeps each command\'s options and subcommands in the file that defines it (no file patches other entries)', () => { + const dir = path.join(root, 'src', 'dict'); + assert.deepStrictEqual(fs.readdirSync(dir).filter((f) => /^extras/.test(f)), [], 'extras files that merge options into other entries'); + for (const f of fs.readdirSync(dir)) { + assert.ok(!/applyExtras|extras(Files|Admin)/.test(fs.readFileSync(path.join(dir, f), 'utf8')), `${f} refers to a file that patches entries`); + } }); it('does not point at the value of an option with "この" or "this" (it reads as the current one)', () => {