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]
34 pub fn new() -> Self {
35 Self
36 }
37}
38
39impl ClaudeCommand for UpdateCommand {
40 type Output = CommandOutput;
41
42 fn args(&self) -> Vec<String> {
43 vec!["update".to_string()]
44 }
45
46 #[cfg(feature = "async")]
47 async fn execute(&self, claude: &Claude) -> Result<CommandOutput> {
48 exec::run_claude(claude, self.args()).await
49 }
50}
51
52#[cfg(test)]
53mod tests {
54 use super::*;
55
56 #[test]
57 fn update_command_args() {
58 assert_eq!(ClaudeCommand::args(&UpdateCommand::new()), vec!["update"]);
59 }
60}