SBoudrias / Inquirer.js

A collection of common interactive command line user interfaces.
MIT License
19.95k stars 1.3k forks source link

Filter for list and checkbox #88

Closed joseadrian closed 10 years ago

joseadrian commented 10 years ago

This is what I tried to do but I just did it for the checkbox prompt. I didn't make a pull request because I haven't added the unit test and I'm not sure if the way I implemented it is ok. Also, I had to remove the J/K option to make it work

Here is a preview:

Checkbox Inquirer

Maybe it can support regex or fuzzy search.

SBoudrias commented 10 years ago

It is very unclear what you're asking... Can you describe what you want in words?

hueitan commented 10 years ago

+1 for this cool feature.

Asking for more choices if other is selected.

danielchatfield commented 10 years ago

@huei90 That is not my interpretation of what @joseadrian means. It is a way of filtering the options by typing the beginning of the name. I can see this being useful for long lists although I would implement it such that typing the name moves the pointer rather than filters the results as this wouldn't require adding anything to the UI.

SBoudrias commented 10 years ago

I'll close as pretty much the same functionality asked in #118 (and I feel the option proposed in the other issue might be more UX friendly).

Manu-Sanchez commented 8 months ago

Hi I've the same issue, but I decided to implement a solution by myself.

It's quite simpler and probably you'll need to make few changes for fit your requirements. Probably as it's a great solution I'll be keeping updating it.

I don't want to fight against pyInquirer, but for my needs, I require this filter functionality.

You can find the source code here: https://github.com/Manu-Sanchez/utils/tree/python_selector

Some kind of feedback or rating will be appretiated 💯