Merge pull request #295 from matthiasbeyer/libimagrt/config-for-everyone
Libimagrt/config for everyone
This commit is contained in:
commit
ee61d079bd
2 changed files with 17 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
use std::path::PathBuf;
|
||||
use std::result::Result as RResult;
|
||||
use std::ops::Deref;
|
||||
|
||||
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 {
|
||||
match v {
|
||||
&Value::Table(ref t) => t.get("verbose")
|
||||
|
|
|
@ -238,6 +238,13 @@ impl<'a> Runtime<'a> {
|
|||
&self.cli_matches
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the configuration object
|
||||
*/
|
||||
pub fn config(&self) -> Option<&Configuration> {
|
||||
self.configuration.as_ref()
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the store object
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue