Skip to main content

Module boolean

Module boolean 

Source
Expand description

The one boolean spelling (true / false) for params, fields and env flags. The one boolean spelling: true / false.

Every boolean-valued input — a CLI key=value param, a workload field given as a string, an NMBRS_* env flag — goes through this module. Nothing else counts as a boolean. Spellings that other tools accept (on/off, yes/no, 1/0) are errors that name the canonical word, so a typo never quietly becomes false.

Functions§

env_flag
Read the boolean env flag name. Unset is false; a set value must be true or false.
is_bool_word
True when raw is a canonical boolean word.
json_bool
Read the boolean key from a workload value: a YAML/JSON bool, or a string spelled true / false (the form a {param} substitution or a CLI override produces).
parse_bool
Parse raw as the value of the boolean key.