I am trying to start a process with the Command
API and redirect its standard output to standard error. The following fails:
Command::new("tput")
.arg("rc")
.stdout(io::stderr())
.status()
.expect("failed to run tput");
because Command::new("tput").arg("rc").stdout(<XXX>)
expects a std::process::Stdio
:
expected struct `std::process::Stdio`, found struct `std::io::Stderr`
The equivalent in Bash would probably be tput rc > /dev/stderr
.
I would like to know how to do this properly.
stdout
method could accept aWriter
instance instead? – Smut