gnu-getopt

Install command:
brew install gnu-getopt

Command-line option parsing utility

https://github.com/util-linux/util-linux

License: GPL-2.0-or-later

Development: Pull requests

Formula JSON API: /api/formula/gnu-getopt.json

Formula code: gnu-getopt.rb on GitHub

Bottle (binary package) installation support provided for:

macOS on
Apple Silicon
golden gate ✅
tahoe ✅
sequoia ✅
Linux ARM64 ✅
x86_64 ✅

Current versions:

stable ✅ 2.42.4

Patches:

https://github.com/util-linux/util-linux/commit/d22edc2f100eb8dd83d3515758565cb73b0d2eed

Keg-only because macOS provides BSD getopt.

Binaries: getopt

GitHub Packages downloads:

Last 30 days54,269
Downloads13,489,097
Analytics install events (30 days)2,624
Downloads / install events (30 days)20.7×

Source: GitHub Packages, fetched 2026-11-13T00:54:07Z. Analytics dates: 2026-10-14 to 2026-11-13. Totals exclude downloads from Bintray before the migration to GitHub Packages. Downloads and install attempts measure different things; the difference does not count analytics opt-outs. Definitions and limitations.

Analytics:

30 days90 days365 days
Installs2,6248,58047,453
Installs (--HEAD)0424
Installs on Request1,0213,59820,666
Installs on Request (--HEAD)0424
Build Errors17