78 using arg_ptr_t = std::shared_ptr<detail::argument_base>;
87 return std::unique_ptr<argument_group>(
new argument_group(parser, name));
Defines the base argument class and common utility.
Represents a group of arguments.
std::shared_ptr< detail::argument_base > arg_ptr_t
The argument pointer type alias.
arg_ptr_vec_t _arguments
A list of arguments that belong to this group.
std::string _name
Name of the group (used in help output).
argument_group & mutually_exclusive(const bool me=true) noexcept
Set the mutually_exclusive attribute of the group.
argument_group & required(const bool r=true) noexcept
Set the required attribute of the group.
void _add_argument(arg_ptr_t arg) noexcept
Add a new argument to this group (called internally by parser).
argument_parser * _parser
Pointer to the owning parser.
static std::unique_ptr< argument_group > create(argument_parser &parser, std::string_view name)
Factory method to create an argument group.
bool _mutually_exclusive
The mutually exclusive attribute value (default: false).
argument_group(argument_parser &parser, const std::string_view name)
Construct a new argument group with the given name.
bool _required
The required attribute value (default: false).
std::vector< arg_ptr_t > arg_ptr_vec_t
The argument pointer list type alias.
The main argument parser class.