use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(version, about)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Commands>,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
Dbs {
#[command(subcommand)]
command: Option<DbCommands>,
},
Lists {
#[command(subcommand)]
command: Option<ListCommands>,
},
Items {
#[command(subcommand)]
command: Option<ItemCommands>,
},
}
#[derive(Subcommand, Debug)]
pub enum DbCommands {
Show,
Add {
#[arg(short, long)]
name: String,
},
}
#[derive(Subcommand, Debug)]
pub enum ListCommands {
Show {
#[arg(short, long)]
name: Option<String>,
},
Add {
#[arg(short, long)]
name: String,
#[arg(short, long)]
db: Option<String>,
},
Delete {
#[arg(short, long)]
name: Option<String>,
#[arg(short, long)]
id: Option<i64>,
#[arg(short, long)]
db: Option<String>,
},
}
#[derive(Subcommand, Debug)]
pub enum ItemCommands {
Show,
Add {
#[arg(short, long)]
name: String,
#[arg(short, long)]
db: Option<String>,
#[arg(short, long)]
list_name: Option<String>,
#[arg(short = 'i', long)]
list_id: Option<i64>,
},
Delete {
#[arg(short, long)]
id: i64,
#[arg(short, long)]
db: Option<String>,
},
ToggleDone {
#[arg(short, long)]
id: i64,
#[arg(short, long)]
db: Option<String>,
},
}