use clap::{ArgEnum, Parser};
use std::path::PathBuf;
#[derive(ArgEnum, Clone, Debug)]
pub enum Column {
Device,
Start,
End,
Sectors,
Size,
Type,
Guid,
Attributes,
Name,
}
#[derive(Parser, Debug)]
#[clap(version)]
pub struct Opt {
#[clap(short = 'l', long = "list")]
pub print: bool,
#[clap(
short = 'o',
long = "output",
arg_enum,
default_value = "device,start,end,sectors,size,type,guid,attributes,name",
use_value_delimiter = true
)]
pub columns: Vec<Column>,
#[clap(name = "DEVICE", parse(from_os_str))]
pub device: PathBuf,
#[clap(short = 'i', long = "init")]
pub init: bool,
#[clap(short = 'b', long = "sector-size")]
pub sector_size: Option<u64>,
#[clap(short = 'a', long = "align")]
pub align: Option<u64>,
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn verify_app() {
use clap::CommandFactory;
Opt::command().debug_assert();
}
}