Merge pull request #295 from matthiasbeyer/libimagrt/config-for-everyone

Libimagrt/config for everyone
This commit is contained in:
Matthias Beyer 2016-03-26 21:29:40 +01:00
commit ee61d079bd
2 changed files with 17 additions and 0 deletions

View file

@ -1,5 +1,6 @@
use std::path::PathBuf; use std::path::PathBuf;
use std::result::Result as RResult; use std::result::Result as RResult;
use std::ops::Deref;
use toml::{Parser, Value}; use toml::{Parser, Value};
@ -169,6 +170,15 @@ impl Configuration {
} }
impl Deref for Configuration {
type Target = Value;
fn deref(&self) -> &Value {
&self.config
}
}
fn get_verbosity(v: &Value) -> bool { fn get_verbosity(v: &Value) -> bool {
match v { match v {
&Value::Table(ref t) => t.get("verbose") &Value::Table(ref t) => t.get("verbose")

View file

@ -238,6 +238,13 @@ impl<'a> Runtime<'a> {
&self.cli_matches &self.cli_matches
} }
/**
* Get the configuration object
*/
pub fn config(&self) -> Option<&Configuration> {
self.configuration.as_ref()
}
/** /**
* Get the store object * Get the store object
*/ */