From 4c7f6985f1545fd526f477d66dcfa507eb3803d7 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 26 Nov 2014 13:27:26 +0000 Subject: [PATCH] Add an 'options' debug command --- src/commands.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands.cc b/src/commands.cc index 8b88702b..89557d5b 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -781,7 +781,7 @@ const CommandDesc debug_cmd = { ParameterDesc{ SwitchMap{}, ParameterDesc::Flags::SwitchesOnlyAtStart, 1 }, CommandFlags::None, CommandCompleter{}, - [](const ParametersParser& parser, Context&) + [](const ParametersParser& parser, Context& context) { if (parser[0] == "info") { @@ -794,6 +794,12 @@ const CommandDesc debug_cmd = { for (auto& buffer : BufferManager::instance()) write_debug(buffer->debug_description()); } + if (parser[0] == "options") + { + write_debug("Options:"); + for (auto& option : context.options().flatten_options()) + write_debug(" * " + option->name() + ": " + option->get_as_string()); + } else throw runtime_error("unknown debug command '" + parser[0] + "'"); }