From e20112b7406a3f9501aad6609cbb17878bc30a02 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 29 Sep 2026 12:42:52 +0000 Subject: [PATCH 1/6] fix(@angular-devkit/schematics-cli): correctly parse inline boolean values in CLI options When CLI options defined as boolean are provided with inline values like '--debug=false' or '--dry-run=false', 'node:util.parseArgs' in non-strict mode returns string values ('false' / 'true') rather than booleans. This caused false values to be treated as truthy. Normalize string boolean values in CLI options. Closes #34199 --- .../schematics_cli/bin/schematics.ts | 10 +++++++ .../schematics_cli/test/schematics_spec.ts | 27 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/packages/angular_devkit/schematics_cli/bin/schematics.ts b/packages/angular_devkit/schematics_cli/bin/schematics.ts index 8420e520dd39..43eec958e73f 100644 --- a/packages/angular_devkit/schematics_cli/bin/schematics.ts +++ b/packages/angular_devkit/schematics_cli/bin/schematics.ts @@ -568,6 +568,16 @@ function parseOptions(args: string[]): Options { } } + for (const [key, value] of Object.entries(values)) { + if (typeof value === 'string') { + if (value === 'true') { + values[key] = true; + } else if (value === 'false') { + values[key] = false; + } + } + } + return { _: positionals, schematicOptions, diff --git a/packages/angular_devkit/schematics_cli/test/schematics_spec.ts b/packages/angular_devkit/schematics_cli/test/schematics_spec.ts index e6d54b6ddb34..0eb8e87a014d 100644 --- a/packages/angular_devkit/schematics_cli/test/schematics_spec.ts +++ b/packages/angular_devkit/schematics_cli/test/schematics_spec.ts @@ -59,6 +59,33 @@ describe('schematics-cli binary', () => { expect(res).toEqual(0); }); + it('handles boolean CLI options with explicit inline false values', async () => { + const args = ['blank', 'foo', '--dry-run', '--debug=false']; + const res = await main({ args, stdout, stderr }); + const output = stripVTControlCharacters(stdout.read()?.toString() || ''); + expect(output).not.toMatch(/Debug mode enabled/); + expect(output).toMatch(/Dry run enabled\./); + expect(res).toEqual(0); + }); + + it('does not display help when --help=false is passed', async () => { + const args = ['blank', 'foo', '--dry-run', '--help=false']; + const res = await main({ args, stdout, stderr }); + const output = stripVTControlCharacters(stdout.read()?.toString() || ''); + expect(output).not.toMatch(/schematics \[collection-name:\]schematic-name/); + expect(output).toMatch(/Dry run enabled\./); + expect(res).toEqual(0); + }); + + it('does not list schematics when --list-schematics=false is passed', async () => { + const args = ['blank', 'foo', '--dry-run', '--list-schematics=false']; + const res = await main({ args, stdout, stderr }); + const output = stripVTControlCharacters(stdout.read()?.toString() || ''); + expect(output).not.toMatch(/blank/); + expect(output).toMatch(/Dry run enabled\./); + expect(res).toEqual(0); + }); + it('error when no name is provided', async () => { const args = ['blank']; const res = await main({ args, stdout, stderr }); From c724c1d4e36bcb4c2d0a98ca52517506675ee992 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 29 Sep 2026 12:44:34 +0000 Subject: [PATCH 2/6] fix(@angular-devkit/architect): correctly parse inline boolean values in CLI options When CLI options defined as boolean are provided with inline values like '--verbose=false', 'node:util.parseArgs' in non-strict mode returns string values ('false' / 'true') rather than booleans. Normalize string boolean values in CLI options. --- packages/angular_devkit/architect/bin/architect.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/angular_devkit/architect/bin/architect.ts b/packages/angular_devkit/architect/bin/architect.ts index c835fed8394c..98f79412ebb6 100644 --- a/packages/angular_devkit/architect/bin/architect.ts +++ b/packages/angular_devkit/architect/bin/architect.ts @@ -205,6 +205,16 @@ function parseOptions(args: string[]): Options { } } + for (const [key, value] of Object.entries(values)) { + if (typeof value === 'string') { + if (value === 'true') { + values[key] = true; + } else if (value === 'false') { + values[key] = false; + } + } + } + return { positionals, builderOptions, From 88f871fb820eb56aeb11612ea7225cff35912e67 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 29 Sep 2026 13:07:15 +0000 Subject: [PATCH 3/6] fixup! fix(@angular-devkit/schematics-cli): correctly parse inline boolean values in CLI options --- .../angular_devkit/schematics_cli/bin/schematics.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/angular_devkit/schematics_cli/bin/schematics.ts b/packages/angular_devkit/schematics_cli/bin/schematics.ts index 43eec958e73f..67caeda46a24 100644 --- a/packages/angular_devkit/schematics_cli/bin/schematics.ts +++ b/packages/angular_devkit/schematics_cli/bin/schematics.ts @@ -569,12 +569,10 @@ function parseOptions(args: string[]): Options { } for (const [key, value] of Object.entries(values)) { - if (typeof value === 'string') { - if (value === 'true') { - values[key] = true; - } else if (value === 'false') { - values[key] = false; - } + if (value === 'true') { + values[key] = true; + } else if (value === 'false') { + values[key] = false; } } From df69c8ef40a0505f128fb19bafbc0b40d4dfb740 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 29 Sep 2026 13:07:24 +0000 Subject: [PATCH 4/6] fixup! fix(@angular-devkit/architect): correctly parse inline boolean values in CLI options --- packages/angular_devkit/architect/bin/architect.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/angular_devkit/architect/bin/architect.ts b/packages/angular_devkit/architect/bin/architect.ts index 98f79412ebb6..0507f4af0c53 100644 --- a/packages/angular_devkit/architect/bin/architect.ts +++ b/packages/angular_devkit/architect/bin/architect.ts @@ -206,12 +206,10 @@ function parseOptions(args: string[]): Options { } for (const [key, value] of Object.entries(values)) { - if (typeof value === 'string') { - if (value === 'true') { - values[key] = true; - } else if (value === 'false') { - values[key] = false; - } + if (value === 'true') { + values[key] = true; + } else if (value === 'false') { + values[key] = false; } } From 60654a04b051bf35d4a478c8966f21807c54ac87 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 29 Sep 2026 15:04:32 +0000 Subject: [PATCH 5/6] fixup! fix(@angular-devkit/schematics-cli): correctly parse inline boolean values in CLI options --- packages/angular_devkit/schematics_cli/bin/schematics.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/angular_devkit/schematics_cli/bin/schematics.ts b/packages/angular_devkit/schematics_cli/bin/schematics.ts index 67caeda46a24..91a658d0ced8 100644 --- a/packages/angular_devkit/schematics_cli/bin/schematics.ts +++ b/packages/angular_devkit/schematics_cli/bin/schematics.ts @@ -568,7 +568,8 @@ function parseOptions(args: string[]): Options { } } - for (const [key, value] of Object.entries(values)) { + for (const key of Object.keys(CLI_OPTION_DEFINITIONS)) { + const value = values[key]; if (value === 'true') { values[key] = true; } else if (value === 'false') { From b62b4195607b77d03268a2745b3386303a365407 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 29 Sep 2026 15:04:41 +0000 Subject: [PATCH 6/6] fixup! fix(@angular-devkit/architect): correctly parse inline boolean values in CLI options --- packages/angular_devkit/architect/bin/architect.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/angular_devkit/architect/bin/architect.ts b/packages/angular_devkit/architect/bin/architect.ts index 0507f4af0c53..8c0770f6cab3 100644 --- a/packages/angular_devkit/architect/bin/architect.ts +++ b/packages/angular_devkit/architect/bin/architect.ts @@ -205,7 +205,8 @@ function parseOptions(args: string[]): Options { } } - for (const [key, value] of Object.entries(values)) { + for (const key of Object.keys(CLI_OPTION_DEFINITIONS)) { + const value = values[key]; if (value === 'true') { values[key] = true; } else if (value === 'false') {