fizyr / subst

Apache License 2.0
10 stars 4 forks source link

Initial implementation #2

Closed de-vri-es closed 2 years ago

de-vri-es commented 2 years ago

This PR implements variable substitution for &str and &[u8]. You can use either a custom map with your own variables, or Env or EnvBytes to directly use environment variables.

In the long syntax, you can give default values: ${hello:bar}. You can even have variables in the default value: ${XDG_CONFIG_HOME:$HOME/.config}/my-app/config.toml.