diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 8 | ||||
-rw-r--r-- | src/options.rs | 14 |
2 files changed, 22 insertions, 0 deletions
@@ -494,6 +494,14 @@ impl Builder { output_vector.push(line.clone()); } + for (module, lines) in &self.options.module_lines { + for line in lines.iter() { + output_vector.push("--module-raw-line".into()); + output_vector.push(module.clone()); + output_vector.push(line.clone()); + } + } + if self.options.use_core { output_vector.push("--use-core".into()); } diff --git a/src/options.rs b/src/options.rs index 657c3c9a..8beac469 100644 --- a/src/options.rs +++ b/src/options.rs @@ -338,6 +338,13 @@ where .takes_value(true) .multiple(true) .number_of_values(1), + Arg::with_name("module-raw-line") + .long("module-raw-line") + .help("Add a raw line of Rust code to a given module.") + .takes_value(true) + .multiple(true) + .number_of_values(2) + .value_names(&["module-name", "raw-line"]), Arg::with_name("rust-target") .long("rust-target") .help(&rust_target_help) @@ -769,6 +776,13 @@ where } } + if let Some(mut values) = matches.values_of("module-raw-line") { + while let Some(module) = values.next() { + let line = values.next().unwrap(); + builder = builder.module_raw_line(module, line); + } + } + if matches.is_present("use-core") { builder = builder.use_core(); } |