Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T03:32:06.410Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

process.rs

45 lines · 1.2 KB · rust
1//! A module for working with processes.
2
3use crate::wit::zed::extension::process;
4pub use crate::wit::zed::extension::process::{Command, Output};
5
6impl Command {
7    pub fn new(program: impl Into<String>) -> Self {
8        Self {
9            command: program.into(),
10            args: Vec::new(),
11            env: Vec::new(),
12        }
13    }
14
15    pub fn arg(mut self, arg: impl Into<String>) -> Self {
16        self.args.push(arg.into());
17        self
18    }
19
20    pub fn args(mut self, args: impl IntoIterator<Item = impl Into<String>>) -> Self {
21        self.args.extend(args.into_iter().map(Into::into));
22        self
23    }
24
25    pub fn env(mut self, key: impl Into<String>, value: impl Into<String>) -> Self {
26        self.env.push((key.into(), value.into()));
27        self
28    }
29
30    pub fn envs(
31        mut self,
32        envs: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
33    ) -> Self {
34        self.env.extend(
35            envs.into_iter()
36                .map(|(key, value)| (key.into(), value.into())),
37        );
38        self
39    }
40
41    pub fn output(&mut self) -> Result<Output, String> {
42        process::run_command(self)
43    }
44}
45
Served at tenant.openagents/omega Member data and write actions are omitted.