cascade_cli/cli/commands/
version.rs

1use crate::errors::Result;
2
3/// Show version information
4pub async fn run() -> Result<()> {
5    println!("🌊 Cascade CLI");
6    println!("━━━━━━━━━━━━━━━");
7    println!("Version: {}", env!("CARGO_PKG_VERSION"));
8    println!("Authors: {}", env!("CARGO_PKG_AUTHORS"));
9    println!("Homepage: {}", env!("CARGO_PKG_HOMEPAGE"));
10    println!("Description: {}", env!("CARGO_PKG_DESCRIPTION"));
11
12    println!("\nšŸ“‹ Build Information:");
13    println!("  Rust version: {}", env!("CARGO_PKG_RUST_VERSION"));
14    println!("  Target: {}", std::env::consts::ARCH);
15    println!("  OS: {}", std::env::consts::OS);
16
17    #[cfg(debug_assertions)]
18    println!("  Build type: Debug");
19    #[cfg(not(debug_assertions))]
20    println!("  Build type: Release");
21
22    println!("\nšŸ“¦ Key Dependencies:");
23    println!("  clap: 4.0+");
24    println!("  git2: 0.18+");
25    println!("  reqwest: 0.11+");
26    println!("  tokio: 1.0+");
27    println!("  serde: 1.0+");
28
29    println!("\nšŸ”— Links:");
30    println!("  Repository: https://github.com/your-org/cascade-cli");
31    println!("  Issues: https://github.com/your-org/cascade-cli/issues");
32    println!("  Documentation: https://github.com/your-org/cascade-cli/wiki");
33
34    println!("\nšŸ’” Quick Start:");
35    println!("  Initialize repository: ca init");
36    println!("  Show help: ca --help");
37    println!("  Check status: ca status");
38
39    Ok(())
40}
41
42#[cfg(test)]
43mod tests {
44    use super::*;
45
46    #[tokio::test]
47    async fn test_version_command() {
48        let result = run().await;
49        assert!(result.is_ok());
50    }
51}