From 2cb3c3df4099297b0a0554bb482e2de04fe86b5c Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 24 Aug 2022 00:02:17 -0500 Subject: add command-line arguments --- libs/cargs/docs/reference/cag_option_prepare.md | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 libs/cargs/docs/reference/cag_option_prepare.md (limited to 'libs/cargs/docs/reference/cag_option_prepare.md') diff --git a/libs/cargs/docs/reference/cag_option_prepare.md b/libs/cargs/docs/reference/cag_option_prepare.md new file mode 100644 index 0000000..c9aa9e5 --- /dev/null +++ b/libs/cargs/docs/reference/cag_option_prepare.md @@ -0,0 +1,30 @@ +--- +title: cag_option_prepare +description: Prepare argument options context for parsing. +--- + +_(since v1.0.0)_ +Prepare argument options context for parsing. + +## Description +```c +void cag_option_prepare(cag_option_context *context, const cag_option *options, + size_t option_count, int argc, char **argv); +``` + +This function prepares the context for iteration and initializes the context +with the supplied options and arguments. After the context has been prepared, +it can be used to fetch arguments from it. + +## Parameters + * **context**: The context which will be initialized. + * **options**: The registered options which are available for the program. + * **option_count**: The amount of options which are available for the program. + * **argc**: The amount of arguments the user supplied in the main function. + * **argv**: A pointer to the arguments of the main function. + +## Changelog + +| Version | Description | +|------------|--------------------------------------------------------| +| **v1.0.0** | The function is introduced. | -- cgit v1.2.1