Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const vorpal = require('vorpal');
- const cli = vorpal();
- cli
- .command('newprovider <handle> <name>', 'Creates a new provider, eg. `newprovider new "New provider"`')
- .action(function(args, cb) {
- const { handle, name } = args;
- console.log(`Creating provider with handle ${handle} and name ${name}`);
- this.prompt([
- {
- type: 'input',
- name: 'url',
- message: 'Enter a local path or a url of the provider logo '
- }
- ]).then(result => {
- console.log(`URL: ${result.url}`);
- cb();
- });
- });
- cli.show();
- cli.exec('newprovider fuzz "Fuzz Provider"', () => {
- // Callback gets called AFTER the prompt has resolved.
- console.log('Callback');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement