#![deny(missing_docs)]
use std::path::PathBuf;
use clap::{Args, Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub op: Option<Op>,
}
#[derive(Subcommand, Debug)]
pub enum Op {
List(ListArg),
Add(AddArg),
Done,
Edit(EditArg),
Delete(DeleteArg),
}
#[derive(Debug, Default, Args)]
pub struct ListArg {
#[arg(short, long)]
output: Option<bool>,
#[arg(short)]
number: Option<usize>,
}
#[derive(Args, Debug)]
pub struct AddArg {
pub title: String,
#[arg(short, long, requires = "title")]
pub description: Option<String>,
}
#[derive(Debug, Args)]
pub struct EditArg {
pub id: i64,
#[arg(short, long)]
pub title: Option<String>,
#[arg(short, long)]
pub description: Option<String>,
}
#[derive(Debug, Args)]
pub struct DeleteArg {
pub id: i64,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn verify_cli() {
use clap::CommandFactory;
Cli::command().debug_assert();
}
}