UI Ask

SolidGroundUX DocumentationSolidGroundUX
NL

Provide interactive prompting and lightweight dialog utilities

Source: target-root/usr/local/lib/solidgroundux/common/ui-ask.sh

Provide interactive prompting and lightweight dialog utilities

Public functions

Internal functions
FunctionPurposeArgumentsOutput
_ask_expand_choicesExpand a comma-separated choice specification into one choice per line.- $1 — Choice specification to expand.Writes one expanded choice per line to stdout.
_ask_choice_is_validValidate a single choice against a ask_choose-style choices list.- $1 — VALUE—
_ask_build_promptBuild the colored prompt string used by ask-style input functions.- $1 — Label text.Writes the prompt string to stdout.
_ask_validateRun a validation callback when provided.- $1 — VALIDATE_FUNCTION—
_ask_decision_expand_choicesExpand a decision choice specification into canonical/alias pairs.- $1 — Decision specification, for example "YES\Y,NO\
_ask_decision_normalizeConvert a typed decision or alias into its canonical decision value.- $1 — Typed value to normalize.Writes the canonical decision value to stdout.
_ask_decision_displayBuild a compact display string from a decision specification.- $1 — CHOICESWrites display string, e.g. YES/NO.
_ask_decision_map_dlg_rcConvert ask_dlg_autocontinue return codes into canonical decision values.- $1 — Return code from ask_dlg_autocontinue.Writes the mapped canonical decision value to stdout.
_ask_parse_fieldspecSplit a form field specification into the temporary parser globals used by ask_prompt_form.- $1 — Field specification in KEY\LABEL\
_ask_is_identTest whether a value is a valid shell variable identifier.- $1 — VALUE—
_ask_datetime_normalizeNormalize an absolute date/time value or SolidGroundUX datetime shortcut.——

Description

Provides the framework's console interaction layer.

The library:

  • Prompts for typed input using labeled questions
  • Supports editable defaults and validation hooks
  • Supports constrained symbolic decisions
  • Supports timed auto-continue prompts with simple intervention keys
  • Supports typed and immediate choice selection helpers
  • Supports normalized absolute and relative datetime input through ask_datetime
  • Supports prompting a variable set from field-spec lines
  • Reads input from the controlling terminal to avoid stdin conflicts

Public API:

  • ask
  • ask_datetime
  • ask_decision
  • ask_dlg_autocontinue
  • ask_selection
  • ask_choose
  • ask_choose_immediate
  • ask_prompt_form