Skip to content

Commit

Permalink
Update the library documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
workanator committed Nov 15, 2015
1 parent c9292d5 commit 2b36b8b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,25 @@
//! The crate has an ability to inject environment variables into the configuration file. That
//! becomes possible using special syntax:
//!
//! * $"SOME_ENV_VAR_NAME"::bool for `ScalarValue::Boolean`
//! * $"SOME_ENV_VAR_NAME"::str for `ScalarValue::Str`
//! * $"SOME_ENV_VAR_NAME"::i32 for `ScalarValue::Integer32`
//! * $"SOME_ENV_VAR_NAME"::i64 for `ScalarValue::Integer64`
//! * $"SOME_ENV_VAR_NAME"::f32 for `ScalarValue::Floating32`
//! * $"SOME_ENV_VAR_NAME"::f64 for `ScalarValue::Floating64`
//! * `$"SOME_ENV_VAR_NAME"::str` to inject the environment variables `SOME_ENV_VAR_NAME` as the string value.
//! No additiocal changes are made ot the value.
//! * `$"SOME_ENV_VAR_NAME"::bool` to inject the environment variables `SOME_ENV_VAR_NAME` as the boolean value.
//! The value `true` or `yes` or `on` or `1` are converted into `true` otherwise into `false`.
//! * `$"SOME_ENV_VAR_NAME"::int` to inject the environment variables `SOME_ENV_VAR_NAME` as the integer value.
//! The successfully parsed value is injected as `i32` or `i64`, depending on the format, otherwise `0i32` is injected.
//! * `$"SOME_ENV_VAR_NAME"::flt` to inject the environment variables `SOME_ENV_VAR_NAME` as the floating value.
//! The successfully parsed value is injected as `f32` or `f64`, depending on the format, otherwise `0f32` is injected.
//!
//!
//! **Example**:
//!
//! ```ignore
//! #!/bin/sh
//! export LOG_LEVEL=debug
//! ```
//!
//! ```ignore
//! // Configuration file
//! log = {
//! // Inject (use) the value of the environment variable LOG_LEVEL
//! level = $"LOG_LEVEL"::str;
Expand Down

0 comments on commit 2b36b8b

Please sign in to comment.