summaryrefslogtreecommitdiff
path: root/libs/cargs/docs/reference/cag_option_get_index.md
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-08-24 00:02:17 -0500
committersanine <sanine.not@pm.me>2022-08-24 00:02:17 -0500
commit2cb3c3df4099297b0a0554bb482e2de04fe86b5c (patch)
tree7796b4064c16460d9d603707b5256027649aa8b6 /libs/cargs/docs/reference/cag_option_get_index.md
parent709e1b6e1ce86f8da4fc136747fcefbc6c6057bd (diff)
add command-line arguments
Diffstat (limited to 'libs/cargs/docs/reference/cag_option_get_index.md')
-rwxr-xr-xlibs/cargs/docs/reference/cag_option_get_index.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/libs/cargs/docs/reference/cag_option_get_index.md b/libs/cargs/docs/reference/cag_option_get_index.md
new file mode 100755
index 0000000..ef27d88
--- /dev/null
+++ b/libs/cargs/docs/reference/cag_option_get_index.md
@@ -0,0 +1,29 @@
+---
+title: cag_option_get_index
+description: Gets the current index of the context.
+---
+
+_(since v1.0.0)_
+Gets the current index of the context.
+
+## Description
+```c
+int cag_option_get_index(const cag_option_context *context);
+```
+
+This function gets the index within the argv arguments of the context. The
+context always points to the next item which it will inspect. This is
+particularly useful to inspect the original argument array, or to get
+non-option arguments after option fetching has finished.
+
+## Parameters
+ * **context**: The context from which the option was fetched.
+
+## Return Value
+Returns the current index of the context.
+
+## Changelog
+
+| Version | Description |
+|------------|--------------------------------------------------------|
+| **v1.0.0** | The function is introduced. |