16namespace sharg::detail
22class format_tdl :
public format_help
42 throw validation_error{
"Validation failed for option --export-help: "
43 "Value must be one of "
44 + detail::supported_exports +
"."};
61namespace sharg::detail
70 return tdl::BoolValue(v);
76 return tdl::IntValue(v);
82 return tdl::DoubleValue(v);
88 return tdl::StringValue(v);
92auto to_tdl(
auto SHARG_DOXYGEN_ONLY(v))
94 return tdl::BoolValue(
false);
166 template <
typename option_type,
typename val
idator_t>
176 if (
auto const & validator_message =
config.
validator.get_help_page_message(); !validator_message.empty())
177 description +=
". " + validator_message;
186 tags.insert(
"advanced");
204 tags.insert(
"directory");
209 tags.insert(
"output");
213 tags.insert(
"directory");
214 tags.insert(
"output");
219 .description = description,
220 .tags = std::move(tags),
221 .value = tdl::StringValue{valueAsStr},
234 .description = description,
235 .tags = std::move(tags),
247 template <
typename val
idator_t>
266 template <
typename option_type,
typename val
idator_t>
270 auto positional_default_message = [&value]() ->
std::string
285 if (
auto const & validator_message =
config.
validator.get_help_page_message(); !validator_message.empty())
286 return ". " + validator_message;
294 default_message = positional_default_message(),
307 node.value = tdl::StringValueList{};
311 node.value = tdl::StringValue{};
312 node.tags.insert(
"required");
334 info.metaInfo = tdl::MetaInfo{
348 if (!executable_name.
empty())
350 info.metaInfo.executableName = executable_name[0];
352 for (
size_t i{1}; i < executable_name.
size(); ++i)
355 .name = executable_name[executable_name.
size() - i],
356 .tags = {
"basecommand"},
393 bool SHARG_DOXYGEN_ONLY(is_paragraph),
394 bool const SHARG_DOXYGEN_ONLY(advanced_only))
402 bool const SHARG_DOXYGEN_ONLY(advanced_only))
414 template <
typename val
idator_t>
Whether the option type is considered to be a container.
Definition detail/concept.hpp:38
std::string to_string(value_types &&... values)
Streams all parameters via std::ostringstream and returns a concatenated string.
Definition to_string.hpp:40
Option struct that is passed to the sharg::parser::add_option() function.
Definition config.hpp:43
std::string description
The description to be shown on any (exported) help page.
Definition config.hpp:68
std::string long_id
The long identifier for the option (e.g. "age", making the option callable via --age).
Definition config.hpp:62
bool hidden
Whether the option should be hidden.
Definition config.hpp:117
bool advanced
Whether the option should only be displayed on the advanced help page.
Definition config.hpp:105
bool required
Whether the option is required.
Definition config.hpp:129
validator_t validator
A sharg::validator that verifies the value after parsing (callable).
Definition config.hpp:135
std::string default_message
The default message to be shown on any (exported) help page.
Definition config.hpp:87
Provides some standard validators for (positional) options.