Skip to main content

parse_daemon_bool

Function parse_daemon_bool 

Source
pub fn parse_daemon_bool(value: &str) -> Option<bool>
Expand description

The boolean grammar of shep.toml and the SHEP_* environment: 1, 0, true, false, and nothing else.

One function so the file/env layer and the --log-json flag cannot drift. clap’s own BoolishValueParser additionally accepts yes/no/y/n/on/off; using it would widen the grammar on the flag side only, and widening an input grammar beyond spec is a named drift risk on this project.

The name says whose grammar this is on purpose. It is not a general boolean parser and must not be widened into one: the whole value of exporting it is that there is exactly one answer to “what counts as true in shep’s daemon config”.