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