markfink / whaaaaat

Inquirer.js port to Python (https://www.npmjs.com/package/inquirer). people blame me for staling this project. I do not have time to work on this right now - whaaaaat do you want me to do? take it offline?
MIT License
83 stars 9 forks source link

Custom final message on keyboard interrupt #21

Closed denizs closed 2 years ago

denizs commented 6 years ago

This PR introduces an additional kwarg named keyboard_interrupt_msg, which let's you customize the output of whaaaaat when a user hits ctrl+c. Now hardcodede as Cancelled by user, this let's you do something like this:

prompt(questions, style=style, keyboard_interrupt_msg="Ok ok, I'm backing off! See ya later")

which would result in:

[?] Some question where you hit ctrl+c

Ok ok, I'm backing off! See ya later
markfink commented 6 years ago

I understand that you want to add a lot of additional features to whaaaaat but this is not what we intended. whaaaaat is supposed to be a small library (like a building block). If you want to implement more complex dialogues I suggest you use something like https://github.com/finklabs/banana or write your own.