From 1921499ccf6a61e50e9f14a47fe71c33d25cc782 Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Thu, 29 Dec 2016 17:53:34 -0800 Subject: [PATCH] fix(command options): allow to use camelCase for options. Previously this resulted in weird behaviour, now we automatically add an alias for the camelize version of the flag name. Fixes #3625. --- packages/@angular/cli/ember-cli/lib/models/command.js | 1 + tests/e2e/tests/build/aot/aot-i18n.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/@angular/cli/ember-cli/lib/models/command.js b/packages/@angular/cli/ember-cli/lib/models/command.js index 58e68b4c4c8a..471f68596150 100644 --- a/packages/@angular/cli/ember-cli/lib/models/command.js +++ b/packages/@angular/cli/ember-cli/lib/models/command.js @@ -183,6 +183,7 @@ Command.prototype.mergeDuplicateOption = function(key) { */ Command.prototype.normalizeOption = function(option) { option.key = camelize(option.name); + option.aliases = (option.aliases || []).concat(camelize(option.name)); option.required = option.required || false; return option; }; diff --git a/tests/e2e/tests/build/aot/aot-i18n.ts b/tests/e2e/tests/build/aot/aot-i18n.ts index e530d9179dbd..548174f170c7 100644 --- a/tests/e2e/tests/build/aot/aot-i18n.ts +++ b/tests/e2e/tests/build/aot/aot-i18n.ts @@ -22,6 +22,8 @@ export default function() { '

Hello i18n!

')) .then(() => ng('build', '--aot', '--i18n-file', 'src/locale/messages.fr.xlf', '--i18n-format', 'xlf', '--locale', 'fr')) + .then(() => ng('build', '--aot', '--i18nFile', 'src/locale/messages.fr.xlf', '--i18nFormat', + 'xlf', '--locale', 'fr')) .then(() => expectFileToMatch('dist/main.bundle.js', /Bonjour i18n!/)) .then(() => ng('build', '--aot')) .then(() => expectToFail(() => expectFileToMatch('dist/main.bundle.js', /Bonjour i18n!/)))