feat: add xshell
This commit is contained in:
11
__shell/xshell/src/main.rs
Normal file
11
__shell/xshell/src/main.rs
Normal 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(())
|
||||
}
|
||||
Reference in New Issue
Block a user