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

How to use the list type from inquirer? #10

Closed
stevenzeck opened this issue Jul 8, 2018 · 2 comments
Closed

How to use the list type from inquirer? #10

stevenzeck opened this issue Jul 8, 2018 · 2 comments

Comments

@stevenzeck
Copy link

Do list types work for this? I'm playing around and trying the following as an option

  Favorite: {
    describe: "What is your favorite color?",
    prompt: "always",
    type: "list",
    choices: [
      "Blue",
      "Red",
      "Green",
      "Yellow",
      "Orange"
    ],
  },

But I just get an error saying You must provide a choices parameter.

@nanovazquez
Copy link
Owner

Hey @szeck87. You actually found a bug :D

v2.0.1 includes the fix and was just published. Could you please run npm i -S yargs-interactive@latest and try again? Let me know the result.

@stevenzeck
Copy link
Author

@nanovazquez I actually looked further and saw that you were passing them as options, so I used that and it worked. Looks like you reverted it back to using choices. I'll update yargs-interactive and switch it back to choices in my code. Thanks!

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

2 participants