File tree 1 file changed +6
-3
lines changed
library/std/src/sys/process
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ pub struct Command {
23
23
args : Vec < OsString > ,
24
24
stdout : Option < Stdio > ,
25
25
stderr : Option < Stdio > ,
26
+ stdin : Option < Stdio > ,
26
27
env : CommandEnv ,
27
28
}
28
29
@@ -48,6 +49,7 @@ impl Command {
48
49
args : Vec :: new ( ) ,
49
50
stdout : None ,
50
51
stderr : None ,
52
+ stdin : None ,
51
53
env : Default :: default ( ) ,
52
54
}
53
55
}
@@ -64,8 +66,8 @@ impl Command {
64
66
panic ! ( "unsupported" )
65
67
}
66
68
67
- pub fn stdin ( & mut self , _stdin : Stdio ) {
68
- panic ! ( "unsupported" )
69
+ pub fn stdin ( & mut self , stdin : Stdio ) {
70
+ self . stdin = Some ( stdin ) ;
69
71
}
70
72
71
73
pub fn stdout ( & mut self , stdout : Stdio ) {
@@ -166,7 +168,8 @@ impl Command {
166
168
} ;
167
169
168
170
// 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) ?;
170
173
if let Some ( con) = stdin {
171
174
cmd. stdin_init ( con)
172
175
} else {
You can’t perform that action at this time.
0 commit comments