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::{
55 ffi:: { OsStr , OsString } ,
66 io:: Write ,
77 path:: { Path , PathBuf } ,
8- process:: Command ,
8+ process:: { Command , Stdio } ,
99 sync:: RwLock ,
1010} ;
1111
@@ -158,14 +158,16 @@ impl Tool {
158158 cargo_output. print_debug ( & stdout) ;
159159
160160 // 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 ( ) ;
169171
170172 let clang = stdout. contains ( r#""clang""# ) ;
171173 let gcc = stdout. contains ( r#""gcc""# ) ;
You can’t perform that action at this time.
0 commit comments