Skip to content

Commit 496e13a

Browse files
authored
fix(command options): allow to use camelCase for options. (#3787)
Previously this resulted in weird behaviour, now we automatically add an alias for the camelize version of the flag name. Fixes #3625.
1 parent d8f36df commit 496e13a

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/@angular/cli/ember-cli/lib/models/command.js

+1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ Command.prototype.mergeDuplicateOption = function(key) {
183183
*/
184184
Command.prototype.normalizeOption = function(option) {
185185
option.key = camelize(option.name);
186+
option.aliases = (option.aliases || []).concat(camelize(option.name));
186187
option.required = option.required || false;
187188
return option;
188189
};

tests/e2e/tests/build/aot/aot-i18n.ts

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export default function() {
2222
'<h1 i18n="An introduction header for this sample">Hello i18n!</h1>'))
2323
.then(() => ng('build', '--aot', '--i18n-file', 'src/locale/messages.fr.xlf', '--i18n-format',
2424
'xlf', '--locale', 'fr'))
25+
.then(() => ng('build', '--aot', '--i18nFile', 'src/locale/messages.fr.xlf', '--i18nFormat',
26+
'xlf', '--locale', 'fr'))
2527
.then(() => expectFileToMatch('dist/main.bundle.js', /Bonjour i18n!/))
2628
.then(() => ng('build', '--aot'))
2729
.then(() => expectToFail(() => expectFileToMatch('dist/main.bundle.js', /Bonjour i18n!/)))

0 commit comments

Comments
 (0)