diff --git a/CHANGELOG.md b/CHANGELOG.md index 650f537f..cfdffd28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [v0.31.2] - 2023-11-29 +- Add `skip-crate-attributes` config flag - Add iterators for register/cluster/field arrays - Use parentheses instead of square brackets in docs for field arrays diff --git a/src/config.rs b/src/config.rs index 29a95475..c80dc561 100644 --- a/src/config.rs +++ b/src/config.rs @@ -10,6 +10,7 @@ pub struct Config { pub atomics_feature: Option, pub generic_mod: bool, pub make_mod: bool, + pub skip_crate_attributes: bool, pub ignore_groups: bool, pub keep_list: bool, pub strict: bool, diff --git a/src/generate/device.rs b/src/generate/device.rs index 36413f63..b799b648 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -29,28 +29,31 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result Result<()> { .action(ArgAction::SetTrue) .help("Create mod.rs instead of lib.rs, without inner attributes"), ) + .arg( + Arg::new("skip_crate_attributes") + .long("skip-crate-attributes") + .alias("skip_crate_attributes") + .action(ArgAction::SetTrue) + .help("Do not generate crate attributes"), + ) .arg( Arg::new("strict") .long("strict")