Yeoman generator will run through all defined functions by default, Now I want to specify a argument with yo my_generator model username:string password:string
as an isolation command to create model files, but do not run prompt and copy templates
module.exports = class extends Generator {
constructor(args, opts) {
super(args, opts);
this.argument('model', {desc: 'model generete', required: false, type: String})
}
prompting(){
....
}
copyTemplates(){
...
}
model(){
this.log('only run when "model" argument provide')
}
};
There's sub generators for that: yo my_generator:model