Add --version flag with clap built-in support and test (#342)

Co-authored-by: firat.sertgoz <[email protected]>
This commit is contained in:
DevBroco
2026-02-25 17:25:07 +04:00
committed by GitHub
co-authored by firat.sertgoz
parent e41b282868
commit db2ba424ce
+15
View File
@@ -166,3 +166,18 @@ impl Cli {
matches!(self.command, None | Some(Command::Run))
}
}
#[cfg(test)]
mod tests {
use super::*;
use clap::CommandFactory;
#[test]
fn test_version() {
let cmd = Cli::command();
assert_eq!(
cmd.get_version().unwrap_or("unknown"),
env!("CARGO_PKG_VERSION")
);
}
}