nanovazquez / yargs-interactive

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

yargs fails when `choices` is set to a function #22

Closed brandonweiss closed 4 years ago

brandonweiss commented 5 years ago

Inquirer allows the choices property to be an array or a function that returns an array (in order to make the choices dynamic based on previously answered questions). But it seems like yargs expects the choices property to be a string or array?

nanovazquez commented 4 years ago

Hey @brandonweiss. First of all, I'm really sorry for the late response, I didn't have the notifications turned on for this repo. It's fixed now.

You are right, given that this functionality is not provided by yargs, there is some work required to make it work in here. I haven't found any use case to support it, but in case you have one I'm open to receive a PR and review it. What do you think?

brandonweiss commented 4 years ago

No worries! I’ve certainly done that myself before 😓

Hmm… honestly it’s been so long I can’t remember what in particular I wanted this feature for 😅 Apparently it wasn’t a big enough problem because I completely forgot about it 🤷‍♂ Feel free to close!

nanovazquez commented 4 years ago

Will do, but feel free to open it again if you need it.

And sorry again for taking so long to answer.