mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-07-08 01:31:53 +08:00
Allow to print stats when recv ctrlc
This commit is contained in:
@@ -1540,6 +1540,11 @@ lazy_static::lazy_static! {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _ = ctrlc::try_set_handler(|| {
|
||||
eprintln!("Aborted.");
|
||||
eprintln!("{}", std::ops::Deref::deref(&COUNTER));
|
||||
std::process::exit(1);
|
||||
});
|
||||
let arg = args::parse_args();
|
||||
if arg.backtrace {
|
||||
unsafe { std::env::set_var("RUST_LIB_BACKTRACE", "1") };
|
||||
|
||||
Reference in New Issue
Block a user