Skip to main content

expand_vars_with

Function expand_vars_with 

Source
pub fn expand_vars_with(
    input: &str,
    lookup: impl Fn(&str) -> Option<String>,
) -> String
Expand description

Expand $VAR, ${VAR}, ${VAR:-default} (the default when unset or empty) and $$ (a literal $) in input, with the variables lookup gives. A variable it does not give expands to nothing.