gnu-getopt

Command-line option parsing utility compatible with GNU getopt

brewmacoslinux
Try with needOr install directly
Source

About

Command-line option parsing utility

Commands

getopt

Examples

Parse short options from a command line$ getopt ab:c "$@"
Parse long options with validation$ getopt -o ab:c --long alpha,beta:,charlie -- "$@"
Extract parsed options in a shell script$ ARGS=$(getopt -o h --long help -- "$@") && eval set -- "$ARGS"