run_script:在Rust中运行Shell脚本

时间:2021-05-06 23:54:10
【文件属性】:
文件名称:run_script:在Rust中运行Shell脚本
文件大小:837KB
文件格式:ZIP
更新时间:2021-05-06 23:54:10
rust scripting shell-script rust-library bash-script run_script 在运行shell脚本。 执照 概述 该库使您可以根据外壳脚本的内容来调用它们。 尽管std :: process :: Command非常适合执行独立命令,但您需要更多手动代码来获取脚本文本并执行它。 为此,创建了该库。 用法 只需包括该库,并使用脚本文本和运行选项调用运行/生成功能: use run_script :: ScriptOptions; fn main () { let options = ScriptOptions :: new (); let args = vec! []; // run the script and get the script execution output let (code, output, error) = run_script :: run ( r#"

网友评论