8000 GitHub - Uzaaft/expand-env-vars
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Uzaaft/expand-env-vars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

env-expand

A simple cross-platform Rust utility to expand environment variable placeholders in strings.

Supports:

  • Unix-style: $VAR, ${VAR}
  • Windows-style: %VAR%

Missing environment variables are replaced with empty strings by default. In the future they will error out

Usage

Add to your project:

mod env_expand;

use env_expand::expand_env_vars;

fn main() {
    std::env::set_var("USERNAME", "alice");
    let input = "Hello $USERNAME!";
    
    match expand_env_vars(input) {

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0