1use clap::{Parser, ValueEnum};
2use std::path::PathBuf;
3
4#[derive(Parser)]
5#[command(
6 name = "bilal",
7 version,
8 about = "Bilal [A CLI salah time]",
9 after_long_help = "Bugs can be reported on GitHub: https://github.com/azzamsa/bilal/issues"
10)]
11#[derive(Debug)]
12pub struct Opts {
13 #[arg(value_enum)]
15 pub mode: Mode,
16
17 #[arg(short = 'J', long)]
19 pub json: bool,
20
21 #[arg(
23 short,
24 long,
25 value_enum,
26 default_value_t = Color::Auto,
27 )]
28 pub color: Color,
29
30 #[arg(long)]
32 pub config: Option<PathBuf>,
33}
34
35#[derive(Debug, Clone, ValueEnum)]
36pub enum Mode {
37 All,
38 Next,
39 Current,
40}
41
42#[derive(Debug, Clone, ValueEnum)]
43pub enum Color {
44 Auto,
46 Always,
48 Never,
50}
51
52impl Color {
53 #[must_use]
54 pub fn as_str(&self) -> &'static str {
55 match self {
56 Color::Auto => "auto",
57 Color::Never => "never",
58 Color::Always => "always",
59 }
60 }
61}