---
to: "src/commands/nouns/{{ name | snake_case }}_command.rs"
vars:
  name: "NamespaceCommand"
  noun: "Namespace"
  description: "Namespace noun command handler"
---

use clap::Parser;
use crate::CommandResult;

/// Namespace command for noun-verb CLI
#[derive(Parser, Debug)]
#[command(name = "Namespace_LOWER")]
#[command(about = "Namespace operations")]
pub struct NamespaceCommand {
    /// The action to perform
    #[arg(value_name = "ACTION")]
    pub action: String,

    /// Additional arguments
    #[arg(trailing_var_arg = true, allow_hyphen_values = true)]
    pub args: Vec<String>,
}

impl NamespaceCommand {
    /// Execute the Namespace command
    pub async fn execute(&self) -> CommandResult<String> {
        match self.action.as_str() {
            "create" => self.create().await,
            "read" | "get" => self.read().await,
            "update" => self.update().await,
            "delete" | "remove" => self.delete().await,
            "list" => self.list().await,
            _ => Err(format!("Unknown Namespace_LOWER action: {}", self.action).into()),
        }
    }

    async fn create(&self) -> CommandResult<String> {
        Ok(format!("Creating new Namespace_LOWER"))
    }

    async fn read(&self) -> CommandResult<String> {
        Ok(format!("Reading Namespace_LOWER"))
    }

    async fn update(&self) -> CommandResult<String> {
        Ok(format!("Updating Namespace_LOWER"))
    }

    async fn delete(&self) -> CommandResult<String> {
        Ok(format!("Deleting Namespace_LOWER"))
    }

    async fn list(&self) -> CommandResult<String> {
        Ok(format!("Listing Namespace_LOWERs"))
    }
}
