duct 0.5.0

a library for creating shell pipelines
Documentation

duct.rs Travis build AppVeyor build crates.io docs.rs

A cross-platform library for running child processes and building pipelines.

duct wants to make shelling out in Rust as easy and flexible as it is in Bash. It also takes care of tricky inconsistencies in the way different platforms shell out. And it's a cross-language library; the original implementation is in Python, with an identical API.

Example

duct uses os_pipe internally, and the docs for that one include a big example that uses more than a dozen lines of code to read both stdout and stderr from a child process. duct can do that in one line:

use duct::sh;

let output = sh("echo foo && echo bar >&2").stderr_to_stdout().read().unwrap();

assert!(output.split_whitespace().eq(vec!["foo", "bar"]));