2 ms·
> frustrated to find that the osx version of getopt does not support long options Probably best not to use getopt, but use getopts instead. In bash, getopts is
by rascul 5y ago
> frustrated to find that the osx version of getopt does not support long options
Probably best not to use getopt, but use getopts instead. In bash, getopts is a builtin. See the link below.
http://mywiki.wooledge.org/ComplexOptionParsing#util-linux.27s_special_getopt http://mywiki.wooledge.org/ComplexOptionParsing#util-linux.2...
- 0xbadcafebee 5y agogetopts is actually POSIX so all POSIX-compatible shells should have it. Looks like zsh does: https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Commands.html https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Command... For anyone new to parsing args with getopts, a guide like this might help: https://www.shellscript.sh/tips/getopts/ https://www.shellscript.sh/tips/getopts/