1
- use std:: fs:: File ;
2
- use std:: io:: { self , Error , ErrorKind } ;
3
1
4
- use clap:: { App , Arg } ;
5
2
6
- use bindgen:: { builder, Builder } ;
3
+ use bindgen:: { Builder , builder} ;
4
+
5
+ use clap:: { App , Arg } ;
6
+ use std:: fs:: File ;
7
+ use std:: io:: { self , Error , ErrorKind } ;
7
8
8
9
/// Construct a new [`Builder`](./struct.Builder.html) from command line flags.
9
- pub fn builder_from_flags < I > ( args : I ) -> Result < ( Builder , Box < io:: Write > ) , io:: Error >
10
- where I : Iterator < Item =String >
10
+ pub fn builder_from_flags < I > ( args : I )
11
+ -> Result < ( Builder , Box < io:: Write > ) , io:: Error >
12
+ where I : Iterator < Item = String > ,
11
13
{
12
14
let matches = App :: new ( "bindgen" )
13
15
. version ( env ! ( "CARGO_PKG_VERSION" ) )
@@ -19,7 +21,8 @@ pub fn builder_from_flags<I>(args: I) -> Result<(Builder, Box<io::Write>), io::E
19
21
. required ( true ) ,
20
22
Arg :: with_name ( "bitfield-enum" )
21
23
. long ( "bitfield-enum" )
22
- . help ( "Mark any enum whose name matches <regex> as a set of bitfield flags instead of an enumeration." )
24
+ . help ( "Mark any enum whose name matches <regex> as a set of \
25
+ bitfield flags instead of an enumeration.")
23
26
. value_name ( "regex" )
24
27
. takes_value ( true )
25
28
. multiple ( true )
@@ -33,18 +36,21 @@ pub fn builder_from_flags<I>(args: I) -> Result<(Builder, Box<io::Write>), io::E
33
36
. number_of_values ( 1 ) ,
34
37
Arg :: with_name ( "builtins" )
35
38
. long ( "builtins" )
36
- . help ( "Output bindings for builtin definitions, e.g. __builtin_va_list." ) ,
39
+ . help ( "Output bindings for builtin definitions, e.g. \
40
+ __builtin_va_list.") ,
37
41
Arg :: with_name ( "ctypes-prefix" )
38
42
. long ( "ctypes-prefix" )
39
- . help ( "Use the given prefix before raw types instead of ::std::os::raw." )
43
+ . help ( "Use the given prefix before raw types instead of \
44
+ ::std::os::raw.")
40
45
. value_name ( "prefix" )
41
46
. takes_value ( true ) ,
42
47
// All positional arguments after the end of options marker, `--`
43
48
Arg :: with_name ( "clang-args" )
44
49
. multiple ( true ) ,
45
50
Arg :: with_name ( "dummy-uses" )
46
51
. long ( "dummy-uses" )
47
- . help ( "For testing purposes, generate a C/C++ file containing dummy uses of all types defined in the input header." )
52
+ . help ( "For testing purposes, generate a C/C++ file containing \
53
+ dummy uses of all types defined in the input header.")
48
54
. takes_value ( true ) ,
49
55
Arg :: with_name ( "emit-clang-ast" )
50
56
. long ( "emit-clang-ast" )
@@ -60,7 +66,8 @@ pub fn builder_from_flags<I>(args: I) -> Result<(Builder, Box<io::Write>), io::E
60
66
. number_of_values ( 1 ) ,
61
67
Arg :: with_name ( "ignore-functions" )
62
68
. long ( "ignore-functions" )
63
- . help ( "Do not generate bindings for functions or methods. This is useful when you only care about struct layouts." ) ,
69
+ . help ( "Do not generate bindings for functions or methods. This \
70
+ is useful when you only care about struct layouts.") ,
64
71
Arg :: with_name ( "ignore-methods" )
65
72
. long ( "ignore-methods" )
66
73
. help ( "Do not generate bindings for methods." ) ,
@@ -110,21 +117,26 @@ pub fn builder_from_flags<I>(args: I) -> Result<(Builder, Box<io::Write>), io::E
110
117
. help ( "MSVC C++ ABI mangling. DEPRECATED: Has no effect." ) ,
111
118
Arg :: with_name ( "whitelist-function" )
112
119
. long ( "whitelist-function" )
113
- . help ( "Whitelist all the free-standing functions matching <regex>. Other non-whitelisted functions will not be generated." )
120
+ . help ( "Whitelist all the free-standing functions matching \
121
+ <regex>. Other non-whitelisted functions will not be \
122
+ generated.")
114
123
. value_name ( "regex" )
115
124
. takes_value ( true )
116
125
. multiple ( true )
117
126
. number_of_values ( 1 ) ,
118
127
Arg :: with_name ( "whitelist-type" )
119
128
. long ( "whitelist-type" )
120
- . help ( "Whitelist the type. Other non-whitelisted types will not be generated." )
129
+ . help ( "Whitelist the type. Other non-whitelisted types will \
130
+ not be generated.")
121
131
. value_name ( "type" )
122
132
. takes_value ( true )
123
133
. multiple ( true )
124
134
. number_of_values ( 1 ) ,
125
135
Arg :: with_name ( "whitelist-var" )
126
136
. long ( "whitelist-var" )
127
- . help ( "Whitelist all the free-standing variables matching <regex>. Other non-whitelisted variables will not be generated." )
137
+ . help ( "Whitelist all the free-standing variables matching \
138
+ <regex>. Other non-whitelisted variables will not be \
139
+ generated.")
128
140
. value_name ( "regex" )
129
141
. takes_value ( true )
130
142
. multiple ( true )
0 commit comments