rust-lang/rust — pull request #15566 by japaric (2014-07-10 02:38:20+00:00)
Title: Derive Clone for Command and StdioContainer

Allows use cases like this one:

``` rust
use std::io::Command;

fn main() {
let mut cmd = Command::new("ls");
cmd.arg("-l");

for &dir in ["a", "b", "c"].iter() {
println!("{}", cmd.clone().arg(dir));
}
}
```

Output:
```
ls '-l' 'a'
ls '-l' 'b'
ls '-l' 'c'
```
Without the `clone()`, you'll end up with:
```
ls '-l' 'a'
ls '-l' 'a' 'b'
ls '-l' 'a' 'b' 'c'
```

cc #15294