Do not add newline at eof with --no-format option
@@ -239,10 +239,10 @@ fn main() {
process::exit(1);
}
};
- let output = if output.ends_with('\n') {
- output
- } else {
+ let output = if !output.ends_with('\n') && !cli::has_flag(&matches, "no_format") {
format!("{}\n", output)
+ } else {
+ output
};
write_output(output.into_bytes(), output_file.as_deref());
}
