Skip to content

Commit 21c1ede

Browse files
committed
improve readme
Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
1 parent f0f612f commit 21c1ede

File tree

3 files changed

+66
-4
lines changed

3 files changed

+66
-4
lines changed

Cargo.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
[package]
22
name = "environment"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
authors = ["Freyskeyd <simon.paitrault@gmail.com>"]
55
description = "Helper to deal with environment variables."
6-
license = "MIT"
7-
6+
license = "MIT OR Apache-2.0"
7+
repository = "https://github.com/Freyskeyd/environment.git"
8+
homepage = "https://github.com/Freyskeyd/environment"
9+
documentation = "http://docs.rs/environment/"
10+
readme = "README.md"
11+
keywords = ["environment", "env"]
812

913
[dependencies]

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Environment
2+
3+
> **Handle environment variable context** - This crate helps you to deal with environment variables.
4+
5+
[![Build Status](https://travis-ci.org/Freyskeyd/environment.svg)](https://travis-ci.org/Freyskeyd/environment) [![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation]
6+
7+
## Install
8+
9+
Just add it to your `Cargo.toml`:
10+
11+
```toml
12+
[dependencies]
13+
environment = "0.1"
14+
```
15+
16+
## Example
17+
18+
Here's a trivial example:
19+
20+
```rust
21+
extern crate environment;
22+
23+
use std::process::Command;
24+
25+
fn main() {
26+
let env = Environment::inherit().insert("foo", "bar");
27+
28+
29+
let mut c = Command::new("printenv");
30+
31+
let output = c.env_clear()
32+
.envs(env.compile())
33+
.output()
34+
.expect("failed to execute command");
35+
36+
let output = String::from_utf8_lossy(&output.stdout);
37+
38+
assert!(output.contains("foo=bar"));
39+
40+
}
41+
```
42+
43+
## License
44+
45+
Licensed under either of
46+
47+
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
48+
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
49+
50+
at your option.
51+
52+
### Contribution
53+
54+
Unless you explicitly state otherwise, any contribution intentionally
55+
submitted for inclusion in the work by you, as defined in the Apache-2.0
56+
license, shall be dual licensed as above, without any additional terms or
57+
conditions.
58+
59+
[Documentation]: https://docs.rs/environment

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ where
125125
#[cfg(test)]
126126
mod test {
127127
use super::*;
128-
use std::borrow::Cow;
129128
use std::process::Command;
130129

131130
#[test]

0 commit comments

Comments
 (0)