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

Add functionality to skip prompts #132

Closed
jkwohlfahrt opened this issue Feb 12, 2019 · 7 comments
Closed

Add functionality to skip prompts #132

jkwohlfahrt opened this issue Feb 12, 2019 · 7 comments
Labels
enhancement New feature or request

Comments

@jkwohlfahrt
Copy link

jkwohlfahrt commented Feb 12, 2019

I'm really enjoying the prompts module, but would love added functionality for skipping prompts, and using command line options instead, similar to how overrides were implemented in the prompt npm package, here: https://github.com/flatiron/prompt#skipping-prompts. Overrides like these provide tremendous ease of use, especially for cli commands that have lots of nested menus and options.

@lumio
Copy link
Collaborator

lumio commented Feb 20, 2019

Definitely something we should look into.

I implemented something for one of my terminal programs that just skips certain questions if they are already present. But it would be nice if terkelg/prompts can handle those similar to flatiron/prompt.

I wonder how prompts should react if some questions are unanswered and not overwritten. Are the overwritten questions still being rendered with their new values as defaults or should just the missing questions be rendered?

@jkwohlfahrt
Copy link
Author

@lumio I feel that just the missing questions should be rendered. We use override functionality on our homegrown cli tooling, and only rendering the questions that are left really speeds up the use of the tooling.

@lumio
Copy link
Collaborator

lumio commented Feb 20, 2019

@jkwohlfahrt that makes sense. Why would you overwrite it in the first place then, right?

@jkwohlfahrt
Copy link
Author

jkwohlfahrt commented Feb 20, 2019

I've used the prompt override functionality fairly heavily in the past, to quickly execute commands that have lots of prompts involved. For instance, we have CLI commands that call APIs with several prompted parameters. Often times, especially for testing purposes, our engineering team needs to make the same call over and over again, largely with the same parameters. Overwriting the prompts takes away a lot of the monotony of gong through the same steps over and over again. Does that answer your question at all, @lumio ? Not sure I fully understand what you're asking.

@lumio
Copy link
Collaborator

lumio commented Feb 20, 2019

@jkwohlfahrt sorry for the confusion. I meant it in a rhetorical way 😄
I fully agree with you! If you overwrite the answers of your questions, you don't want to render them any longer.

I might have a look into it tomorrow.

@terkelg
Copy link
Owner

terkelg commented Feb 24, 2019

This will be included in the next release, thank you guys!

@terkelg terkelg closed this as completed Feb 24, 2019
@terkelg terkelg added the enhancement New feature or request label Feb 24, 2019
@giacomocerquone
Copy link

typings are missing here, I'll add it ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants