Skip to content

Commit

Permalink
docs(nxdev): make sure rendered command string includes param indicat…
Browse files Browse the repository at this point in the history
…ion (#9489)
  • Loading branch information
juristr committed Mar 24, 2022
1 parent 57df570 commit 09c356b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/generated/cli/list.md
Expand Up @@ -10,7 +10,7 @@ Lists installed plugins, capabilities of installed plugins and other available p
## Usage

```bash
nx list
nx list [plugin]
```

[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/cli/migrate.md
Expand Up @@ -16,7 +16,7 @@ Creates a migrations file or runs migrations from the migrations file.
## Usage

```bash
nx migrate
nx migrate [packageAndVersion]
```

[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/cli/workspace-generator.md
Expand Up @@ -10,7 +10,7 @@ Runs a workspace generator from the tools/generators directory
## Usage

```bash
nx workspace-generator
nx workspace-generator [name]
```

[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/cli/workspace-lint.md
Expand Up @@ -10,7 +10,7 @@ Lint nx specific workspace files (nx.json, workspace.json)
## Usage

```bash
nx workspace-lint
nx workspace-lint [files..]
```

[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.
10 changes: 8 additions & 2 deletions scripts/documentation/generate-cli-data.ts
Expand Up @@ -33,6 +33,7 @@ interface ParsedCommandOption {

interface ParsedCommand {
name: string;
commandString: string;
description: string;
options?: Array<ParsedCommandOption>;
}
Expand Down Expand Up @@ -80,7 +81,11 @@ export async function generateCLIDocumentation() {
command.builder.apply
)
) {
return { name, description: command.description };
return {
name,
commandString: command.original,
description: command.description,
};
}
// Show all the options we can get from yargs
const builder = await command.builder(
Expand All @@ -92,6 +97,7 @@ export async function generateCLIDocumentation() {
return {
name,
description: command.description,
commandString: command.original,
options:
Object.keys(builderDescriptions).map((key) => ({
name: key,
Expand All @@ -117,7 +123,7 @@ ${command.description}
## Usage
\`\`\`bash
nx ${command.name}
nx ${command.commandString}
\`\`\`
[Install \`nx\` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using \`nx\`, or use \`npx nx\`, \`yarn nx\`, or \`pnpx nx\`.\n`;
Expand Down

1 comment on commit 09c356b

@vercel
Copy link

@vercel vercel bot commented on 09c356b Mar 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.