Additionnal infos parameter
Hi!
Sometime we need to give more informations about the user choices and the problem is when we wrote all the questions into the same object.
let questions = [
{
// question 1
},
{
// question 2
}
]
inquirer.prompt(questions).then(function(answers) {
// Do the stuff
})
This approach allow me to build a wrapper for the questions and a validator for all submitted answers. This work perfectly but i can't give additionnal information when it's required.
Can you add a param to provide a string wich can be colored with chalk? Like:
tooltip: chalk.yellow('[Warning] Using this option without granted access can make you banned!')
Allow a callback could be really usefull too
Thank you !
You can use the when function to console.log() warning on your own. Or you can just split your prompts in multiples functions that you chain:
prompt1()
.then(prompt2)
.then(prompt3)
.then(onAnswer);
I don't think Inquirer needs to provide a specific API for that.
[cleaning up old issues]
Prompts taking a list of choices now exposes a description option. That description test appears when a choice is highlighted. And with theme the display can be customized.