feat: add xshell

This commit is contained in:
2020-11-07 10:55:52 +08:00
parent 743c38725f
commit 47eb944308
4 changed files with 60 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
use xshell::{cmd, read_file};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let name = "World";
let output = cmd!("echo Hello {name}!").read()?;
println!("{}", output);
let err = read_file("feeling-lucky.txt").unwrap_err();
println!("cannot read file: {}", err);
Ok(())
}