fn: sgnd_print
Purpose
Render console text with theme color, padding, alignment and automatic wrapping.
Behavior
- With empty text, write a blank line via sgnd_print_single.
- When wrapping is enabled, wrap with sgnd_wrap_words.
- Delegate each rendered line to sgnd_print_single.
Arguments
--text TEXT— Text to print; also accepts the first positional value.--textclr ANSI— Text color sequence.--justify L|C|R— Alignment (default: left).--wrap 0|1— Explicit wrapping; otherwise wrap when text exceeds the available width.--pad N— Left padding in spaces.--rightmargin N— Right margin in spaces.--maxwidth N— Maximum content width, capped at terminal width.
Inputs (globals)
SGND_UI_TEXT, RESET.
Output
Writes one or more styled console lines to stdout.
Returns
0 for an empty-text call; otherwise final rendering status.
Usage
sgnd_print --text "Ready" --pad 2
sgnd_print --text "$description" --wrap 1 --maxwidth 80
