diff options
author | Jeffrey Deng <jeffreydeng@live.com> | 2017-02-04 15:22:26 -0500 |
---|---|---|
committer | Jeffrey Deng <jeffreydeng@live.com> | 2017-02-04 15:45:36 -0500 |
commit | 692ff7420c84f1b00813a247b853caf3ece2c27c (patch) | |
tree | 00ede8a80ab47656f4fb3301d5780d6a660e900d /src | |
parent | 62f8ed1174f140b754291b8029828de06da0583b (diff) |
Removed verbose option flag from builder, and kept it in options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 19 | ||||
-rw-r--r-- | src/main.rs | 3 | ||||
-rw-r--r-- | src/options.rs | 8 |
3 files changed, 6 insertions, 24 deletions
@@ -433,17 +433,6 @@ impl Builder { self } - /// Set to output verbose messages - pub fn verbose(mut self) -> Self { - self.options.verbose = true; - self - } - - /// Is set to output verbose messages - pub fn is_verbose(&self) -> bool { - return self.options.verbose; - } - /// Generate the Rust bindings using the options built up thus far. pub fn generate<'ctx>(self) -> Result<Bindings<'ctx>, ()> { Bindings::generate(self.options, None) @@ -554,19 +543,16 @@ pub struct BindgenOptions { /// See the builder method description for more details. pub conservative_inline_namespaces: bool, - /// Whether to keep documentation comments in the generated output. See the + /// Wether to keep documentation comments in the generated output. See the /// documentation for more details. pub generate_comments: bool, - /// Whether to whitelist types recursively. Defaults to true. + /// Wether to whitelist types recursively. Defaults to true. pub whitelist_recursively: bool, /// Intead of emitting 'use objc;' to files generated from objective c files, /// generate '#[macro_use] extern crate objc;' pub objc_extern_crate: bool, - - /// Whether we should print verbose messages. - pub verbose: bool, } /// TODO(emilio): This is sort of a lie (see the error message that results from @@ -619,7 +605,6 @@ impl Default for BindgenOptions { generate_comments: true, whitelist_recursively: true, objc_extern_crate: false, - verbose: false, } } } diff --git a/src/main.rs b/src/main.rs index a73b0fee..7f424318 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,9 +44,8 @@ pub fn main() { } match builder_from_flags(bind_args.into_iter()) { - Ok((builder, output)) => { + Ok((builder, output, verbose)) => { - let verbose = (&builder).is_verbose(); let builder_result = panic::catch_unwind(|| builder.generate().expect("Unable to generate bindings") diff --git a/src/options.rs b/src/options.rs index f341b5dd..63df8b2a 100644 --- a/src/options.rs +++ b/src/options.rs @@ -5,7 +5,7 @@ use std::io::{self, Error, ErrorKind}; /// Construct a new [`Builder`](./struct.Builder.html) from command line flags. pub fn builder_from_flags<I>(args: I) - -> Result<(Builder, Box<io::Write>), io::Error> + -> Result<(Builder, Box<io::Write>, bool), io::Error> where I: Iterator<Item = String>, { let matches = App::new("bindgen") @@ -349,9 +349,7 @@ pub fn builder_from_flags<I>(args: I) Box::new(io::BufWriter::new(io::stdout())) as Box<io::Write> }; - if matches.is_present("verbose") { - builder = builder.verbose(); - } + let verbose = matches.is_present("verbose"); - Ok((builder, output)) + Ok((builder, output, verbose)) } |