🍺 BREW Explorer

← all formulae

popt

brew install popt v1.19 MIT

C library for parsing command-line options with support for aliases, reentrancy, and arbitrary argv[] arrays.

Why you might care

Drop-in enhancement over getopt(3) when building C/C++ CLI tools that need robust argument parsing with features like option aliasing and reentrant safety. Widely used as a build dependency in rpm and other system tools. Smaller and simpler than full argument-parsing frameworks but more flexible than standard getopt.

Categories

Alternatives

getopt argp glib boost-program-options
6.7k
30-day installs · #478
20.4k
90-day · #512
74.3k
365-day · #518
64
★ GitHub stars · updated 2mo ago

Links

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

Raw metadata
{
  "aliases": [],
  "alternatives": [
    "getopt",
    "argp",
    "glib",
    "boost-program-options"
  ],
  "build_dependencies": [],
  "categories": [
    "library",
    "parser"
  ],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Library like getopt(3) with a number of enhancements",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:40:53+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "popt",
  "github_default_branch": "master",
  "github_last_commit_at": "2026-04-14T12:25:12Z",
  "github_readme_excerpt": "This is the popt(3) command line option parsing library. While it is similar\nto getopt(3), it contains a number of enhancements, including:\n\n\t1) popt is fully reentrant\n\t2) popt can parse arbitrary argv[] style arrays while \n\t   getopt(3) makes this quite difficult\n\t3) popt allows users to alias command line arguments\n\t4) popt provides convenience functions for parsing strings\n\t   into argv[] style arrays\n\nComplete documentation on popt(3) is available in popt.pdf (included in this\ntarball), which is excerpted with permission from the book \"Linux\nApplication Development\" by Michael K. Johnson and Erik Troan (available\nfrom Addison Wesley in May, 1998).\n\nBugs, feature requests and contributions can be submitted at\nhttps://github.com/rpm-software-management/popt or alternatively\nrpm-maint@lists.rpm.org.\n",
  "github_repo": "rpm-software-management/popt",
  "github_stars": 64,
  "github_topics": [],
  "homepage": "https://github.com/rpm-software-management/popt",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 6693,
  "installs_365d": 74266,
  "installs_90d": 20368,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "MIT",
  "llm_generated_at": "2026-06-20T23:45:06+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "popt",
  "oldnames": [],
  "one_liner": "C library for parsing command-line options with support for aliases, reentrancy, and arbitrary argv[] arrays.",
  "optional_dependencies": [],
  "rank_30d": 478,
  "rank_365d": 518,
  "rank_90d": 512,
  "raw_hash": "53225fe408c32a29",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/p/popt.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [],
  "version_head": null,
  "version_stable": "1.19",
  "versioned_formulae": [],
  "why_use_this": "Drop-in enhancement over getopt(3) when building C/C++ CLI tools that need robust argument parsing with features like option aliasing and reentrant safety. Widely used as a build dependency in rpm and other system tools. Smaller and simpler than full argument-parsing frameworks but more flexible than standard getopt."
}