diff --git a/docs/generated/cli/affected.md b/docs/generated/cli/affected.md index 09a84bb5884ed..0071512f33d59 100644 --- a/docs/generated/cli/affected.md +++ b/docs/generated/cli/affected.md @@ -107,8 +107,6 @@ Change the way Nx is calculating the affected command by providing directly chan Type: `string` -Default: `false` - Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. ### head diff --git a/docs/generated/cli/exec.md b/docs/generated/cli/exec.md index 2a5b82e2d2116..9c5b2825f940c 100644 --- a/docs/generated/cli/exec.md +++ b/docs/generated/cli/exec.md @@ -33,8 +33,6 @@ Exclude certain projects from being processed Type: `string` -Default: `false` - Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. ### nx-bail diff --git a/docs/generated/cli/run-many.md b/docs/generated/cli/run-many.md index 109c5bcc19c90..d525acdaddc6c 100644 --- a/docs/generated/cli/run-many.md +++ b/docs/generated/cli/run-many.md @@ -97,8 +97,6 @@ Exclude certain projects from being processed Type: `string` -Default: `false` - Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. ### help diff --git a/docs/generated/packages/nx/documents/affected.md b/docs/generated/packages/nx/documents/affected.md index 09a84bb5884ed..0071512f33d59 100644 --- a/docs/generated/packages/nx/documents/affected.md +++ b/docs/generated/packages/nx/documents/affected.md @@ -107,8 +107,6 @@ Change the way Nx is calculating the affected command by providing directly chan Type: `string` -Default: `false` - Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. ### head diff --git a/docs/generated/packages/nx/documents/exec.md b/docs/generated/packages/nx/documents/exec.md index 2a5b82e2d2116..9c5b2825f940c 100644 --- a/docs/generated/packages/nx/documents/exec.md +++ b/docs/generated/packages/nx/documents/exec.md @@ -33,8 +33,6 @@ Exclude certain projects from being processed Type: `string` -Default: `false` - Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. ### nx-bail diff --git a/docs/generated/packages/nx/documents/run-many.md b/docs/generated/packages/nx/documents/run-many.md index 109c5bcc19c90..d525acdaddc6c 100644 --- a/docs/generated/packages/nx/documents/run-many.md +++ b/docs/generated/packages/nx/documents/run-many.md @@ -97,8 +97,6 @@ Exclude certain projects from being processed Type: `string` -Default: `false` - Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. ### help diff --git a/packages/nx/src/command-line/yargs-utils/shared-options.ts b/packages/nx/src/command-line/yargs-utils/shared-options.ts index c78e4fa92e337..4a2a32443fd1a 100644 --- a/packages/nx/src/command-line/yargs-utils/shared-options.ts +++ b/packages/nx/src/command-line/yargs-utils/shared-options.ts @@ -32,9 +32,11 @@ export function withRunOptions(yargs: Argv) { type: 'string', describe: 'Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser.', - default: false, coerce: (value) => - value === 'true' || value === true + // when the type of an opt is "string", passing `--opt` comes through as having an empty string value. + // this coercion allows `--graph` to be passed through as a boolean directly, and also normalizes the + // `--graph=true` to produce the same behaviour as `--graph`. + value === '' || value === 'true' || value === true ? true : value === 'false' || value === false ? false