koutil
|
Classes | |
struct | Arg |
Base structure representing a subcommand argument. More... | |
class | Arguments |
Base class for argument collections. More... | |
class | ArgumentsBase |
class | Commands |
Collection of subcommands. More... | |
class | Commands< Cmd > |
Specialization of Commands for a single subcommand. More... | |
class | CommandsBase |
Base class for commands. More... | |
class | Parser |
Template class representing a parser. More... | |
struct | Subcommand |
Subcommand template struct. More... | |
struct | Subcommand< type::types< Args... >, type::types< Cmd... > > |
Specialization of Subcommand for argument and subcommand types. More... | |
struct | SubcommandBase |
Base class for subcommands. More... | |
Concepts | |
concept | is_arg |
Checks if a type is Arg. | |
concept | are_arguments |
Checks if a type is derived from ArgumentsBase. | |
concept | parser |
Concept to check if a type is a parser. | |
concept | is_subcommand |
Concept to check if a type satisfies the requirements of a subcommand. | |
concept | are_commands |
Concept to check if a type satisfies the requirements of a collection of commands. | |
Enumerations | |
enum class | ParseResult { OK , ERR , ERR_EMPTY_OPTION , ERR_UNKNOWN , ERR_INVALID_VALUE , ERR_MISSING_VALUE } |
Enum class representing possible parse results. More... | |
Functions | |
template<typename Ctx , parser< Ctx > UParser, are_arguments Args, are_commands Cmds> | |
constexpr auto | make_parser (Ctx &ctx, Args &&args, Cmds &&commands) |
Creates a Parser object. | |
template<typename Ctx , parser< Ctx > UParser, are_arguments Args, are_commands Cmds> | |
ParseResult | process_args (std::size_t argc, const char **argv, Ctx &ctx, Args &&args, Cmds &&commands) |
Processes the command-line arguments. | |
template<is_arg... Args, is_subcommand... Cmds> | |
constexpr auto | make_subcommand (std::string_view name, const Arguments< Args... > &args=Arguments<> {}, const Commands< Cmds... > &cmds=Commands<> {}) |
Helper function to create a subcommand. | |
|
strong |
Enum class representing possible parse results.
|
constexpr |
|
constexpr |
Helper function to create a subcommand.
Args | Argument types. |
Cmds | Subcommand types. |
name | The name of the subcommand. |
args | The arguments of the subcommand. |
cmds | The subcommands of the subcommand. |
ParseResult koutil::argparser::process_args | ( | std::size_t | argc, |
const char ** | argv, | ||
Ctx & | ctx, | ||
Args && | args, | ||
Cmds && | commands ) |
Processes the command-line arguments.
Ctx | The context type. |
UParser | The user-defined parser type. |
Args | The argument types. |
Cmds | The command types. |
argc | The argument count. |
argv | The argument values. |
ctx | The context. |
args | The arguments. |
commands | The commands. |