nanovazquez / yargs-interactive

Interactive support for yargs
MIT License
46 stars 9 forks source link

How to use the list type from inquirer? #10

Closed stevenzeck closed 6 years ago

stevenzeck commented 6 years ago

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 achoicesparameter.

nanovazquez commented 6 years ago

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 commented 6 years ago

@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!