Interactive user-input functions for terminal CLI applications.
Provides prompts for questions, yes/no confirmation, predefined-option selection, and bullet-list menus.
Usage
answer = Alaja.Printer.Interactive.question("What's your name?")
:yes = Alaja.Printer.Interactive.yesno("Continue?")
Alaja.Printer.Interactive.menu("Select option:", [{"A", :a}, {"B", :b}])
Summary
Functions
Shows an options menu.
Asks a question to the user and returns their answer.
Question with predefined options.
Yes or no question.
Functions
Asks a question to the user and returns their answer.
Options
:color- Text color (default: :white):align- Text alignment (default: :left)
Examples
iex> question("What is your name?")
"John"
iex> question("Enter value:", color: :cyan)
"42"
Question with predefined options.
Returns the value associated with the selected option,
or :error if the answer doesn't match any option.
Examples
iex> question_with_options("Choose:", [{"Yes", :yes}, {"No", :no}])
:yes
Yes or no question.
Returns :yes or :no.
Options
:default- Default answer if user presses Enter (default: :no)
Examples
iex> yesno("Do you want to continue?")
:yes
iex> yesno("Are you sure?", default: :yes)
:no