Skip to content

Commit

Permalink
bug(help): resolve issue when using --help (#3522)
Browse files Browse the repository at this point in the history
Fixes #3195 and #3168
  • Loading branch information
Brocco authored Dec 13, 2016
1 parent 0c1c391 commit 1352545
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/angular-cli/ember-cli/lib/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions tests/e2e/tests/commands/help/help-option-command.ts
Original file line number Diff line number Diff line change
@@ -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'));
}
9 changes: 9 additions & 0 deletions tests/e2e/tests/commands/help/help-option.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {silentNg} from '../../../utils/process';


export default function() {
return Promise.resolve()
.then(() => silentNg('--help'))
.then(() => process.chdir('/'))
.then(() => silentNg('--help'));
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {silentNg} from '../../utils/process';
import {silentNg} from '../../../utils/process';


export default function() {
Expand Down

0 comments on commit 1352545

Please sign in to comment.