use clap::{Parser, ValueEnum};
#[derive(Parser)]
#[command(
name = "bilal",
version,
about = "Bilal [A CLI salah time]",
after_long_help = "Bugs can be reported on GitHub: https://github.com/azzamsa/bilal/issues"
)]
#[derive(Debug)]
pub struct Opts {
#[arg(value_enum)]
pub mode: Mode,
#[arg(short = 'J', long)]
pub json: bool,
#[arg(
short,
long,
value_enum,
default_value_t = Color::Auto,
)]
pub color: Color,
}
#[derive(Debug, Clone, ValueEnum)]
pub enum Mode {
All,
Next,
Current,
}
#[derive(Debug, Clone, ValueEnum)]
pub enum Color {
Auto,
Always,
Never,
}
impl Color {
pub fn as_str(&self) -> &'static str {
match self {
Color::Auto => "auto",
Color::Never => "never",
Color::Always => "always",
}
}
}