Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accepting short as input? #359

Open
unional opened this issue Oct 6, 2022 · 0 comments
Open

Accepting short as input? #359

unional opened this issue Oct 6, 2022 · 0 comments

Comments

@unional
Copy link

unional commented Oct 6, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant