*
* * Non-option arguments (anything else).
*
- * The argpar parsers don't accept `-` or `--` as arguments. The latter
- * means "end of options" for many command-line tools, but this library
- * is all about keeping the order of the arguments, so it doesn't mean
- * much to put them at the end. This has the side effect that a
+ * The argpar parsers parse `-` and `--` as non-option arguments. A
* non-option argument cannot have the form of an option, for example if
* you need to pass the exact relative path `--component`. In that case,
* you would need to pass `./--component`. There's no generic way to
/* Short option character, or `\0` */
const char short_name;
- /* Long option name (without `--`), or `NULL` */
+ /* Long option name (without the `--` prefix), or `NULL` */
const char * const long_name;
/* True if this option has an argument */
ARGPAR_HIDDEN
unsigned int argpar_item_non_opt_non_opt_index(const struct argpar_item *item);
+/*
+ * Destroys `item`, as created by argpar_iter_next().
+ */
+ARGPAR_HIDDEN
+void argpar_item_destroy(const struct argpar_item *item);
+
struct argpar_item_array {
const struct argpar_item **items;
* actually start parsing the arguments.
*
* `*argv` and `*descrs` must NOT change for the lifetime of the
- * returned iterator (until you call argpar_iter_destroy()).
+ * returned iterator (until you call argpar_iter_destroy()) and for the
+ * lifetime of any parsing item (until you call argpar_item_destroy())
+ * argpar_iter_next() creates for the returned iterator.
*
* Call argpar_iter_next() with the returned iterator to obtain the next
* parsing result (item).
ARGPAR_HIDDEN
unsigned int argpar_iter_ingested_orig_args(const struct argpar_iter *iter);
-/*
- * Destroys `item`, as created by argpar_iter_next().
- */
-ARGPAR_HIDDEN
-void argpar_item_destroy(const struct argpar_item *item);
-
/*
* Destroys `_item` (`const struct argpar_item *`) and sets it to
* `NULL`.