1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
//! # Lazyf
//!
//! Lazyf is both a file format, and a mechanism for loading configurations.
//! It's primary aim is to allow the user to be as lazy as possible when
//! trying to get user options out of their code.
//!
//! With lazyf user options come from two places. -Flags and config files.
//! The cfg (config) module combines the lzlist (lazyfile) module and the
//! flag module
//!
//! The lazyf file format basically looks like this (ignore quotes):
//!
//! ```
//! "
//! Superman:
//! power:Flying
//! age:29
//!
//! Batman:
//! power:Money
//! age:40
//! ";
//! ```
//!
//! The simplesy way to get config options is:
//!
//! ```
//! use lazyf::{Cfg,SGetter};
//!
//! let cf = Cfg::load_first("-c", &["--config-location--"]);
//! let age = cf.get_t_def(("-bman","Batman.age"),10);
//! //age == 40
//! ```
//!
//! In this config location will be the location specified after the flag -c
//! or the first of the config locations to return a result.
//! if none are found a Cfg is still returned, as flags can still be used.
//!
pub mod flag;
pub use flag::Fg;
pub mod lzlist;
pub use lzlist::{LzList,Lz};
pub mod cfg;
pub use cfg::Cfg;
pub mod brace;
pub mod get;
pub use get::SGetter;
pub mod lz_err;
pub use lz_err::LzErr;
//make trait public
#[cfg(test)]
mod tests;