rust-clippy/tests/ui/suspicious_command_arg_space.fixed
2023-08-11 14:02:28 +00:00

10 lines
481 B
Rust

fn main() {
// Things it should warn about:
std::process::Command::new("echo").args(["-n", "hello"]).spawn().unwrap();
std::process::Command::new("cat").args(["--number", "file"]).spawn().unwrap();
// Things it should not warn about:
std::process::Command::new("echo").arg("hello world").spawn().unwrap();
std::process::Command::new("a").arg("--fmt=%a %b %c").spawn().unwrap();
std::process::Command::new("b").arg("-ldflags=-s -w").spawn().unwrap();
}