#deal #env #helper

dev environment

Helper to deal with environment variables

2 releases

Uses old Rust 2015

0.1.1 Oct 12, 2017
0.1.0 Oct 12, 2017

#15 in #deal

Download history 556/week @ 2024-12-02 517/week @ 2024-12-09 489/week @ 2024-12-16 202/week @ 2024-12-23 278/week @ 2024-12-30 429/week @ 2025-01-06 710/week @ 2025-01-13 508/week @ 2025-01-20 465/week @ 2025-01-27 1189/week @ 2025-02-03 832/week @ 2025-02-10 394/week @ 2025-02-17 1447/week @ 2025-02-24 1616/week @ 2025-03-03 2164/week @ 2025-03-10 2106/week @ 2025-03-17

7,399 downloads per month
Used in 42 crates (via assert_cli)

MIT/Apache

9KB
149 lines

Environment

Handle environment variable context - This crate helps you to deal with environment variables.

Build Status Documentation

Install

Just add it to your Cargo.toml:

[dependencies]
environment = "0.1"

Example

Here's a trivial example:

extern crate environment;

use std::process::Command;

fn main() {
    let env = Environment::inherit().insert("foo", "bar");


    let mut c = Command::new("printenv");

    let output = c.env_clear()
        .envs(env.compile())
        .output()
        .expect("failed to execute command");

    let output = String::from_utf8_lossy(&output.stdout);

    assert!(output.contains("foo=bar"));

}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps