Support yay arguments in config file (Closes #220) (#233)

This commit is contained in:
Idan Katz
2019-10-03 08:12:43 +03:00
committed by Roey Darwish Dror
parent 623929cb64
commit 11694247c1
4 changed files with 28 additions and 5 deletions

View File

@@ -61,6 +61,7 @@ pub struct ConfigFile {
git_arguments: Option<String>,
set_title: Option<bool>,
assume_yes: Option<bool>,
yay_arguments: Option<String>,
}
impl ConfigFile {
@@ -286,4 +287,13 @@ impl Config {
pub fn yes(&self) -> bool {
self.config_file.assume_yes.unwrap_or(self.opt.yes)
}
/// Extra yay arguments
#[cfg(target_os = "linux")]
pub fn yay_arguments(&self) -> &str {
match &self.config_file.yay_arguments {
Some(args) => args.as_str(),
None => "--devel",
}
}
}