dthree / vorpal

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

Show Inquirer default value #125

Closed devinus closed 8 years ago

devinus commented 8 years ago

Inquirer shows default values, but Inquirer used from Vorpal does not.

Inquirer:

screen shot 2016-03-02 at 11 24 46 am

Vorpal:

screen shot 2016-03-02 at 11 25 39 am
dthree commented 8 years ago

Thanks. To assist in debug, could you give me the code you used to reproduce this? Thanks.

MatthieuLemoine commented 8 years ago

I have the same issue. It can be reproduce with

vorpal
  .command('setup')
  .description('Setup your cli / Update your informations')
  .action(function action(args, cb) {
    this
      .prompt([
        {
          type    : 'input',
          name    : 'name',
          message : 'Enter your name : ',
          default : 'defaultName',
        },
      ])
      .then(answers => {
        cb(`Welcome ${answers.name}!`);
      })
      .catch(err => cb(err));
  });