Added extra config option to highlight optdepends

i18n
Michal S 2 years ago
parent 49c3664c26
commit 719faf7124
No known key found for this signature in database
GPG Key ID: A6A1A4DCB22279B9

@ -14,6 +14,7 @@ pub struct Config {
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct ConfigBase { pub struct ConfigBase {
pub pacdiff_warn: bool, pub pacdiff_warn: bool,
pub highlight_optdepends: bool,
pub powerpill: bool, pub powerpill: bool,
} }
@ -29,6 +30,7 @@ impl Default for Config {
Self { Self {
base: ConfigBase { base: ConfigBase {
pacdiff_warn: true, pacdiff_warn: true,
highlight_optdepends: true,
powerpill: false, powerpill: false,
}, },
extra: ConfigExtra { extra: ConfigExtra {

@ -42,6 +42,7 @@ pub fn init(options: Options) {
let config = "\ let config = "\
[base] [base]
pacdiff_warn = true pacdiff_warn = true
highlight_optdepends = true
powerpill = false powerpill = false
[extra] [extra]

@ -93,6 +93,7 @@ fn cmd_install(args: InstallArgs, options: Options, cachedir: &str) {
// Initialise variables // Initialise variables
let packages = args.packages; let packages = args.packages;
let sorted = sort(&packages, options); let sorted = sort(&packages, options);
let config = internal::config::read();
info!("Attempting to install packages: {}", packages.join(", ")); info!("Attempting to install packages: {}", packages.join(", "));
@ -115,7 +116,7 @@ fn cmd_install(args: InstallArgs, options: Options, cachedir: &str) {
} }
// Show optional dependencies for installed packages // Show optional dependencies for installed packages
if packages.len() > 1 { if packages.len() > 1 && config.base.highlight_optdepends {
info!("Showing optional dependencies for installed packages"); info!("Showing optional dependencies for installed packages");
for p in packages { for p in packages {
info!("{}:", p); info!("{}:", p);

Loading…
Cancel
Save