From 01c9a4e1c2d601870b3ff9a162b9657a20990cdc Mon Sep 17 00:00:00 2001 From: Pavel Shramov Date: Fri, 17 Nov 2023 09:21:32 +0300 Subject: [PATCH] scheme: Dump sorted options --- src/scheme.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scheme.cc b/src/scheme.cc index a4d33df1..8b87949e 100644 --- a/src/scheme.cc +++ b/src/scheme.cc @@ -1678,12 +1678,17 @@ std::string dump(const tll::scheme::Option * options, std::string_view key = "op std::string r; r += fmt::format("{}: {{", key); bool comma = false; + std::map map; for (auto &o : list_wrap(options)) { if (o.name == std::string_view("_auto")) continue; + map.emplace(o.name, o.value); + } + + for (auto & [k, v] : map) { if (comma) r += ", "; comma = true; - r += fmt::format("'{}': '{}'", o.name, o.value); + r += fmt::format("'{}': '{}'", k, v); } r += "}"; return r;