Add configuration file parsing for reporting mode
This commit is contained in:
parent
aa30137300
commit
d9deb9025b
1 changed files with 8 additions and 0 deletions
|
@ -19,6 +19,7 @@ pub struct Configuration {
|
||||||
pub store_sub : String,
|
pub store_sub : String,
|
||||||
pub editor : Option<String>,
|
pub editor : Option<String>,
|
||||||
pub editor_opts : String,
|
pub editor_opts : String,
|
||||||
|
pub report_exit : bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Configuration {
|
impl Configuration {
|
||||||
|
@ -32,18 +33,21 @@ impl Configuration {
|
||||||
let store_sub = String::from(cfg.lookup_str("store").unwrap_or("/store"));
|
let store_sub = String::from(cfg.lookup_str("store").unwrap_or("/store"));
|
||||||
let editor = cfg.lookup_str("editor").map(String::from);
|
let editor = cfg.lookup_str("editor").map(String::from);
|
||||||
let editor_opts = String::from(cfg.lookup_str("editor-opts").unwrap_or(""));
|
let editor_opts = String::from(cfg.lookup_str("editor-opts").unwrap_or(""));
|
||||||
|
let report_exit = cfg.lookup_boolean("report-exit").unwrap_or(false);
|
||||||
|
|
||||||
debug!("Building configuration");
|
debug!("Building configuration");
|
||||||
debug!(" - store sub : {}", store_sub);
|
debug!(" - store sub : {}", store_sub);
|
||||||
debug!(" - runtimepath: {}", rtp);
|
debug!(" - runtimepath: {}", rtp);
|
||||||
debug!(" - editor : {:?}", editor);
|
debug!(" - editor : {:?}", editor);
|
||||||
debug!(" - editor-opts: {}", editor_opts);
|
debug!(" - editor-opts: {}", editor_opts);
|
||||||
|
debug!(" - report exit: {}", report_exit);
|
||||||
|
|
||||||
Configuration {
|
Configuration {
|
||||||
store_sub: store_sub,
|
store_sub: store_sub,
|
||||||
rtp: rtp,
|
rtp: rtp,
|
||||||
editor: editor,
|
editor: editor,
|
||||||
editor_opts: editor_opts,
|
editor_opts: editor_opts,
|
||||||
|
report_exit: report_exit,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +73,10 @@ impl Configuration {
|
||||||
self.editor_opts.clone()
|
self.editor_opts.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn report_exit(&self) -> bool {
|
||||||
|
self.report_exit
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue