vios_app 0.1.1

Small JSON vaults: Argon2id + AES-GCM, with optional AAD binding.
Documentation
// src/build_info.rs
use std::sync::Once;

/// Compile-time values injected by build.rs (or Cargo), with sensible fallbacks.
pub fn pkg_name() -> &'static str {
    env!("CARGO_PKG_NAME")
}
pub fn pkg_version() -> &'static str {
    env!("CARGO_PKG_VERSION")
}

pub fn git_sha() -> &'static str {
    option_env!("GIT_SHA").unwrap_or("unknown")
}
pub fn git_branch() -> &'static str {
    option_env!("GIT_BRANCH").unwrap_or("unknown")
}
pub fn git_dirty() -> &'static str {
    option_env!("GIT_DIRTY").unwrap_or("unknown")
}

pub fn rustc_version() -> &'static str {
    option_env!("RUSTC_VERSION").unwrap_or("rustc ?")
}
pub fn target_triple() -> &'static str {
    option_env!("TARGET_TRIPLE").unwrap_or("target ?")
}
pub fn build_profile() -> &'static str {
    option_env!("BUILD_PROFILE").unwrap_or("profile ?")
}
pub fn build_time_unix() -> &'static str {
    option_env!("BUILD_TIME_UNIX").unwrap_or("0")
}

/// One-line banner for --version or startup prints.
pub fn banner() -> String {
    format!(
        "{} v{}  |  git:{}@{} ({})  |  {}  |  {}",
        pkg_name(),
        pkg_version(),
        git_sha(),
        git_branch(),
        git_dirty(),
        target_triple(),
        rustc_version(),
    )
}

/// Print the banner once per process (safe to call many times).
pub fn print_banner() {
    static ONCE: Once = Once::new();
    ONCE.call_once(|| {
        println!("{}", banner());
    });
}