use clap::{Args, Subcommand, ValueHint};
use std::path::PathBuf;
#[derive(Subcommand, Debug, Clone)]
pub enum ScheduleSubcommand {
#[command(
long_about = "Create a durable scheduled task.\n\nExamples:\n vtcode schedule create --prompt \"check the deployment\" --every 10m\n vtcode schedule create --prompt \"review the nightly build\" --cron \"0 9 * * 1-5\"\n vtcode schedule create --reminder \"push the release branch\" --at \"15:00\""
)]
Create(ScheduleCreateArgs),
List,
Delete {
#[arg(value_name = "TASK_ID")]
id: String,
},
Serve,
#[command(name = "install-service")]
InstallService,
#[command(name = "uninstall-service")]
UninstallService,
}
#[derive(Args, Debug, Clone)]
pub struct ScheduleCreateArgs {
#[arg(long, value_name = "NAME")]
pub name: Option<String>,
#[arg(long, value_name = "PROMPT", conflicts_with = "reminder")]
pub prompt: Option<String>,
#[arg(long, value_name = "TEXT", conflicts_with = "prompt")]
pub reminder: Option<String>,
#[arg(long, value_name = "DURATION", conflicts_with_all = ["cron", "at"])]
pub every: Option<String>,
#[arg(long, value_name = "EXPR", conflicts_with_all = ["every", "at"])]
pub cron: Option<String>,
#[arg(long, value_name = "TIME", conflicts_with_all = ["every", "cron"])]
pub at: Option<String>,
#[arg(long, value_name = "PATH", value_hint = ValueHint::DirPath)]
pub workspace: Option<PathBuf>,
}