Find and remove dead code and unused APIs in OCaml projects

feat(memtrace): modernize package and integrate cmdliner term into all binaries

Modernize the memtrace package for the monorepo: convert Printf to Fmt,
restructure tests into alcotest pattern with suite exports, add cmdliner
term (--memtrace, --memtrace-rate, --memtrace-context), and add
argv-peeking trace_if_requested. Integrate Memtrace.term into setup
terms across all binaries that previously called trace_if_requested().

+6 -8
+6 -8
bin/main.ml
··· 172 172 173 173 open Cmdliner 174 174 175 + let setup = Term.(const (fun () () -> ()) $ Vlog.setup "prune" $ Memtrace.term) 176 + 175 177 (* Clean subcommand arguments *) 176 178 let dry_run = 177 179 let doc = "Only report what would be removed, don't actually remove" in ··· 251 253 let config = build_config dry_run force step_wise in 252 254 process_clean config paths exclude_dirs public_files ()) 253 255 $ dry_run $ force $ step_wise $ paths $ exclude_dirs $ public_files 254 - $ Vlog.setup "prune") 256 + $ setup) 255 257 in 256 258 Cmd.v info term 257 259 ··· 274 276 ] 275 277 in 276 278 let info = Cmd.info "doctor" ~doc ~man in 277 - let term = Term.(const process_doctor $ sample_mli $ Vlog.setup "prune") in 279 + let term = Term.(const process_doctor $ sample_mli $ setup) in 278 280 Cmd.v info term 279 281 280 282 (* Show subcommand arguments *) ··· 318 320 ] 319 321 in 320 322 let info = Cmd.info "show" ~doc ~man in 321 - let term = 322 - Term.(const process_show $ format $ output_dir $ paths $ Vlog.setup "prune") 323 - in 323 + let term = Term.(const process_show $ format $ output_dir $ paths $ setup) in 324 324 Cmd.v info term 325 325 326 326 (* Main command group *) ··· 358 358 359 359 Cmd.eval cmd |> exit 360 360 361 - let () = 362 - Memtrace.trace_if_requested (); 363 - main () 361 + let () = main ()