style(lib): use a standard format for error messages

This commit is contained in:
Orhun Parmaksız 2021-11-22 20:54:14 +03:00
parent f59b808ffa
commit ad7dfa48ed
No known key found for this signature in database
GPG key ID: F83424824B3E4B90
4 changed files with 5 additions and 5 deletions

View file

@ -241,7 +241,7 @@ impl Sysctl {
parameters.push(parameter);
}
Err(e) => {
eprintln!("{} ({})", e, ctl.name()?);
eprintln!("error: `{} ({})`", e, ctl.name()?);
}
}
}

View file

@ -40,7 +40,7 @@ impl<'a> App<'a> {
fn fetch_documentation(&mut self, kernel_docs: &Path) -> Result<()> {
if !kernel_docs.exists() {
eprintln!(
"WARN: Linux kernel documentation is not found in path: {:?}",
"warning: Linux kernel documentation is not found in path: {:?}",
kernel_docs.to_string_lossy()
);
}
@ -63,7 +63,7 @@ impl<'a> App<'a> {
}
}
Err(e) => {
eprintln!("Pager error: {}", e);
eprintln!("error: `pager error: {}`", e);
fallback_to_default = true;
}
}

View file

@ -56,7 +56,7 @@ impl Args {
let matches = opts
.parse(&env::args().collect::<Vec<String>>()[1..])
.map_err(|e| eprintln!("error: {}", e))
.map_err(|e| eprintln!("error: `{}`", e))
.ok()?;
let required_args_present = matches.opt_present("a")

View file

@ -6,7 +6,7 @@ fn main() {
match systeroid::run(args) {
Ok(_) => process::exit(0),
Err(e) => {
eprintln!("{}", e);
eprintln!("error: `{}`", e);
process::exit(1)
}
}