dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.64k stars 280 forks source link

Mutliple prompts called from different files #138

Open Maxtoros opened 8 years ago

Maxtoros commented 8 years ago

So am working with multiple prompts called from different files like this : vorpal .command('init') .description ('Create the configuration file for the project.') .action(function(args, cb){ const self = this; cordovaTasker.createConfig; })

The function createConfig simply provides a prompt like this :

var formulaire = [{...},{...}];

vorpal .command('bake [type]') .description ('Generation Cordova.') .autocomplete(['corn', 'steak', 'pasta']) .option('-ng, --angular', 'Generate a cordova project with AngularJS architecture') .action(function(args, cb){ const self = this; this.prompt(formulaire, function(answers){ displayModule.infoOut('Test affichage'); console.log('\n Review _______________________ '); console.log(JSON.stringify(answers, null, ' ')); }); }) .cancel(function () { this.log('Didn\'t mother teach you to be patient?'); }) .show(); };

Is it possible to have prompts called out like this ? #