claude_wrapper/command/
version.rs1#[cfg(feature = "async")]
2use crate::Claude;
3use crate::command::ClaudeCommand;
4#[cfg(feature = "async")]
5use crate::error::Result;
6#[cfg(feature = "async")]
7use crate::exec;
8use crate::exec::CommandOutput;
9
10#[derive(Debug, Clone, Default)]
25pub struct VersionCommand;
26
27impl VersionCommand {
28 #[must_use]
29 pub fn new() -> Self {
30 Self
31 }
32}
33
34impl ClaudeCommand for VersionCommand {
35 type Output = CommandOutput;
36
37 fn args(&self) -> Vec<String> {
38 vec!["--version".to_string()]
39 }
40
41 #[cfg(feature = "async")]
42 async fn execute(&self, claude: &Claude) -> Result<CommandOutput> {
43 exec::run_claude(claude, self.args()).await
44 }
45}
46
47#[cfg(test)]
48mod tests {
49 use super::*;
50
51 #[test]
52 fn test_version_args() {
53 let cmd = VersionCommand::new();
54 assert_eq!(cmd.args(), vec!["--version"]);
55 }
56}