amber/global_this
Values
pub fn alert() -> Nil
Shows a message and waits for the user to press Enter.
Does nothing if stdin is not interactive.
pub fn alert_with(message: String) -> Nil
Shows the given message and waits for the user to press Enter.
Does nothing if stdin is not interactive.
pub fn confirm() -> Bool
Shows “Confirm” and waits for the user to respond with y/n.
Returns False if stdin is not interactive.
pub fn confirm_with(message: String) -> Bool
Shows the given message and waits for the user to respond with y/n.
Returns False if stdin is not interactive.
pub fn prompt() -> Result(String, Nil)
Shows “Prompt” and waits for the user to input text.
Returns Error(Nil) if the user cancels or stdin is not interactive.
pub fn prompt_with(message: String) -> Result(String, Nil)
Shows the given message and waits for the user to input text.
Returns Error(Nil) if the user cancels or stdin is not interactive.
pub fn prompt_with_default(
message message: String,
or default: String,
) -> Result(String, Nil)
Shows the given message and waits for the user to input text, using the provided default value if the user submits empty input.
Returns Error(Nil) if the user cancels or stdin is not interactive.