summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-11-26 13:27:26 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-11-26 13:27:26 +0000
commit4c7f6985f1545fd526f477d66dcfa507eb3803d7 (patch)
treea5797b74821ef2ded6c67d94eff4fe591a64f057 /src
parent593aa44c3fc444617b7c119ef2ab56afcfa68330 (diff)
Add an 'options' debug command
Diffstat (limited to 'src')
-rw-r--r--src/commands.cc8
1 files changed, 7 insertions, 1 deletions
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] + "'");
}