From ac0c746072dbfe9ee530efa5a0f41872a1090527 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 7 Aug 2016 10:47:26 +0100 Subject: [PATCH] Tweak format of option docstrings --- src/option_manager.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/option_manager.hh b/src/option_manager.hh index 94340d10..d4d50daf 100644 --- a/src/option_manager.hh +++ b/src/option_manager.hh @@ -224,7 +224,9 @@ public: return **it; throw runtime_error(format("option '{}' already declared with different type or flags", name)); } - m_descs.emplace_back(new OptionDesc{name.str(), format("({}): {}", option_type_name::name(), docstring), flags}); + String doc = docstring.empty() ? format("[{}]", option_type_name::name()) + : format("[{}] - {}", option_type_name::name(), docstring); + m_descs.emplace_back(new OptionDesc{name.str(), std::move(doc), flags}); opts.emplace_back(new TypedCheckedOption{m_global_manager, *m_descs.back(), value}); return *opts.back(); }