zinit 0.3.9

Process supervisor with dependency management
Documentation
//! Version information for zinit and binaries.
//!
//! All binaries use the same version from Cargo.toml, automatically
//! synchronized at build time.

/// Get the zinit version string
/// This is automatically set from Cargo.toml at build time
pub fn version() -> &'static str {
    env!("CARGO_PKG_VERSION")
}

/// Get the full version information
pub fn full_version() -> String {
    format!("zinit v{}", version())
}

/// Get version info for a specific binary
pub fn binary_version(binary: &str) -> String {
    format!("{} v{}", binary, version())
}

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

    #[test]
    fn test_version_format() {
        let ver = version();
        assert!(!ver.is_empty());
        // Should be semantic version like "0.1.0"
        assert!(ver.chars().next().unwrap().is_numeric());
    }

    #[test]
    fn test_full_version_format() {
        let full = full_version();
        assert!(full.starts_with("zinit v"));
    }

    #[test]
    fn test_binary_version_format() {
        let bin_ver = binary_version("zinit-server");
        assert!(bin_ver.starts_with("zinit-server v"));
    }
}