Skip to content

Prompt

Index

prompt::ny

Prompt the user with a [y/N] question (default: no); return true if the user answers yes.

Arguments

  • $1 (question): text

prompt::yn

Prompt the user with a [Y/n] question (default: yes); return true if the user answers yes.

Arguments

  • $1 (question): text

prompt::for_value

Prompt the user for a free-form value; loops until a non-empty response is given. If a default is provided, it is shown in the prompt and accepted on empty input. Output: stdout — the value entered by the user (or the default)

Arguments

  • $1 (prompt): text
  • $2 (default): value (optional)