apple_clis/
open.rs

1use crate::prelude::*;
2
3pub mod well_known;
4
5pub struct OpenCLIInstance {
6	exec_path: Utf8PathBuf,
7}
8
9impl_exec_instance!(OpenCLIInstance, "open", skip_version_check);
10// impl ExecInstance for OpenCLIInstance {
11// 	const BINARY_NAME: &'static str = "open";
12
13// 	unsafe fn new_unchecked(exec_path: impl AsRef<Utf8Path>) -> Self {
14// 		Self {
15// 			exec_path: exec_path.as_ref().to_owned(),
16// 		}
17// 	}
18
19// 	fn get_inner_exec_path(&self) -> &Utf8Path {
20// 		&self.exec_path
21// 	}
22
23// 	fn validate_version(&self) -> bool {
24// 		// builtin usually
25// 		true
26// 	}
27// }
28
29// impl OpenCLIInstance {
30// 	pub fn new() -> Result<Self> {
31// 		<Self as ExecInstance>::new()
32// 	}
33// }
34
35impl OpenCLIInstance {
36	#[tracing::instrument(level = "trace", skip(self, path))]
37	pub fn open_path(&self, path: impl AsRef<Utf8Path>) -> Result<bossy::ExitStatus> {
38		Ok(
39			self
40				.bossy_command()
41				.with_arg(path.as_ref())
42				.run_and_wait()?,
43		)
44	}
45}