@@ -257,15 +257,19 @@ where
257
257
Useful when debugging bindgen, using C-Reduce, or when \
258
258
filing issues. The resulting file will be named \
259
259
something like `__bindgen.i` or `__bindgen.ii`.") ,
260
+ Arg :: with_name ( "no-rustfmt-bindings" )
261
+ . long ( "no-rustfmt-bindings" )
262
+ . help ( "Do not format the generated bindings with rustfmt." ) ,
260
263
Arg :: with_name ( "rustfmt-bindings" )
261
264
. long ( "rustfmt-bindings" )
262
- . help ( "Format the generated bindings with rustfmt. \
263
- Rustfmt needs to be in the global PATH.") ,
265
+ . help ( "Format the generated bindings with rustfmt. DEPRECATED: \
266
+ --rustfmt-bindings is now enabled by default. Disable \
267
+ with --no-rustfmt-bindings.") ,
264
268
Arg :: with_name ( "rustfmt-configuration-file" )
265
269
. long ( "rustfmt-configuration-file" )
266
270
. help ( "The absolute path to the rustfmt configuration file. \
267
271
The configuration file will be used for formatting the bindings. \
268
- Setting this parameter, will automatically set - -rustfmt-bindings.")
272
+ This parameter is incompatible with --no -rustfmt-bindings.")
269
273
. value_name ( "path" )
270
274
. takes_value ( true )
271
275
. multiple ( false )
@@ -529,13 +533,21 @@ where
529
533
builder. dump_preprocessed_input ( ) ?;
530
534
}
531
535
532
- if matches. is_present ( "rustfmt-bindings" ) {
533
- builder = builder. rustfmt_bindings ( true ) ;
536
+ let no_rustfmt_bindings = matches. is_present ( "no-rustfmt-bindings" ) ;
537
+ if no_rustfmt_bindings {
538
+ builder = builder. rustfmt_bindings ( false ) ;
534
539
}
535
540
536
541
if let Some ( path_str) = matches. value_of ( "rustfmt-configuration-file" ) {
537
542
let path = PathBuf :: from ( path_str) ;
538
543
544
+ if no_rustfmt_bindings {
545
+ return Err ( Error :: new (
546
+ ErrorKind :: Other ,
547
+ "Cannot supply both --rustfmt-configuration-file and --no-rustfmt-bindings"
548
+ ) ) ;
549
+ }
550
+
539
551
if !path. is_absolute ( ) {
540
552
return Err ( Error :: new (
541
553
ErrorKind :: Other ,
0 commit comments