use clap::{Parser, ValueEnum};
#[derive(Parser, Debug, Clone)]
#[command(name = "list_dir")]
#[command(author = "Kamil Utku Mavi, <kamilutkumavi0@gmail.com>")]
#[command(version)]
#[command(
help_template = "{author-with-newline} {about-section}Version: {version} \n {usage-heading} {usage} \n {all-args} {tab}"
)]
#[command(name = "lists diroctory")]
pub struct Args {
#[arg(default_value_t=String::from("./"))]
pub path: String,
#[arg(long, short = 'H')]
pub hiden: bool,
#[arg(long, short = 'a')]
pub all: bool,
#[arg(long, short, value_enum,default_value_t = PType::All)]
pub p_type: PType,
#[arg(long, short, value_enum,default_value_t = SortType::Name)]
pub sort: SortType,
#[arg(long, short = 'o')]
pub one_col: bool,
#[arg(long, short = 'l')]
pub long: bool,
#[arg(long, short, default_value_t = false)]
pub recursive: bool,
#[arg(long, short, default_value_t = String::new())]
pub filter: String,
#[arg(long, short = 'S', default_value_t = String::new())]
pub search: String,
#[arg(long, short, default_value_t = false)]
pub color_test: bool,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
pub enum PType {
All,
File,
Dir,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
pub enum SortType {
Name,
Size,
}
pub fn pars_args() -> Args {
Args::parse()
}