1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#![warn(
missing_docs,
future_incompatible,
single_use_lifetimes,
trivial_casts,
trivial_numeric_casts,
unreachable_pub,
unused_extern_crates,
unused_import_braces,
unused_qualifications,
unused_results,
unused_variables,
variant_size_differences,
missing_debug_implementations,
rust_2018_idioms
)]
use std::{
ffi::{OsStr, OsString},
process::Command,
};
use error::Error;
pub mod console;
pub mod error;
pub mod io;
mod process;
mod util;
pub use process::Process;
pub fn spawn(command: impl AsRef<OsStr>) -> Result<Process, Error> {
let mut cmd = OsString::new();
cmd.push("cmd /C ");
cmd.push(command);
Process::spawn(Command::new(&cmd))
}