-
Notifications
You must be signed in to change notification settings - Fork 93
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
Added pause prompt #108
Added pause prompt #108
Conversation
Hey @allanmcarvalho, I'm in favour of a I've had a similar use case previously, but I just wanted a simple "Press enter to continue..." to allow the user to read the previous output. In that scenario, I wouldn't want a box with text, as the output I want them to read had already been written. What are your thoughts on something more simple API like: function pause($message = 'Press enter to continue...'): void
{
//...
} Which would just output something similar to the In your case, you could output the license separately, followed by a |
Hi @jessarcher! Thanks by your review, you are definitely right. I will refactor with your suggestions ASAP and then push here. Have a good week! |
@jessarcher I made the suggestions that you provided. warning("Warning: The changes you are about to make cannot be undone. Please proceed with caution.");
pause();
info('Ok, processing...'); Message attribute is present, but optional and it's default is What do you think now? |
Hey @allanmcarvalho, Looks good! I changed it so that when the terminal is non-interactive, the As mentioned previously, for scenarios where you need explicit confirmation from the user before doing something potentially destructive, I'd recommend using the What are your thoughts? |
Yes, I think that's it. Your point of view appears to well describe the objective behind of creation of this prompt. To be honest, I had the idea to create this prompt in a scenario where I needed to make a pause to read the previous content, so, it's like you described. For scenarios where the user must to agree if continues or exit, maybe in future an exclusive prompt that made this like a charm can be crafted, but definitely it's not a job for pause. Thanks for you review and contribution. |
This PR introduce the pause prompt that will be useful in a lot of scenarios. Eg.: