piotrmurach / tty-prompt

A beautiful and powerful interactive command line prompt
https://ttytoolkit.org
MIT License
1.47k stars 136 forks source link

Is there any way can set some choices items disabled? #61

Closed maimake closed 6 years ago

maimake commented 7 years ago

Thanks for your lib . And I want to know how to disable some items in list, which acts like the js lib named Inquirer. Is there any configuration with tty-prompt?

$ node checkbox.js 
? Select toppings 
  = The extras = 
 ◯ Pineapple
 - Olives (out of stock)    <==== this item is disabled
❯◯ Extra cheese
  = The Meats = 
 ◯ Pepperoni
 ◯ Ham
(Move up and down to reveal more choices)

You can clone it and try:

git clone https://github.com/SBoudrias/Inquirer.js.git
yarn 
cd example
node checkbox.js

BTW, Make all prompts(yes, ask, select ...) into one prompt is cool, like Inquirer's way

piotrmurach commented 7 years ago

Hey,

Thanks for using the library! The tty-prompt prompts such as select and multi_select were inspired by inquirer beautiful output, though they take very much Ruby approach and implementation, as far as mechanics go, to construct the choice menus.

Currently there is no way to disable any menu items. Do you fancy submitting PR?