#shell #macro #cli #input-output

已删除 qshell

用于轻松运行命令的宏

2 个版本

0.1.1 2024年2月13日
0.1.0 2024年2月13日

#82#input-output

MIT 许可证

4KB
54 代码行

qshell: 运行命令的宏

sh 是一个运行外部命令的宏。它提供了将输入和输出管道到变量以及将 Rust 表达式作为程序参数的功能。


lib.rs:

示例

let world = "world";
let mut out = String::new();
sh!(echo hello {world} > {out});
assert_eq!(out, "hello world\n");
let world = "world";
let mut out = String::new();
sh!(echo hello {world} > {out});
assert_eq!(out, "hello world\n");

有关更多信息,请参阅 [sh] 的文档。

依赖项

~250KB