mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-25 14:53:34 +00:00
Add --version flag with clap built-in support and test (#342)
Co-authored-by: firat.sertgoz <[email protected]>
This commit is contained in:
co-authored by
firat.sertgoz
parent
e41b282868
commit
db2ba424ce
@@ -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")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user