2019-04-11 15:23:14 -07:00
|
|
|
use crate::common::*;
|
2017-11-16 23:30:08 -08:00
|
|
|
|
2017-11-17 17:28:06 -08:00
|
|
|
pub const DEFAULT_SHELL: &str = "sh";
|
2017-11-16 23:30:08 -08:00
|
|
|
|
|
|
|
pub struct Configuration<'a> {
|
2018-12-08 14:29:41 -08:00
|
|
|
pub dry_run: bool,
|
|
|
|
pub evaluate: bool,
|
2017-11-16 23:30:08 -08:00
|
|
|
pub highlight: bool,
|
2019-04-11 15:23:14 -07:00
|
|
|
pub overrides: BTreeMap<&'a str, &'a str>,
|
2018-12-08 14:29:41 -08:00
|
|
|
pub quiet: bool,
|
|
|
|
pub shell: &'a str,
|
|
|
|
pub color: Color,
|
2018-08-31 00:04:06 -07:00
|
|
|
pub verbosity: Verbosity,
|
2017-11-16 23:30:08 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> Default for Configuration<'a> {
|
|
|
|
fn default() -> Configuration<'static> {
|
|
|
|
Configuration {
|
2018-12-08 14:29:41 -08:00
|
|
|
dry_run: false,
|
|
|
|
evaluate: false,
|
2017-11-16 23:30:08 -08:00
|
|
|
highlight: false,
|
|
|
|
overrides: empty(),
|
2018-12-08 14:29:41 -08:00
|
|
|
quiet: false,
|
|
|
|
shell: DEFAULT_SHELL,
|
|
|
|
color: default(),
|
2018-08-31 00:04:06 -07:00
|
|
|
verbosity: Verbosity::from_flag_occurrences(0),
|
2017-11-16 23:30:08 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|