fix(sysctl): suppress error messages if -e flag is given

This commit is contained in:
Orhun Parmaksız 2022-03-06 02:02:11 +03:00
parent 8a10f39f05
commit 449b52c57d
No known key found for this signature in database
GPG key ID: F83424824B3E4B90

View file

@ -71,7 +71,7 @@ impl Sysctl {
|| param.get_absolute_name() == Some(&query.replace('/', "."))
})
.collect::<Vec<&Parameter>>();
if parameters.is_empty() {
if parameters.is_empty() && !self.config.ignore_errors {
eprintln!(
"{}: cannot stat {}{}: No such file or directory",
env!("CARGO_PKG_NAME").split('-').collect::<Vec<_>>()[0],