claude_wrapper/command/
version.rs1#[cfg(feature = "async")]
9use crate::Claude;
10use crate::command::ClaudeCommand;
11#[cfg(feature = "async")]
12use crate::error::Result;
13#[cfg(feature = "async")]
14use crate::exec;
15use crate::exec::CommandOutput;
16
17#[derive(Debug, Clone, Default)]
32pub struct VersionCommand;
33
34impl VersionCommand {
35 #[must_use]
37 pub fn new() -> Self {
38 Self
39 }
40}
41
42impl ClaudeCommand for VersionCommand {
43 type Output = CommandOutput;
44
45 fn args(&self) -> Vec<String> {
46 vec!["--version".to_string()]
47 }
48
49 #[cfg(feature = "async")]
50 async fn execute(&self, claude: &Claude) -> Result<CommandOutput> {
51 exec::run_claude(claude, self.args()).await
52 }
53}
54
55#[cfg(test)]
56mod tests {
57 use super::*;
58
59 #[test]
60 fn test_version_args() {
61 let cmd = VersionCommand::new();
62 assert_eq!(cmd.args(), vec!["--version"]);
63 }
64}