Skip to main content

env_flag_value_enabled

Function env_flag_value_enabled 

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

Whether an already-read environment value is an affirmative flag.

This is the same accepted-value set as env_flag_enabled, applied to a value the caller has already read. Callers that snapshot the environment (see vtcode_commons::terminal_capabilities::TerminalEnv) reuse one canonical rule instead of forking the value set.

assert!(env_flag_value_enabled(Some("1")));
assert!(!env_flag_value_enabled(Some("0")));
assert!(!env_flag_value_enabled(None));