File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
## v1.7.1 (2024-??-??)
2
2
- [ bug] Fix ` cppo -version ` , which used to print a blank line (#92 ).
3
+ - [ +ui] Added the ` -b ` output binary option so that Windows does
4
+ not add CRLF endings.
3
5
4
6
## v1.7.0 (2024-08-22)
5
7
- [ +ui] Multi-line macros, without line terminators ` \ ` ,
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ let main () =
78
78
let preserve_quotations = ref false in
79
79
let show_exact_locations = ref false in
80
80
let show_no_locations = ref false in
81
+ let output_binary = ref false in
81
82
let options = [
82
83
" -D" , Arg. String (fun s -> header := (" #define " ^ s ^ " \n " ) :: ! header),
83
84
" DEF
@@ -133,6 +134,10 @@ let main () =
133
134
Do not output any line directive other than those found in the
134
135
input (overrides -s)." ;
135
136
137
+ " -b" , Arg. Set output_binary,
138
+ "
139
+ Write output without CRLF normalization on Windows." ;
140
+
136
141
" -version" , Arg. Unit (fun () ->
137
142
print_endline Cppo_version. cppo_version;
138
143
exit 0 ),
@@ -215,7 +220,10 @@ Options:" Sys.argv.(0) in
215
220
print_string (Buffer. contents buf);
216
221
flush stdout
217
222
| Some file ->
218
- let oc = open_out file in
223
+ let oc =
224
+ if ! output_binary then open_out_bin file
225
+ else open_out file
226
+ in
219
227
output_string oc (Buffer. contents buf);
220
228
close_out oc
221
229
You can’t perform that action at this time.
0 commit comments