Closed Rafaelcv7 closed 1 year ago
Works for me! Bonus point if you can add a unit test to verify the behavior is the same before and after
Somewhat related - I'm curious if it's possible add in the ability to select an option using a letter? So instead of hitting the down arrow to get to "Cancel," for example, one could just hit "X" and it would immediately select the cancel option.
Works for me! Bonus point if you can add a unit test to verify the behavior is the same before and after
Nice! I would then implement it on this next week is possible for me. I would try to set the Unit tests too.
Somewhat related - I'm curious if it's possible add in the ability to select an option using a letter? So instead of hitting the down arrow to get to "Cancel," for example, one could just hit "X" and it would immediately select the cancel option.
Mmm, this is interesting, although I like arrow keys as navigation on the terminal menus. I would see if their is a good way to implement a relation of keyboard letters to each command also.
Mmm, this is interesting, although I like arrow keys as navigation on the terminal menus. I would see if their is a good way to implement a relation of keyboard letters to each command also.
Oh for sure, keep the arrow key navigation because I think that's the natural thing most people will reach for. But if possible, I think having the option to set a letter as a shortcut for the options might be nice/convenient. :)
Closing Issue because a Pull Request has already been merged addressing this issue. PR: #63
Hey I was thinking that on this piece of the code on the prompt.ts we can refactor it. The value property on each option could be an anonymous function that do the actions specified on the if sequence. That way we can get rid of the "const x = answer === y" part and the different IF calculations. Then you will only need to call answer() to execute the action.
Unless I'm not picking up something it seems to me like a good idea, and I could implement it if you want. Please let me know if Im wrong or if you want me to do it. 😄