mirror of
https://github.com/rust-lang/cargo
synced 2024-10-13 19:22:33 +00:00
Add Show to ProcessBuilder
This commit is contained in:
parent
b3c2350325
commit
ecf4f37f5e
|
@ -1,3 +1,5 @@
|
|||
use std::fmt;
|
||||
use std::fmt::{Show,Formatter};
|
||||
use std::os;
|
||||
use std::path::Path;
|
||||
use std::io;
|
||||
|
@ -13,6 +15,18 @@ pub struct ProcessBuilder {
|
|||
cwd: Path
|
||||
}
|
||||
|
||||
impl Show for ProcessBuilder {
|
||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||
try!(write!(f.buf, "`{}", self.program));
|
||||
|
||||
if self.args.len() > 0 {
|
||||
try!(write!(f.buf, " {}", self.args.connect(" ")));
|
||||
}
|
||||
|
||||
write!(f.buf, "`")
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Upstream a Windows/Posix branch to Rust proper
|
||||
static PATH_SEP : &'static str = ":";
|
||||
|
||||
|
|
Loading…
Reference in a new issue