A type that can be specialised to provide customisation point implementations for the seqan3::argument_parser such that third party types may be adapted.
More...
template<typename t>
struct seqan3::custom::argument_parsing< t >
A type that can be specialised to provide customisation point implementations for the seqan3::argument_parser such that third party types may be adapted.
- Template Parameters
-
t | The type you wish to specialise for. |
Named Enumerations
In order to use a third party type within the seqan3::argument_parser::add_option or seqan3::argument_parser::add_positional_option call, you can specialise this struct in the following way:
{
template <>
{
{"timed_out", std::errc::timed_out},
{"invalid_argument", std::errc::invalid_argument},
{"io_error", std::errc::io_error}};
};
}
int main(int argc, char const * argv[])
{
'e',
"errc",
"Give me a std::errc value.",
try
{
parser.parse();
}
{
return -1;
}
return 0;
}
Meta-header for the Argument Parser module .
Argument parser exception that is thrown whenever there is an error while parsing the command line ar...
Definition exceptions.hpp:37
The SeqAn command line parser.
Definition argument_parser.hpp:145
void add_option(option_type &value, char const short_id, std::string const &long_id, std::string const &desc, option_spec const spec=option_spec::standard, validator_type option_validator=validator_type{})
Adds an option to the seqan3::argument_parser.
Definition argument_parser.hpp:236
A validator that checks whether a value is inside a list of valid values.
Definition validators.hpp:196
@ standard
The default were no checking or special displaying is happening.
Definition auxiliary.hpp:248
A namespace for third party and standard library specialisations of SeqAn customisation points.
Definition char.hpp:40
SeqAn specific customisations in the standard namespace.
A type that can be specialised to provide customisation point implementations for the seqan3::argumen...
Definition auxiliary.hpp:49
Please note that by default the t const
, t &
and t const &
specialisations of this class inherit the specialisation for t
so you usually only need to provide a specialisation for t
.
- Note
- Only use this if you cannot provide respective functions in your namespace. See the tutorial Parsing command line arguments with Sharg for an example of customising a type within your own namespace.