From 8d428fa94d191782e7130c5a7b36e5956110cfe4 Mon Sep 17 00:00:00 2001 From: Samuel Mimram Date: Fri, 7 Jun 2024 17:54:36 +0200 Subject: [PATCH] Count only. --- examples/inspect.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/inspect.ml b/examples/inspect.ml index 9d5f179..6dd2f9e 100644 --- a/examples/inspect.ml +++ b/examples/inspect.ml @@ -29,9 +29,13 @@ let show_plugin p = Printf.printf "\n%!" let () = + let count = ref false in + Arg.parse [ + "--count", Arg.Set count, " Only count plugins." + ] (fun _ -> ()) "inspect [options]"; let w = World.create () in World.load_all w; let pp = World.plugins w in Printf.printf "We have %d plugins.\n\n%!" (Plugins.length pp); - Plugins.iter show_plugin pp; + if not !count then Plugins.iter show_plugin pp; Gc.full_major ()