getopt() but smaller
dotat.at
getopt() but smaller
1–3 of 3 posts
Re: getopt() but smaller
#2I 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.
Re: getopt() but smaller
#3I 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.
Plan 9’s ARG(2) [0] macros are worth a look too. No dependencies at all, just plain macros, super lightweight and easy to use.