CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.91k stars 235 forks source link

example/checkbox.py validate is not working #161

Open g-paras opened 3 years ago

g-paras commented 3 years ago

According to the code, user must select at least one topping otherwise it should print 'You must choose at least one topping' then ask again but instead program prints a dictionary with toppings as key and empty list as value, which is wrong.

flavienbwk commented 2 years ago

I can reproduce the issue.

kyzima-spb commented 2 years ago

I can reproduce the issue.

prompt([
    {
        'type': 'checkbox',
        'name': 'invalid_value',
        'message': 'Any value invalid',
        'validate': lambda answer: False,
        'choices': [{'name': 'item 1'}, {'name': 'item 2'}, {'name': 'item 3'}]
    }
])

The example from the documentation doesn't work either.

juandspy commented 2 years ago

I think it's not implemented yet: https://github.com/CITGuru/PyInquirer/blob/master/PyInquirer/prompts/checkbox.py#L121