---
to: "{{ project_name }}/src/cmds/{{ noun }}/{{ verb }}.rs"
vars:
  noun: "resource"
  verb: "get"
  noun_description: "resource"
---
//! {{ verb | capitalize }} {{ noun_description }} command

use clap_noun_verb_macros::verb;
use clap_noun_verb::Result;
use serde::Serialize;

#[derive(Debug, Serialize)]
pub struct GetResult {
    id: String,
    name: String,
    description: String,
    created_at: String,
    status: String,
}

/// Get details for a {{ noun_description }}
#[verb] // Verb "get" auto-inferred, noun "{{ noun }}" auto-inferred from directory
pub fn get_{{ noun }}(
    /// ID or name of the {{ noun_description }}
    #[arg(index = 0)]
    id: String,
    /// Show detailed information
    #[arg(short, long)]
    detailed: bool,
) -> Result<GetResult> {
    // TODO: Implement get logic here
    let result = GetResult {
        id: id.clone(),
        name: format!("{{ noun }}-{}", id),
        description: "Example {{ noun_description }}".to_string(),
        created_at: "2025-10-10T12:00:00Z".to_string(),
        status: "active".to_string(),
    };

    Ok(result)
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_{{ verb }}_basic() {
        let result = get_{{ noun }}("test-123".to_string(), false);
        assert!(result.is_ok());
        let output = result.unwrap();
        assert_eq!(output.id, "test-123");
    }
}
