ft: add dump flag

This commit is contained in:
2025-05-28 15:59:37 +09:00
parent 7e8fdeba54
commit 4c63b7a21a
3 changed files with 24 additions and 10 deletions

View File

@@ -28,6 +28,10 @@ struct Args {
/// Path of the binary
#[arg(short, long, global = true)]
path: Option<String>,
/// Dump progress of disassembly, in case of encountering an error.
#[arg(short, long, global = true, action)]
dump: bool,
}
fn main() {
@@ -39,7 +43,7 @@ fn main() {
match args.command {
Command::Disasm => {
let mut disasm = Disassembler::new(&args);
let instructions = disasm.disassemble();
let instructions = disasm.disassemble(args.dump);
match instructions {
Ok(instrs) => instrs.iter().for_each(|i| println!("{i}")),
_ => {}