I wanted to run clippy using process::Command but it doesn't seem to be working.
I ran cargo build on this:
use std::env;
use std::process::Command;
use std::io;
use std::io::Write;
fn main() {
let pwd = env::current_dir();
match pwd {
Ok(data) => {
println!("{}", &data.display());
let output = Command::new("cargo")
.arg("clippy")
.output()
.expect("there was an error");
io::stdout().write_all(&output.stdout).unwrap();
},
Err(_) => (),
}
}
than executed the binary in the root of another rust project. But I don't seem to be getting any output. I've tried replacing cargo clippy with ls and that ran normally. Properly listing all files in that directory.
Any ideas?
cargo clippyonly outputs errors and warnings on stderr, not stdout.