The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

-init is now taken into account when -e is used (#14190)

authored by

Emile Trotignon and committed by
GitHub
606d69b9 10102722

+13 -5
+2
Changes
··· 331 331 (Gabriel Scherer, review by Nicolás Ojeda Bär and Florian Angeletti, 332 332 report by Kate Deplaix) 333 333 334 + - #14190: `ocaml -e` now also processes `-init` (previously it was ignored). 335 + (Emile Trotignon, review by David Allsopp and @ygrek) 334 336 335 337 ### Internal/compiler-libs changes: 336 338
+5 -2
man/ocaml.1
··· 317 317 318 318 When 319 319 .BR ocaml (1) 320 - is invoked, it will read phrases from an initialization file before 321 - giving control to the user. The file read is the first found of: 320 + is invoked as a toplevel, it will read phrases from an initialization file 321 + before giving control to the user. This does not happen when running a 322 + script, or when using -e. 323 + 324 + The file read is the first found of: 322 325 .IP 1. 323 326 \fB.ocamlinit\fP in the current directory; 324 327 .IP 2.
+6 -3
toplevel/toploop.ml
··· 109 109 110 110 let load_file = load_file false 111 111 112 + let load_explicit_ocamlinit ppf f = 113 + if Sys.file_exists f then ignore (use_silently ppf (File f) ) 114 + else fprintf ppf "Init file not found: \"%s\".@." f 115 + 112 116 (* Execute a script. If [name] is "", read the script from stdin. *) 113 117 114 118 let run_script ppf name args = ··· 128 132 else filename) 129 133 | (Stdin | String _) as x -> x 130 134 in 135 + Option.iter (load_explicit_ocamlinit ppf) !Clflags.init_file; 131 136 use_silently ppf explicit_name 132 137 133 138 (* Toplevel initialization. Performed here instead of at the ··· 263 268 let load_ocamlinit ppf = 264 269 if !Clflags.noinit then () 265 270 else match !Clflags.init_file with 266 - | Some f -> 267 - if Sys.file_exists f then ignore (use_silently ppf (File f) ) 268 - else fprintf ppf "Init file not found: \"%s\".@." f 271 + | Some f -> load_explicit_ocamlinit ppf f 269 272 | None -> 270 273 match find_ocamlinit () with 271 274 | None -> ()