A simple, flexible, header-only C++11 argument parsing library inspired by Python's argparse.
args is a header-only C++11 library for parsing command-line arguments. It provides a simple, type-safe API inspired by Python's argparse, allowing developers to define flags, positional arguments, and validation groups with minimal boilerplate. It solves the problem of building robust CLI interfaces in C++ without external dependencies.
C++ developers building command-line tools or applications that require flexible and type-safe argument parsing, especially those familiar with Python's argparse or seeking a lightweight alternative to libraries like TCLAP or Boost.Program_options.
args offers a clean, modern API with static type checking, nested validation groups, and automatic help generation—all in a single header file. It outperforms alternatives in speed and flexibility while remaining easy to integrate and customize.
A simple header-only C++ argument parser library. Supposed to be flexible and powerful, and attempts to be compatible with the functionality of the Python standard argparse library (though not necessarily the API).
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Single include file with no external dependencies, making integration trivial—just copy args.hxx into your project or use standard install methods like CMake.
Leverages C++ static type checking for flags and values, reducing runtime errors compared to string-based parsers, as shown in examples with ValueFlag<int> and custom types.
Allows changing prefixes and separators to mimic styles like GNU, Windows, or dd, demonstrated in examples that reconfigure LongPrefix and LongSeparator.
Supports nested validation groups and git-like subparsers, enabling complex CLI structures with reusable argument logic, as illustrated in the command refactoring examples.
Benchmarked significantly faster than TCLAP and Boost.Program_options in provided tests, with claims of 65% and 220% speed improvements respectively.
Limited handling of non-ASCII characters; the README warns that combined glyphs can mess up help output, making it unsuitable for internationalized interfaces.
Group validation failures only output generic messages like 'Group validation failed somewhere!', forcing developers to implement custom error handling for complex logic.
The library is declared feature-complete, meaning no new major functionality or API changes will be added, which limits adaptability to evolving needs.
Cannot intermix different prefix types in the same parser, and has ordering limitations (e.g., positional lists cannot precede other positionals), reducing flexibility for some CLI designs.