99// tslint:disable:no-global-tslint-disable no-any
1010import { tags , terminal } from '@angular-devkit/core' ;
1111import { NodePackageDoesNotSupportSchematics } from '@angular-devkit/schematics/tools' ;
12- import { CommandScope , Option } from '../models/command' ;
1312import { parseOptions } from '../models/command-runner' ;
1413import { SchematicCommand } from '../models/schematic-command' ;
1514import { NpmInstall } from '../tasks/npm-install' ;
1615import { getPackageManager } from '../utilities/config' ;
1716
1817
1918export class AddCommand extends SchematicCommand {
20- readonly name = 'add' ;
21- readonly description = 'Add support for a library to your project.' ;
2219 readonly allowPrivateSchematics = true ;
23- static aliases = [ ] ;
24- static scope = CommandScope . inProject ;
25- arguments = [ 'collection' ] ;
26- options : Option [ ] = [ ] ;
2720
2821 private async _parseSchematicOptions ( collectionName : string ) : Promise < any > {
2922 const schematicOptions = await this . getOptions ( {
3023 schematicName : 'ng-add' ,
3124 collectionName,
3225 } ) ;
26+ this . addOptions ( schematicOptions ) ;
3327
34- const options = this . options . concat ( schematicOptions . options ) ;
35- const args = schematicOptions . arguments . map ( arg => arg . name ) ;
36-
37- return parseOptions ( this . _rawArgs , options , args , this . argStrategy ) ;
28+ return parseOptions ( this . _rawArgs , this . options ) ;
3829 }
3930
4031 validate ( options : any ) {
4132 const collectionName = options . _ [ 0 ] ;
4233
4334 if ( ! collectionName ) {
4435 this . logger . fatal (
45- `The "ng ${ this . name } " command requires a name argument to be specified eg. `
36+ `The "ng add " command requires a name argument to be specified eg. `
4637 + `${ terminal . yellow ( 'ng add [name] ' ) } . For more details, use "ng help".` ,
4738 ) ;
4839
@@ -57,7 +48,7 @@ export class AddCommand extends SchematicCommand {
5748
5849 if ( ! firstArg ) {
5950 this . logger . fatal (
60- `The "ng ${ this . name } " command requires a name argument to be specified eg. `
51+ `The "ng add " command requires a name argument to be specified eg. `
6152 + `${ terminal . yellow ( 'ng add [name] ' ) } . For more details, use "ng help".` ,
6253 ) ;
6354
0 commit comments