Skip to content

Commit 4db16ac

Browse files
committed
fix(@angular/cli): Resolve interface type anonymous option
1 parent e50bd2b commit 4db16ac

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

packages/@angular/cli/commands/generate.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,20 @@ export default Command.extend({
102102
ui: this.ui,
103103
project: this.project
104104
});
105+
const collectionName = this.getCollectionName(rawArgs);
105106

106107
return getOptionsTask.run({
107108
schematicName,
108-
collectionName: this.getCollectionName(rawArgs)
109+
collectionName
109110
})
110111
.then((availableOptions: SchematicAvailableOptions) => {
112+
let anonymousOptions: string[] = [];
113+
if (collectionName === '@schematics/angular' && schematicName === 'interface') {
114+
anonymousOptions = ['<type>'];
115+
}
116+
111117
this.registerOptions({
118+
anonymousOptions: anonymousOptions,
112119
availableOptions: availableOptions
113120
});
114121
});
@@ -143,11 +150,16 @@ export default Command.extend({
143150
ui: this.ui,
144151
project: this.project
145152
});
153+
const collectionName = this.getCollectionName(rawArgs);
154+
155+
if (collectionName === '@schematics/angular' && schematicName === 'interface' && rawArgs[2]) {
156+
commandOptions.type = rawArgs[2];
157+
}
146158

147159
return schematicRunTask.run({
148160
taskOptions: commandOptions,
149161
workingDir: cwd,
150-
collectionName: this.getCollectionName(rawArgs),
162+
collectionName,
151163
schematicName
152164
});
153165
},

0 commit comments

Comments
 (0)