File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
library/std/src/sys/process Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ pub struct Command {
2323 args : Vec < OsString > ,
2424 stdout : Option < Stdio > ,
2525 stderr : Option < Stdio > ,
26+ stdin : Option < Stdio > ,
2627 env : CommandEnv ,
2728}
2829
@@ -48,6 +49,7 @@ impl Command {
4849 args : Vec :: new ( ) ,
4950 stdout : None ,
5051 stderr : None ,
52+ stdin : None ,
5153 env : Default :: default ( ) ,
5254 }
5355 }
@@ -64,8 +66,8 @@ impl Command {
6466 panic ! ( "unsupported" )
6567 }
6668
67- pub fn stdin ( & mut self , _stdin : Stdio ) {
68- panic ! ( "unsupported" )
69+ pub fn stdin ( & mut self , stdin : Stdio ) {
70+ self . stdin = Some ( stdin ) ;
6971 }
7072
7173 pub fn stdout ( & mut self , stdout : Stdio ) {
@@ -166,7 +168,8 @@ impl Command {
166168 } ;
167169
168170 // Setup Stdin
169- let stdin = Self :: create_stdin ( Stdio :: Null ) ?;
171+ let stdin = self . stdin . unwrap_or ( Stdio :: Null ) ;
172+ let stdin = Self :: create_stdin ( stdin) ?;
170173 if let Some ( con) = stdin {
171174 cmd. stdin_init ( con)
172175 } else {
You can’t perform that action at this time.
0 commit comments