Tons of cleanup. More useless git notices.

This commit is contained in:
Cutieguwu
2025-12-31 17:22:57 -05:00
parent ae3b5d8855
commit 2da0ab11e5
6 changed files with 155 additions and 140 deletions

View File

@@ -1,10 +1,13 @@
use std::path::PathBuf;
use std::sync::LazyLock;
use crate::FB_SECTOR_SIZE;
use clap::Parser;
use clap::{ArgAction, Parser};
#[derive(Parser, Debug)]
pub static CONFIG: LazyLock<Args> = LazyLock::new(|| Args::parse());
#[derive(Parser, Debug, Clone)]
pub struct Args {
/// Path to source file or block device
#[arg(short, long, value_hint = clap::ValueHint::DirPath)]
@@ -20,7 +23,7 @@ pub struct Args {
/// Max number of consecutive sectors to test as a group
#[arg(short, long, default_value_t = 128)]
pub cluster_length: u16,
pub cluster_length: usize,
/// Number of brute force read passes
#[arg(short, long, default_value_t = 2)]
@@ -28,5 +31,12 @@ pub struct Args {
/// Sector size
#[arg(short, long, default_value_t = FB_SECTOR_SIZE)]
pub sector_size: u16,
pub sector_size: usize,
// Behaviour is backwards.
// ArgAction::SetFalse by default evaluates to true,
// ArgAction::SetTrue by default evaluates to false.
/// Whether to reopen the file on a read error or not.
#[arg(short, long, action=ArgAction::SetTrue)]
pub reopen_on_error: bool,
}