model-writtenrun 586 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Japin Li proposed advancing optind and resetting place before returning BADARG for a missing long-option argument, matching the short-option state handling #1.
- Michael Paquier identified that resetting place before printing the diagnostic would erase the option name, and requested examples using PostgreSQL's replacement getopt_long() implementation #2.
- Japin Li demonstrated incorrect option names and repeated errors before the fix, then supplied a revised fix preserving diagnostic text alongside a demonstration binary #3 #4.
- Michael Paquier committed the revised fix unchanged in 745becce33, leaving out the demonstration binary from #4; the commit explains that backpatching could alter error handling for invalid option combinations.
- Michael Paquier confirmed the change on HEAD after comparing behavior with libc, noting a remaining optopt inconsistency without proposing further work; Japin Li acknowledged completion #5 #6.