File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ std:: process:: Command :: new ( "echo" ) . arg ( "hello world" ) . spawn ( ) . unwrap ( ) ;
3
+ std:: process:: Command :: new ( "echo" ) . arg ( "-n hello" ) . spawn ( ) . unwrap ( ) ;
4
+ std:: process:: Command :: new ( "cat" ) . arg ( "--number file" ) . spawn ( ) . unwrap ( ) ;
5
+ }
Original file line number Diff line number Diff line change
1
+ error: single argument that looks like it should be multiple arguments
2
+ --> $DIR/suspicious_command_arg_space.rs:3:44
3
+ |
4
+ LL | std::process::Command::new("echo").arg("-n hello").spawn().unwrap();
5
+ | ^^^^^^^^^^
6
+ |
7
+ = note: `-D clippy::suspicious-command-arg-space` implied by `-D warnings`
8
+ help: consider splitting the argument
9
+ |
10
+ LL | std::process::Command::new("echo").args(["-n", "hello"]).spawn().unwrap();
11
+ | ~~~~ ~~~~~~~~~~~~~~~
12
+
13
+ error: single argument that looks like it should be multiple arguments
14
+ --> $DIR/suspicious_command_arg_space.rs:4:43
15
+ |
16
+ LL | std::process::Command::new("cat").arg("--number file").spawn().unwrap();
17
+ | ^^^^^^^^^^^^^^^
18
+ |
19
+ help: consider splitting the argument
20
+ |
21
+ LL | std::process::Command::new("cat").args(["--number", "file"]).spawn().unwrap();
22
+ | ~~~~ ~~~~~~~~~~~~~~~~~~~~
23
+
24
+ error: aborting due to 2 previous errors
25
+
You can’t perform that action at this time.
0 commit comments