Skip to content

Commit 66899e3

Browse files
authored
docs: sync README CLI help output with actual CLI (#984)
* docs: sync README CLI help output with actual CLI The help text in the README had drifted from the actual CLI: - add missing --log-level option to the main command help - add missing generate options: --config-file, --chunk-size, --index, --minify, --type-map, and the updated -t/--target description (including sitemap, web, and custom generator specifiers) - make --ignore a required variadic glob argument - drop stale hardcoded defaults for --threads, --version, --changelog, and --git-ref, which are now resolved via configuration * fix(core): accept a value for the --git-ref option --git-ref was defined without an argument, so commander treated it as a boolean flag: passing a ref errored with 'too many arguments', and the bare flag set ref to true, breaking the ref/repository URL templates which expect a string. Define it as --git-ref <ref> and re-sync the README help output.
1 parent f29d46b commit 66899e3

2 files changed

Lines changed: 26 additions & 13 deletions

File tree

README.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ Usage: @node-core/doc-kit [options] [command]
4949
CLI tool to generate the Node.js API documentation
5050
5151
Options:
52-
-h, --help display help for command
52+
--log-level <level> Log level (choices: "debug", "info", "warn", "error",
53+
"fatal", default: "info")
54+
-h, --help display help for command
5355
5456
Commands:
55-
generate [options] Generate API docs
56-
help [command] display help for command
57+
generate [options] Generate API docs
58+
help [command] display help for command
5759
```
5860

5961
### `generate`
@@ -70,15 +72,26 @@ Usage: @node-core/doc-kit generate [options]
7072
Generate API docs
7173
7274
Options:
73-
-i, --input <patterns...> Input file patterns (glob)
74-
--ignore [patterns...] Ignore patterns (comma-separated)
75-
-o, --output <dir> Output directory
76-
-p, --threads <number> (default: "12")
77-
-v, --version <semver> Target Node.js version (default: "v22.14.0")
78-
-c, --changelog <url> Changelog URL or path (default: "https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md")
79-
--git-ref <url> Git ref/commit URL (default: "https://github.com/nodejs/node/tree/HEAD")
80-
-t, --target [modes...] Target generator modes (choices: "json-simple", "legacy-html", "legacy-html-all", "man-page", "legacy-json", "legacy-json-all", "addon-verify", "api-links", "orama-db", "llms-txt")
81-
-h, --help display help for command
75+
--config-file <path> Config file
76+
-i, --input <patterns...> Input file patterns (glob)
77+
-t, --target <generator...> Target generator(s): a built-in name
78+
(json-simple, legacy-html, legacy-html-all,
79+
man-page, legacy-json, legacy-json-all,
80+
addon-verify, api-links, orama-db, llms-txt,
81+
sitemap, web) or an import specifier for a custom
82+
generator
83+
--ignore <patterns...> Ignore file patterns (glob)
84+
-o, --output <directory> The output directory
85+
-p, --threads <number> Number of threads to use (minimum: 1)
86+
--chunk-size <number> Number of items to process per worker thread
87+
(minimum: 1)
88+
-v, --version <semver> Target Node.js version
89+
-c, --changelog <url> Changelog URL or path
90+
--git-ref <ref> Git ref
91+
--index <url> index.md URL or path
92+
--minify Minify?
93+
--type-map <url> Type map URL or path
94+
-h, --help display help for command
8295
```
8396

8497
## Examples

packages/core/bin/commands/generate.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default new Command('generate')
6161
)
6262
.addOption(new Option('-v, --version <semver>', 'Target Node.js version'))
6363
.addOption(new Option('-c, --changelog <url>', 'Changelog URL or path'))
64-
.addOption(new Option('--git-ref', 'Git ref URL'))
64+
.addOption(new Option('--git-ref <ref>', 'Git ref'))
6565
.addOption(new Option('--index <url>', 'index.md URL or path'))
6666
.addOption(new Option('--minify', 'Minify?'))
6767
.addOption(new Option('--type-map <url>', 'Type map URL or path'))

0 commit comments

Comments
 (0)