Decision from dialog rc

SolidGroundUX DocumentationSolidGroundUX
NL

fn: sgnd_decision_from_dialog_rc

Purpose

Translate a dialog return code into a normalized decision.

Arguments

  • $1 — dialog return code; $2: choices; optional $3: default value.

Output

Prints the corresponding canonical decision, if recognized.

Returns

  • 0 when translated; nonzero when no mapping is available.

Usage

  sgnd_decision_from_dialog_rc 2 "Yes|Y,No|N,Cancel|C" "No"