From 864baf81f335c8aae1a99f07fb28cf6400815c2e Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Sun, 8 Oct 2017 18:11:27 +0200 Subject: [PATCH] show switches in increasing version order We rely on the fact that the StringMap order is close to what we want. It would be more robust to use an actual alphanumeric ordering. --- tools/opam-builder/commandJson.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/opam-builder/commandJson.ml b/tools/opam-builder/commandJson.ml index 3ec0a1b..c8974f9 100644 --- a/tools/opam-builder/commandJson.ml +++ b/tools/opam-builder/commandJson.ml @@ -140,6 +140,11 @@ let generate_json dirs = | c :: _ -> main_cs := c :: !main_cs ) !switches; + (* switches are iterated in alphabetic order, + but main_cs is appended-to so it has to be reversed + to show switches in order *) + main_cs := List.rev !main_cs; + generate_json "opam-builder.json" "All Switches" !main_cs; Gc.major();