Browse Source

Fix missing list-remote in command doc (#461)

remotes/origin/add-with-shims
BinHong Lee 4 years ago committed by GitHub
parent
commit
4eda8d3990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      .ci/print-command-docs.js
  2. 1
      .gitignore
  3. 8
      docs/commands.md

9
.ci/print-command-docs.js

@ -110,10 +110,11 @@ async function getCommandHelp(fnmPath, command) { @@ -110,10 +110,11 @@ async function getCommandHelp(fnmPath, command) {
const headerIndex = rows.findIndex((x) => x.includes("SUBCOMMANDS"));
/** @type {string[]} */
const subcommands = [];
for (const row of rows.slice(headerIndex + 1)) {
const matched = row.match(/^\s{4}(\w+)/);
if (!matched) break;
subcommands.push(matched[1]);
if (!command) {
for (const row of rows.slice(headerIndex + 1)) {
const words = row.split(/\s+/);
subcommands.push(words[1]);
}
}
return {
subcommands,

1
.gitignore vendored

@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
node_modules/
docs/screen_recording
/benchmarks/results
/target

8
docs/commands.md

@ -309,14 +309,14 @@ OPTIONS: @@ -309,14 +309,14 @@ OPTIONS:
```
# `fnm list`
# `fnm list-remote`
```
fnm-list 1.25.0
List all locally installed Node.js versions
fnm-list-remote 1.25.0
List all remote Node.js versions
USAGE:
fnm list [OPTIONS]
fnm list-remote [OPTIONS]
FLAGS:
-h, --help Prints help information

Loading…
Cancel
Save