File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use std::{
5
5
ffi:: { OsStr , OsString } ,
6
6
io:: Write ,
7
7
path:: { Path , PathBuf } ,
8
- process:: Command ,
8
+ process:: { Command , Stdio } ,
9
9
sync:: RwLock ,
10
10
} ;
11
11
@@ -158,14 +158,16 @@ impl Tool {
158
158
cargo_output. print_debug ( & stdout) ;
159
159
160
160
// https://gitlab.kitware.com/cmake/cmake/-/blob/69a2eeb9dff5b60f2f1e5b425002a0fd45b7cadb/Modules/CMakeDetermineCompilerId.cmake#L267-271
161
- let accepts_cl_style_flags = run ( Command :: new ( path) . arg ( "-?" ) , path, & {
162
- // the errors are not errors!
163
- let mut cargo_output = cargo_output. clone ( ) ;
164
- cargo_output. warnings = cargo_output. debug ;
165
- cargo_output. output = OutputKind :: Discard ;
166
- cargo_output
167
- } )
168
- . is_ok ( ) ;
161
+ // stdin is set to null to ensure that the help output is never paginated.
162
+ let accepts_cl_style_flags =
163
+ run ( Command :: new ( path) . arg ( "-?" ) . stdin ( Stdio :: null ( ) ) , path, & {
164
+ // the errors are not errors!
165
+ let mut cargo_output = cargo_output. clone ( ) ;
166
+ cargo_output. warnings = cargo_output. debug ;
167
+ cargo_output. output = OutputKind :: Discard ;
168
+ cargo_output
169
+ } )
170
+ . is_ok ( ) ;
169
171
170
172
let clang = stdout. contains ( r#""clang""# ) ;
171
173
let gcc = stdout. contains ( r#""gcc""# ) ;
You can’t perform that action at this time.
0 commit comments