TEXT_PICKER - Ask the user to interactively enter text via the UI

When to use it

Any time text is required - such as a host name or user name.

Syntax

  TEXT_PICKER [text prompt] [default text]
  

text prompt

Prompt to show the user. Prompts should be kept short enough to fit on the device display.

default text

Default value to populate the picker.

The text picker dialog

The text picker dialog

The text picker editor

The text picker editor

Results

TEXT_PICKER will wait until the user has made a selection, pausing the payload.

TEXT_PICKER exits with a return code of 0 if the user continues, and non-zero if the user cancels.

TEXT_PICKER returns the text as the output.

Examples

  __host=$(TEXT_PICKER "Target hostname" "foo-client") || exit 0
  
  __demo=$(TEXT_PICKER "No default text" "") || exit 0