gengetopt
« Back to VersTracker
Description:
Generate C code to parse command-line arguments via getopt_long
Type: Formula  |  Latest Version: 0.9.5@0  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: cli code-generation c getopt gnu
Install: brew install gengetopt
About:
Gengetopt is a command-line generator that parses command-line arguments using the standard GNU getopt_long function. It takes a simple, human-readable definition file as input and automatically generates robust C code for parsing options and arguments. This tool significantly reduces boilerplate code and minimizes errors in command-line interface development for C applications.
Key Features:
  • Generates C source code from a simple definition file
  • Supports standard GNU getopt_long features including options, flags, and commands
  • Automatically generates comprehensive help and version output
  • Produces reentrant code suitable for multi-threaded applications
  • Includes a runtime library for easy integration
Use Cases:
  • Developing command-line utilities in C or C++
  • Standardizing argument parsing across multiple tools
  • Rapid prototyping of CLI interfaces for embedded systems
Alternatives:
  • getopt – Standard library function requiring manual parsing loops; Gengetopt automates this process.
  • argp – GNU's alternative for complex parsing; Gengetopt offers a simpler, file-to-code generation workflow.
Version History
Detected Version Rev Change Commit
Sep 11, 2025 12:36am 0.9.5 0 VERSION_BUMP 5a1df087