ExPrompt.confirm

You're seeing just the function confirm, go back to ExPrompt module for more information.
Link to this function

confirm(prompt, default \\ nil)

View Source

Specs

confirm(prompt(), boolean() | nil) :: boolean()

Asks for confirmation to the user. It allows the user to answer or respond with the following options:

  • Yes, yes, YES, Y, y
  • No, no, NO, N, n

In case that the answer is none of the above, it will prompt again until we do or the default value if it's present.

Examples

To ask whether the user wants to delete a file or not:

ExPrompt.confirm("Are you sure you want to delete this file?")

It's the same example above, returning false as default.

ExPrompt.confirm("Are you sure you want to delete this file?", false)