plopjs / plop

Consistency Made Simple
http://plopjs.com
MIT License
7.12k stars 277 forks source link

Accepting `short` as input? #359

Open unional opened 2 years ago

unional commented 2 years ago

inquirer's choice question support this short value. Is it possible to use that as the input when doing it through command line?

for example:

export default function (plop) {
  plop.setGenerator('test', {
    description: 'blah',
    prompts: [{
      type: 'list',
      name: 'where',
      message: 'something',
      choices: [{
        name: 'some name that can be quite long',
        short: 'blah',
        value: 'some-value'
      }, {
        name: 'another very long name',
        short: 'blah2',
        value: 'some-value2'
      }]
    }]
  })
}

can invoke this with: plop blah2

https://www.npmjs.com/package/inquirer#questions