Ajout : module error
This commit is contained in:
parent
1de0e1674e
commit
802e97387a
1 changed files with 8 additions and 0 deletions
8
src/error.rs
Normal file
8
src/error.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
use std::path::Path;
|
||||
|
||||
pub fn print_error(message: String) {
|
||||
let name = std::env::args().next().unwrap();
|
||||
let name = Path::new(&name).file_name().unwrap().to_str().unwrap();
|
||||
|
||||
eprintln!("{}: {}", name, message);
|
||||
}
|
Loading…
Reference in a new issue