use clap::{Parser, ValueEnum};
#[derive(Parser, Debug)]
#[command(
name = "df",
version,
about = "Advanced disk free utility - modern alternative to df command",
long_about = "A modern, fast, and feature-rich disk usage viewer with multiple output formats and real-time monitoring capabilities.",
author = "Hadi Cahyadi <cumulus13@gmail.com>",
after_help = "Examples:\n df\n df -H\n df /home\n df --output json\n df --watch 5\n df -H -t ext4\n df --sort percent -r\n\nConfig file locations:\n Windows: %APPDATA%\\df3\\config.toml\n Linux/macOS: ~/.config/df3/config.toml",
display_order = 1
)]
pub struct Cli {
#[arg(short = 'H', long, default_value_t = true)]
pub human_readable: bool,
#[arg(short = 'l', long)]
pub local_only: bool,
#[arg(short = 'a', long)]
pub all: bool,
#[arg(short = 'i', long)]
pub inodes: bool,
#[arg(short = 'o', long, value_enum, default_value_t = OutputFormat::Table)]
pub output: OutputFormat,
#[arg(short = 'B', long, default_value_t = 1024)]
pub block_size: u64,
#[arg(short = 't', long = "type")]
pub fs_type: Vec<String>,
#[arg(short = 'x', long = "exclude-type")]
pub exclude_type: Vec<String>,
#[arg(short = 'S', long, value_enum)]
pub sort: Option<SortField>,
#[arg(short = 'r', long)]
pub reverse: bool,
#[arg(long)]
pub total: bool,
#[arg(short = 's', long)]
pub sync: bool,
#[arg(short = 'w', long, default_value_t = 0)]
pub watch: u64,
#[arg(short = 'c', long)]
pub config: Option<String>,
#[arg(short = 'V', long)]
pub version: bool,
#[arg()]
pub mounts: Vec<String>,
}
#[derive(ValueEnum, Clone, Debug, PartialEq)]
pub enum OutputFormat {
Table,
Json,
Csv,
Inodes,
}
#[derive(ValueEnum, Clone, Debug, PartialEq)]
pub enum SortField {
Filesystem,
Size,
Used,
Avail,
Percent,
Mounted,
}
pub fn parse() -> Cli {
Cli::parse()
}