| Crates.io | shleazy |
| lib.rs | shleazy |
| version | 0.1.1 |
| created_at | 2025-01-18 07:40:29.067687+00 |
| updated_at | 2025-01-18 07:54:59.554552+00 |
| description | Shell Made Easy: convenience wrappers around std::process |
| homepage | https://github.com/wberrier/shleazy |
| repository | https://github.com/wberrier/shleazy |
| max_upload_size | |
| id | 1521439 |
| size | 5,432 |
"Shell Made Easy"
There are several std::process wrappers, but all seem too verbose for
some common use cases.
_shell variants wrap command in sh -c ''.
use shleazy::*;
fn main() -> Result<()> {
// Returns Err since non-zero exit code
run_shell_or_err("ls /invalid-path")?;
// Returns 1
let exit_code = getstatus_shell("false")?;
// Returns "test"
let output = getoutput_shell_or_err("echo 'test'")?;
// returns (0, "test")
let (exit_code, output) = getstatusoutput_shell("echo 'test'")?;
}
stderrCmd::new("").
Cmd::new_shell("").
Cmd::new_args("", "arg1").
Cmd::new("").output()
Cmd::new("").output_or_err()
Cmd::new("").status()
Cmd::new("").status_or_err()
Cmd::new("").or_err()
Cmd::new("").statusoutput()
Cmd::new("").statusoutput_or_err()