Skip to content

Commit 133bf68

Browse files
Lars van Rhijngabhijit
authored andcommitted
feat: Add possibility to disable rustfmt for ASN1 compiler via CLI
Signed-off-by: Lars van Rhijn <[email protected]>
1 parent 1f88923 commit 133bf68

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

asn-compiler/src/bin/hampi-rs-asn1c.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ struct Cli {
4646
/// Log verbosity (default: info, -d: debug, -dd...: trace)
4747
#[arg(short, action=clap::ArgAction::Count)]
4848
debug: u8,
49+
50+
/// Whether to disable `rustfmt` formatting of the generated files.
51+
#[arg(long, default_value_t = false)]
52+
no_rustfmt: bool,
4953
}
5054

5155
fn main() -> Result<()> {
@@ -90,6 +94,11 @@ fn main() -> Result<()> {
9094
cli.codec.clone(),
9195
derives.clone(),
9296
);
97+
98+
if cli.no_rustfmt {
99+
compiler.set_rustfmt_generated_code(false);
100+
}
101+
93102
compiler.compile_files(&cli.files)?;
94103

95104
Ok(())

0 commit comments

Comments
 (0)