Merge branch 'master' into on-demand-les-request

This commit is contained in:
Robert Habermeier
2016-12-28 14:00:33 +01:00
385 changed files with 9443 additions and 6152 deletions

View File

@@ -94,7 +94,7 @@ notify_work = ["http://localhost:3001"]
[footprint]
tracing = "auto"
pruning = "auto"
pruning_history = 64
pruning_history = 1200
cache_size_db = 64
cache_size_blocks = 8
cache_size_queue = 50

View File

@@ -238,7 +238,7 @@ usage! {
or |c: &Config| otry!(c.footprint).tracing.clone(),
flag_pruning: String = "auto",
or |c: &Config| otry!(c.footprint).pruning.clone(),
flag_pruning_history: u64 = 64u64,
flag_pruning_history: u64 = 1200u64,
or |c: &Config| otry!(c.footprint).pruning_history.clone(),
flag_cache_size_db: u32 = 64u32,
or |c: &Config| otry!(c.footprint).cache_size_db.clone(),
@@ -632,7 +632,7 @@ mod tests {
// -- Footprint Options
flag_tracing: "auto".into(),
flag_pruning: "auto".into(),
flag_pruning_history: 64u64,
flag_pruning_history: 1200u64,
flag_cache_size_db: 64u32,
flag_cache_size_blocks: 8u32,
flag_cache_size_queue: 50u32,

View File

@@ -137,7 +137,7 @@ macro_rules! usage {
impl Args {
pub fn parse<S: AsRef<str>>(command: &[S]) -> Result<Self, ArgsError> {
let raw_args = try!(RawArgs::parse(command));
let raw_args = RawArgs::parse(command)?;
// Skip loading config file if no_config flag is specified
if raw_args.flag_no_config {
@@ -151,8 +151,8 @@ macro_rules! usage {
(Ok(mut file), _) => {
println_stderr!("Loading config file from {}", &config_file);
let mut config = String::new();
try!(file.read_to_string(&mut config).map_err(|e| ArgsError::Config(config_file, e)));
try!(Self::parse_config(&config))
file.read_to_string(&mut config).map_err(|e| ArgsError::Config(config_file, e))?;
Self::parse_config(&config)?
},
// Don't display error in case default config cannot be loaded.
(Err(_), false) => Config::default(),
@@ -172,7 +172,7 @@ macro_rules! usage {
#[cfg(test)]
fn parse_with_config<S: AsRef<str>>(command: &[S], config: Config) -> Result<Self, ArgsError> {
Ok(try!(RawArgs::parse(command)).into_args(config))
RawArgs::parse(command).map(|raw| raw.into_args(config)).map_err(ArgsError::Docopt)
}
fn parse_config(config: &str) -> Result<Config, ArgsError> {