use std::path::PathBuf;
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "tasks", version, about = "Markdown-based TODO task management CLI")]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Subcommand)]
pub enum Command {
Info,
Lib {
#[command(subcommand)]
command: LibCommand,
},
New {
title: String,
#[arg(short, long)]
priority: Option<String>,
#[arg(short, long = "tag")]
tags: Vec<String>,
#[arg(short, long)]
due: Option<String>,
#[arg(long)]
dir: Option<String>,
},
List {
#[arg(long)]
dir: Option<String>,
#[arg(short, long)]
status: Option<String>,
#[arg(short, long)]
tag: Option<String>,
#[arg(short, long)]
priority: Option<String>,
#[arg(long)]
due_before: Option<String>,
#[arg(long)]
due_after: Option<String>,
},
Search {
query: String,
#[arg(short, long)]
status: Option<String>,
#[arg(short, long)]
tag: Option<String>,
},
Tag {
#[command(subcommand)]
command: TagCommand,
},
Show { id: String },
Delete {
id: String,
#[arg(short, long)]
force: bool,
},
Start { id: String },
Done { id: String },
Cancel { id: String },
Status { id: String, status: String },
Set {
id: String,
#[arg(long)]
title: Option<String>,
#[arg(long)]
priority: Option<String>,
#[arg(long)]
due: Option<String>,
#[arg(long = "tag-add")]
tag_add: Vec<String>,
#[arg(long = "tag-remove")]
tag_remove: Vec<String>,
},
Edit {
id: Option<String>,
#[arg(long)]
editor: Option<String>,
#[arg(long = "lib")]
lib: bool,
},
}
#[derive(Subcommand)]
pub enum TagCommand {
Add {
id: String,
#[arg(required = true)]
tags: Vec<String>,
},
Remove {
id: String,
#[arg(required = true)]
tags: Vec<String>,
},
List,
}
#[derive(Subcommand)]
pub enum LibCommand {
Add { name: String, path: PathBuf },
List,
Use { name: String },
Current,
Remove { name: String },
}