Full threadoguz-ismail·I like NetBSD sh's nextopt <https://github.com/NetBSD/src/blob/23fcbd850aae17ef0843523f3...>. Since getopt's internal state can't be reset portably, most shells roll their own option parser.View on HN