Add stdin
to run_make_support::command::Command
This commit is contained in:
parent
6db3289de7
commit
5a66a796fc
@ -36,8 +36,10 @@ impl Command {
|
||||
Self { cmd: StdCommand::new(program), stdin: None, drop_bomb: DropBomb::arm(program) }
|
||||
}
|
||||
|
||||
pub fn set_stdin(&mut self, stdin: Box<[u8]>) {
|
||||
self.stdin = Some(stdin);
|
||||
/// Specify a stdin input
|
||||
pub fn stdin<I: AsRef<[u8]>>(&mut self, input: I) -> &mut Self {
|
||||
self.stdin = Some(input.as_ref().to_vec().into_boxed_slice());
|
||||
self
|
||||
}
|
||||
|
||||
/// Specify an environment variable.
|
||||
|
@ -171,7 +171,7 @@ impl LlvmFilecheck {
|
||||
|
||||
/// Pipe a read file into standard input containing patterns that will be matched against the .patterns(path) call.
|
||||
pub fn stdin<I: AsRef<[u8]>>(&mut self, input: I) -> &mut Self {
|
||||
self.cmd.set_stdin(input.as_ref().to_vec().into_boxed_slice());
|
||||
self.cmd.stdin(input);
|
||||
self
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ impl Rustc {
|
||||
|
||||
/// Specify a stdin input
|
||||
pub fn stdin<I: AsRef<[u8]>>(&mut self, input: I) -> &mut Self {
|
||||
self.cmd.set_stdin(input.as_ref().to_vec().into_boxed_slice());
|
||||
self.cmd.stdin(input);
|
||||
self
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ impl Rustdoc {
|
||||
|
||||
/// Specify a stdin input
|
||||
pub fn stdin<I: AsRef<[u8]>>(&mut self, input: I) -> &mut Self {
|
||||
self.cmd.set_stdin(input.as_ref().to_vec().into_boxed_slice());
|
||||
self.cmd.stdin(input);
|
||||
self
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user