{"repo":"rust-shell-script/rust_cmd_lib","free":true,"listed":false,"github":"https://github.com/rust-shell-script/rust_cmd_lib","clone":"git clone https://github.com/rust-shell-script/rust_cmd_lib.git","description":"Common rust command-line macros and utilities, to write shell-script like tasks in a clean, natural and rusty way","language":"Rust","stars":1159,"topics":["rust","pipe","command-line","shell","script","bash"],"license":"Apache-2.0","category":"cli-tools","readme_excerpt":"cmd lib Rust command-line library Common rust command-line macros and utilities, to write shell-script like tasks easily in rust programming language. Available at crates.io. Why you need this If you need to run some external commands in rust, the std::process::Command is a good abstraction layer on top of different OS syscalls. It provides fine-grained control over how a new process should be spawned, and it allows you to wait for process to finish and check the exit status or collect all of its output. However, when Redirection) or Piping#Piping) is needed, you need to set up the parent and child IO handles manually, like this in the rust cookbook, which is often tedious and error prone. A lot of developers just choose shell(sh, bash, ...) scripts for such tasks, by using to redirect output and to pipe outputs. In my experience, this is the only good parts of shell script. You can find all kinds of pitfalls and mysterious tricks to make other parts of shell script work. As the shell scripts grow, they will ultimately be unmaintainable and no one wants to touch them any more. This cmd lib library is trying to provide the redirection and piping capabilities, and other facilities to make writing shell-script like tasks easily without launching any shell . For the rust cookbook examples, they can usually be implemented as one line of rust macro with the help of this library, as in the examples/rust cookbook.rs. Since they are rust code, you can always rewrite them in rust nativ","default_branch":null,"files":null,"tree":[],"storefront":"/r/rust-shell-script","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/rust-shell-script/rust_cmd_lib/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}