Huge refactor. Introduce anyhow for error handling.

This commit is contained in:
Cutieguwu
2025-12-29 15:31:01 -05:00
parent e98383d9e5
commit 4b5460f754
13 changed files with 411 additions and 746 deletions

32
src/cli.rs Normal file
View File

@@ -0,0 +1,32 @@
use std::path::PathBuf;
use crate::FB_SECTOR_SIZE;
use clap::Parser;
#[derive(Parser, Debug)]
pub struct Args {
/// Path to source file or block device
#[arg(short, long, value_hint = clap::ValueHint::DirPath)]
pub input: PathBuf,
/// Path to output file. Defaults to {input}.iso
#[arg(short, long, value_hint = clap::ValueHint::DirPath)]
pub output: Option<PathBuf>,
/// Path to rescue map. Defaults to {input}.map
#[arg(short, long, value_hint = clap::ValueHint::DirPath)]
pub map: Option<PathBuf>,
/// Max number of consecutive sectors to test as a group
#[arg(short, long, default_value_t = 128)]
pub cluster_length: u16,
/// Number of brute force read passes
#[arg(short, long, default_value_t = 2)]
pub brute_passes: usize,
/// Sector size
#[arg(short, long, default_value_t = FB_SECTOR_SIZE)]
pub sector_size: u16,
}