rust_cmd_lib is a Rust library that provides macros and utilities to write “shell-script-like” tasks in Rust in a more ergonomic way. It offers abstractions over running external commands, managing redirections, piping, environment variables, and other aspects of shell scripting, but with the type safety, error checking, and performance of Rust. Its goal is to enable developers to replace or port common shell scripts into Rust with less boilerplate.
Features
- Macros like run_cmd! and run_fun! to execute external commands with capturing output, chaining, error handling etc.
- Support for piping and redirection (so you can write pipes and redirects inside macro usage, not manually spawn subprocesses and wire IO)
- Utilities for passing parameters more intuitively (literal strings, variable interpolation) so scripts feel more natural than verbose process spawning code
- Feature flags and optional dependencies so you can enable or disable parts of functionality depending on your needs (logging, pipefail, etc.)
- Examples and test suite, including “tetris game example” among others, showing how more complex shell script behavior can be expressed.
- A library design: no spawning of extra shell when possible, so reduced runtime overhead and more safety around escaping, etc.
Categories
LibrariesLicense
Apache License V2.0Follow rust_cmd_lib
Other Useful Business Software
Our Free Plans just got better! | Auth0
You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of rust_cmd_lib!