rust_calendar/
options.rs

1use clap::*;
2#[derive(Parser)]
3#[command(name = "rust-calendar")]
4#[command(author = "Mogmoug <mogmoug123@outlook.com>")]
5#[command(version = "0.1.1")]
6#[command(about = "A calendar command-line tool written in rust", long_about = None)]
7pub struct Cil{
8    #[command(subcommand)]
9    pub command: Option<Commands>,
10    /// The first day of the week.Sunday(0) or Monday(1).
11    #[arg(short,long,default_value_t = 0)]
12    pub the_first_day_of_the_week: i8,
13}
14
15#[derive(Subcommand)]
16pub enum Commands {
17    #[command(about = "Now get the calendar for this month.")]
18    Now,
19    #[command(about = "Usage: rust-calendar date [YEAR] [MONTH]\nGet the calendar for a month and year.")]
20    Date{
21        year: Option<String>,
22        month: Option<String>
23    },
24    #[command(about = "Debug output information.")]
25    DebugInfo
26}