lesavka/common/src/cli.rs

23 lines
672 B
Rust
Raw Normal View History

//! Shared CLI helpers for the small `lesavka-common` utility binary.
/// Build the CLI banner shown by `lesavka-common`.
///
/// Inputs: the version string that should be displayed to the operator.
/// Outputs: a stable banner string that can be printed directly.
/// Why: keeping banner construction pure makes the tiny CLI testable without
/// depending on stdout capture in every caller.
#[must_use]
pub fn banner(version: &str) -> String {
format!("lesavka-common CLI (v{version})")
}
#[cfg(test)]
mod tests {
use super::banner;
#[test]
fn banner_includes_version() {
assert_eq!(banner("0.11.28"), "lesavka-common CLI (v0.11.28)");
}
}