@@ -211,6 +211,25 @@ typedef struct adopt_parser {
211
211
in_short : 1 ;
212
212
} adopt_parser ;
213
213
214
+ /**
215
+ * Parses all the command-line arguments and updates all the options using
216
+ * the pointers provided. Parsing stops on any invalid argument and
217
+ * information about the failure will be provided in the opt argument.
218
+ *
219
+ * This is the simplest way to parse options; it handles the initialization
220
+ * (`parser_init`) and looping (`parser_next`).
221
+ *
222
+ * @param opt The The `adopt_opt` information that failed parsing
223
+ * @param specs A NULL-terminated array of `adopt_spec`s that can be parsed
224
+ * @param args The arguments that will be parsed
225
+ * @param args_len The length of arguments to be parsed
226
+ */
227
+ adopt_status_t adopt_parse (
228
+ adopt_opt * opt ,
229
+ const adopt_spec specs [],
230
+ char * * args ,
231
+ size_t args_len );
232
+
214
233
/**
215
234
* Initializes a parser that parses the given arguments according to the
216
235
* given specifications.
@@ -240,22 +259,6 @@ adopt_status_t adopt_parser_next(
240
259
adopt_opt * opt ,
241
260
adopt_parser * parser );
242
261
243
- /**
244
- * Parses all the command-line arguments and updates all the options using
245
- * the pointers provided. Parsing stops on any invalid argument and
246
- * information about the failure will be provided in the opt argument.
247
- *
248
- * @param opt The The `adopt_opt` information that failed parsing
249
- * @param specs A NULL-terminated array of `adopt_spec`s that can be parsed
250
- * @param args The arguments that will be parsed
251
- * @param args_len The length of arguments to be parsed
252
- */
253
- adopt_status_t adopt_parse (
254
- adopt_opt * opt ,
255
- const adopt_spec specs [],
256
- char * * args ,
257
- size_t args_len );
258
-
259
262
/**
260
263
* Prints the status after parsing the most recent argument. This is
261
264
* useful for printing an error message when an unknown argument was
0 commit comments