npm / ndm

ndm allows you to deploy OS-specific service-wrappers directly from npm-packages.
ISC License
182 stars 22 forks source link

ndm interview with command line parameters #80

Open piranna opened 10 years ago

piranna commented 10 years ago

prompt allow to define command line parameters so it doesn't do that questions later, it would be a good feature for ndm interview so it doesn't block asking the configuration parameters.

seanewest commented 10 years ago

sounds like a good idea.

ndm install calls interview as well -- did you picture being able to send the interview's command line arguments to install?

bcoe commented 10 years ago

This is something I'd had on my mind as well, although I don't think we need to switch off of inquirer to get the functionality.

In my head, I was picturing that you could pass answers to prompt questions as part of the ndm invocation:

ndm interview --answer-banana=apple --answer-coolio=blarg

I also thought it would be good to be able to have an answers.json on disk, which is a map providing answers to interview questions.

piranna commented 10 years ago

@seanewest I didn't think about ndm install,but obviously they should be used there and any other place ndm interview could be called indirectly ;-)

@bcoe I'm not saying to replace inquier with prompt, it's only I found that feature really useful. In fact, the example you've put is the same I was thinking about :-) Is the answers.json a config file for ndm interview? If so it would be also import from stdio by setting - as input file :-)

bcoe commented 10 years ago

@piranna one option is just piping in the answers:

ndm interview < answers.txt

If you have answers in the appropriate order, with \n on each line, it should do the right thing. Do you think we should just document this and skip adding the json feature?

piranna commented 10 years ago

Piping a file is a good idea, it should be on the readme. But what happens if you have the answers for first and third questions, but you want to ask the second one? This is possible only by passing the answers as parameters or as a json mapping file.

bcoe commented 10 years ago

:+1: good point, I like the idea of being able to pipe JSON.

piranna commented 10 years ago

Thank you ;-)