diff --git a/packages/angular-cli/ember-cli/lib/cli/cli.js b/packages/angular-cli/ember-cli/lib/cli/cli.js index 052fc7fc5b58..ac9648d0c283 100644 --- a/packages/angular-cli/ember-cli/lib/cli/cli.js +++ b/packages/angular-cli/ember-cli/lib/cli/cli.js @@ -25,6 +25,16 @@ module.exports = CLI; CLI.prototype.run = function(environment) { return Promise.hash(environment).then(function(environment) { var args = environment.cliArgs.slice(); + + if (args[0] === '--help') { + if (args.length === 1) { + args[0] = 'help'; + } else { + args.shift(); + args.push('--help'); + } + } + var commandName = args.shift(); var commandArgs = args; var helpOptions; diff --git a/tests/e2e/tests/commands/help/help-option-command.ts b/tests/e2e/tests/commands/help/help-option-command.ts new file mode 100644 index 000000000000..73537f7ed8e2 --- /dev/null +++ b/tests/e2e/tests/commands/help/help-option-command.ts @@ -0,0 +1,9 @@ +import {silentNg} from '../../../utils/process'; + + +export default function() { + return Promise.resolve() + .then(() => silentNg('--help', 'build')) + .then(() => process.chdir('/')) + .then(() => silentNg('--help', 'build')); +} diff --git a/tests/e2e/tests/commands/help/help-option.ts b/tests/e2e/tests/commands/help/help-option.ts new file mode 100644 index 000000000000..03b96b5758d9 --- /dev/null +++ b/tests/e2e/tests/commands/help/help-option.ts @@ -0,0 +1,9 @@ +import {silentNg} from '../../../utils/process'; + + +export default function() { + return Promise.resolve() + .then(() => silentNg('--help')) + .then(() => process.chdir('/')) + .then(() => silentNg('--help')); +} diff --git a/tests/e2e/tests/commands/help.ts b/tests/e2e/tests/commands/help/help.ts similarity index 76% rename from tests/e2e/tests/commands/help.ts rename to tests/e2e/tests/commands/help/help.ts index b2800c120cc3..f326f6a81ff8 100644 --- a/tests/e2e/tests/commands/help.ts +++ b/tests/e2e/tests/commands/help/help.ts @@ -1,4 +1,4 @@ -import {silentNg} from '../../utils/process'; +import {silentNg} from '../../../utils/process'; export default function() {