Slightly prettier output

This commit is contained in:
Gwilym Inzani 2024-04-01 14:10:23 +01:00
parent 3f374f3e9c
commit 726b400463
2 changed files with 8 additions and 1 deletions

View file

@ -14,6 +14,7 @@ addr2line = { version = "0.21", default-features = false, features = [
"rustc-demangle",
"std-object",
] }
colored = "2"
[profile.dev]
opt-level = 3

View file

@ -2,6 +2,7 @@ use std::{fs, path::PathBuf};
use addr2line::{gimli, object};
use clap::Parser;
use colored::Colorize;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
@ -65,7 +66,12 @@ fn print_address(ctx: &addr2line::Context<impl gimli::Reader>, address: u64) ->
})
.unwrap_or_default();
println!("{function_name} ({}:{})", location.filename, location.line);
println!(
"{}\n\t{}:{}",
function_name.white(),
location.filename.green(),
location.line.to_string().green()
);
}
Ok(())