Tons of cleanup. More useless git notices.
This commit is contained in:
18
src/cli.rs
18
src/cli.rs
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user