Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element.
Callers store zero here to inhibit the error message for unrecognized options.
This is what Unix does. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. Only valid when a long-named option was found. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option.