Tweak format of option docstrings
This commit is contained in:
parent
f73e89a716
commit
ac0c746072
|
@ -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<T>::name(), docstring), flags});
|
||||
String doc = docstring.empty() ? format("[{}]", option_type_name<T>::name())
|
||||
: format("[{}] - {}", option_type_name<T>::name(), docstring);
|
||||
m_descs.emplace_back(new OptionDesc{name.str(), std::move(doc), flags});
|
||||
opts.emplace_back(new TypedCheckedOption<T, validator>{m_global_manager, *m_descs.back(), value});
|
||||
return *opts.back();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user