1.0.1 |
|
---|---|
1.0.0 |
|
0.1.9 |
|
#60 in #sh
每月下载量:31
4KB
78 行
ScriptKit
Rust 中用于 shell 脚本的简单工具包!
基本用法
use scriptkit::shell::{Cmd, Arg, shell_tools::null_sh};
#[allow(unused_imports)]
use scriptkit::sys::{OS, os_eye::open};
fn print_host() {
println!("Executed On: {:?}", open().name);
}
fn main() {
// Construct your command!
let cmd = Cmd::new("echo");
// Construct your argument!
let arg = Arg::new("Hello, World!");
// Execute the command!
null_sh(cmd, arg).expect("Failed to run command");
print_host();
}