enquirer v0.1.0 Enquirer
Enquirer is a simple module to make is easy to get user input in terminal applications.
Summary
Functions
Asks the user a yes/no question. A default can be supplied.
A true
result indicates a “yes” answer. false
indicated “no”
Allows the user to choose between options. An optional default can be supplied
Gets input from the user
Asks the user a to enter a list of items. A blank line is treated as the end of the input
Outputs a string to the terminal, optionaly specifying a colour.
Valid colours are :red
, :green
and :yellow
Functions
Asks the user a yes/no question. A default can be supplied.
A true
result indicates a “yes” answer. false
indicated “no”
Without a default:
ask "Do you like oranges?"
With a default:
ask "So you like oranges?", false
Allows the user to choose between options. An optional default can be supplied.
Without a default:
choose "What is your favourite colour?",
red: "Red",
green: "Green",
yellow: "Yellow"
With a default:
choose "What is your favourite colour?",
red: "Red",
green: "Green",
yellow: "Yellow",
default: :yellow
Asks the user a to enter a list of items. A blank line is treated as the end of the input
get_list "Enter your favourite colours"