rust-clippy/tests/ui/suspicious_command_arg_space.rs

11 lines
469 B
Rust
Raw Normal View History

2023-02-10 16:13:30 +00:00
fn main() {
// Things it should warn about:
2023-02-10 16:13:30 +00:00
std::process::Command::new("echo").arg("-n hello").spawn().unwrap();
std::process::Command::new("cat").arg("--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();
2023-02-10 16:13:30 +00:00
}