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