Skip to content

Commit 5904a00

Browse files
authored
refactor(boot): remove unused variables (ocaml#10527)
Some options are interpreted by `bootstrap.ml`, other ones by `duneboot.ml`. They need to be parsed, but can be ignored instead of setting a dummy reference. Signed-off-by: Etienne Millon <[email protected]>
1 parent f1255f0 commit 5904a00

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

boot/bootstrap.ml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,21 @@ open Printf
66

77
let min_supported_natively = 4, 08, 0
88

9-
let _verbose, keep_generated_files, _debug =
9+
let keep_generated_files =
1010
let anon s = raise (Arg.Bad (sprintf "don't know what to do with %s\n" s)) in
11-
let verbose = ref false in
1211
let keep_generated_files = ref false in
13-
let debug = ref false in
1412
Arg.parse
1513
[ "-j", Arg.Int ignore, "JOBS Concurrency"
16-
; "--verbose", Arg.Set verbose, " Set the display mode"
14+
; "--verbose", Arg.Unit ignore, " Set the display mode"
1715
; "--keep-generated-files", Arg.Set keep_generated_files, " Keep generated files"
18-
; "--debug", Arg.Set debug, " Enable various debugging options"
16+
; "--debug", Arg.Unit ignore, " Enable various debugging options"
1917
; ( "--force-byte-compilation"
2018
, Arg.Unit ignore
2119
, " Force bytecode compilation even if ocamlopt is available" )
2220
]
2321
anon
2422
"Usage: ocaml bootstrap.ml <options>\nOptions are:";
25-
!verbose, !keep_generated_files, !debug
23+
!keep_generated_files
2624
;;
2725

2826
let modules = [ "boot/libs"; "boot/duneboot" ]

boot/duneboot.ml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
(** {2 Command line} *)
22

3-
let concurrency, verbose, _keep_generated_files, debug, secondary, force_byte_compilation =
3+
let concurrency, verbose, debug, secondary, force_byte_compilation =
44
let anon s = raise (Arg.Bad (Printf.sprintf "don't know what to do with %s\n" s)) in
55
let concurrency = ref None in
66
let verbose = ref false in
7-
let keep_generated_files = ref false in
87
let prog = Filename.basename Sys.argv.(0) in
98
let debug = ref false in
109
let secondary = ref false in
1110
let force_byte_compilation = ref false in
1211
Arg.parse
1312
[ "-j", Int (fun n -> concurrency := Some n), "JOBS Concurrency"
1413
; "--verbose", Set verbose, " Set the display mode"
15-
; "--keep-generated-files", Set keep_generated_files, " Keep generated files"
14+
; "--keep-generated-files", Unit ignore, " Keep generated files"
1615
; "--debug", Set debug, " Enable various debugging options"
1716
; "--secondary", Set secondary, " Use the secondary compiler installation"
1817
; ( "--force-byte-compilation"
@@ -21,12 +20,7 @@ let concurrency, verbose, _keep_generated_files, debug, secondary, force_byte_co
2120
]
2221
anon
2322
(Printf.sprintf "Usage: %s <options>\nOptions are:" prog);
24-
( !concurrency
25-
, !verbose
26-
, !keep_generated_files
27-
, !debug
28-
, !secondary
29-
, !force_byte_compilation )
23+
!concurrency, !verbose, !debug, !secondary, !force_byte_compilation
3024
;;
3125

3226
(** {2 General configuration} *)

0 commit comments

Comments
 (0)