-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.rs
More file actions
23 lines (20 loc) · 742 Bytes
/
main.rs
File metadata and controls
23 lines (20 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! CLI interface to allow regex based file renaming
//!
//! # Example:
//! ```bash
//! clear; el; carr -- '(C|c)argo.*(\..*)' --rep '$1ogra$2' --preview
//! clear; el; carr -- '(C|c)argo.*(\..*)' --rep '${1}ogra$2' --preview
//! ```
use clap::Parser;
use rename_files::{Args, app, error::Result, logging};
fn main() -> Result<()> {
logging::tracing_subscribe_boilerplate("warn");
let args = Args::parse();
match app(&args) {
Ok(()) => Ok(()), // ensures that change to app success value isn't erased by call code
Err(e) => {
eprintln!("Error: {}", e); // bubling error will not pretty-print cause
std::process::exit(1);
}
}
}