🍺 BREW Explorer

← all formulae

gnu-getopt

brew install gnu-getopt v2.42.2 GPL-2.0-or-later keg-only

GNU getopt command-line parser utility for shell scripts (keg-only; macOS provides BSD getopt).

Why you might care

Provides POSIX-compliant getopt(1) with long option support for portable shell scripts. macOS's default BSD getopt lacks long options (--flag syntax), so this matters if you're writing scripts meant to work across Linux and macOS. Keg-only to avoid shadowing the system tool; link explicitly or use via shim if needed.

Categories

Alternatives

getopts getopt
7.3k
30-day installs · #445
17.2k
90-day · #594
63.3k
365-day · #570
3.2k
★ GitHub stars · updated 3d ago

Links

Keg-only reason

:shadowed_by_macos — macOS provides BSD getopt

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [],
  "alternatives": [
    "getopts",
    "getopt"
  ],
  "build_dependencies": [],
  "categories": [
    "shell",
    "text-processor"
  ],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Command-line option parsing utility",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:38:13+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "gnu-getopt",
  "github_default_branch": "master",
  "github_last_commit_at": "2026-06-17T11:49:56Z",
  "github_readme_excerpt": "\n\t\t\t\t  util-linux\n\n\t\tutil-linux is a random collection of Linux utilities\n\n     Note: for the years 2006-2010 this project was named \"util-linux-ng\".\n\nCOMPILE \u0026 INSTALL:\n\n      See Documentation/howto-compilation.txt.\n\nMAILING LIST:\n\n      E-MAIL:  util-linux@vger.kernel.org\n      URL:     http://vger.kernel.org/vger-lists.html#util-linux\n      ARCHIVE: https://lore.kernel.org/util-linux/\n\n      The mailing list will reject email messages that contain:\n       - more than 100K characters\n       - html\n       - spam phrases/keywords\n      See: http://vger.kernel.org/majordomo-info.html#taboo\n\nIRC CHANNEL:\n\n      #util-linux at libera.chat:\n\n      irc://irc.libera.chat/util-linux\n\n      The IRC channel and Mailing list are for developers and project\n      maintainers. For end users it is recommended to utilize the\n      distribution\u0027s support system.\n\nBUG REPORTING:\n\n      E-MAIL: util-linux@vger.kernel.org\n      Web:    https://github.com/util-linux/util-linux/issues\n\n      Bug reports with sensitive or private information: Karel Zak \u003ckzak@redhat.com\u003e\n\n      This project has no resources to provide support for distribution specific\n      issues. For end users it is recommended to utilize the distribution\u0027s\n      support system.\n\nNLS (PO TRANSLATIONS):\n\n      PO files are maintained by:\n\t  https://translationproject.org/domain/util-linux.html\n\nVERSION SCHEMA:\n\n      Standard releases:\n\t  \u003cmajor\u003e.\u003cminor\u003e[.\u003cmaint\u003e]\n\t     major = fatal and deep changes\n\t     minor = typical release with new features\n\t     maint = maintenance releases; bug fixes only\n\n      Development releases:\n\t \u003cmajor\u003e.\u003cminor\u003e-rc\u003cN\u003e\n\nSOURCE CODE:\n\n Download archive:\n\t  https://www.kernel.org/pub/linux/utils/util-linux/\n\n See also:\n     Documentation/howto-contribute.txt\n     Documentation/howto-build-sys.txt\n     Documentation/howto-pull-request.txt\n\n SCM (Source Code Management) Repository:\n\n    Primary repository:\n\t  git clone git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git\n\n    Backup re",
  "github_repo": "util-linux/util-linux",
  "github_stars": 3176,
  "github_topics": [],
  "homepage": "https://github.com/util-linux/util-linux",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 7319,
  "installs_365d": 63315,
  "installs_90d": 17153,
  "keg_only": 1,
  "keg_only_reason": ":shadowed_by_macos \u2014 macOS provides BSD getopt",
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "GPL-2.0-or-later",
  "llm_generated_at": "2026-06-20T23:44:55+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "gnu-getopt",
  "oldnames": [],
  "one_liner": "GNU getopt command-line parser utility for shell scripts (keg-only; macOS provides BSD getopt).",
  "optional_dependencies": [],
  "rank_30d": 445,
  "rank_365d": 570,
  "rank_90d": 594,
  "raw_hash": "515504a7358a63c4",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/g/gnu-getopt.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [],
  "version_head": null,
  "version_stable": "2.42.2",
  "versioned_formulae": [],
  "why_use_this": "Provides POSIX-compliant getopt(1) with long option support for portable shell scripts. macOS\u0027s default BSD getopt lacks long options (--flag syntax), so this matters if you\u0027re writing scripts meant to work across Linux and macOS. Keg-only to avoid shadowing the system tool; link explicitly or use via shim if needed."
}