use anyhow::Result;
use clap::Args;
#[derive(Args, Clone)]
pub struct VersionArgs {
#[arg(short = 'd', long = "detailed")]
pub detailed: bool,
#[arg(short = 'b', long = "build-info")]
pub build_info: bool,
}
pub async fn execute(args: VersionArgs) -> Result<()> {
use crate::cli::banner;
let git_branch = option_env!("GIT_BRANCH").unwrap_or("unknown");
banner::print_banner(None);
if args.build_info {
println!("\n📦 Build Information:");
println!(" Version: {}", env!("CARGO_PKG_VERSION"));
println!(" Commit: {}", env!("GIT_SHA"));
println!(" Branch: {}", git_branch);
println!(" Target: {}", env!("TARGET"));
println!(" Profile: {}", env!("PROFILE"));
println!(" Rustc: {}", env!("RUSTC_VERSION"));
println!(" Built: {}", env!("BUILD_TIMESTAMP"));
println!();
println!("📋 Package Details:");
println!(" Name: {}", env!("CARGO_PKG_NAME"));
println!(" Repository: {}", env!("CARGO_PKG_REPOSITORY"));
println!(" License: {}", env!("CARGO_PKG_LICENSE"));
println!(" Description: {}", env!("CARGO_PKG_DESCRIPTION"));
} else if args.detailed {
println!("\nBranch: {git_branch}");
println!("Rust Edition: 2024");
println!("Built with: clap 4.5.41, tokio 1.46.1, dialoguer 0.11.0");
println!("Repository: {}", env!("CARGO_PKG_REPOSITORY"));
println!("License: {}", env!("CARGO_PKG_LICENSE"));
println!("Description: {}", env!("CARGO_PKG_DESCRIPTION"));
}
Ok(())
}