Skip to content

Commit

Permalink
fix(@angular/cli): Fix help for generate command.
Browse files Browse the repository at this point in the history
fixes #9412
  • Loading branch information
Brocco committed Feb 15, 2018
1 parent 18940e5 commit 256e38d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/@angular/cli/commands/generate.ts
Expand Up @@ -64,8 +64,11 @@ export default Command.extend({
],

getCollectionName(rawArgs: string[], parsedOptions?: { collection?: string }): [string, string] {
let collectionName: string = CliConfig.getValue('defaults.schematics.collection');
if (!rawArgs || rawArgs.length === 0) {
return [collectionName, null];
}
let schematicName = rawArgs[0];
let collectionName = CliConfig.getValue('defaults.schematics.collection');

if (schematicName.match(/:/)) {
[collectionName, schematicName] = schematicName.split(':', 2);
Expand Down Expand Up @@ -206,7 +209,7 @@ export default Command.extend({

printDetailedHelp: function (_options: any, rawArgs: any): string | Promise<string> {
const engineHost = getEngineHost();
const collectionName = this.getCollectionName();
const [collectionName] = this.getCollectionName();
const collection = getCollection(collectionName);
const schematicName = rawArgs[1];
if (schematicName) {
Expand Down

0 comments on commit 256e38d

Please sign in to comment.