use clap::Subcommand;
use crate::daemon::client::DaemonClient;
#[derive(Subcommand, Debug)]
pub enum IssueCommands {
Plan {
number: u64,
},
Build {
number: u64,
#[arg(long)]
auto_approve: bool,
},
}
pub async fn handle(command: IssueCommands, client: &mut DaemonClient) -> anyhow::Result<()> {
match command {
IssueCommands::Plan { number } => {
println!("[plan_issue] Planning issue #{number}...");
super::run_workflow_chain(client, "plan_issue", number, 1, false).await
}
IssueCommands::Build {
number,
auto_approve,
} => {
if auto_approve {
println!("[implement_issue] Building issue #{number} (auto-approve)...");
} else {
println!("[implement_issue] Building issue #{number}...");
}
super::run_workflow_chain(client, "implement_issue", number, 1, !auto_approve).await
}
}
}