use crate::error::Result;
use async_trait::async_trait;
use clap::Args;
#[derive(Debug, Clone, Args)]
pub struct TaskCommand {
#[command(subcommand)]
pub action: TaskAction,
}
#[derive(Debug, Clone, clap::Subcommand)]
pub enum TaskAction {
Create {
description: String,
#[arg(long, default_value = "medium")]
priority: String,
},
List {
#[arg(long)]
status: Option<String>,
},
Assign {
task_id: String,
agent_id: String,
},
}
#[async_trait]
impl super::Command for TaskCommand {
async fn execute(self) -> Result<()> {
match self.action {
TaskAction::Create {
description,
priority,
} => {
tracing::info!("Creating task: {} with priority {}", description, priority);
}
TaskAction::List { status } => {
tracing::info!("Listing tasks with status: {:?}", status);
}
TaskAction::Assign { task_id, agent_id } => {
tracing::info!("Assigning task {} to agent {}", task_id, agent_id);
}
}
Ok(())
}
}