diff --git a/packages/angular/cli/models/parser.ts b/packages/angular/cli/models/parser.ts index 99d31f93c3dd..60344f416d57 100644 --- a/packages/angular/cli/models/parser.ts +++ b/packages/angular/cli/models/parser.ts @@ -281,6 +281,12 @@ export function parseArguments(args: string[], options: Option[] | null): Argume // Argument is of form -abcdef. Starts at 1 because we skip the `-`. for (let i = 1; i < arg.length; i++) { const flag = arg[i]; + // If the next character is an '=', treat it as a long flag. + if (arg[i + 1] == '=') { + const f = '--' + flag + arg.slice(i + 1); + _assignOption(f, args, options, parsedOptions, positionals, leftovers, ignored, errors); + break; + } // Treat the last flag as `--a` (as if full flag but just one letter). We do this in // the loop because it saves us a check to see if the arg is just `-`. if (i == arg.length - 1) { diff --git a/packages/angular/cli/models/parser_spec.ts b/packages/angular/cli/models/parser_spec.ts index 73513c235c44..972c5b6b25f4 100644 --- a/packages/angular/cli/models/parser_spec.ts +++ b/packages/angular/cli/models/parser_spec.ts @@ -80,7 +80,9 @@ describe('parseArguments', () => { '--noHelloBool': { helloBool: false }, '--noBool': { bool: false }, '-b': { bool: true }, + '-b=true': { bool: true }, '-sb': { bool: true, str: '' }, + '-s=b': { str: 'b' }, '-bs': { bool: true, str: '' }, '--t1=true': { t1: true }, '--t1': { t1: true },