ExPrompt.choose
You're seeing just the function
choose
, go back to ExPrompt module for more information.
Specs
Asks the user to select form a list of choices. It returns either the index of the element in the list or -1 if it's not found.
This method tries first to get said element by the list number, if it fails it will attempt to get the index from the list of choices by the value that the user wrote.
Examples
To ask for a favorite color in a predefined list
ExPrompt.choose("Favorite color?" , ~w(red green blue))
It's the same example above, but defines to the second option (green) as default value if none is selected.
ExPrompt.choose("Favorite color?" , ~w(red green blue), 2)