From: Ian Jackson Date: Mon, 3 May 2021 12:41:18 +0000 (+0100) Subject: apitest: Capture and return the output from otter(1) in at-* X-Git-Tag: otter-0.6.0~445 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=37bcc937c32211e631b9e5b4341407ba8d5465b1;p=otter.git apitest: Capture and return the output from otter(1) in at-* Signed-off-by: Ian Jackson --- diff --git a/apitest/apitest.rs b/apitest/apitest.rs index 421ce708..09bbca59 100644 --- a/apitest/apitest.rs +++ b/apitest/apitest.rs @@ -632,6 +632,7 @@ _ = "error" # rocket #[error("wait status: {0}")] pub struct ExitStatusError(pub std::process::ExitStatus); +#[derive(Debug)] pub struct OtterOutput { output: Option, } diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index aa4afc3e..c273ec57 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -484,12 +484,12 @@ pub use GrabHow as GH; impl Ctx { #[throws(AE)] - pub fn otter>(&mut self, args: &[S]) { + pub fn otter>(&mut self, args: &[S]) -> OtterOutput { let args: Vec = ["--account", "server:"].iter().cloned().map(Into::into) .chain(args.iter().map(|s| s.as_ref().to_owned())) .collect(); - self.su().ds.otter_prctx(&self.prctx, &args)?; + self.su().ds.otter_prctx(&self.prctx, &args)? } #[throws(AE)]