one_command/
lib.rs

1#[cfg(not(feature = "async"))]
2include!("blocking.rs");
3
4#[cfg(feature = "async")]
5pub mod blocking;
6
7#[cfg(feature = "async")]
8use std::ffi::OsStr;
9
10/// Execute commands on the Windows platform,
11/// without opening a window to maintain consistency with other system behaviors.
12#[cfg(feature = "async")]
13pub struct Command;
14
15#[cfg(feature = "async")]
16impl Command {
17    #[allow(clippy::new_ret_no_self)]
18    pub fn new<S: AsRef<OsStr>>(program: S) -> async_process::Command {
19        blocking::Command::new(program).into()
20    }
21}