diff --git a/README.md b/README.md index debb838..2105079 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Simple Rust Tests Project or files: ``` . +├── __concurrent +│   └── arc-swap ├── __crypto │   ├── btc-address │   ├── crypto @@ -12,6 +14,7 @@ Project or files: │   ├── pwhash │   ├── random │   ├── ring +│   ├── rsa │   ├── secp256k1 │   └── totp ├── __database @@ -20,6 +23,8 @@ Project or files: ├── __diff │   ├── diffy │   └── prettydiff +├── __enclave +│   └── virt_enclave ├── __err │   ├── err_derive │   └── quick_error @@ -28,6 +33,8 @@ Project or files: │   ├── cpp │   ├── jni │   └── live-reload-rust +├── __fs +│   └── fuse ├── __image │   └── svg ├── __lang @@ -36,6 +43,7 @@ Project or files: │   ├── quickjs │   └── sana ├── __linux +│   ├── notify │   ├── psutil │   └── sysinfo ├── __misc @@ -45,6 +53,8 @@ Project or files: │   ├── smartstring │   └── walkdir ├── __network +│   ├── ip +│   ├── nfqueue │   ├── tcp │   └── udp_laminar ├── __search @@ -56,6 +66,8 @@ Project or files: │   ├── encoding │   ├── flatbuffers │   └── serde_json +├── __shell +│   └── xshell ├── __std │   ├── async_await │   ├── into @@ -64,6 +76,7 @@ Project or files: │   └── thread ├── __term │   ├── colored_msg +│   ├── confy_table │   ├── indicatif │   └── term ├── __time @@ -107,7 +120,7 @@ Project or files: ├── vec.rs └── while.rs -79 directories, 26 files +92 directories, 26 files ``` diff --git a/__shell/xshell/Cargo.lock b/__shell/xshell/Cargo.lock new file mode 100644 index 0000000..7d7e541 --- /dev/null +++ b/__shell/xshell/Cargo.lock @@ -0,0 +1,23 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "xshell" +version = "0.1.0" +dependencies = [ + "xshell 0.1.6", +] + +[[package]] +name = "xshell" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e9bbfccbb2233e6b0473b7870d4b0811a402e9e249a5e8394e768e5a5c9c37d" +dependencies = [ + "xshell-macros", +] + +[[package]] +name = "xshell-macros" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f1c632d730a1704b21dc551a4c74fbed713cfa59593708f94943548206134" diff --git a/__shell/xshell/Cargo.toml b/__shell/xshell/Cargo.toml new file mode 100644 index 0000000..8f33213 --- /dev/null +++ b/__shell/xshell/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "xshell" +version = "0.1.0" +authors = ["Hatter Jiang "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +xshell = "0.1" + + diff --git a/__shell/xshell/src/main.rs b/__shell/xshell/src/main.rs new file mode 100644 index 0000000..0f9d175 --- /dev/null +++ b/__shell/xshell/src/main.rs @@ -0,0 +1,11 @@ +use xshell::{cmd, read_file}; + +fn main() -> Result<(), Box> { + 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(()) +}