@@ -192,42 +192,20 @@ export default Command.extend({
192
192
const collection = getCollection ( collectionName ) ;
193
193
const schematicName = rawArgs [ 1 ] ;
194
194
if ( schematicName ) {
195
- const SchematicGetOptionsTask = require ( '../tasks/schematic-get-options ' ) . default ;
196
- const getOptionsTask = new SchematicGetOptionsTask ( {
195
+ const SchematicGetHelpOutputTask = require ( '../tasks/schematic-get-help-output ' ) . default ;
196
+ const getHelpOutputTask = new SchematicGetHelpOutputTask ( {
197
197
ui : this . ui ,
198
198
project : this . project
199
199
} ) ;
200
- return getOptionsTask . run ( {
200
+ return getHelpOutputTask . run ( {
201
201
schematicName,
202
202
collectionName
203
203
} )
204
- . then ( ( availableOptions : SchematicAvailableOptions [ ] ) => {
205
- const output : string [ ] = [ ] ;
206
- output . push ( cyan ( `ng generate ${ schematicName } ${ cyan ( '[name]' ) } ${ cyan ( '<options...>' ) } ` ) ) ;
207
- availableOptions
208
- . filter ( opt => opt . name !== 'name' )
209
- . forEach ( opt => {
210
- let text = cyan ( ` --${ opt . name } ` ) ;
211
- if ( opt . schematicType ) {
212
- text += cyan ( ` (${ opt . schematicType } )` ) ;
213
- }
214
- if ( opt . schematicDefault ) {
215
- text += cyan ( ` (Default: ${ opt . schematicDefault } )` ) ;
216
- }
217
- if ( opt . description ) {
218
- text += ` ${ opt . description } ` ;
219
- }
220
- output . push ( text ) ;
221
- if ( opt . aliases && opt . aliases . length > 0 ) {
222
- const aliasText = opt . aliases . reduce (
223
- ( acc , curr ) => {
224
- return acc + ` -${ curr } ` ;
225
- } ,
226
- '' ) ;
227
- output . push ( grey ( ` aliases: ${ aliasText } ` ) ) ;
228
- }
229
- } ) ;
230
- return output . join ( '\n' ) ;
204
+ . then ( ( output : string [ ] ) => {
205
+ return [
206
+ cyan ( `ng generate ${ schematicName } ${ cyan ( '[name]' ) } ${ cyan ( '<options...>' ) } ` ) ,
207
+ ...output
208
+ ] . join ( '\n' ) ;
231
209
} ) ;
232
210
} else {
233
211
const schematicNames : string [ ] = engineHost . listSchematics ( collection ) ;
0 commit comments