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